Skip to content

Commit

Permalink
Merge branch 'main' into doc/-License-update
Browse files Browse the repository at this point in the history
  • Loading branch information
waltersma authored Oct 21, 2024
2 parents f1927d6 + 4152aa5 commit d01a902
Show file tree
Hide file tree
Showing 88 changed files with 2,921 additions and 66 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: '25.1.0.dev14'
DOCKER_IMAGE_TAG: '25.1.0.dev19'
MAIN_PYTHON_VERSION: '3.10'
PACKAGE_NAME: 'ansys-meshing-prime'
PACKAGE_NAMESPACE: 'ansys.meshing.prime'
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/916.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MAINT: update code form ADO 0.7.0.dev19
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.7.0.dev14"
version = "0.7.0.dev19"
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
2 changes: 2 additions & 0 deletions src/ansys/meshing/prime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
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.autogen.shellblcontrolstructs import *
from ansys.meshing.prime.autogen.shellblcontrol import *

from ansys.meshing.prime.internals.error_handling import PrimeRuntimeError, PrimeRuntimeWarning
from ansys.meshing.prime.internals.client import Client
Expand Down
22 changes: 22 additions & 0 deletions src/ansys/meshing/prime/autogen/automesh.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

""" Auto-generated file. DO NOT MODIFY """
from __future__ import annotations
from ansys.meshing.prime.internals.comm_manager import CommunicationManager
Expand Down
22 changes: 22 additions & 0 deletions src/ansys/meshing/prime/autogen/automeshstructs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

""" Auto-generated file. DO NOT MODIFY """
import enum
from typing import Dict, Any, Union, List, Iterable
Expand Down
22 changes: 22 additions & 0 deletions src/ansys/meshing/prime/autogen/autoquadmesher.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

""" Auto-generated file. DO NOT MODIFY """
from __future__ import annotations
from ansys.meshing.prime.internals.comm_manager import CommunicationManager
Expand Down
22 changes: 22 additions & 0 deletions src/ansys/meshing/prime/autogen/autoquadmesherstructs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

""" Auto-generated file. DO NOT MODIFY """
import enum
from typing import Dict, Any, Union, List, Iterable
Expand Down
22 changes: 22 additions & 0 deletions src/ansys/meshing/prime/autogen/boundaryfittednurbs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

""" Auto-generated file. DO NOT MODIFY """
from __future__ import annotations
from ansys.meshing.prime.internals.comm_manager import CommunicationManager
Expand Down
22 changes: 22 additions & 0 deletions src/ansys/meshing/prime/autogen/collapsetool.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

""" Auto-generated file. DO NOT MODIFY """
from __future__ import annotations
from ansys.meshing.prime.internals.comm_manager import CommunicationManager
Expand Down
67 changes: 60 additions & 7 deletions src/ansys/meshing/prime/autogen/collapsetoolstructs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
# Copyright (C) 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

""" Auto-generated file. DO NOT MODIFY """
import enum
from typing import Dict, Any, Union, List, Iterable
Expand All @@ -23,6 +45,10 @@ class CollapseParams(CoreObject):
Option to preserve quality of neighboring triangles when performing collapse.Collapse may lead to quality deterioration beyond target skewness. Such collapse is prevented, when the option is enabled.
target_skewness: float, optional
Skewness limit used as target to preserve quality. Better quality elements are skipped for collapse.
keep_edge_connectivity: bool, optional
Option to keep edge connectivity. The default value is false. When keep edge connectivity is true, edges that were connected to collapsed triangles will be connected to different triangles. Otherwise, edges will be disconnected from faces.
**This is a beta parameter**. **The behavior and name may change in the future**.
json_data: dict, optional
JSON dictionary to create a ``CollapseParams`` object with provided parameters.
Expand All @@ -37,11 +63,13 @@ def __initialize(
feature_type: SurfaceFeatureType,
collapse_ratio: float,
preserve_quality: bool,
target_skewness: float):
target_skewness: float,
keep_edge_connectivity: bool):
self._feature_type = SurfaceFeatureType(feature_type)
self._collapse_ratio = collapse_ratio
self._preserve_quality = preserve_quality
self._target_skewness = target_skewness
self._keep_edge_connectivity = keep_edge_connectivity

