From 6be0ae0876941782d8f1065a8cea0036765287c3 Mon Sep 17 00:00:00 2001 From: Samuel Lopez Date: Thu, 3 Feb 2022 16:26:40 +0100 Subject: [PATCH 1/2] Assign correct CS to the Antenna Inserted --- examples/02-Maxwell/Maxwell2D_Transient.py | 2 +- pyaedt/modules/PostProcessor.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/02-Maxwell/Maxwell2D_Transient.py b/examples/02-Maxwell/Maxwell2D_Transient.py index 91ae5f12b44..986f2104c08 100644 --- a/examples/02-Maxwell/Maxwell2D_Transient.py +++ b/examples/02-Maxwell/Maxwell2D_Transient.py @@ -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", diff --git a/pyaedt/modules/PostProcessor.py b/pyaedt/modules/PostProcessor.py index b30da8187a2..03c316b0d22 100644 --- a/pyaedt/modules/PostProcessor.py +++ b/pyaedt/modules/PostProcessor.py @@ -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 From 53348b21a8506cf287f93d549911ae50b4aad53e Mon Sep 17 00:00:00 2001 From: Samuel Lopez Date: Thu, 3 Feb 2022 17:22:17 +0100 Subject: [PATCH 2/2] UnitTest updated for the method --- _unittest/test_12_PostProcessing.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/_unittest/test_12_PostProcessing.py b/_unittest/test_12_PostProcessing.py index 17cee06e2f4..6b1ba1982af 100644 --- a/_unittest/test_12_PostProcessing.py +++ b/_unittest/test_12_PostProcessing.py @@ -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: