Skip to content
Draft
Show file tree
Hide file tree
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
Binary file added doc/source/_static/banner_api.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/_static/banner_osl_server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/_static/banner_python_scripts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"sphinx.ext.doctest",
"sphinx.ext.extlinks",
"sphinx.ext.intersphinx",
"sphinx_design",
"sphinx_copybutton",
"sphinx_gallery.gen_gallery",
"ansys_sphinx_theme.extension.linkcode",
Expand Down Expand Up @@ -118,7 +119,7 @@
# path to your examples scripts
"examples_dirs": ["../../examples/"],
# path where to save gallery generated examples
"gallery_dirs": ["examples"],
"gallery_dirs": ["examples/gallery_examples"],
# Pattern to search for example files
"filename_pattern": r"\.py",
# Remove the "Download all examples" button from the top level gallery
Expand Down
83 changes: 83 additions & 0 deletions doc/source/examples/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
.. toctree::
:hidden:
:maxdepth: 3

gallery_examples/api/index.rst
gallery_examples/evaluate_design/index.rst
gallery_examples/osl_server/index.rst
gallery_examples/parametric_design_study_manager/index.rst
gallery_examples/run_python_script/index.rst
gallery_examples/workflow_creation/index.rst

.. _ref_examples:

Examples
========
End-to-end examples show how you can use PyOptiSLang. If PyOptiSLang is installed
on your machine, you can download these examples as Python files or Jupyter
notebooks and run them locally.

.. grid:: 2 2 3 3
:gutter: 1 2 3 3
:padding: 1 2 3 3

.. grid-item-card:: API usage examples
:link: sphx_glr_examples_gallery_examples_api
:link-type: ref

.. image:: ../_static/banner_api.png
:height: 150px
:align: center

These examples demonstrate how to use the explixit API to communicate with optiSLang.

.. grid-item-card:: Evaluate designs
:link: sphx_glr_examples_gallery_examples_evaluate_design
:link-type: ref

.. image:: ../_static/01_ten_bar_truss_evaluate_design.png
:height: 150px
:align: center

These examples demonstrate how to evaluate designs.

.. grid-item-card:: Raw optiSLang server communication
:link: sphx_glr_examples_gallery_examples_osl_server
:link-type: ref

.. image:: ../_static/banner_osl_server.png
:height: 150px
:align: center

These examples demonstrate how to use PyOptiSLang to perform raw communiction with the optiSLang server.

.. grid-item-card:: Parametric Design Study Manager
:link: sphx_glr_examples_gallery_examples_parametric_design_study_manager
:link-type: ref

.. image:: ../_static/03_1_ProxySolverSensitivity.png
:height: 150px
:align: center

These examples demonstrate how to create and execute design studies using templates.


.. grid-item-card:: Run Python scripts
:link: sphx_glr_examples_gallery_examples_run_python_script
:link-type: ref

.. image:: ../_static/banner_python_scripts.png
:height: 150px
:align: center

These examples demonstrate how to run Python scripts.

.. grid-item-card:: Create workflow
:link: sphx_glr_examples_gallery_examples_workflow_creation
:link-type: ref

.. image:: ../_static/04_1_RDO_w_python.png
:height: 150px
:align: center

These examples demonstrate how to create workflow using pyOptiSLang.
6 changes: 5 additions & 1 deletion examples/evaluate_design/01_ten_bar_truss.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

#########################################################
# Workflow:
# .. image:: ../../_static/01_ten_bar_truss_evaluate_design.png
# .. image:: ../../../_static/01_ten_bar_truss_evaluate_design.png
# :width: 400
# :alt: Result of script.
#
Expand All @@ -62,6 +62,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/01_ten_bar_truss_evaluate_design.png"
# sphinx_gallery_end_ignore

from pathlib import Path
import tempfile
from typing import TYPE_CHECKING, List
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
# ------------------------
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/01_general_algorithm.png"
# sphinx_gallery_end_ignore

from math import sin
from pathlib import Path
Expand Down Expand Up @@ -132,6 +135,6 @@ def callback(designs: list[Design]) -> list[Design]:
# -----------------------
# This image shows the generated workflow.
#
# .. image:: ../../_static/01_general_algorithm.png
# .. image:: ../../../_static/01_general_algorithm.png
# :width: 400
# :alt: Result of script.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
# ------------------------
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_optimization_on_mop.png"
# sphinx_gallery_end_ignore

from math import sin
from pathlib import Path
Expand Down Expand Up @@ -154,6 +157,6 @@ def callback(designs: list[Design]) -> list[Design]:
# -----------------------
# This image shows the generated workflow.
#
# .. image:: ../../_static/02_optimization_on_mop.png
# .. image:: ../../../_static/02_optimization_on_mop.png
# :width: 1200
# :alt: Result of script.
6 changes: 5 additions & 1 deletion examples/run_python_script/01_ten_bar_truss.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/01_ten_bar_truss.png"
# sphinx_gallery_end_ignore

from ansys.optislang.core import Optislang
import ansys.optislang.core.examples as examples

Expand Down Expand Up @@ -96,7 +100,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~
# This image shows the generated workflow.
#
# .. image:: ../../_static/01_ten_bar_truss.png
# .. image:: ../../../_static/01_ten_bar_truss.png
# :width: 400
# :alt: Result of script.
#
6 changes: 5 additions & 1 deletion examples/run_python_script/02_1_oscillator_robustness.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_1_oscillator_robustness.png"
# sphinx_gallery_end_ignore

from ansys.optislang.core import Optislang
import ansys.optislang.core.examples as examples

