Skip to content

Commit

Permalink
MAINT: Update code from ADO - 0.6.0.dev4 (#739)
Browse files Browse the repository at this point in the history
Co-authored-by: srpyprime <[email protected]>
Co-authored-by: Kathy Pippert <[email protected]>
  • Loading branch information
3 people authored Mar 15, 2024
1 parent 08dc0f5 commit 6a5047d
Show file tree
Hide file tree
Showing 8 changed files with 777 additions and 454 deletions.
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.dev2'
DOCKER_IMAGE_TAG: '24.2.0.dev4'
MAIN_PYTHON_VERSION: '3.9'
PACKAGE_NAME: 'ansys-meshing-prime'
PACKAGE_NAMESPACE: 'ansys.meshing.prime'
Expand Down
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.0.dev2"
version = "0.6.0.dev4"
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
230 changes: 138 additions & 92 deletions src/ansys/meshing/prime/autogen/connectstructs.py

Large diffs are not rendered by default.

338 changes: 169 additions & 169 deletions src/ansys/meshing/prime/autogen/fileiostructs.py

Large diffs are not rendered by default.

33 changes: 27 additions & 6 deletions src/ansys/meshing/prime/autogen/primeconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class ErrorCode(enum.IntEnum):
"""Pyramid meshing failed."""
DELETEMESHFAILED = 142
"""Deleting mesh failed."""
INCREMENTALVOLUMEMESHINGNOTSUPPORTED = 143
"""Incremental volume meshing is not supported."""
OUTOFMEMORY = 200
"""Out of memory."""
INTERRUPTED = 201
Expand Down Expand Up @@ -308,6 +310,8 @@ class ErrorCode(enum.IntEnum):
"""Merge zonelets is not supported for part with topology data."""
MERGEVOLUMESNOTSUPPORTEDFORTOPOLOGYPART = 1207
"""Merge volumes is not supported for part with topology data."""
NOTSUPPORTEDFORPOLYMESHPART = 1208
"""Operation does not support poly elements."""
MERGEPARTSFAILED = 1301
"""Merge parts failed."""
MERGEPARTSWANDWOTOPO = 1302
Expand Down Expand Up @@ -538,16 +542,19 @@ class ErrorCode(enum.IntEnum):
"""Resolution Factor should be greater than 0 but less than or equal to 1."""
WRAPPERLEAKINGFLUIDREGIONS = 3444
"""Two or more fluid regions leaking into each other.
This parameter is a Beta. Parameter behavior and name may change in future."""
This is a beta parameter. The behavior and name may change in the future."""
WRAPPERPATCHFLOWREGIONS_INVALIDHOLESIZE = 3445
"""Hole size specified for dead region should be positive double.
This parameter is a Beta. Parameter behavior and name may change in future."""
This is a beta parameter. The behavior and name may change in the future."""
WRAPPERPATCHFLOWREGIONS_FAILED = 3446
"""Unable to create patch surfaces.
This parameter is a Beta. Parameter behavior and name may change in future."""
This is a beta parameter. The behavior and name may change in the future."""
WRAPPERPATCHFLOWREGIONS_TOOSMALLHOLESIZE = 3447
"""Too small hole size provided for dead region.
This parameter is a Beta. Parameter behavior and name may change in future."""
This is a beta parameter. The behavior and name may change in the future."""
WRAPPERPATCHFLOWREGIONS_INVALIDBASESIZE = 3448
"""Base size specified for patching should be positive double.
This is a beta parameter. The behavior and name may change in the future."""
CELLSEPARATIONFAILED = 6000
"""Cell separation failed."""
NOCELLSSEPARATED = 6001
Expand Down Expand Up @@ -600,6 +607,8 @@ class ErrorCode(enum.IntEnum):
"""Some bodies are intersecting or incorrectly defined."""
STACKER_BASEFACEUNMESHED = 10111
"""Base face list input has unmeshed topofaces."""
FACEZONELETSHAVECELLSCONNECTED = 10205
"""Face zonelets have cells connected."""
INVALIDTHINVOLUMECONTROLS = 12101
"""Invalid input provided for thin volume control."""
THINVOLUMECONTROLINVALIDSOURCESCOPE = 12102
Expand Down Expand Up @@ -636,10 +645,10 @@ class ErrorCode(enum.IntEnum):
"""Bad shape properties."""
AUTOQUADMESHER_NEGATIVEINPUTPARAMETER = 15000
"""Autoquadmesher error codes.
This parameter is a Beta. Parameter behavior and name may change in future."""
This is a beta parameter. The behavior and name may change in the future."""
AUTOQUADMESHER_INVALIDMINMAXSIZES = 15001
"""Difference in maximum value and minimum value is negative.
This parameter is a Beta. Parameter behavior and name may change in future."""
This is a beta parameter. The behavior and name may change in the future."""

class WarningCode(enum.IntEnum):
"""Warning codes associated with the PyPrimeMesh operation.
Expand Down Expand Up @@ -680,6 +689,10 @@ class WarningCode(enum.IntEnum):
"""Degenerate input."""
ALIGN_OPERATIONINTERRUPTED = 1900
"""Align operation interrupted."""
FUSEOVERLAPREMOVALINCOMPLETE = 4500
"""Self intersections found. Use Fuse operation to remove it."""
REMOVEOVERLAPWITHINTERSECT = 4501
"""Self intersections found. Use Intersect operation to remove it."""
IGA_NOGEOMZONELETFORSPLINEFITTING = 5001
"""Invalid input for IGA."""
NOHOLESFOUNDONPLANE = 5501
Expand Down Expand Up @@ -728,5 +741,13 @@ class WarningCode(enum.IntEnum):
"""CAD geometry not found for some or all topo entities. Projected on facets for those topo entites."""
DUPLICATEINPUT = 8001
"""Duplicate items in input."""
UNPROCESSEDKEYWORDSINABAQUSFILE = 11001
"""Unprocessed Abaqus keywords have been found."""
EXPORTMAPDLANALYSISSETTINGSFAILED = 11101
"""Export MAPDL analysis settings failed."""
WRITINGCONTACTPAIRSSKIPPED = 11102
"""Writing of contact pairs skipped."""
WRITINGTIESSKIPPED = 11103
"""Writing of ties skipped."""
MULTIZONEMESHER_SURFACESCOPEVOLUMESCOPEINCONSISTENCY = 110001
"""MultiZone warning codes"""
103 changes: 71 additions & 32 deletions src/ansys/meshing/prime/autogen/surfaceutilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_bounding_box_of_zonelets(self, zonelets : Iterable[int]) -> BoundingBox:
"""
if not isinstance(zonelets, Iterable):
raise TypeError("Invalid argument type passed for zonelets, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'zonelets'. Valid argument type is Iterable[int].")
args = {"zonelets" : zonelets}
command_name = "PrimeMesh::SurfaceUtilities/GetBoundingBoxOfZonelets"
self._model._print_logs_before_command("get_bounding_box_of_zonelets", args)
Expand Down Expand Up @@ -85,11 +85,11 @@ def fix_invalid_normal_nodes_of_face_zonelets(self, part_id : int, face_zonelets
"""
if not isinstance(part_id, int):
raise TypeError("Invalid argument type passed for part_id, valid argument type is int.")
raise TypeError("Invalid argument type passed for 'part_id'. Valid argument type is int.")
if not isinstance(face_zonelets, Iterable):
raise TypeError("Invalid argument type passed for face_zonelets, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'face_zonelets'. Valid argument type is Iterable[int].")
if not isinstance(params, FixInvalidNormalNodeParams):
raise TypeError("Invalid argument type passed for params, valid argument type is FixInvalidNormalNodeParams.")
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is FixInvalidNormalNodeParams.")
args = {"part_id" : part_id,
"face_zonelets" : face_zonelets,
"params" : params._jsonify()}
Expand Down Expand Up @@ -125,11 +125,11 @@ def copy_face_zonelets(self, face_zonelets : Iterable[int], target_part_id : int
"""
if not isinstance(face_zonelets, Iterable):
raise TypeError("Invalid argument type passed for face_zonelets, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'face_zonelets'. Valid argument type is Iterable[int].")
if not isinstance(target_part_id, int):
raise TypeError("Invalid argument type passed for target_part_id, valid argument type is int.")
raise TypeError("Invalid argument type passed for 'target_part_id'. Valid argument type is int.")
if not isinstance(params, CopyZoneletsParams):
raise TypeError("Invalid argument type passed for params, valid argument type is CopyZoneletsParams.")
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is CopyZoneletsParams.")
args = {"face_zonelets" : face_zonelets,
"target_part_id" : target_part_id,
"params" : params._jsonify()}
Expand Down Expand Up @@ -167,13 +167,13 @@ def fill_holes_at_plane(self, part_id : int, face_zonelets : Iterable[int], plan
"""
if not isinstance(part_id, int):
raise TypeError("Invalid argument type passed for part_id, valid argument type is int.")
raise TypeError("Invalid argument type passed for 'part_id'. Valid argument type is int.")
if not isinstance(face_zonelets, Iterable):
raise TypeError("Invalid argument type passed for face_zonelets, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'face_zonelets'. Valid argument type is Iterable[int].")
if not isinstance(plane_points, Iterable):
raise TypeError("Invalid argument type passed for plane_points, valid argument type is Iterable[float].")
raise TypeError("Invalid argument type passed for 'plane_points'. Valid argument type is Iterable[float].")
if not isinstance(params, FillHolesAtPlaneParams):
raise TypeError("Invalid argument type passed for params, valid argument type is FillHolesAtPlaneParams.")
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is FillHolesAtPlaneParams.")
args = {"part_id" : part_id,
"face_zonelets" : face_zonelets,
"plane_points" : plane_points,
Expand Down Expand Up @@ -210,11 +210,11 @@ def create_cap_on_face_zonelets(self, part_id : int, face_zonelets : Iterable[in
"""
if not isinstance(part_id, int):
raise TypeError("Invalid argument type passed for part_id, valid argument type is int.")
raise TypeError("Invalid argument type passed for 'part_id'. Valid argument type is int.")
if not isinstance(face_zonelets, Iterable):
raise TypeError("Invalid argument type passed for face_zonelets, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'face_zonelets'. Valid argument type is Iterable[int].")
if not isinstance(params, CreateCapParams):
raise TypeError("Invalid argument type passed for params, valid argument type is CreateCapParams.")
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is CreateCapParams.")
args = {"part_id" : part_id,
"face_zonelets" : face_zonelets,
"params" : params._jsonify()}
Expand Down Expand Up @@ -249,11 +249,11 @@ def delete_unwetted_surfaces(self, face_zonelet_ids : Iterable[int], live_materi
"""
if not isinstance(face_zonelet_ids, Iterable):
raise TypeError("Invalid argument type passed for face_zonelet_ids, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'face_zonelet_ids'. Valid argument type is Iterable[int].")
if not isinstance(live_material_point_names, List):
raise TypeError("Invalid argument type passed for live_material_point_names, valid argument type is List[str].")
raise TypeError("Invalid argument type passed for 'live_material_point_names'. Valid argument type is List[str].")
if not isinstance(params, DeleteUnwettedParams):
raise TypeError("Invalid argument type passed for params, valid argument type is DeleteUnwettedParams.")
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is DeleteUnwettedParams.")
args = {"face_zonelet_ids" : face_zonelet_ids,
"live_material_point_names" : live_material_point_names,
"params" : params._jsonify()}
Expand Down Expand Up @@ -286,9 +286,9 @@ def resolve_intersections(self, face_zonelet_ids : Iterable[int], params : Resol
"""
if not isinstance(face_zonelet_ids, Iterable):
raise TypeError("Invalid argument type passed for face_zonelet_ids, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'face_zonelet_ids'. Valid argument type is Iterable[int].")
if not isinstance(params, ResolveIntersectionsParams):
raise TypeError("Invalid argument type passed for params, valid argument type is ResolveIntersectionsParams.")
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is ResolveIntersectionsParams.")
args = {"face_zonelet_ids" : face_zonelet_ids,
"params" : params._jsonify()}
command_name = "PrimeMesh::SurfaceUtilities/ResolveIntersections"
Expand Down Expand Up @@ -320,9 +320,9 @@ def smooth_dihedral_face_nodes(self, zonelets : Iterable[int], params : SmoothDi
"""
if not isinstance(zonelets, Iterable):
raise TypeError("Invalid argument type passed for zonelets, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'zonelets'. Valid argument type is Iterable[int].")
if not isinstance(params, SmoothDihedralFaceNodesParams):
raise TypeError("Invalid argument type passed for params, valid argument type is SmoothDihedralFaceNodesParams.")
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is SmoothDihedralFaceNodesParams.")
args = {"zonelets" : zonelets,
"params" : params._jsonify()}
command_name = "PrimeMesh::SurfaceUtilities/SmoothDihedralFaceNodes"
Expand Down Expand Up @@ -355,9 +355,9 @@ def refine_at_contacts(self, part_ids : Iterable[int], params : RefineAtContacts
"""
if not isinstance(part_ids, Iterable):
raise TypeError("Invalid argument type passed for part_ids, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'part_ids'. Valid argument type is Iterable[int].")
if not isinstance(params, RefineAtContactsParams):
raise TypeError("Invalid argument type passed for params, valid argument type is RefineAtContactsParams.")
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is RefineAtContactsParams.")
args = {"part_ids" : part_ids,
"params" : params._jsonify()}
command_name = "PrimeMesh::SurfaceUtilities/RefineAtContacts"
Expand Down Expand Up @@ -389,9 +389,9 @@ def add_thickness(self, zonelets : Iterable[int], params : AddThicknessParams) -
"""
if not isinstance(zonelets, Iterable):
raise TypeError("Invalid argument type passed for zonelets, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'zonelets'. Valid argument type is Iterable[int].")
if not isinstance(params, AddThicknessParams):
raise TypeError("Invalid argument type passed for params, valid argument type is AddThicknessParams.")
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is AddThicknessParams.")
args = {"zonelets" : zonelets,
"params" : params._jsonify()}
command_name = "PrimeMesh::SurfaceUtilities/AddThickness"
Expand Down Expand Up @@ -423,9 +423,9 @@ def create_boi(self, face_zonelet_ids : Iterable[int], params : CreateBOIParams)
"""
if not isinstance(face_zonelet_ids, Iterable):
raise TypeError("Invalid argument type passed for face_zonelet_ids, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'face_zonelet_ids'. Valid argument type is Iterable[int].")
if not isinstance(params, CreateBOIParams):
raise TypeError("Invalid argument type passed for params, valid argument type is CreateBOIParams.")
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is CreateBOIParams.")
args = {"face_zonelet_ids" : face_zonelet_ids,
"params" : params._jsonify()}
command_name = "PrimeMesh::SurfaceUtilities/CreateBOI"
Expand Down Expand Up @@ -459,11 +459,11 @@ def create_contact_patch(self, source_zonelets : Iterable[int], target_zonelets
"""
if not isinstance(source_zonelets, Iterable):
raise TypeError("Invalid argument type passed for source_zonelets, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'source_zonelets'. Valid argument type is Iterable[int].")
if not isinstance(target_zonelets, Iterable):
raise TypeError("Invalid argument type passed for target_zonelets, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'target_zonelets'. Valid argument type is Iterable[int].")
if not isinstance(params, CreateContactPatchParams):
raise TypeError("Invalid argument type passed for params, valid argument type is CreateContactPatchParams.")
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is CreateContactPatchParams.")
args = {"source_zonelets" : source_zonelets,
"target_zonelets" : target_zonelets,
"params" : params._jsonify()}
Expand Down Expand Up @@ -496,13 +496,52 @@ def stretch_free_boundaries(self, face_zonelet_ids : Iterable[int], params : Str
"""
if not isinstance(face_zonelet_ids, Iterable):
raise TypeError("Invalid argument type passed for face_zonelet_ids, valid argument type is Iterable[int].")
raise TypeError("Invalid argument type passed for 'face_zonelet_ids'. Valid argument type is Iterable[int].")
if not isinstance(params, StretchFreeBoundariesParams):
raise TypeError("Invalid argument type passed for params, valid argument type is StretchFreeBoundariesParams.")
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is StretchFreeBoundariesParams.")
args = {"face_zonelet_ids" : face_zonelet_ids,
"params" : params._jsonify()}
command_name = "PrimeMesh::SurfaceUtilities/StretchFreeBoundaries"
self._model._print_logs_before_command("stretch_free_boundaries", args)
result = self._comm.serve(self._model, command_name, self._object_id, args=args)
self._model._print_logs_after_command("stretch_free_boundaries", StretchFreeBoundariesResults(model = self._model, json_data = result))
return StretchFreeBoundariesResults(model = self._model, json_data = result)

def triangulate_face_zonelets(self, face_zonelet_ids : Iterable[int], params : TriangulateParams) -> TriangulateResults:
""" Split faces in zonelets to get triangular faces.
Parameters
----------
face_zonelet_ids : Iterable[int]
Ids of face zonelets.
params : TriangulateParams
Parameters to control the split operation.
Returns
-------
TriangulateResults
Returns the TriangulateResults.
Notes
-----
This is a Beta API. The Behavior and implementation may change in future.
Examples
--------
>>> result = surf_utils.triangulate_face_zonelets(face_zonelet_ids, params)
"""
if not isinstance(face_zonelet_ids, Iterable):
raise TypeError("Invalid argument type passed for 'face_zonelet_ids'. Valid argument type is Iterable[int].")
if not isinstance(params, TriangulateParams):
raise TypeError("Invalid argument type passed for 'params'. Valid argument type is TriangulateParams.")
args = {"face_zonelet_ids" : face_zonelet_ids,
"params" : params._jsonify()}
command_name = "PrimeMesh::SurfaceUtilities/TriangulateFaceZonelets"
self._model._print_beta_api_warning("triangulate_face_zonelets")
self._model._print_logs_before_command("triangulate_face_zonelets", args)
result = self._comm.serve(self._model, command_name, self._object_id, args=args)
self._model._print_logs_after_command("triangulate_face_zonelets", TriangulateResults(model = self._model, json_data = result))
return TriangulateResults(model = self._model, json_data = result)
Loading

0 comments on commit 6a5047d

Please sign in to comment.