Skip to content

Commit

Permalink
MAINT: update code form ADO 0.7.0.dev14 (#882)
Browse files Browse the repository at this point in the history
Co-authored-by: pyansys-ci-bot <[email protected]>
  • Loading branch information
rchopade7 and pyansys-ci-bot authored Sep 23, 2024
1 parent bbebe56 commit efdf382
Show file tree
Hide file tree
Showing 25 changed files with 1,842 additions and 187 deletions.
6 changes: 3 additions & 3 deletions .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.dev14'
MAIN_PYTHON_VERSION: '3.10'
PACKAGE_NAME: 'ansys-meshing-prime'
PACKAGE_NAMESPACE: 'ansys.meshing.prime'
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
PYPRIMEMESH_LAUNCH_CONTAINER: 1
PYPRIMEMESH_SPHINX_BUILD: 1
PYPRIMEMESH_IMAGE_TAG: ${{ env.DOCKER_IMAGE_TAG }}
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER )}}
ANSYSLMD_LICENSE_FILE: '1055@${{ secrets.LICENSE_SERVER }}'

testing:
name: Run Unit Tests
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
env:
PYPRIMEMESH_LAUNCH_CONTAINER: 1
PYPRIMEMESH_IMAGE_TAG: ${{ env.DOCKER_IMAGE_TAG }}
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER )}}
ANSYSLMD_LICENSE_FILE: '1055@${{ secrets.LICENSE_SERVER }}'
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/882.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINT: update code form ADO 0.7.0.dev14
2 changes: 1 addition & 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.dev14"
description = "PyPrimeMesh is a Python client to Ansys Prime Server, which delivers core Ansys meshing technology."
readme = "README.md"
requires-python = ">=3.10,<4"
Expand Down
6 changes: 6 additions & 0 deletions src/ansys/meshing/prime/autogen/commontypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ 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)."""
WARP = 7
"""Face quality metric to check warping factor.
**This is a beta parameter**. **The behavior and name may change in the future**."""
ELEMENTQUALITY = 50
"""The Element Quality metric ranges between 0 (worst) and 1 (best). A value of 1 indicates a perfect cube or square (best) while a value of 0 indicates that the element has a zero or negative volume (worst)."""

Expand Down
2 changes: 1 addition & 1 deletion src/ansys/meshing/prime/autogen/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def subtract_volumes(self, part_id : int, target_volumes : Iterable[int], cutter
return SubtractVolumesResults(model = self._model, json_data = result)

def stitch_face_zonelets(self, part_id : int, face_zonelet_ids : Iterable[int], with_face_zonelet_ids : Iterable[int], params : StitchParams) -> ConnectResults:
""" Stitches a set of face zonelets with another set of face zones.
""" Stitches a set of face zonelets with another set of face zonelets.
Parameters
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
12 changes: 6 additions & 6 deletions src/ansys/meshing/prime/autogen/fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def write_pmdat(self, file_name : str, file_write_params : FileWriteParams) -> F
return FileWriteResults(model = self._model, json_data = result)

def get_abaqus_simulation_data(self, partId : int) -> str:
""" Get Simulation document generated by Abaqus import for a given part.
""" Gets simulation document generated by Abaqus import for a given part.
This method will return the JSON Simulation Document for a part if the part exists. Otherwise,
it returns an empty string.
Expand Down Expand Up @@ -190,7 +190,7 @@ def import_abaqus_inp(self, file_name : str, params : ImportAbaqusParams) -> Imp
return ImportAbaqusResults(model = self._model, json_data = result)

def import_fluent_meshing_size_field(self, file_name : str) -> SizeFieldFileReadResults:
""" Import Fluent-Meshing's sizefield file from disk.
""" Imports Fluent-Meshing's size field file from disk.
Fluent-Meshing's sizefield files have sf and sf.gz extension.
Expand Down Expand Up @@ -511,7 +511,7 @@ def export_fluent_case(self, file_name : str, export_fluent_case_params : Export
return FileWriteResults(model = self._model, json_data = result)

def export_fluent_meshing_mesh(self, file_name : str, export_fluent_mesh_params : ExportFluentMeshingMeshParams) -> FileWriteResults:
""" Export Fluent Meshing mesh file. Fluent Meshing mesh files have .msh extension.
""" Exports Fluent Meshing mesh file. Fluent Meshing mesh files have .msh extension.
Parameters
Expand Down Expand Up @@ -583,7 +583,7 @@ def export_lsdyna_keyword_file(self, file_name : str, export_params : ExportLSDy
return ExportLSDynaResults(model = self._model, json_data = result)

def export_lsdyna_iga_keyword_file(self, file_name : str, export_params : ExportLSDynaIgaKeywordFileParams) -> FileWriteResults:
""" Export IGA LS-DYNA Keyword file for solid, surface splines, or both.
""" Exports IGA LS-DYNA Keyword file for solid, surface splines, or both.
Parameters
Expand Down Expand Up @@ -621,7 +621,7 @@ def export_lsdyna_iga_keyword_file(self, file_name : str, export_params : Export
return FileWriteResults(model = self._model, json_data = result)

def export_boundary_fitted_spline_kfile(self, file_name : str, export_params : ExportBoundaryFittedSplineParams) -> FileWriteResults:
""" Export IGA LS-DYNA Keyword file for boundary fitted spline.
""" Exports IGA LS-DYNA Keyword file for boundary fitted spline.
Parameters
Expand Down Expand Up @@ -694,7 +694,7 @@ def import_cad(self, file_name : str, import_cad_params : ImportCadParams) -> Im
return ImportCadResults(model = self._model, json_data = result)

def export_stl(self, file_name : str, params : ExportSTLParams) -> FileWriteResults:
""" Export STL file.
""" Exports STL file.
Parameters
Expand Down
Loading

0 comments on commit efdf382

Please sign in to comment.