Skip to content

Commit

Permalink
updated mesh region to support 2022R1 and 2022R2 new settings settings (
Browse files Browse the repository at this point in the history
#969)

Co-authored-by: maxcapodi78 <Shark78>
  • Loading branch information
maxcapodi78 authored Mar 18, 2022
1 parent 8595ff7 commit fa4d455
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions pyaedt/modules/MeshIcepak.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections import OrderedDict

from pyaedt import settings
from pyaedt.generic.general_methods import generate_unique_name
from pyaedt.generic.general_methods import pyaedt_function_handler
from pyaedt.modules.Mesh import meshers
Expand Down Expand Up @@ -71,6 +72,20 @@ def __init__(self, meshmodule, dimension, units):
self.Objects = ["Region"]
self.SubModels = False
self.Enable = True
self.ProximitySizeFunction = True
self.CurvatureSizeFunction = True
self.EnableTransition = False
self.OptimizePCBMesh = True
self.Enable2DCutCell = False
self.EnforceCutCellMeshing = False
self.Enforce2dot5DCutCell = False
self.SlackMinX = "0mm"
self.SlackMinY = "0mm"
self.SlackMinZ = "0mm"
self.SlackMaxX = "0mm"
self.SlackMaxY = "0mm"
self.SlackMaxZ = "0mm"
self.CoordCS = "Global"

@pyaedt_function_handler()
def _dim_arg(self, value):
Expand All @@ -84,6 +99,47 @@ def _dim_arg(self, value):
val = "{0}{1}".format(value, self.model_units)
return val

@property
def _new_versions_fields(self):
arg = []
if settings.aedt_version > "2021.2":
arg = [
"ProximitySizeFunction:=",
self.ProximitySizeFunction,
"CurvatureSizeFunction:=",
self.CurvatureSizeFunction,
"EnableTransition:=",
self.EnableTransition,
"OptimizePCBMesh:=",
self.OptimizePCBMesh,
"Enable2DCutCell:=",
self.Enable2DCutCell,
"EnforceCutCellMeshing:=",
self.EnforceCutCellMeshing,
"Enforce2dot5DCutCell:=",
self.Enforce2dot5DCutCell,
]
if settings.aedt_version >= "2022.2":
arg.extend(
[
"SlackMinX:=",
self.SlackMinX,
"SlackMinY:=",
self.SlackMinY,
"SlackMinZ:=",
self.SlackMinZ,
"SlackMaxX:=",
self.SlackMaxX,
"SlackMaxY:=",
self.SlackMaxY,
"SlackMaxZ:=",
self.SlackMaxZ,
"CoordCS:=",
self.CoordCS,
]
)
return arg

@property
def autosettings(self):
"""Automatic mesh settings."""
Expand All @@ -109,6 +165,7 @@ def autosettings(self):
else:
arg.append("Objects:=")
arg.append(self.Objects)
arg.extend(self._new_versions_fields)
return arg

@property
Expand Down Expand Up @@ -163,6 +220,7 @@ def manualsettings(self):
else:
arg.append("Objects:=")
arg.append(self.Objects)
arg.extend(self._new_versions_fields)
return arg

@property
Expand Down

0 comments on commit fa4d455

Please sign in to comment.