Skip to content

Commit

Permalink
simplify symmetry handlings
Browse files Browse the repository at this point in the history
  • Loading branch information
otvam committed Jan 7, 2025
1 parent fac7f28 commit 1b75f82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions examples/examples_stl/transformer_air/run_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,8 @@ def _show_matrix(matrix):
{"src": "sec_src", "sink": "sec_sink"},
]

# definition of a list of permutations defining the symmetries
symmetry = [
[[0, 1], [1, 0]],
]
# definition of a list of permutations with the symmetries
symmetry = [[0, 1], [1, 0]]

# ########################################################
# ### extract the impedance matrix
Expand Down
5 changes: 2 additions & 3 deletions pypeec/utils/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,8 @@ def get_symmetry(terminal, symmetry):
assert V_mat.shape == (n_winding, n_solution), "invalid solution: voltage matrix shape"

# expand the solution with the symmetries
for sym_tmp in symmetry:
I_mat = _get_symmetry_expand(I_mat, sym_tmp)
V_mat = _get_symmetry_expand(V_mat, sym_tmp)
I_mat = _get_symmetry_expand(I_mat, symmetry)
V_mat = _get_symmetry_expand(V_mat, symmetry)

# remove redundant solutions
IV_mat = np.vstack((I_mat, V_mat))
Expand Down

0 comments on commit 1b75f82

Please sign in to comment.