Skip to content

Commit

Permalink
Add submodule for material property sets
Browse files Browse the repository at this point in the history
  • Loading branch information
greschd committed Feb 7, 2024
1 parent 1c61043 commit 9a564a1
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 153 deletions.
2 changes: 0 additions & 2 deletions doc/source/api/material_property_sets.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Material property sets
----------------------

.. TODO: move these to a public module
.. currentmodule:: ansys.acp.core

.. autosummary::
Expand Down
7 changes: 3 additions & 4 deletions examples/001_basic_flat_plate.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@
# Import pyACP dependencies
from ansys.acp.core import (
ACPWorkflow,
ConstantEngineeringConstants,
ConstantStrainLimits,
PlyType,
example_helpers,
get_composite_post_processing_files,
get_dpf_unit_system,
launch_acp,
material_property_sets,
print_model,
)

Expand Down Expand Up @@ -76,12 +75,12 @@
# %%
# Create an orthotropic material and fabric including strain limits, which are later
# used to post-process the simulation.
engineering_constants = ConstantEngineeringConstants(
engineering_constants = material_property_sets.ConstantEngineeringConstants(
E1=5e10, E2=1e10, E3=1e10, nu12=0.28, nu13=0.28, nu23=0.3, G12=5e9, G23=4e9, G31=4e9
)

strain_limit = 0.01
strain_limits = ConstantStrainLimits(
strain_limits = material_property_sets.ConstantStrainLimits(
eXc=-strain_limit,
eYc=-strain_limit,
eZc=-strain_limit,
Expand Down
49 changes: 2 additions & 47 deletions src/ansys/acp/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import importlib.metadata

from . import example_helpers
from . import example_helpers, material_property_sets
from ._model_printer import get_model_tree, print_model
from ._server import ACP, DirectLaunchConfig, DockerComposeLaunchConfig, LaunchMode, launch_acp
from ._tree_objects import (
Expand All @@ -18,16 +18,6 @@
BooleanSelectionRuleNodalData,
CADComponent,
CADGeometry,
ConstantDensity,
ConstantEngineeringConstants,
ConstantFabricFiberAngle,
ConstantLaRCConstants,
ConstantPuckConstants,
ConstantStrainLimits,
ConstantStressLimits,
ConstantTsaiWuConstants,
ConstantWovenCharacterization,
ConstantWovenStressLimits,
CutoffMaterialType,
CutoffRuleType,
CutoffSelectionRule,
Expand All @@ -49,13 +39,11 @@
Fabric,
FabricWithAngle,
FeFormat,
FieldVariable,
GeometricalRuleType,
GeometricalSelectionRule,
GeometricalSelectionRuleElementalData,
GeometricalSelectionRuleNodalData,
IgnorableEntity,
InterpolationOptions,
Lamina,
LinkedSelectionRule,
LookUpTable1D,
Expand Down Expand Up @@ -84,7 +72,6 @@
ProductionPly,
ProductionPlyElementalData,
ProductionPlyNodalData,
PuckMaterialType,
Rosette,
RosetteSelectionMethod,
ScalarData,
Expand All @@ -105,19 +92,9 @@
TubeSelectionRuleElementalData,
TubeSelectionRuleNodalData,
UnitSystemType,
VariableDensity,
VariableEngineeringConstants,
VariableFabricFiberAngle,
VariableLaRCConstants,
VariableOffsetSelectionRule,
VariableOffsetSelectionRuleElementalData,
VariableOffsetSelectionRuleNodalData,
VariablePuckConstants,
VariableStrainLimits,
VariableStressLimits,
VariableTsaiWuConstants,
VariableWovenCharacterization,
VariableWovenStressLimits,
VectorData,
VirtualGeometry,
VirtualGeometryDimension,
Expand All @@ -140,16 +117,6 @@
"BooleanSelectionRuleNodalData",
"CADComponent",
"CADGeometry",
"ConstantDensity",
"ConstantEngineeringConstants",
"ConstantFabricFiberAngle",
"ConstantLaRCConstants",
"ConstantPuckConstants",
"ConstantStrainLimits",
"ConstantStressLimits",
"ConstantTsaiWuConstants",
"ConstantWovenCharacterization",
"ConstantWovenStressLimits",
"CutoffMaterialType",
"CutoffRuleType",
"CutoffSelectionRule",
Expand All @@ -174,7 +141,6 @@
"Fabric",
"FabricWithAngle",
"FeFormat",
"FieldVariable",
"GeometricalRuleType",
"GeometricalSelectionRule",
"GeometricalSelectionRuleElementalData",
Expand All @@ -183,7 +149,6 @@
"get_dpf_unit_system",
"get_model_tree",
"IgnorableEntity",
"InterpolationOptions",
"Lamina",
"launch_acp",
"LaunchMode",
Expand All @@ -195,6 +160,7 @@
"LookUpTable3DInterpolationAlgorithm",
"LookUpTableColumnValueType",
"Material",
"material_property_sets",
"Model",
"ModelElementalData",
"ModelingGroup",
Expand All @@ -215,7 +181,6 @@
"ProductionPly",
"ProductionPlyElementalData",
"ProductionPlyNodalData",
"PuckMaterialType",
"Rosette",
"RosetteSelectionMethod",
"ScalarData",
Expand All @@ -236,19 +201,9 @@
"TubeSelectionRuleElementalData",
"TubeSelectionRuleNodalData",
"UnitSystemType",
"VariableDensity",
"VariableEngineeringConstants",
"VariableFabricFiberAngle",
"VariableLaRCConstants",
"VariableOffsetSelectionRule",
"VariableOffsetSelectionRuleElementalData",
"VariableOffsetSelectionRuleNodalData",
"VariablePuckConstants",
"VariableStrainLimits",
"VariableStressLimits",
"VariableTsaiWuConstants",
"VariableWovenCharacterization",
"VariableWovenStressLimits",
"VectorData",
"VirtualGeometry",
"VirtualGeometryDimension",
Expand Down
47 changes: 1 addition & 46 deletions src/ansys/acp/core/_tree_objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,32 +55,7 @@
from .lookup_table_1d_column import LookUpTable1DColumn
from .lookup_table_3d import LookUpTable3D
from .lookup_table_3d_column import LookUpTable3DColumn
from .material import (
ConstantDensity,
ConstantEngineeringConstants,
ConstantFabricFiberAngle,
ConstantLaRCConstants,
ConstantPuckConstants,
ConstantStrainLimits,
ConstantStressLimits,
ConstantTsaiWuConstants,
ConstantWovenCharacterization,
ConstantWovenStressLimits,
FieldVariable,
InterpolationOptions,
Material,
PuckMaterialType,
VariableDensity,
VariableEngineeringConstants,
VariableFabricFiberAngle,
VariableLaRCConstants,
VariablePuckConstants,
VariableStrainLimits,
VariableStressLimits,
VariableTsaiWuConstants,
VariableWovenCharacterization,
VariableWovenStressLimits,
)
from .material import Material
from .model import FeFormat, IgnorableEntity, Model, ModelElementalData, ModelNodalData
from .modeling_group import ModelingGroup
from .modeling_ply import ModelingPly, ModelingPlyElementalData, ModelingPlyNodalData, TaperEdge
Expand Down Expand Up @@ -126,16 +101,6 @@
"BooleanSelectionRuleNodalData",
"CADComponent",
"CADGeometry",
"ConstantDensity",
"ConstantEngineeringConstants",
"ConstantFabricFiberAngle",
"ConstantLaRCConstants",
"ConstantPuckConstants",
"ConstantStrainLimits",
"ConstantStressLimits",
"ConstantTsaiWuConstants",
"ConstantWovenCharacterization",
"ConstantWovenStressLimits",
"CutoffMaterialType",
"CutoffRuleType",
"CutoffSelectionRule",
Expand Down Expand Up @@ -213,19 +178,9 @@
"TubeSelectionRuleElementalData",
"TubeSelectionRuleNodalData",
"UnitSystemType",
"VariableDensity",
"VariableEngineeringConstants",
"VariableFabricFiberAngle",
"VariableLaRCConstants",
"VariableOffsetSelectionRule",
"VariableOffsetSelectionRuleElementalData",
"VariableOffsetSelectionRuleNodalData",
"VariablePuckConstants",
"VariableStrainLimits",
"VariableStressLimits",
"VariableTsaiWuConstants",
"VariableWovenCharacterization",
"VariableWovenStressLimits",
"VectorData",
"VirtualGeometry",
"VirtualGeometryDimension",
Expand Down
53 changes: 1 addition & 52 deletions src/ansys/acp/core/_tree_objects/material/__init__.py
Original file line number Diff line number Diff line change
@@ -1,54 +1,3 @@
from .material import Material
from .property_sets import (
ConstantDensity,
ConstantEngineeringConstants,
ConstantFabricFiberAngle,
ConstantLaRCConstants,
ConstantPuckConstants,
ConstantStrainLimits,
ConstantStressLimits,
ConstantTsaiWuConstants,
ConstantWovenCharacterization,
ConstantWovenStressLimits,
FieldVariable,
InterpolationOptions,
PuckMaterialType,
VariableDensity,
VariableEngineeringConstants,
VariableFabricFiberAngle,
VariableLaRCConstants,
VariablePuckConstants,
VariableStrainLimits,
VariableStressLimits,
VariableTsaiWuConstants,
VariableWovenCharacterization,
VariableWovenStressLimits,
)

__all__ = [
"ConstantDensity",
"ConstantEngineeringConstants",
"ConstantFabricFiberAngle",
"ConstantLaRCConstants",
"ConstantPuckConstants",
"ConstantStrainLimits",
"ConstantStressLimits",
"ConstantTsaiWuConstants",
"ConstantWovenCharacterization",
"ConstantWovenStressLimits",
"FieldVariable",
"InterpolationOptions",
"Material",
"property_sets",
"PuckMaterialType",
"VariableDensity",
"VariableEngineeringConstants",
"VariableFabricFiberAngle",
"VariableLaRCConstants",
"VariablePuckConstants",
"VariableStrainLimits",
"VariableStressLimits",
"VariableTsaiWuConstants",
"VariableWovenCharacterization",
"VariableWovenStressLimits",
]
__all__ = ["Material"]
54 changes: 54 additions & 0 deletions src/ansys/acp/core/material_property_sets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""Defines the property sets for materials."""

from ._tree_objects.material.property_sets import (
ConstantDensity,
ConstantEngineeringConstants,
ConstantFabricFiberAngle,
ConstantLaRCConstants,
ConstantPuckConstants,
ConstantStrainLimits,
ConstantStressLimits,
ConstantTsaiWuConstants,
ConstantWovenCharacterization,
ConstantWovenStressLimits,
FieldVariable,
InterpolationOptions,
PuckMaterialType,
VariableDensity,
VariableEngineeringConstants,
VariableFabricFiberAngle,
VariableLaRCConstants,
VariablePuckConstants,
VariableStrainLimits,
VariableStressLimits,
VariableTsaiWuConstants,
VariableWovenCharacterization,
VariableWovenStressLimits,
)

__all__ = [
"ConstantDensity",
"ConstantEngineeringConstants",
"ConstantFabricFiberAngle",
"ConstantLaRCConstants",
"ConstantPuckConstants",
"ConstantStrainLimits",
"ConstantStressLimits",
"ConstantTsaiWuConstants",
"ConstantWovenCharacterization",
"ConstantWovenStressLimits",
"FieldVariable",
"InterpolationOptions",
"PuckMaterialType",
"VariableDensity",
"VariableEngineeringConstants",
"VariableFabricFiberAngle",
"VariableLaRCConstants",
"VariablePuckConstants",
"VariableStrainLimits",
"VariableStressLimits",
"VariableTsaiWuConstants",
"VariableWovenCharacterization",
"VariableWovenStressLimits",
"wrap_property_set",
]
4 changes: 2 additions & 2 deletions tests/unittests/test_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import numpy.testing as npt
import pytest

from ansys.acp.core import (
from ansys.acp.core import PlyType
from ansys.acp.core.material_property_sets import (
ConstantDensity,
ConstantEngineeringConstants,
ConstantFabricFiberAngle,
Expand All @@ -18,7 +19,6 @@
ConstantWovenStressLimits,
FieldVariable,
InterpolationOptions,
PlyType,
VariableDensity,
VariableEngineeringConstants,
VariableStrainLimits,
Expand Down

0 comments on commit 9a564a1

Please sign in to comment.