[fdfd.operators] fix eh_full for non-None mu
This commit is contained in:
parent
0ff23542ac
commit
0afe2297b0
4 changed files with 178 additions and 4 deletions
|
|
@ -70,6 +70,15 @@ def test_eh_full_matches_sparse_operator_with_mu() -> None:
|
|||
assert_fields_match(functional_h, matrix_h)
|
||||
|
||||
|
||||
def test_eh_full_matches_sparse_operator_without_mu() -> None:
|
||||
matrix_result = operators.eh_full(OMEGA, DXES, vec(EPSILON)) @ numpy.concatenate([vec(E_FIELD), vec(H_FIELD)])
|
||||
matrix_e, matrix_h = (unvec(part, SHAPE) for part in numpy.split(matrix_result, 2))
|
||||
functional_e, functional_h = functional.eh_full(OMEGA, DXES, EPSILON)(E_FIELD, H_FIELD)
|
||||
|
||||
assert_fields_match(functional_e, matrix_e)
|
||||
assert_fields_match(functional_h, matrix_h)
|
||||
|
||||
|
||||
def test_e2h_matches_sparse_operator_with_mu() -> None:
|
||||
matrix_result = apply_matrix(
|
||||
operators.e2h(OMEGA, DXES, vec(MU)),
|
||||
|
|
@ -80,6 +89,16 @@ def test_e2h_matches_sparse_operator_with_mu() -> None:
|
|||
assert_fields_match(functional_result, matrix_result)
|
||||
|
||||
|
||||
def test_e2h_matches_sparse_operator_without_mu() -> None:
|
||||
matrix_result = apply_matrix(
|
||||
operators.e2h(OMEGA, DXES),
|
||||
E_FIELD,
|
||||
)
|
||||
functional_result = functional.e2h(OMEGA, DXES)(E_FIELD)
|
||||
|
||||
assert_fields_match(functional_result, matrix_result)
|
||||
|
||||
|
||||
def test_m2j_matches_sparse_operator_without_mu() -> None:
|
||||
matrix_result = apply_matrix(
|
||||
operators.m2j(OMEGA, DXES),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue