Skip to content

Commit

Permalink
Update Transient Field plot in Maxwell 2D Transient (#815)
Browse files Browse the repository at this point in the history
* Exception for Maxwell 2D Transient

* UnitTest updated for the method
  • Loading branch information
Samuelopez-ansys authored Feb 3, 2022
1 parent 8ce66b6 commit dc9f9ab
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions _unittest/test_12_PostProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,19 @@ def test_15_export_plot(self):
)
assert os.path.exists(obj.image_file)

@pytest.mark.skipif(is_ironpython, reason="Not running in ironpython")
def test_16_create_field_plot(self):
cutlist = ["Global:XY"]
plot = self.aedtapp.post._create_fieldplot(
objlist=cutlist,
quantityName="Mag_E",
setup_name=self.aedtapp.nominal_adaptive,
intrinsincList={"Freq": "5GHz", "Phase": "0deg"},
objtype="Surface",
listtype="CutPlane",
)
assert plot

def test_51_get_efields(self):
if is_ironpython:

Expand Down
2 changes: 1 addition & 1 deletion examples/02-Maxwell/Maxwell2D_Transient.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
cutlist = ["Global:XY"]
face_lists = rect1.faces
face_lists += rect2.faces
timesteps = [str(i * 1e-3) + "s" for i in range(21)]
timesteps = [str(i * 2e-4) + "s" for i in range(11)]
id_list = [f.id for f in face_lists]
animatedGif = maxwell_2d.post.animate_fields_from_aedtplt_2(
"Mag_B",
Expand Down
2 changes: 2 additions & 0 deletions pyaedt/modules/PostProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2316,6 +2316,8 @@ def _create_fieldplot(self, objlist, quantityName, setup_name, intrinsincList, o
plot.objtype = objtype
plot.listtype = listtype
plt = plot.create()
if "Maxwell" in self._app.design_type and self.post_solution_type == "Transient":
self.ofieldsreporter.SetPlotsViewSolutionContext([plot_name], setup_name, "Time:" + intrinsincList["Time"])
if plt:
self.field_plots[plot_name] = plot
return plot
Expand Down

0 comments on commit dc9f9ab

Please sign in to comment.