Expand Down Expand Up @@ -88,7 +92,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~
# This image shows the generated workflow.
#
# .. image:: ../../_static/02_1_oscillator_robustness.png
# .. image:: ../../../_static/02_1_oscillator_robustness.png
# :width: 600
# :alt: Result of script.
#
6 changes: 5 additions & 1 deletion examples/run_python_script/02_2_oscillator_python_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_2_python_system.png"
# sphinx_gallery_end_ignore

from ansys.optislang.core import Optislang
import ansys.optislang.core.examples as examples

Expand Down Expand Up @@ -89,7 +93,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~
# This image shows the generated workflow.
#
# .. image:: ../../_static/02_2_python_system.png
# .. image:: ../../../_static/02_2_python_system.png
# :width: 300
# :alt: Result of script.
#
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_3_optimization_on_EA.png"
# sphinx_gallery_end_ignore

from ansys.optislang.core import Optislang
import ansys.optislang.core.examples as examples

Expand Down Expand Up @@ -90,7 +94,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~
# This image shows the generated workflow.
#
# .. image:: ../../_static/02_3_optimization_on_EA.png
# .. image:: ../../../_static/02_3_optimization_on_EA.png
# :width: 400
# :alt: Result of script.
#
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_4_oscillator_MOP_sensitivity_and_optimization.png"
# sphinx_gallery_end_ignore

from ansys.optislang.core import Optislang
import ansys.optislang.core.examples as examples

Expand Down Expand Up @@ -95,7 +99,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~
# This image shows the generated workflow.
#
# .. image:: ../../_static/02_4_oscillator_MOP_sensitivity_and_optimization.png
# .. image:: ../../../_static/02_4_oscillator_MOP_sensitivity_and_optimization.png
# :width: 600
# :alt: Result of script.
#
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/02_5_oscillator_calibration_systems.png"
# sphinx_gallery_end_ignore

from ansys.optislang.core import Optislang
import ansys.optislang.core.examples as examples

Expand Down Expand Up @@ -95,7 +99,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~
# This image shows the generated workflow.
#
# .. image:: ../../_static/02_5_oscillator_calibration_systems.png
# .. image:: ../../../_static/02_5_oscillator_calibration_systems.png
# :width: 400
# :alt: Result of script.
#
6 changes: 5 additions & 1 deletion examples/run_python_script/03_etk_abaqus.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/03_etk_abaqus.png"
# sphinx_gallery_end_ignore

from ansys.optislang.core import Optislang
import ansys.optislang.core.examples as examples

Expand Down Expand Up @@ -83,7 +87,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~
# This image shows the generated workflow.
#
# .. image:: ../../_static/03_etk_abaqus.png
# .. image:: ../../../_static/03_etk_abaqus.png
# :width: 400
# :alt: Result of script.
#
6 changes: 5 additions & 1 deletion examples/run_python_script/04_python_node_and_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/04_python_node_and_help.png"
# sphinx_gallery_end_ignore

from ansys.optislang.core import Optislang
import ansys.optislang.core.examples as examples

Expand Down Expand Up @@ -91,7 +95,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~
# This image shows the generated workflow.
#
# .. image:: ../../_static/04_python_node_and_help.png
# .. image:: ../../../_static/04_python_node_and_help.png
# :width: 300
# :alt: Result of script.
#
6 changes: 5 additions & 1 deletion examples/run_python_script/05_optimizer_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/05_optimizer_settings.png"
# sphinx_gallery_end_ignore

from ansys.optislang.core import Optislang
import ansys.optislang.core.examples as examples

Expand Down Expand Up @@ -82,7 +86,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~
# This image shows the generated workflow.
#
# .. image:: ../../_static/05_optimizer_settings.png
# .. image:: ../../../_static/05_optimizer_settings.png
# :width: 300
# :alt: Result of script.
#
6 changes: 5 additions & 1 deletion examples/run_python_script/06_sensitivity_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/06_sensitivity_settings.png"
# sphinx_gallery_end_ignore

from ansys.optislang.core import Optislang
import ansys.optislang.core.examples as examples

Expand Down Expand Up @@ -82,7 +86,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~
# This image shows the generated workflow.
#
# .. image:: ../../_static/06_sensitivity_settings.png
# .. image:: ../../../_static/06_sensitivity_settings.png
# :width: 300
# :alt: Result of script.
#
7 changes: 6 additions & 1 deletion examples/run_python_script/07_simple_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
# Perform required imports
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/07_simple_calculator.png"
# sphinx_gallery_end_ignore

from ansys.optislang.core import Optislang
import ansys.optislang.core.examples as examples

Expand Down Expand Up @@ -87,7 +92,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~
# This image shows the generated workflow.
#
# .. image:: ../../_static/07_simple_calculator.png
# .. image:: ../../../_static/07_simple_calculator.png
# :width: 400
# :alt: Result of script.
#
6 changes: 5 additions & 1 deletion examples/workflow_creation/01_ten_bar_truss.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~
# Perform the required imports.

# sphinx_gallery_start_ignore
# sphinx_gallery_thumbnail_path = "../../doc/source/_static/01_ten_bar_truss_pyOSL_workflow.png"
# sphinx_gallery_end_ignore

import os
from pathlib import Path

Expand Down Expand Up @@ -378,7 +382,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~
# This image shows the generated workflow.
#
# .. image:: ../../_static/01_ten_bar_truss_pyOSL_workflow.png
# .. image:: ../../../_static/01_ten_bar_truss_pyOSL_workflow.png
# :width: 400
# :alt: Result of script.
#
Loading
Loading