Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT - update code from ADO - 0.7.0.dev6 #843

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

env:
DOCKER_IMAGE_NAME: ghcr.io/ansys/prime
DOCKER_IMAGE_TAG: '24.2.0'
DOCKER_IMAGE_TAG: '25.1.0.dev6'
MAIN_PYTHON_VERSION: '3.9'
PACKAGE_NAME: 'ansys-meshing-prime'
PACKAGE_NAMESPACE: 'ansys.meshing.prime'
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/843.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINT - update code from ADO - 0.7.0.dev6
17 changes: 16 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "ansys-meshing-prime"
version = "0.6.1"
version = "0.7.0.dev6"
description = "PyPrimeMesh is a Python client to Ansys Prime Server, which delivers core Ansys meshing technology."
readme = "README.md"
requires-python = ">=3.8,<4"
Expand Down Expand Up @@ -132,3 +132,18 @@ directory = "miscellaneous"
name = "Miscellaneous"
showcontent = true


[[tool.towncrier.type]]
directory = "documentation"
name = "Documentation"
showcontent = true

[[tool.towncrier.type]]
directory = "maintenance"
name = "Maintenance"
showcontent = true

[[tool.towncrier.type]]
directory = "test"
name = "Test"
showcontent = true
1 change: 1 addition & 0 deletions src/ansys/meshing/prime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@

import ansys.meshing.prime.examples as examples
import ansys.meshing.prime.lucid as lucid
import ansys.meshing.prime.numen as numen


__LOCAL_CLIENT = None
Expand Down
2 changes: 2 additions & 0 deletions src/ansys/meshing/prime/autogen/commontypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class FaceQualityMeasure(enum.IntEnum):
"""
SKEWNESS = 0
"""The Skewness metric ranges between 0 (worst) and 1 (best). A value of 0 indicates an equilateral cell (best) and a value of 1 indicates a completely degenerate cell (worst)."""
SIZECHANGE = 2
"""Size Change is the maximum ratio of the area of each neighboring face element to the area of face element when the area of the face element is smaller than the neighbor. The minimum value for size change is 1."""
ASPECTRATIO = 5
"""The Aspect Ratio metric is greater than 1. A value of 1 indicates an equilateral cell (best) and a value of 20(e.g) indicates a stretched cell (worst)."""
ELEMENTQUALITY = 50
Expand Down
133 changes: 82 additions & 51 deletions src/ansys/meshing/prime/autogen/connectstructs.py

Large diffs are not rendered by default.

65 changes: 58 additions & 7 deletions src/ansys/meshing/prime/autogen/controlstructs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,26 @@ class ScopeExpressionType(enum.IntEnum):
NAMEPATTERN = 2
"""Use name pattern expression to evaluate scope."""

class SweepType(enum.IntEnum):
"""Provides the Sweep Mesh Decomposition type.
"""
STANDARD = 1
"""Multizone create mapped and swept blocks if possible (should be default).

**This is a beta parameter**. **The behavior and name may change in the future**."""
THINSWEEP = 2
"""Creates swept blocks on thin wall geometries.

**This is a beta parameter**. **The behavior and name may change in the future**."""
MEDIALAXIS = 3
"""Creates swept blocks on axisymmetric sweepable geometries.

**This is a beta parameter**. **The behavior and name may change in the future**."""
PROGRAMCONTROLLED = 4
"""Multizone chooses the best decomposition method based on geometry analysis and decomposition tries.

**This is a beta parameter**. **The behavior and name may change in the future**."""

class ScopeDefinition(CoreObject):
"""ScopeDefinition to scope entities based on entity and evaluation type.

Expand Down Expand Up @@ -1572,6 +1592,10 @@ class MultiZoneSweepMeshParams(CoreObject):
thin_sweep: bool, optional
Thin sweep option set to True will generate sweep mesh in thin volumes by respecting nDivisions. Thin sweep option set to False will generate sweep mesh whose number of divisions in the direction of sweep is determined by sweepMeshSize.

**This is a beta parameter**. **The behavior and name may change in the future**.
sweep_type: SweepType, optional
Option to specify the sweep mesh decomposition type.

**This is a beta parameter**. **The behavior and name may change in the future**.
json_data: dict, optional
JSON dictionary to create a ``MultiZoneSweepMeshParams`` object with provided parameters.
Expand All @@ -1587,11 +1611,13 @@ def __initialize(
source_and_target_scope: ScopeDefinition,
sweep_mesh_size: float,
n_divisions: int,
thin_sweep: bool):
thin_sweep: bool,
sweep_type: SweepType):
self._source_and_target_scope = source_and_target_scope
self._sweep_mesh_size = sweep_mesh_size
self._n_divisions = n_divisions
self._thin_sweep = thin_sweep
self._sweep_type = SweepType(sweep_type)

