From 84924ef10f73f02d44a288521a31c6a16c190dbf Mon Sep 17 00:00:00 2001 From: Simone Raimondi Date: Wed, 18 Dec 2024 11:35:28 +0100 Subject: [PATCH 1/2] Added exit call to avoid problems when building documentation --- examples/use_cases/01-optimizing-ply-angles.py | 3 +++ examples/workflows/05-pymechanical-to-cdb-workflow.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/examples/use_cases/01-optimizing-ply-angles.py b/examples/use_cases/01-optimizing-ply-angles.py index eb4b704adf..bd4458dc86 100644 --- a/examples/use_cases/01-optimizing-ply-angles.py +++ b/examples/use_cases/01-optimizing-ply-angles.py @@ -493,3 +493,6 @@ def get_max_irf_for_parameters( plt.tight_layout() plt.show() + +# Close MAPDL instance +mapdl.exit() diff --git a/examples/workflows/05-pymechanical-to-cdb-workflow.py b/examples/workflows/05-pymechanical-to-cdb-workflow.py index 2089016be5..60ccc717a8 100644 --- a/examples/workflows/05-pymechanical-to-cdb-workflow.py +++ b/examples/workflows/05-pymechanical-to-cdb-workflow.py @@ -314,3 +314,6 @@ {"failure_label": pydpf_composites.constants.FailureOutput.FAILURE_VALUE} ) irf_field.plot() + +# Close MAPDL instance +mapdl.exit() From 7e636acf83612834af84dff84acdf8c0b7f77a3f Mon Sep 17 00:00:00 2001 From: Simone Raimondi Date: Wed, 18 Dec 2024 16:59:47 +0100 Subject: [PATCH 2/2] Added mapdl.exit() call whenever an instance is created --- examples/workflows/01-pymapdl-workflow.py | 3 +++ examples/workflows/02-advanced-pymapdl-workflow.py | 3 +++ src/ansys/acp/core/extras/example_helpers.py | 3 +++ 3 files changed, 9 insertions(+) diff --git a/examples/workflows/01-pymapdl-workflow.py b/examples/workflows/01-pymapdl-workflow.py index 10df7f2274..80c602bd66 100644 --- a/examples/workflows/01-pymapdl-workflow.py +++ b/examples/workflows/01-pymapdl-workflow.py @@ -270,3 +270,6 @@ # %% # Release the composite model to close the open streams to the result file. composite_model = None # type: ignore + +# Close MAPDL instance +mapdl.exit() diff --git a/examples/workflows/02-advanced-pymapdl-workflow.py b/examples/workflows/02-advanced-pymapdl-workflow.py index f328c0d317..f9fa138b9e 100644 --- a/examples/workflows/02-advanced-pymapdl-workflow.py +++ b/examples/workflows/02-advanced-pymapdl-workflow.py @@ -390,3 +390,6 @@ def add_ply(mg, name, ply_material, angle, oss): # Query and plot the results. irf_field = output_all_elements.get_field({"failure_label": FailureOutput.FAILURE_VALUE}) irf_field.plot() + +# Close MAPDL instance +mapdl.exit() diff --git a/src/ansys/acp/core/extras/example_helpers.py b/src/ansys/acp/core/extras/example_helpers.py index 337b51db38..99e3f87d22 100644 --- a/src/ansys/acp/core/extras/example_helpers.py +++ b/src/ansys/acp/core/extras/example_helpers.py @@ -264,3 +264,6 @@ def _run_analysis(model: "Model") -> None: # %% # Release composite model to close open streams to result file. composite_model = None # type: ignore + + # Close MAPDL instance + mapdl.exit()