Skip to content

Commit

Permalink
Merge branch 'main' into fix_analysis_args
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys authored Apr 23, 2024
2 parents 520729e + 49f567f commit ab0c8d3
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 22 deletions.
2 changes: 1 addition & 1 deletion doc/source/API/SetupTemplatesIcepak.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You can edit a setup after it is created. Here is an example:
# Any property of this setup can be found on this page.
setup = app.create_setup(MaxIterations=5)
Available turbulent models are: ``"ZeroEquation"``, ``"TwoEquation"``, ``"EnhancedTwoEquation"``, ``"RNG"``, ``"EnhancedRNG"``, ``"RealizableTwoEquation"``, ``"EnhancedRealizableTwoEquation"``, ``"SpalartAllmaras"``, ``"kOmegaSST"``.

.. pprint:: pyaedt.modules.SetupTemplates.TransientFlowOnly
.. pprint:: pyaedt.modules.SetupTemplates.TransientTemperatureOnly
Expand Down
2 changes: 1 addition & 1 deletion pyaedt/generic/general_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def deprecate_kwargs(func_name, kwargs, aliases):
msg += "{} is deprecated, use {} instead.".format(alias, new)
raise TypeError(msg)
pyaedt_logger.warning(
'`{}` is deprecated as an argument to `{}`; use" f" `{}` instead.'.format(alias, func_name, new)
"Argument `{}` is deprecated for method `{}`; use `{}` instead.".format(alias, func_name, new)
)
kwargs[new] = kwargs.pop(alias)

Expand Down
19 changes: 18 additions & 1 deletion pyaedt/generic/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,24 @@ def _read_mesh_files(self, read_frames=False):
if ".case" in field.path:
reader = pv.get_reader(os.path.abspath(field.path)).read()
field._cached_polydata = reader[reader.keys()[0]].extract_surface()
field.scalar_name = field._cached_polydata.point_data.active_scalars_name

if (
hasattr(field._cached_polydata.point_data, "active_vectors")
and field._cached_polydata.point_data.active_vectors_name
):
field.scalar_name = field._cached_polydata.point_data.active_scalars_name
vector_scale = (max(field._cached_polydata.bounds) - min(field._cached_polydata.bounds)) / (
10
* (
np.vstack(field._cached_polydata.active_vectors).max()
- np.vstack(field._cached_polydata.active_vectors).min()
)
)
field._cached_polydata["vectors"] = field._cached_polydata.active_vectors * vector_scale

field.is_vector = True
else:
field.scalar_name = field._cached_polydata.point_data.active_scalars_name

