Skip to content

Commit 8303e47

Browse files
committed
FEAT: implemented unit test for flux lines in Maxwell 2D
1 parent 781dd94 commit 8303e47

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

tests/system/visualization/test_12_1_PostProcessing.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ def m2d_app(add_app):
6060
app.close_project(app.project_name)
6161

6262

63+
@pytest.fixture()
64+
def m2d_blank(add_app):
65+
app = add_app(application=ansys.aedt.core.Maxwell2d)
66+
yield app
67+
app.close_project(app.project_name)
68+
69+
6370
class TestClass:
6471
def test_export_model_picture(self, aedtapp, local_scratch):
6572
path = aedtapp.post.export_model_picture(full_name=Path(local_scratch.path) / "images2.jpg")
@@ -188,14 +195,13 @@ def test_create_fieldplot_surface_4(self, aedtapp):
188195
intrinsic = {"Freq": frequency, "Phase": phase}
189196
assert not aedtapp.post.create_fieldplot_surface(123123123, "Mag_E", setup_name, intrinsic)
190197

191-
def test_create_fieldplot_surface_5(self, aedtapp):
192-
frequency = Quantity("5GHz")
193-
phase = Quantity("180deg")
194-
setup_name = aedtapp.existing_analysis_sweeps[0]
195-
intrinsic = {"Freq": frequency, "Phase": phase}
196-
assert not aedtapp.post.create_fieldplot_surface(
197-
aedtapp.modeler["outer"].faces, "Flux_Lines", setup_name, intrinsic
198-
)
198+
def test_create_fieldplot_surface_5(self, m2d_blank):
199+
circ = m2d_blank.modeler.create_circle(origin=[0, 0, 0], radius=5, material="copper")
200+
m2d_blank.assign_current(assignment=circ.name, amplitude=5)
201+
region = m2d_blank.modeler.create_region(pad_value=100)
202+
m2d_blank.assign_balloon(assignment=region.edges)
203+
m2d_blank.create_setup()
204+
assert m2d_blank.post.create_fieldplot_surface(assignment=m2d_blank.modeler.object_list, quantity="Flux_Lines")
199205

200206
def test_design_setups(self, aedtapp):
201207
assert len(aedtapp.design_setups["Setup1"].sweeps[0].frequencies) > 0

0 commit comments

Comments
 (0)