Skip to content

Commit

Permalink
revert back get_solution_data
Browse files Browse the repository at this point in the history
  • Loading branch information
gmalinve committed Jan 10, 2025
1 parent 31cca63 commit 2158e18
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
37 changes: 37 additions & 0 deletions tests/system/general/test_28_Maxwell3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,43 @@ def test_export_rl_matrix(self, local_scratch, m3d_app):
assert m3d_app.export_rl_matrix("matrix_export_test", export_path_2, False, 10, 3, True)
assert os.path.exists(export_path_2)

@pytest.mark.skipif(is_linux, reason="Failing in Ubuntu 22.")
def test_get_solution_data(self, m3d_app):
m3d_app.solution_type = SOLUTIONS.Maxwell3d.EddyCurrent

m3d_app.modeler.create_box([0, 1.5, 0], [1, 2.5, 5], name="Coil_1", material="aluminum")
m3d_app.modeler.create_box([8.5, 1.5, 0], [1, 2.5, 5], name="Coil_2", material="aluminum")
m3d_app.modeler.create_box([16, 1.5, 0], [1, 2.5, 5], name="Coil_3", material="aluminum")
m3d_app.modeler.create_box([32, 1.5, 0], [1, 2.5, 5], name="Coil_4", material="aluminum")

rectangle1 = m3d_app.modeler.create_rectangle(0, [0.5, 1.5, 0], [2.5, 5], name="Sheet1")
rectangle2 = m3d_app.modeler.create_rectangle(0, [9, 1.5, 0], [2.5, 5], name="Sheet2")
rectangle3 = m3d_app.modeler.create_rectangle(0, [16.5, 1.5, 0], [2.5, 5], name="Sheet3")

m3d_app.assign_current(rectangle1.faces[0], amplitude=1, name="Cur1")
m3d_app.assign_current(rectangle2.faces[0], amplitude=1, name="Cur2")
m3d_app.assign_current(rectangle3.faces[0], amplitude=1, name="Cur3")

matrix = m3d_app.assign_matrix(assignment=["Cur1", "Cur2", "Cur3"], matrix_name="Matrix1")
matrix.join_series(sources=["Cur1", "Cur2"], matrix_name="ReducedMatrix1")

setup = m3d_app.create_setup(MaximumPasses=2)
m3d_app.analyze(setup=setup.name)

expressions = m3d_app.post.available_report_quantities(
report_category="EddyCurrent", display_type="Data Table", context={"Matrix1": "ReducedMatrix1"}
)
data = m3d_app.post.get_solution_data(expressions=expressions, context={"Matrix1": "ReducedMatrix1"})
assert data

expressions = m3d_app.post.available_report_quantities(report_category="EddyCurrent", display_type="Data Table")
assert isinstance(expressions, list)
expressions = m3d_app.post.available_report_quantities(
report_category="EddyCurrent", display_type="Data Table", context="Matrix1"
)
data = m3d_app.post.get_solution_data(expressions=expressions, context="Matrix1")
assert data

def test_initial_mesh_settings(self, m3d_app):
assert m3d_app.mesh.initial_mesh_settings
assert m3d_app.mesh.initial_mesh_settings.props
Expand Down
37 changes: 0 additions & 37 deletions tests/system/solvers/test_00_analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,40 +652,3 @@ def test_10_export_to_maxwell(self, add_app):
app2 = add_app("assm_test2", application=Rmxprt, solution_type="ASSM")
app2.import_configuration(config)
assert app2.circuit

def test_11_maxwell3d_get_solution_data(self, add_app):
m3d_app = add_app("maxwell_get_solution_data", application=Maxwell3d, subfolder="T11")
m3d_app.solution_type = "EddyCurrent"

m3d_app.modeler.create_box([0, 1.5, 0], [1, 2.5, 5], name="Coil_1", material="aluminum")
m3d_app.modeler.create_box([8.5, 1.5, 0], [1, 2.5, 5], name="Coil_2", material="aluminum")
m3d_app.modeler.create_box([16, 1.5, 0], [1, 2.5, 5], name="Coil_3", material="aluminum")
m3d_app.modeler.create_box([32, 1.5, 0], [1, 2.5, 5], name="Coil_4", material="aluminum")

rectangle1 = m3d_app.modeler.create_rectangle(0, [0.5, 1.5, 0], [2.5, 5], name="Sheet1")
rectangle2 = m3d_app.modeler.create_rectangle(0, [9, 1.5, 0], [2.5, 5], name="Sheet2")
rectangle3 = m3d_app.modeler.create_rectangle(0, [16.5, 1.5, 0], [2.5, 5], name="Sheet3")

m3d_app.assign_current(rectangle1.faces[0], amplitude=1, name="Cur1")
m3d_app.assign_current(rectangle2.faces[0], amplitude=1, name="Cur2")
m3d_app.assign_current(rectangle3.faces[0], amplitude=1, name="Cur3")

matrix = m3d_app.assign_matrix(assignment=["Cur1", "Cur2", "Cur3"], matrix_name="Matrix1")
matrix.join_series(sources=["Cur1", "Cur2"], matrix_name="ReducedMatrix1")

setup = m3d_app.create_setup(MaximumPasses=2)
m3d_app.analyze(setup=setup.name)

expressions = m3d_app.post.available_report_quantities(
report_category="EddyCurrent", display_type="Data Table", context={"Matrix1": "ReducedMatrix1"}
)
data = m3d_app.post.get_solution_data(expressions=expressions, context={"Matrix1": "ReducedMatrix1"})
assert data

expressions = m3d_app.post.available_report_quantities(report_category="EddyCurrent", display_type="Data Table")
assert isinstance(expressions, list)
expressions = m3d_app.post.available_report_quantities(
report_category="EddyCurrent", display_type="Data Table", context="Matrix1"
)
data = m3d_app.post.get_solution_data(expressions=expressions, context="Matrix1")
assert data

0 comments on commit 2158e18

Please sign in to comment.