Skip to content

Commit 6573d85

Browse files
committed
update available report and categories
1 parent bfab942 commit 6573d85

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

pyaedt/modules/Boundary.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,6 @@ def __init__(self, app, name, props=None, boundarytype=None):
12821282
self.type = boundarytype
12831283
self._boundary_name = self.name
12841284
self.auto_update = True
1285-
self.CATEGORIES = CATEGORIESQ3D()
12861285

12871286
@property
12881287
def object_properties(self):
@@ -1470,7 +1469,7 @@ def get_sources_for_plot(
14701469
get_mutual_terms=True,
14711470
first_element_filter=None,
14721471
second_element_filter=None,
1473-
category="C",
1472+
category="L",
14741473
):
14751474
"""Return a list of source of specified matrix ready to be used in plot reports.
14761475
@@ -1485,7 +1484,7 @@ def get_sources_for_plot(
14851484
second_element_filter : str, optional
14861485
Filter to apply to second element of equation. It accepts `*` and `?` as special characters.
14871486
category : str
1488-
Plot category name as in the report. Eg. "C" is category Capacitance.
1487+
Plot category name as in the report. Eg. "L" is category Inductance.
14891488
Matrix `CATEGORIES` property can be used to map available categories.
14901489
14911490
Returns
@@ -1504,7 +1503,7 @@ def get_sources_for_plot(
15041503
if not second_element_filter:
15051504
second_element_filter = "*"
15061505
is_cg = False
1507-
if category in [self.CATEGORIES.Q3D.C, self.CATEGORIES.Q3D.G]:
1506+
if category in [self.CATEGORIESMAXWELL.Maxwell2d.L, self.CATEGORIESMAXWELL.Maxwell2d.R]:
15081507
is_cg = True
15091508
list_output = []
15101509
# params = oDesign.GetChildObject("Parameters")
@@ -2067,6 +2066,7 @@ def get_sources_for_plot(
20672066
>>> q3d.matrices[0].get_sources_for_plot(first_element_filter="Bo?1",
20682067
... second_element_filter="GND*", category="DCL")
20692068
"""
2069+
# DO WE REALLY NEED IT?
20702070
if not first_element_filter:
20712071
first_element_filter = "*"
20722072
if not second_element_filter:

pyaedt/modules/PostProcessor.py

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -945,21 +945,21 @@ def available_display_types(self, report_category=None):
945945

946946
@pyaedt_function_handler()
947947
def available_quantities_categories(
948-
self, report_category=None, display_type=None, solution=None, context="", is_siwave_dc=False
948+
self, report_category=None, display_type=None, solution=None, context=None, is_siwave_dc=False
949949
):
950950
"""Compute the list of all available report categories.
951951
952952
Parameters
953953
----------
954954
report_category : str, optional
955-
Report Category. Default is `None` which will take first default category.
955+
Report Category. Default is ``None`` which will take first default category.
956956
display_type : str, optional
957957
Report Display Type.
958958
Default is `None` which will take first default type which is in most of the case "Rectangular Plot".
959959
solution : str, optional
960-
Report Setup. Default is `None` which will take first nominal_adaptive solution.
961-
context : str, optional
962-
Report Category. Default is `""` which will take first default context.
960+
Report Setup. Default is ``None`` which will take first nominal_adaptive solution.
961+
context : str, dict, optional
962+
Report Category. Default is ``None`` which will take first default context.
963963
is_siwave_dc : bool, optional
964964
Whether if the setup is Siwave DCIR or not. Default is ``False``.
965965
@@ -994,7 +994,14 @@ def available_quantities_categories(
994994
"SimValueContext:=",
995995
[37010, 0, 2, 0, False, False, -1, 1, 0, 1, 1, "", 0, 0, "DCIRID", False, id_, "IDIID", False, "1"],
996996
]
997-
997+
elif self._app.design_type == "Maxwell 2D" and self._app.solution_type == "EddyCurrent":
998+
if isinstance(context, dict):
999+
for k, v in context.items():
1000+
context = ["Context:=", k, "Matrix:=", v]
1001+
elif context and isinstance(context, str):
1002+
context = ["Context:=", context]
1003+
elif not context:
1004+
context = ""
9981005
elif not context: # pragma: no cover
9991006
context = ""
10001007

@@ -1009,7 +1016,7 @@ def available_report_quantities(
10091016
display_type=None,
10101017
solution=None,
10111018
quantities_category=None,
1012-
context="",
1019+
context=None,
10131020
is_siwave_dc=False,
10141021
):
10151022
"""Compute the list of all available report quantities of a given report quantity category.
@@ -1026,8 +1033,10 @@ def available_report_quantities(
10261033
quantities_category : str, optional
10271034
The category to which quantities belong. It has to be one of ``available_quantities_categories`` method.
10281035
Default is ``None`` which will take first default quantity.".
1029-
context : str, optional
1030-
Report Context. Default is ``""`` which will take first default context.
1036+
context : str, dict, optional
1037+
Report Context. Default is ``None`` which will take first default context.
1038+
For Maxwell 2D Eddy Current solution types this can be provided as a dictionary
1039+
where the key is the matrix name and value the reduced matrix.
10311040
is_siwave_dc : bool, optional
10321041
Whether if the setup is Siwave DCIR or not. Default is ``False``.
10331042
@@ -1062,7 +1071,14 @@ def available_report_quantities(
10621071
"SimValueContext:=",
10631072
[37010, 0, 2, 0, False, False, -1, 1, 0, 1, 1, "", 0, 0, "DCIRID", False, id, "IDIID", False, "1"],
10641073
]
1065-
1074+
elif self._app.design_type == "Maxwell 2D" and self._app.solution_type == "EddyCurrent":
1075+
if isinstance(context, dict):
1076+
for k, v in context.items():
1077+
context = ["Context:=", k, "Matrix:=", v]
1078+
elif context and isinstance(context, str):
1079+
context = ["Context:=", context]
1080+
elif not context:
1081+
context = ""
10661082
elif not context:
10671083
context = ""
10681084
if not quantities_category:

0 commit comments

Comments
 (0)