diff --git a/doc/source/_static/gallery_thumbnails/sphx_glr_06-cdb-to-pymechanical-workflow_thumb.png b/doc/source/_static/gallery_thumbnails/sphx_glr_06-cdb-to-pymechanical-workflow_thumb.png index ce181ec59d..128e7340fe 100644 Binary files a/doc/source/_static/gallery_thumbnails/sphx_glr_06-cdb-to-pymechanical-workflow_thumb.png and b/doc/source/_static/gallery_thumbnails/sphx_glr_06-cdb-to-pymechanical-workflow_thumb.png differ diff --git a/examples/workflows/03-pymechanical-shell-workflow.py b/examples/workflows/03-pymechanical-shell-workflow.py index faf7997182..677e1a95fa 100644 --- a/examples/workflows/03-pymechanical-shell-workflow.py +++ b/examples/workflows/03-pymechanical-shell-workflow.py @@ -105,6 +105,7 @@ # This script runs in the Mechanical Python environment, which uses IronPython 2.7. textwrap.dedent( f"""\ + # Import the geometry geometry_import = Model.GeometryImportGroup.AddGeometryImport() import_format = Ansys.Mechanical.DataModel.Enums.GeometryImportPreference.Format.Automatic @@ -119,6 +120,8 @@ import_preferences ) + # The thickness will be overridden by the ACP model, but is required + # for the model to be valid. for body in Model.Geometry.GetChildren( Ansys.Mechanical.DataModel.Enums.DataModelObjectCategory.Body, True ): @@ -138,7 +141,7 @@ # definition file to output_path. composite_definitions_h5 = "ACPCompositeDefinitions.h5" -matml_file = "materials.xml" # TODO: load an example materials XML file instead of defining the materials in ACP +matml_file = "materials.xml" model = acp.import_model(mesh_path, format="ansys:h5") diff --git a/examples/workflows/04-pymechanical-solid-workflow.py b/examples/workflows/04-pymechanical-solid-workflow.py index 749ac96d0c..fe142634c1 100644 --- a/examples/workflows/04-pymechanical-solid-workflow.py +++ b/examples/workflows/04-pymechanical-solid-workflow.py @@ -180,7 +180,7 @@ # - Solid model composite definitions HDF5 file # - Solid model CDB file -matml_file = "materials.xml" # TODO: load an example materials XML file instead of defining the materials in ACP +matml_file = "materials.xml" solid_model_cdb_file = "SolidModel.cdb" solid_model_composite_definitions_h5 = "SolidModel.h5" diff --git a/examples/workflows/05-pymechanical-to-cdb-workflow.py b/examples/workflows/05-pymechanical-to-cdb-workflow.py index 5df0e4535e..2089016be5 100644 --- a/examples/workflows/05-pymechanical-to-cdb-workflow.py +++ b/examples/workflows/05-pymechanical-to-cdb-workflow.py @@ -123,6 +123,8 @@ ): body.Thickness = Quantity(1e-6, "m") + Model.Mesh.GenerateMesh() + # Define named selections at the front and back edges front_edge = Model.AddNamedSelection() front_edge.Name = "Front Edge" @@ -303,6 +305,11 @@ # %% # Query and plot the results. +# +# Note that the maximum IRF is different when compared to :ref:`pymechanical_shell_example` +# because ACP sets the ``ERESX,NO`` option in the CDB file. This option disables interpolation +# of the results from the integration point to the nodes. + irf_field = output_all_elements.get_field( {"failure_label": pydpf_composites.constants.FailureOutput.FAILURE_VALUE} ) diff --git a/examples/workflows/06-cdb-to-pymechanical-workflow.py b/examples/workflows/06-cdb-to-pymechanical-workflow.py index 32257d5de7..9beb625729 100644 --- a/examples/workflows/06-cdb-to-pymechanical-workflow.py +++ b/examples/workflows/06-cdb-to-pymechanical-workflow.py @@ -91,6 +91,7 @@ model = acp.import_model(path=input_file, format="ansys:cdb") +model.unit_system # %% # Visualize the loaded mesh. @@ -130,7 +131,7 @@ strain_limits=strain_limits, ) -fabric = model.create_fabric(name="UD", material=ud_material, thickness=0.1) +fabric = model.create_fabric(name="UD", material=ud_material, thickness=1e-4) # %% @@ -259,7 +260,7 @@ force = analysis.AddForce() force.DefineBy = LoadDefineBy.Components - force.XComponent.Output.SetDiscreteValue(0, Quantity(1e6, "N")) + force.XComponent.Output.SetDiscreteValue(0, Quantity(100, "N")) force.Location = front_edge analysis.Solution.Solve(True)