Skip to content

Commit

Permalink
Add HDF5 Composite CAE import and export methods (#646)
Browse files Browse the repository at this point in the history
Add methods for importing from / exporting to the HDF5 Composite CAE format.

Nested messages in the API are defined as dataclasses. The alternative would be to expose them in a flat way, but I think the same reasoning for nesting them as in the API applies here: The nested structure is slightly easier to parse.

Closes #598.
  • Loading branch information
greschd authored Nov 7, 2024
1 parent cd251ba commit 0cbef89
Show file tree
Hide file tree
Showing 10 changed files with 356 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ exclude = venv, __init__.py, doc/_build
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, E501, F401, F403
count = True
max-complexity = 10
max-line-length = 110
max-line-length = 115
statistics = True
2 changes: 2 additions & 0 deletions doc/source/api/enum_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Enumeration data types
LayupMappingRosetteSelectionMethod
LinkedObjectHandling
LookUpTable3DInterpolationAlgorithm
HDF5CompositeCAEImportMode
HDF5CompositeCAEProjectionMode
LookUpTableColumnValueType
MeshImportType
NodalDataType
Expand Down
1 change: 1 addition & 0 deletions doc/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and attributes.
linked_object_definitions
material_property_sets
enum_types
other_types
plot_utils
other_utils
workflow
Expand Down
14 changes: 14 additions & 0 deletions doc/source/api/other_types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Other types
-----------

.. currentmodule:: ansys.acp.core

.. autosummary::
:toctree: _autosummary

CoordinateTransformation
ImportedSolidModelExportSettings
ShellMappingProperties
SolidMappingProperties
SolidModelExportSettings
DropOffSettings
3 changes: 0 additions & 3 deletions doc/source/api/tree_objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ ACP objects
CutOffGeometry
CutoffSelectionRule
CylindricalSelectionRule
DropOffSettings
EdgeSet
ElementSet
ExtrusionGuide
Expand All @@ -26,7 +25,6 @@ ACP objects
ImportedModelingPly
ImportedProductionPly
ImportedSolidModel
ImportedSolidModelExportSettings
InterfaceLayer
LayupMappingObject
LookUpTable1D
Expand All @@ -47,7 +45,6 @@ ACP objects
SnapToGeometry
SolidElementSet
SolidModel
SolidModelExportSettings
SphericalSelectionRule
Stackup
SubLaminate
Expand Down
11 changes: 11 additions & 0 deletions src/ansys/acp/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
ButtJointSequence,
CADComponent,
CADGeometry,
CoordinateTransformation,
CutOffGeometry,
CutOffGeometryOrientationType,
CutoffMaterialHandling,
Expand Down Expand Up @@ -87,6 +88,8 @@
GeometricalSelectionRule,
GeometricalSelectionRuleElementalData,
GeometricalSelectionRuleNodalData,
HDF5CompositeCAEImportMode,
HDF5CompositeCAEProjectionMode,
IgnorableEntity,
ImportedAnalysisPly,
ImportedModelingGroup,
Expand Down Expand Up @@ -146,11 +149,13 @@
SectionCutType,
Sensor,
SensorType,
ShellMappingProperties,
SnapToGeometry,
SnapToGeometryOrientationType,
SolidElementSet,
SolidElementSetElementalData,
SolidElementSetNodalData,
SolidMappingProperties,
SolidModel,
SolidModelElementalData,
SolidModelExportFormat,
Expand Down Expand Up @@ -205,6 +210,7 @@
"CADComponent",
"CADGeometry",
"ConnectLaunchConfig",
"CoordinateTransformation",
"CutOffGeometry",
"CutOffGeometryOrientationType",
"CutoffMaterialHandling",
Expand All @@ -231,6 +237,7 @@
"ElementSetNodalData",
"ElementTechnology",
"example_helpers",
"ExportSettings",
"ExtrusionGuide",
"ExtrusionGuideType",
"ExtrusionMethod",
Expand All @@ -247,6 +254,8 @@
"get_directions_plotter",
"get_dpf_unit_system",
"get_model_tree",
"HDF5CompositeCAEImportMode",
"HDF5CompositeCAEProjectionMode",
"IgnorableEntity",
"ImportedAnalysisPly",
"ImportedModelingGroup",
Expand Down Expand Up @@ -313,11 +322,13 @@
"SectionCutType",
"Sensor",
"SensorType",
"ShellMappingProperties",
"SnapToGeometry",
"SnapToGeometryOrientationType",
"SolidElementSet",
"SolidElementSetElementalData",
"SolidElementSetNodalData",
"SolidMappingProperties",
"SolidModel",
"SolidModelElementalData",
"SolidModelExportFormat",
Expand Down
19 changes: 18 additions & 1 deletion src/ansys/acp/core/_tree_objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,18 @@
from .lookup_table_3d import LookUpTable3D
from .lookup_table_3d_column import LookUpTable3DColumn
from .material import Material
from .model import FeFormat, IgnorableEntity, MeshData, Model, ModelElementalData, ModelNodalData
from .model import (
FeFormat,
HDF5CompositeCAEImportMode,
HDF5CompositeCAEProjectionMode,
IgnorableEntity,
MeshData,
Model,
ModelElementalData,
ModelNodalData,
ShellMappingProperties,
SolidMappingProperties,
)
from .modeling_group import ModelingGroup
from .modeling_ply import ModelingPly, ModelingPlyElementalData, ModelingPlyNodalData, TaperEdge
from .oriented_selection_set import (
Expand Down Expand Up @@ -161,6 +172,7 @@
TubeSelectionRuleElementalData,
TubeSelectionRuleNodalData,
)
from .utils import CoordinateTransformation
from .variable_offset_selection_rule import (
VariableOffsetSelectionRule,
VariableOffsetSelectionRuleElementalData,
Expand All @@ -181,6 +193,7 @@
"ButtJointSequence",
"CADComponent",
"CADGeometry",
"CoordinateTransformation",
"CutOffGeometry",
"CutOffGeometryOrientationType",
"CutoffMaterialHandling",
Expand Down Expand Up @@ -217,6 +230,8 @@
"GeometricalSelectionRule",
"GeometricalSelectionRuleElementalData",
"GeometricalSelectionRuleNodalData",
"HDF5CompositeCAEImportMode",
"HDF5CompositeCAEProjectionMode",
"IgnorableEntity",
"ImportedAnalysisPly",
"ImportedModelingGroup",
Expand Down Expand Up @@ -279,11 +294,13 @@
"SectionCutType",
"Sensor",
"SensorType",
"ShellMappingProperties",
"SnapToGeometry",
"SnapToGeometryOrientationType",
"SolidElementSet",
"SolidElementSetElementalData",
"SolidElementSetNodalData",
"SolidMappingProperties",
"SolidModel",
"SolidModelElementalData",
"SolidModelExportFormat",
Expand Down
Loading

0 comments on commit 0cbef89

Please sign in to comment.