Skip to content

Commit 846d1c4

Browse files
gmalinvepyansys-ci-botSamuelopez-ansys
authored
FEAT: add vector fields names in extension (#6423)
Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: Samuel Lopez <[email protected]>
1 parent 01bad04 commit 846d1c4

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

doc/changelog.d/6423.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add vector fields names in extension

src/ansys/aedt/core/extensions/maxwell3d/fields_distribution.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2323
# SOFTWARE.
2424

25+
import json
2526
from pathlib import Path
2627
import tkinter as tk
2728

@@ -112,6 +113,10 @@ def frontend(): # pragma: no cover
112113
named_expressions = maxwell.post.available_report_quantities(
113114
report_category="Fields", context=point.name, quantities_category="Calculator Expressions"
114115
)
116+
json_path = Path(__file__).resolve().parent / "vector_fields.json"
117+
with open(json_path, "r") as f:
118+
vector_fields = json.load(f)
119+
named_expressions.extend(vector_fields[design_type])
115120
point.delete()
116121

117122
project_name = maxwell.project_name
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"Maxwell 2D": [
3+
"A_Vector",
4+
"H_Vector",
5+
"B_Vector",
6+
"J_Vector",
7+
"D_Vector",
8+
"surfaceForceDensity",
9+
"edgeForceDensity",
10+
"SurfaceAcForceDensity",
11+
"EdgeAcForceDensity",
12+
"SurfaceMaxForceDensity",
13+
"EdgeMaxForceDensity",
14+
"Displacement_Vector"
15+
],
16+
"Maxwell 3D": [
17+
"Vector_H",
18+
"Vector_B",
19+
"Vector_J",
20+
"Vector_Jsurf",
21+
"Vector_E",
22+
"Vector_D",
23+
"Volume_Force_Density",
24+
"Surface_Force_Density",
25+
"Volume_AC_Force_Density",
26+
"Surface_AC_Force_Density",
27+
"Volume_Max_Force_Density",
28+
"Surface_Max_Force_Density",
29+
"Displacement_Vector"
30+
]
31+
}

0 commit comments

Comments
 (0)