def __init__(
self,
Expand All @@ -50,6 +78,7 @@ def __init__(
collapse_ratio: float = None,
preserve_quality: bool = None,
target_skewness: float = None,
keep_edge_connectivity: bool = None,
json_data : dict = None,
**kwargs):
"""Initialize a ``CollapseParams`` object.
Expand All @@ -66,6 +95,10 @@ def __init__(
Option to preserve quality of neighboring triangles when performing collapse.Collapse may lead to quality deterioration beyond target skewness. Such collapse is prevented, when the option is enabled.
target_skewness: float, optional
Skewness limit used as target to preserve quality. Better quality elements are skipped for collapse.
keep_edge_connectivity: bool, optional
Option to keep edge connectivity. The default value is false. When keep edge connectivity is true, edges that were connected to collapsed triangles will be connected to different triangles. Otherwise, edges will be disconnected from faces.
**This is a beta parameter**. **The behavior and name may change in the future**.
json_data: dict, optional
JSON dictionary to create a ``CollapseParams`` object with provided parameters.
Expand All @@ -78,15 +111,17 @@ def __init__(
SurfaceFeatureType(json_data["featureType"] if "featureType" in json_data else None),
json_data["collapseRatio"] if "collapseRatio" in json_data else None,
json_data["preserveQuality"] if "preserveQuality" in json_data else None,
json_data["targetSkewness"] if "targetSkewness" in json_data else None)
json_data["targetSkewness"] if "targetSkewness" in json_data else None,
json_data["keepEdgeConnectivity"] if "keepEdgeConnectivity" in json_data else None)
else:
all_field_specified = all(arg is not None for arg in [feature_type, collapse_ratio, preserve_quality, target_skewness])
all_field_specified = all(arg is not None for arg in [feature_type, collapse_ratio, preserve_quality, target_skewness, keep_edge_connectivity])
if all_field_specified:
self.__initialize(
feature_type,
collapse_ratio,
preserve_quality,
target_skewness)
target_skewness,
keep_edge_connectivity)
else:
if model is None:
raise ValueError("Invalid assignment. Either pass a model or specify all properties.")
Expand All @@ -97,7 +132,8 @@ def __init__(
feature_type if feature_type is not None else ( CollapseParams._default_params["feature_type"] if "feature_type" in CollapseParams._default_params else SurfaceFeatureType(json_data["featureType"] if "featureType" in json_data else None)),
collapse_ratio if collapse_ratio is not None else ( CollapseParams._default_params["collapse_ratio"] if "collapse_ratio" in CollapseParams._default_params else (json_data["collapseRatio"] if "collapseRatio" in json_data else None)),
preserve_quality if preserve_quality is not None else ( CollapseParams._default_params["preserve_quality"] if "preserve_quality" in CollapseParams._default_params else (json_data["preserveQuality"] if "preserveQuality" in json_data else None)),
target_skewness if target_skewness is not None else ( CollapseParams._default_params["target_skewness"] if "target_skewness" in CollapseParams._default_params else (json_data["targetSkewness"] if "targetSkewness" in json_data else None)))
target_skewness if target_skewness is not None else ( CollapseParams._default_params["target_skewness"] if "target_skewness" in CollapseParams._default_params else (json_data["targetSkewness"] if "targetSkewness" in json_data else None)),
keep_edge_connectivity if keep_edge_connectivity is not None else ( CollapseParams._default_params["keep_edge_connectivity"] if "keep_edge_connectivity" in CollapseParams._default_params else (json_data["keepEdgeConnectivity"] if "keepEdgeConnectivity" 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 @@ -110,7 +146,8 @@ def set_default(
feature_type: SurfaceFeatureType = None,
collapse_ratio: float = None,
preserve_quality: bool = None,
target_skewness: float = None):
target_skewness: float = None,
keep_edge_connectivity: bool = None):
"""Set the default values of the ``CollapseParams`` object.
Parameters
Expand All @@ -123,6 +160,8 @@ def set_default(
Option to preserve quality of neighboring triangles when performing collapse.Collapse may lead to quality deterioration beyond target skewness. Such collapse is prevented, when the option is enabled.
target_skewness: float, optional
Skewness limit used as target to preserve quality. Better quality elements are skipped for collapse.
keep_edge_connectivity: bool, optional
Option to keep edge connectivity. The default value is false. When keep edge connectivity is true, edges that were connected to collapsed triangles will be connected to different triangles. Otherwise, edges will be disconnected from faces.
"""
args = locals()
[CollapseParams._default_params.update({ key: value }) for key, value in args.items() if value is not None]
Expand All @@ -149,11 +188,13 @@ def _jsonify(self) -> Dict[str, Any]:
json_data["preserveQuality"] = self._preserve_quality
if self._target_skewness is not None:
json_data["targetSkewness"] = self._target_skewness
if self._keep_edge_connectivity is not None:
json_data["keepEdgeConnectivity"] = self._keep_edge_connectivity
[ 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 = "feature_type : %s\ncollapse_ratio : %s\npreserve_quality : %s\ntarget_skewness : %s" % (self._feature_type, self._collapse_ratio, self._preserve_quality, self._target_skewness)
message = "feature_type : %s\ncollapse_ratio : %s\npreserve_quality : %s\ntarget_skewness : %s\nkeep_edge_connectivity : %s" % (self._feature_type, self._collapse_ratio, self._preserve_quality, self._target_skewness, self._keep_edge_connectivity)
message += ''.join('\n' + str(key) + ' : ' + str(value) for key, value in self._custom_params.items())
return message

Expand Down Expand Up @@ -197,6 +238,18 @@ def target_skewness(self) -> float:
def target_skewness(self, value: float):
self._target_skewness = value

@property
def keep_edge_connectivity(self) -> bool:
"""Option to keep edge connectivity. The default value is false. When keep edge connectivity is true, edges that were connected to collapsed triangles will be connected to different triangles. Otherwise, edges will be disconnected from faces.
**This is a beta parameter**. **The behavior and name may change in the future**.
"""
return self._keep_edge_connectivity

@keep_edge_connectivity.setter
def keep_edge_connectivity(self, value: bool):
self._keep_edge_connectivity = value

class CollapseResults(CoreObject):
"""Results associated with collapse face elements.
Expand Down
Loading

0 comments on commit d01a902

Please sign in to comment.