Skip to content

Commit

Permalink
MAINT: Update code from ADO - 0.6.0.dev2 (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
ninad-kamat authored Feb 16, 2024
1 parent de95ef2 commit 793497a
Show file tree
Hide file tree
Showing 28 changed files with 1,756 additions and 108 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.1.0.dev10'
DOCKER_IMAGE_TAG: '24.2.0.dev2'
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.5.0.dev11"
version = "0.6.0.dev2"
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
3 changes: 2 additions & 1 deletion src/ansys/meshing/prime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from ansys.meshing.prime.core.volumesweeper import VolumeSweeper
from ansys.meshing.prime.autogen.surfacesearch import SurfaceSearch
from ansys.meshing.prime.autogen.volumesearch import VolumeSearch
from ansys.meshing.prime.autogen.topodata import TopoData
from ansys.meshing.prime.core.wrappercontrol import WrapperControl
from ansys.meshing.prime.core.multizonecontrol import MultiZoneControl
from ansys.meshing.prime.core.controldata import ControlData
Expand All @@ -33,6 +32,7 @@
from ansys.meshing.prime.autogen.volumemeshtool import VolumeMeshTool
from ansys.meshing.prime.autogen.topoutilities import TopoUtilities
from ansys.meshing.prime.autogen.morpher import Morpher
from ansys.meshing.prime.autogen.vtcomposer import VTComposer
from ansys.meshing.prime.autogen.commontypes import *
from ansys.meshing.prime.autogen.commonstructs import *
from ansys.meshing.prime.autogen.modelstructs import *
Expand Down Expand Up @@ -74,6 +74,7 @@
from ansys.meshing.prime.autogen.autoquadmesher import *
from ansys.meshing.prime.autogen.autoquadmesherstructs import *
from ansys.meshing.prime.autogen.toposearchstructs import *
from ansys.meshing.prime.autogen.vtcomposerstructs import *

from ansys.meshing.prime.internals.error_handling import PrimeRuntimeError, PrimeRuntimeWarning
from ansys.meshing.prime.internals.client import Client
Expand Down
6 changes: 3 additions & 3 deletions src/ansys/meshing/prime/autogen/boundaryfittednurbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BoundaryFittedSpline(CoreObject):
"""

def __init__(self, model: CommunicationManager):
""" Initialize BoundaryFittedSpline. """
""" Initialize BoundaryFittedSpline """
self._model = model
self._comm = model._communicator
command_name = "PrimeMesh::BoundaryFittedSpline/Construct"
Expand All @@ -31,7 +31,7 @@ def __exit__(self, type, value, traceback) :
self._comm.serve(self._model, command_name, self._object_id, args={})

def create_boundary_fitted_spline(self, part_id : int, cell_zonelet_ids : Iterable[int], boundary_fitted_spline_params : BoundaryFittedSplineParams) -> IGAResults:
""" Creates boundary fitted spline for structured hex-mesh.
""" Create boundary fitted spline for structured hex-mesh.
The hex-mesh can be structured in blocks but must be conformally connected.
That is, each block must have six sided volume and must be connected to other blocks through unique face.
Expand Down Expand Up @@ -95,7 +95,7 @@ def refine_spline(self, part_id : int, spline_ids : Iterable[int], refine_spline
Returns
-------
IGAResults
Returns the IGAResults structure.
Returns the IGAResults Structure.
Examples
Expand Down
56 changes: 53 additions & 3 deletions src/ansys/meshing/prime/autogen/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Connect(CoreObject):
"""

def __init__(self, model: CommunicationManager):
""" Initialize Connect. """
""" Initialize Connect """
self._model = model
self._comm = model._communicator
command_name = "PrimeMesh::Connect/Construct"
Expand Down Expand Up @@ -126,7 +126,7 @@ def join_face_zonelets(self, part_id : int, face_zonelet_ids : Iterable[int], wi
return ConnectResults(model = self._model, json_data = result)

def subtract_volumes(self, part_id : int, target_volumes : Iterable[int], cutter_volumes : Iterable[int], params : SubtractVolumesParams) -> SubtractVolumesResults:
""" Subtract cutter volumes from target volumes.
""" Subtract cutter volumes from target volumes. Volumes should be computed prior to calling this function.
Parameters
Expand Down Expand Up @@ -215,7 +215,7 @@ def stitch_face_zonelets(self, part_id : int, face_zonelet_ids : Iterable[int],
return ConnectResults(model = self._model, json_data = result)

def merge_boundary_nodes(self, part_id : int, face_zonelet_ids : Iterable[int], with_face_zonelet_ids : Iterable[int], params : MergeBoundaryNodesParams) -> MergeBoundaryNodesResults:
""" Merge boundary nodes of source face zonelets with boundary nodes of target face zonelets according to the provided parameters.
""" Merges boundary nodes of source face zonelets with boundary nodes of target face zonelets according to the provided parameters.
Parameters
Expand Down Expand Up @@ -263,3 +263,53 @@ def merge_boundary_nodes(self, part_id : int, face_zonelet_ids : Iterable[int],
result = self._comm.serve(self._model, command_name, self._object_id, args=args)
self._model._print_logs_after_command("merge_boundary_nodes", MergeBoundaryNodesResults(model = self._model, json_data = result))
return MergeBoundaryNodesResults(model = self._model, json_data = result)

def fuse_face_zonelets(self, part_id : int, source_face_zonelet_ids : Iterable[int], target_face_zonelet_ids : Iterable[int], params : FuseParams) -> FuseResults:
""" Perform fuse between overlapping face zonelets within a single part. Surfaces that are fused can then be colocated, merged or removed as directed.
Parameters
----------
part_id : int
Id of the part.
source_face_zonelet_ids : Iterable[int]
Ids of source face zonelets to be fused.
target_face_zonelet_ids : Iterable[int]
Ids of target face zonelets to be fused.
params : FuseParams
Parameters for fuse operation.
Returns
-------
FuseResults
Returns the FuseResults.
Notes
-----
This API is a Beta. API Behavior and implementation may change in future.
Examples
--------
connect = Connect(model = model)
connect.fuse_face_zonelets(part.id, source_face_zonelet_ids, target_face_zonelet_ids, fuse_params)
"""
if not isinstance(part_id, int):
raise TypeError("Invalid argument type passed for part_id, valid argument type is int.")
if not isinstance(source_face_zonelet_ids, Iterable):
raise TypeError("Invalid argument type passed for source_face_zonelet_ids, valid argument type is Iterable[int].")
if not isinstance(target_face_zonelet_ids, Iterable):
raise TypeError("Invalid argument type passed for target_face_zonelet_ids, valid argument type is Iterable[int].")
if not isinstance(params, FuseParams):
raise TypeError("Invalid argument type passed for params, valid argument type is FuseParams.")
args = {"part_id" : part_id,
"source_face_zonelet_ids" : source_face_zonelet_ids,
"target_face_zonelet_ids" : target_face_zonelet_ids,
"params" : params._jsonify()}
command_name = "PrimeMesh::Connect/FuseFaceZonelets"
self._model._print_beta_api_warning("fuse_face_zonelets")
self._model._print_logs_before_command("fuse_face_zonelets", args)
result = self._comm.serve(self._model, command_name, self._object_id, args=args)
self._model._print_logs_after_command("fuse_face_zonelets", FuseResults(model = self._model, json_data = result))
return FuseResults(model = self._model, json_data = result)
Loading

0 comments on commit 793497a

Please sign in to comment.