Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions examples/workflows/02-advanced-pymapdl-workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

# %%
# Load the CDB file into PyACP and set the unit system.
model = acp.import_model(path=input_file, format="ansys:cdb", unit_system=pyacp.UnitSystemType.MPA)
model = acp.import_model(path=input_file, format="ansys:cdb", unit_system=pyacp.UnitSystemType.MKS)
model


Expand All @@ -99,7 +99,7 @@
# Build Composite Lay-up
# ----------------------
#
# Create the model (MPA unit system).
# Create the model (MKS unit system).

# %%
# Materials
Expand Down Expand Up @@ -341,6 +341,8 @@ def add_ply(mg, name, ply_material, angle, oss):
# To postprocess the results, you must configure the imports, connect to the
# PyDPF - Composites server, and load its plugin.


from ansys.acp.core.dpf_integration_helpers import get_dpf_unit_system
from ansys.dpf.composites.composite_model import CompositeModel
from ansys.dpf.composites.constants import FailureOutput
from ansys.dpf.composites.data_sources import (
Expand All @@ -354,7 +356,6 @@ def add_ply(mg, name, ply_material, angle, oss):
MaxStressCriterion,
)
from ansys.dpf.composites.server_helpers import connect_to_or_start_server
from ansys.dpf.core.unit_system import unit_systems

# %%
# Connect to the server. The ``connect_to_or_start_server`` function
Expand Down Expand Up @@ -384,7 +385,7 @@ def add_ply(mg, name, ply_material, angle, oss):
},
engineering_data=working_dir_path / matml_filename,
),
default_unit_system=unit_systems.solver_nmm,
default_unit_system=get_dpf_unit_system(model.unit_system),
server=dpf_server,
)

Expand Down
Loading