def __init__(
self,
Expand All @@ -1600,6 +1626,7 @@ def __init__(
sweep_mesh_size: float = None,
n_divisions: int = None,
thin_sweep: bool = None,
sweep_type: SweepType = None,
json_data : dict = None,
**kwargs):
"""Initialize a ``MultiZoneSweepMeshParams`` object.
Expand All @@ -1623,6 +1650,10 @@ def __init__(
thin_sweep: bool, optional
Thin sweep option set to True will generate sweep mesh in thin volumes by respecting nDivisions. Thin sweep option set to False will generate sweep mesh whose number of divisions in the direction of sweep is determined by sweepMeshSize.

**This is a beta parameter**. **The behavior and name may change in the future**.
sweep_type: SweepType, optional
Option to specify the sweep mesh decomposition type.

**This is a beta parameter**. **The behavior and name may change in the future**.
json_data: dict, optional
JSON dictionary to create a ``MultiZoneSweepMeshParams`` object with provided parameters.
Expand All @@ -1636,15 +1667,17 @@ def __init__(
ScopeDefinition(model = model, json_data = json_data["sourceAndTargetScope"] if "sourceAndTargetScope" in json_data else None),
json_data["sweepMeshSize"] if "sweepMeshSize" in json_data else None,
json_data["nDivisions"] if "nDivisions" in json_data else None,
json_data["thinSweep"] if "thinSweep" in json_data else None)
json_data["thinSweep"] if "thinSweep" in json_data else None,
SweepType(json_data["sweepType"] if "sweepType" in json_data else None))
else:
all_field_specified = all(arg is not None for arg in [source_and_target_scope, sweep_mesh_size, n_divisions, thin_sweep])
all_field_specified = all(arg is not None for arg in [source_and_target_scope, sweep_mesh_size, n_divisions, thin_sweep, sweep_type])
if all_field_specified:
self.__initialize(
source_and_target_scope,
sweep_mesh_size,
n_divisions,
thin_sweep)
thin_sweep,
sweep_type)
else:
if model is None:
raise ValueError("Invalid assignment. Either pass a model or specify all properties.")
Expand All @@ -1655,7 +1688,8 @@ def __init__(
source_and_target_scope if source_and_target_scope is not None else ( MultiZoneSweepMeshParams._default_params["source_and_target_scope"] if "source_and_target_scope" in MultiZoneSweepMeshParams._default_params else ScopeDefinition(model = model, json_data = (json_data["sourceAndTargetScope"] if "sourceAndTargetScope" in json_data else None))),
sweep_mesh_size if sweep_mesh_size is not None else ( MultiZoneSweepMeshParams._default_params["sweep_mesh_size"] if "sweep_mesh_size" in MultiZoneSweepMeshParams._default_params else (json_data["sweepMeshSize"] if "sweepMeshSize" in json_data else None)),
n_divisions if n_divisions is not None else ( MultiZoneSweepMeshParams._default_params["n_divisions"] if "n_divisions" in MultiZoneSweepMeshParams._default_params else (json_data["nDivisions"] if "nDivisions" in json_data else None)),
thin_sweep if thin_sweep is not None else ( MultiZoneSweepMeshParams._default_params["thin_sweep"] if "thin_sweep" in MultiZoneSweepMeshParams._default_params else (json_data["thinSweep"] if "thinSweep" in json_data else None)))
thin_sweep if thin_sweep is not None else ( MultiZoneSweepMeshParams._default_params["thin_sweep"] if "thin_sweep" in MultiZoneSweepMeshParams._default_params else (json_data["thinSweep"] if "thinSweep" in json_data else None)),
sweep_type if sweep_type is not None else ( MultiZoneSweepMeshParams._default_params["sweep_type"] if "sweep_type" in MultiZoneSweepMeshParams._default_params else SweepType(json_data["sweepType"] if "sweepType" in json_data else None)))
self._custom_params = kwargs
if model is not None:
[ model._logger.warning(f'Unsupported argument : {key}') for key in kwargs ]
Expand All @@ -1668,7 +1702,8 @@ def set_default(
source_and_target_scope: ScopeDefinition = None,
sweep_mesh_size: float = None,
n_divisions: int = None,
thin_sweep: bool = None):
thin_sweep: bool = None,
sweep_type: SweepType = None):
"""Set the default values of the ``MultiZoneSweepMeshParams`` object.

Parameters
Expand All @@ -1681,6 +1716,8 @@ def set_default(
Number of divisions in the sweep direction.
thin_sweep: bool, optional
Thin sweep option set to True will generate sweep mesh in thin volumes by respecting nDivisions. Thin sweep option set to False will generate sweep mesh whose number of divisions in the direction of sweep is determined by sweepMeshSize.
sweep_type: SweepType, optional
Option to specify the sweep mesh decomposition type.
"""
args = locals()
[MultiZoneSweepMeshParams._default_params.update({ key: value }) for key, value in args.items() if value is not None]
Expand All @@ -1707,11 +1744,13 @@ def _jsonify(self) -> Dict[str, Any]:
json_data["nDivisions"] = self._n_divisions
if self._thin_sweep is not None:
json_data["thinSweep"] = self._thin_sweep
if self._sweep_type is not None:
json_data["sweepType"] = self._sweep_type
[ json_data.update({ utils.to_camel_case(key) : value }) for key, value in self._custom_params.items()]
return json_data

def __str__(self) -> str:
message = "source_and_target_scope : %s\nsweep_mesh_size : %s\nn_divisions : %s\nthin_sweep : %s" % ('{ ' + str(self._source_and_target_scope) + ' }', self._sweep_mesh_size, self._n_divisions, self._thin_sweep)
message = "source_and_target_scope : %s\nsweep_mesh_size : %s\nn_divisions : %s\nthin_sweep : %s\nsweep_type : %s" % ('{ ' + str(self._source_and_target_scope) + ' }', self._sweep_mesh_size, self._n_divisions, self._thin_sweep, self._sweep_type)
message += ''.join('\n' + str(key) + ' : ' + str(value) for key, value in self._custom_params.items())
return message

Expand Down Expand Up @@ -1763,6 +1802,18 @@ def thin_sweep(self) -> bool:
def thin_sweep(self, value: bool):
self._thin_sweep = value

@property
def sweep_type(self) -> SweepType:
"""Option to specify the sweep mesh decomposition type.

**This is a beta parameter**. **The behavior and name may change in the future**.
"""
return self._sweep_type

@sweep_type.setter
def sweep_type(self, value: SweepType):
self._sweep_type = value

class MultiZoneEdgeBiasingParams(CoreObject):
"""Defines MultiZone edge biasing control parameters.

Expand Down
Loading
Loading