diff --git a/src/ansys/aedt/core/visualization/post/common.py b/src/ansys/aedt/core/visualization/post/common.py index 6c131a9ca47..ab2d0b2b313 100644 --- a/src/ansys/aedt/core/visualization/post/common.py +++ b/src/ansys/aedt/core/visualization/post/common.py @@ -218,7 +218,10 @@ def available_quantities_categories( "SimValueContext:=", [37010, 0, 2, 0, False, False, -1, 1, 0, 1, 1, "", 0, 0, "DCIRID", False, id_, "IDIID", False, "1"], ] - elif self._app.design_type in ["Maxwell 2D", "Maxwell 3D"] and self._app.solution_type == "EddyCurrent": + elif self._app.design_type in ["Maxwell 2D", "Maxwell 3D"] and self._app.solution_type in [ + "EddyCurrent", + "Electrostatic", + ]: if isinstance(context, dict): for k, v in context.items(): context = ["Context:=", k, "Matrix:=", v] @@ -400,7 +403,10 @@ def available_report_quantities( ] else: context = ["Diff:=", "differential_pairs", "Domain:=", "Sweep"] - elif self._app.design_type in ["Maxwell 2D", "Maxwell 3D"] and self._app.solution_type == "EddyCurrent": + elif self._app.design_type in ["Maxwell 2D", "Maxwell 3D"] and self._app.solution_type in [ + "EddyCurrent", + "Electrostatic", + ]: if isinstance(context, dict): for k, v in context.items(): context = ["Context:=", k, "Matrix:=", v] @@ -1289,8 +1295,8 @@ def create_report( report.matrix = context elif ( self._app.design_type in ["Maxwell 2D", "Maxwell 3D"] - and self._app.solution_type == "EddyCurrent" and context + and self._app.solution_type in ["EddyCurrent", "Electrostatic"] ): if isinstance(context, dict): for k, v in context.items(): @@ -1514,8 +1520,8 @@ def get_solution_data( report.matrix = context elif ( self._app.design_type in ["Maxwell 2D", "Maxwell 3D"] - and self._app.solution_type == "EddyCurrent" and context + and self._app.solution_type in ["EddyCurrent", "Electrostatic"] ): if isinstance(context, dict): for k, v in context.items(): diff --git a/src/ansys/aedt/core/visualization/report/standard.py b/src/ansys/aedt/core/visualization/report/standard.py index 6655c8dace0..43425b20011 100644 --- a/src/ansys/aedt/core/visualization/report/standard.py +++ b/src/ansys/aedt/core/visualization/report/standard.py @@ -169,13 +169,13 @@ def _context(self): ctxt = ["Context:=", "Original"] else: ctxt = ["Context:=", self.matrix] - elif ( - self._post._app.design_type in ["Maxwell 2D", "Maxwell 3D"] - and self._post._app.solution_type == "EddyCurrent" - ): + elif self._post._app.design_type in ["Maxwell 2D", "Maxwell 3D"] and self._post._app.solution_type in [ + "EddyCurrent", + "Electrostatic", + ]: if not self.matrix: ctxt = ["Context:=", "Original"] - elif not self.reduced_matrix: + elif self.matrix and not self.reduced_matrix: ctxt = ["Context:=", self.matrix] elif self.reduced_matrix: ctxt = ["Context:=", self.matrix, "Matrix:=", self.reduced_matrix] diff --git a/tests/system/general/test_28_Maxwell3D.py b/tests/system/general/test_28_Maxwell3D.py index 054fde90def..36fdc55e539 100644 --- a/tests/system/general/test_28_Maxwell3D.py +++ b/tests/system/general/test_28_Maxwell3D.py @@ -504,8 +504,27 @@ def test_32_matrix(self, add_app): m3d.assign_voltage(box1.faces, amplitude=1, name="Voltage6") m3d.assign_voltage(box2, amplitude=1, name="Voltage7") + setup = m3d.create_setup(MaximumPasses=2) + m3d.analyze(setup=setup.name) + L = m3d.assign_matrix(assignment="Voltage1") assert L.props["MatrixEntry"]["MatrixEntry"][0]["Source"] == "Voltage1" + cat = m3d.post.available_quantities_categories(context=L.name) + assert isinstance(cat, list) + assert "C" in cat + quantities = m3d.post.available_report_quantities( + display_type="Data Table", quantities_category="C", context=L.name + ) + assert isinstance(quantities, list) + report = m3d.post.create_report( + expressions=quantities, + plot_type="Data Table", + context=L.name, + primary_sweep_variable="X", + variations={"X": "All"}, + ) + assert quantities == report.expressions + assert report.matrix == L.name assert L.delete() group_sources = "Voltage2" L = m3d.assign_matrix(assignment=["Voltage1", "Voltage3"], matrix_name="Test1", group_sources=group_sources)