elif ".aedtplt" in field.path:
vertices, faces, scalars, log1 = _parse_aedtplt(field.path)
Expand Down
40 changes: 23 additions & 17 deletions pyaedt/modules/SetupTemplates.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
{
"Enabled": True,
"Flow Regime": "Laminar",
"Turbulent Model Eqn": "ZeroEquation",
"Include Temperature": True,
"Include Flow": True,
"Include Gravity": False,
Expand Down Expand Up @@ -380,6 +381,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
{
"Enabled": True,
"Flow Regime": "Laminar",
"Turbulent Model Eqn": "ZeroEquation",
"Include Temperature": True,
"Include Gravity": False,
"Solution Initialization - X Velocity": "0m_per_sec",
Expand Down Expand Up @@ -441,6 +443,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
{
"Enabled": True,
"Flow Regime": "Laminar",
"Turbulent Model Eqn": "ZeroEquation",
"Include Flow": True,
"Include Gravity": False,
"Solution Initialization - X Velocity": "0m_per_sec",
Expand Down Expand Up @@ -793,6 +796,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
{
"Enabled": True,
"Flow Regime": "Laminar",
"Turbulent Model Eqn": "ZeroEquation",
"Include Temperature": True,
"Include Flow": True,
"Include Gravity": False,
Expand All @@ -811,7 +815,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
"Convergence Criteria - Turbulent Dissipation Rate": "0.001",
"Convergence Criteria - Specific Dissipation Rate": "0.001",
"Convergence Criteria - Discrete Ordinates": "1e-06",
"IsEnabled:=": False,
"IsEnabled": False,
"Radiation Model": "Off",
"Solar Radiation Model": "Solar Radiation Calculator",
"Solar Radiation - Scattering Fraction": "0",
Expand Down Expand Up @@ -865,9 +869,9 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
"Linear Solver Stabilization - Temperature": "None",
"Coupled pressure-velocity formulation": False,
"Frozen Flow Simulation": False,
"Start Time:=": "0s",
"Stop Time:=": "20s",
"Time Step:=": "1s",
"Start Time": "0s",
"Stop Time": "20s",
"Time Step": "1s",
"Iterations per Time Step": 20,
"Import Start Time": False,
"Copy Fields From Source": False,
Expand All @@ -883,6 +887,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
{
"Enabled": True,
"Flow Regime": "Laminar",
"Turbulent Model Eqn": "ZeroEquation",
"Include Temperature": True,
"Include Flow": False,
"Include Gravity": False,
Expand All @@ -901,7 +906,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
"Convergence Criteria - Turbulent Dissipation Rate": "0.001",
"Convergence Criteria - Specific Dissipation Rate": "0.001",
"Convergence Criteria - Discrete Ordinates": "1e-06",
"IsEnabled:=": False,
"IsEnabled": False,
"Radiation Model": "Off",
"Solar Radiation Model": "Solar Radiation Calculator",
"Solar Radiation - Scattering Fraction": "0",
Expand Down Expand Up @@ -955,9 +960,9 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
"Linear Solver Stabilization - Temperature": "None",
"Coupled pressure-velocity formulation": False,
"Frozen Flow Simulation": False,
"Start Time:=": "0s",
"Stop Time:=": "20s",
"Time Step:=": "1s",
"Start Time": "0s",
"Stop Time": "20s",
"Time Step": "1s",
"Iterations per Time Step": 20,
"Import Start Time": False,
"Copy Fields From Source": False,
Expand All @@ -973,6 +978,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
{
"Enabled": True,
"Flow Regime": "Laminar",
"Turbulent Model Eqn": "ZeroEquation",
"Include Temperature": False,
"Include Flow": True,
"Include Gravity": False,
Expand All @@ -991,7 +997,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
"Convergence Criteria - Turbulent Dissipation Rate": "0.001",
"Convergence Criteria - Specific Dissipation Rate": "0.001",
"Convergence Criteria - Discrete Ordinates": "1e-06",
"IsEnabled:=": False,
"IsEnabled": False,
"Radiation Model": "Off",
"Solar Radiation Model": "Solar Radiation Calculator",
"Solar Radiation - Scattering Fraction": "0",
Expand Down Expand Up @@ -1045,9 +1051,9 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
"Linear Solver Stabilization - Temperature": "None",
"Coupled pressure-velocity formulation": False,
"Frozen Flow Simulation": False,
"Start Time:=": "0s",
"Stop Time:=": "20s",
"Time Step:=": "1s",
"Start Time": "0s",
"Stop Time": "20s",
"Time Step": "1s",
"Iterations per Time Step": 20,
"Import Start Time": False,
"Copy Fields From Source": False,
Expand Down Expand Up @@ -1150,7 +1156,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
"InclBBoxOption": 1,
"AuxBlock": OrderedDict({}),
"DoAdaptive": True,
"Color": ["R:=", 0, "G:=", 0, "B:=", 0], # TODO: create something smart for color arrays: like a class
"Color": ["R", 0, "G", 0, "B", 0], # TODO: create something smart for color arrays: like a class
"AdvancedSettings": HFSS3DLayout_AdvancedSettings,
"CurveApproximation": HFSS3DLayout_CurveApproximation,
"Q3D_DCSettings": HFSS3DLayout_Q3D_DCSettings,
Expand Down Expand Up @@ -1225,7 +1231,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
"ICModeLength": "50nm",
"AuxBlock": OrderedDict({}),
"DoAdaptive": True,
"Color": ["R:=", 0, "G:=", 0, "B:=", 0], # TODO: create something smart for color arrays: like a class
"Color": ["R", 0, "G", 0, "B", 0], # TODO: create something smart for color arrays: like a class
"AdvancedSettings": HFSS3DLayout_AdvancedSettings,
"CurveApproximation": HFSS3DLayout_CurveApproximation,
"Q3D_DCSettings": HFSS3DLayout_Q3D_DCSettings,
Expand All @@ -1240,8 +1246,8 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
HFSS3DLayout_SIWAdvancedSettings = OrderedDict(
{
"IncludeCoPlaneCoupling": True,
"IncludeInterPlaneCoupling:=": False,
"IncludeSplitPlaneCoupling:=": True,
"IncludeInterPlaneCoupling": False,
"IncludeSplitPlaneCoupling": True,
"IncludeFringeCoupling": True,
"IncludeTraceCoupling": True,
"XtalkThreshold": "-34",
Expand Down Expand Up @@ -1334,7 +1340,7 @@ def HFSS3DLayout_AdaptiveFrequencyData(freq):
"Properties": HFSS3DLayout_Properties,
"CustomSetup": False,
"SolveSetupType": "SIwave",
"Color": ["R:=", 0, "G:=", 0, "B:=", 0],
"Color": ["R", 0, "G", 0, "B", 0],
"Position": 0,
"SimSetupType": "kSIwave",
"SimulationSettings": HFSS3DLayout_ACSimulationSettings,
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"fpdf2",
"jsonschema",
"psutil",
"pyedb>=0.4.0,<0.5; python_version == '3.7'",
"pyedb>=0.4.0,<0.9; python_version == '3.7'",
"pyedb>=0.5.0; python_version > '3.7'",
"pytomlpp; python_version < '3.12'",
"rpyc>=6.0.0,<6.1",
Expand All @@ -49,7 +49,7 @@ tests = [
"pytest>=7.4.0,<8.2",
"pytest-cov>=4.0.0,<5.1",
"pytest-xdist>=3.5.0,<3.7",
"pyedb>=0.4.0,<0.5; python_version == '3.7'",
"pyedb>=0.4.0,<0.9; python_version == '3.7'",
"pyedb>=0.5.0,<0.9; python_version > '3.7'",
"pyvista>=0.38.0,<0.44",
"scikit-learn>=1.0.0,<1.5",
Expand Down

0 comments on commit ab0c8d3

Please sign in to comment.