Skip to content

Commit

Permalink
Update server APIs from 0.5.0.dev8 (#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
ninad-kamat authored Oct 23, 2023
1 parent 6fe3b5c commit f747ea9
Show file tree
Hide file tree
Showing 31 changed files with 3,979 additions and 78 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.dev7'
DOCKER_IMAGE_TAG: '24.1.0.dev9'
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.dev7"
version = "0.5.0.dev9"
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: 3 additions & 0 deletions src/ansys/meshing/prime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
from ansys.meshing.prime.autogen.topoutilitystructs import *
from ansys.meshing.prime.autogen.morpherstructs import *
from ansys.meshing.prime.autogen.morpherbcsstructs import *
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.internals.error_handling import PrimeRuntimeError, PrimeRuntimeWarning
from ansys.meshing.prime.internals.client import Client
Expand Down
255 changes: 255 additions & 0 deletions src/ansys/meshing/prime/autogen/autoquadmesher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@
""" Auto-generated file. DO NOT MODIFY """
from __future__ import annotations
from ansys.meshing.prime.internals.comm_manager import CommunicationManager
from ansys.meshing.prime.params.primestructs import *
from ansys.meshing.prime.autogen.coreobject import *
from typing import List, Any, Union

class AutoQuadMesher(CoreObject):
"""Generate full quad mesh.
"""

def __init__(self, model: CommunicationManager):
""" Initialize AutoQuadMesher """
self._model = model
self._comm = model._communicator
command_name = "PrimeMesh::AutoQuadMesher/Construct"
args = {"ModelID" : model._object_id , "MaxID" : -1 }
result = self._comm.serve(model, command_name, args=args)
self._object_id = result["ObjectIndex"]
self._freeze()

def __enter__(self):
""" Enter context for AutoQuadMesher. """
return self

def __exit__(self, type, value, traceback) :
""" Exit context for AutoQuadMesher. """
command_name = "PrimeMesh::AutoQuadMesher/Destruct"
self._comm.serve(self._model, command_name, self._object_id, args={})

def detect_and_treat_features(self, part_id : int, topo_face_ids : Iterable[int], params : DetectAndTreatFeaturesParams) -> AutoQuadMesherResults:
""" Detect features in topology and treat them with given parameters.
Parameters
----------
part_id : int
Id of the Part.
topo_face_ids : Iterable[int]
Ids of topofaces.
params : DetectAndTreatFeaturesParams
Parameters of detect and treat features.
Returns
-------
AutoQuadMesherResults
Returns the AutoQuadMesherResults structure.
Notes
-----
This API is a Beta. API Behavior and implementation may change in future.
Examples
--------
>>> autoQuadMesher = AutoQuadMesher(model=model)
>>> results = autoQuadMesher.DetectAndTreatFeatures(part_id, topo_face_ids, params);
"""
if not isinstance(part_id, int):
raise TypeError("Invalid argument type passed for part_id, valid argument type is int.")
if not isinstance(topo_face_ids, Iterable):
raise TypeError("Invalid argument type passed for topo_face_ids, valid argument type is Iterable[int].")
if not isinstance(params, DetectAndTreatFeaturesParams):
raise TypeError("Invalid argument type passed for params, valid argument type is DetectAndTreatFeaturesParams.")
args = {"part_id" : part_id,
"topo_face_ids" : topo_face_ids,
"params" : params._jsonify()}
command_name = "PrimeMesh::AutoQuadMesher/DetectAndTreatFeatures"
self._model._print_beta_api_warning("detect_and_treat_features")
self._model._print_logs_before_command("detect_and_treat_features", args)
result = self._comm.serve(self._model, command_name, self._object_id, args=args)
self._model._print_logs_after_command("detect_and_treat_features", AutoQuadMesherResults(model = self._model, json_data = result))
return AutoQuadMesherResults(model = self._model, json_data = result)

def repair_topology(self, part_id : int, topo_face_ids : Iterable[int], params : RepairTopologyParams) -> AutoQuadMesherResults:
""" Repair topology with given parameters.
Parameters
----------
part_id : int
Id of the Part.
topo_face_ids : Iterable[int]
Ids of topofaces.
params : RepairTopologyParams
Parameters of repair topology.
Returns
-------
AutoQuadMesherResults
Returns the AutoQuadMesherResults structure.
Notes
-----
This API is a Beta. API Behavior and implementation may change in future.
Examples
--------
>>> autoQuadMesher = AutoQuadMesher(model=model)
>>> results = autoQuadMesher.RepairTopology(part_id, topo_face_ids, params);
"""
if not isinstance(part_id, int):
raise TypeError("Invalid argument type passed for part_id, valid argument type is int.")
if not isinstance(topo_face_ids, Iterable):
raise TypeError("Invalid argument type passed for topo_face_ids, valid argument type is Iterable[int].")
if not isinstance(params, RepairTopologyParams):
raise TypeError("Invalid argument type passed for params, valid argument type is RepairTopologyParams.")
args = {"part_id" : part_id,
"topo_face_ids" : topo_face_ids,
"params" : params._jsonify()}
command_name = "PrimeMesh::AutoQuadMesher/RepairTopology"
self._model._print_beta_api_warning("repair_topology")
self._model._print_logs_before_command("repair_topology", args)
result = self._comm.serve(self._model, command_name, self._object_id, args=args)
self._model._print_logs_after_command("repair_topology", AutoQuadMesherResults(model = self._model, json_data = result))
return AutoQuadMesherResults(model = self._model, json_data = result)

def defeature_topology(self, part_id : int, topo_face_ids : Iterable[int], params : DefeatureTopologyParams) -> AutoQuadMesherResults:
""" Defeature topology with given parameters.
Parameters
----------
part_id : int
Id of the Part.
topo_face_ids : Iterable[int]
Ids of topofaces.
params : DefeatureTopologyParams
Parameters of defeature topology.
Returns
-------
AutoQuadMesherResults
Returns the AutoQuadMesherResults structure.
Notes
-----
This API is a Beta. API Behavior and implementation may change in future.
Examples
--------
>>> autoQuadMesher = AutoQuadMesher(model=model)
>>> results = autoQuadMesher.DefeatureTopology(part_id, topo_face_ids, params);
"""
if not isinstance(part_id, int):
raise TypeError("Invalid argument type passed for part_id, valid argument type is int.")
if not isinstance(topo_face_ids, Iterable):
raise TypeError("Invalid argument type passed for topo_face_ids, valid argument type is Iterable[int].")
if not isinstance(params, DefeatureTopologyParams):
raise TypeError("Invalid argument type passed for params, valid argument type is DefeatureTopologyParams.")
args = {"part_id" : part_id,
"topo_face_ids" : topo_face_ids,
"params" : params._jsonify()}
command_name = "PrimeMesh::AutoQuadMesher/DefeatureTopology"
self._model._print_beta_api_warning("defeature_topology")
self._model._print_logs_before_command("defeature_topology", args)
result = self._comm.serve(self._model, command_name, self._object_id, args=args)
self._model._print_logs_after_command("defeature_topology", AutoQuadMesherResults(model = self._model, json_data = result))
return AutoQuadMesherResults(model = self._model, json_data = result)

def optimize_quad_mesh(self, part_id : int, topo_face_ids : Iterable[int], params : OptimizeQuadMeshParams) -> AutoQuadMesherResults:
""" Optimize quad faces with given parameters.
Parameters
----------
part_id : int
Id of the Part.
topo_face_ids : Iterable[int]
Ids of topofaces.
params : OptimizeQuadMeshParams
Parameters of optimize quad mesh.
Returns
-------
AutoQuadMesherResults
Returns the AutoQuadMesherResults structure.
Notes
-----
This API is a Beta. API Behavior and implementation may change in future.
Examples
--------
>>> autoQuadMesher = AutoQuadMesher(model=model)
>>> results = autoQuadMesher.OptimizeQuadMesh(part_id, topo_face_ids, params);
"""
if not isinstance(part_id, int):
raise TypeError("Invalid argument type passed for part_id, valid argument type is int.")
if not isinstance(topo_face_ids, Iterable):
raise TypeError("Invalid argument type passed for topo_face_ids, valid argument type is Iterable[int].")
if not isinstance(params, OptimizeQuadMeshParams):
raise TypeError("Invalid argument type passed for params, valid argument type is OptimizeQuadMeshParams.")
args = {"part_id" : part_id,
"topo_face_ids" : topo_face_ids,
"params" : params._jsonify()}
command_name = "PrimeMesh::AutoQuadMesher/OptimizeQuadMesh"
self._model._print_beta_api_warning("optimize_quad_mesh")
self._model._print_logs_before_command("optimize_quad_mesh", args)
result = self._comm.serve(self._model, command_name, self._object_id, args=args)
self._model._print_logs_after_command("optimize_quad_mesh", AutoQuadMesherResults(model = self._model, json_data = result))
return AutoQuadMesherResults(model = self._model, json_data = result)

def check_topology(self, part_id : int, topo_face_ids : Iterable[int], params : CheckTopologyParams) -> AutoQuadMesherResults:
""" Check topology for inconsistencies with the given parameters.
Parameters
----------
part_id : int
Id of the Part.
topo_face_ids : Iterable[int]
Ids of topofaces.
params : CheckTopologyParams
Parameters of check topology.
Returns
-------
AutoQuadMesherResults
Returns the AutoQuadMesherResults structure.
Notes
-----
This API is a Beta. API Behavior and implementation may change in future.
Examples
--------
>>> autoQuadMesher = AutoQuadMesher(model=model)
>>> results = autoQuadMesher.CheckTopology(part_id, topo_face_ids, params);
"""
if not isinstance(part_id, int):
raise TypeError("Invalid argument type passed for part_id, valid argument type is int.")
if not isinstance(topo_face_ids, Iterable):
raise TypeError("Invalid argument type passed for topo_face_ids, valid argument type is Iterable[int].")
if not isinstance(params, CheckTopologyParams):
raise TypeError("Invalid argument type passed for params, valid argument type is CheckTopologyParams.")
args = {"part_id" : part_id,
"topo_face_ids" : topo_face_ids,
"params" : params._jsonify()}
command_name = "PrimeMesh::AutoQuadMesher/CheckTopology"
self._model._print_beta_api_warning("check_topology")
self._model._print_logs_before_command("check_topology", args)
result = self._comm.serve(self._model, command_name, self._object_id, args=args)
self._model._print_logs_after_command("check_topology", AutoQuadMesherResults(model = self._model, json_data = result))
return AutoQuadMesherResults(model = self._model, json_data = result)
Loading

0 comments on commit f747ea9

Please sign in to comment.