Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add server tutorials to the main tutorials branch #1891

Open
wants to merge 23 commits into
base: doc/new-tutorials-section
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b6a4928
new tutorials layout
luisaFelixSalles Oct 21, 2024
bc998a3
user guide index page with tutorials
luisaFelixSalles Oct 22, 2024
bd08a1e
add new basic tutorial and jupyter_ sphinx extension
luisaFelixSalles Oct 22, 2024
64b4a63
add new basic tutorial in the sidebar
luisaFelixSalles Oct 22, 2024
992c045
add new fundamentals tutorial page
luisaFelixSalles Oct 22, 2024
a0d288e
reorganizing
luisaFelixSalles Oct 22, 2024
f616dd1
add fundamentals and usage tutorials and their sections
luisaFelixSalles Oct 23, 2024
7c79417
add more required tutorials
luisaFelixSalles Nov 7, 2024
0046af2
folders and index files for each tut section
luisaFelixSalles Nov 7, 2024
456b54d
update distributed files section grid
luisaFelixSalles Nov 7, 2024
3421141
updates
luisaFelixSalles Nov 8, 2024
4a2e9d3
layout changes
luisaFelixSalles Nov 12, 2024
db55259
updates on the index cards
luisaFelixSalles Nov 12, 2024
51fc7b9
updates on the index pages
luisaFelixSalles Nov 12, 2024
4de2bf1
updates on the basic tuts
luisaFelixSalles Nov 12, 2024
be5197c
updates
luisaFelixSalles Nov 12, 2024
f5f8f88
updates
luisaFelixSalles Nov 12, 2024
823289f
update tutorials main page
luisaFelixSalles Nov 13, 2024
cdadc07
add maths section
luisaFelixSalles Nov 13, 2024
df79026
add physics data section
luisaFelixSalles Nov 13, 2024
e081f88
adapts the "server types" how to into a licensing tutorial
luisaFelixSalles Nov 7, 2024
a186370
update dpf server index
luisaFelixSalles Nov 12, 2024
9b9e26e
update
luisaFelixSalles Nov 15, 2024
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
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"sphinx_design",
"sphinx_gallery.gen_gallery",
'sphinx_reredirects',
"jupyter_sphinx",
]

redirects = {
Expand Down
65 changes: 30 additions & 35 deletions doc/source/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
User guide
==========

PyDPF-Core is a Python client API for accessing DPF postprocessing
capabilities. The ``ansys.dpf.core`` package makes highly efficient
computation, customization, and remote postprocessing accessible in Python.
**DPF** provides numerical simulation users and engineers with a toolbox for accessing and
transforming data.

The goals of this section are to:
**PyDPF-Core** is a Python client API for accessing DPF
capabilities. The ``ansys.dpf.core`` package makes highly efficient
computation, customization, and remote data processing accessible in Python.

- Describe the most-used DPF entities and how they can help you to access and modify solver data.
- Provide simple how-tos for tackling the most common use cases.
The goals of this section are to:

.. include::
concepts/index.rst
- Describe some DPF entities and how they can help you to access and modify solver data.
- Provide detailed tutorials to demonstrate PyDPF-Core functionalities.
- Explain how to resolve the most common issues encountered when using PyDPF-Core

.. include::
main_entities.rst
tutorials/index.rst

.. include::
how_to.rst

concepts/index.rst

Troubleshooting
---------------
Expand Down Expand Up @@ -52,6 +52,25 @@ Troubleshooting
:text-align: center


.. toctree::
:maxdepth: 2
:hidden:
:caption: Tutorials

tutorials/data_structures/index.rst
tutorials/language_and_usage/index.rst
tutorials/post_processing_basics/index.rst
tutorials/import_data/index.rst
tutorials/mesh/index.rst
tutorials/transform_data/index.rst
tutorials/export_data/index.rst
tutorials/plot/index.rst
tutorials/animate/index.rst
tutorials/enriching_dpf_capabilities/index.rst
tutorials/distributed_files/index.rst
tutorials/dpf_server/index.rst
tutorials/licensing/index.rst

.. toctree::
:maxdepth: 2
:hidden:
Expand All @@ -61,30 +80,6 @@ Troubleshooting
concepts/waysofusing.rst
concepts/stepbystep.rst


.. toctree::
:maxdepth: 2
:hidden:
:caption: DPF most-used entities

model
operators
fields_container


.. toctree::
:maxdepth: 2
:hidden:
:caption: How-tos

plotting.rst
custom_operators.rst
dpf_server.rst
server_types.rst
server_context.rst
xmlfiles.rst


.. toctree::
:maxdepth: 3
:hidden:
Expand Down
24 changes: 24 additions & 0 deletions doc/source/user_guide/tutorials/animate/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. _ref_tutorials_animate:

=======
Animate
=======

These tutorials demonstrate how to visualise the data in an animation.

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

.. grid-item-card:: Animate data
:link: ref_tutorials
:link-type: ref
:text-align: center

This tutorial

.. toctree::
:maxdepth: 2
:hidden:

42 changes: 42 additions & 0 deletions doc/source/user_guide/tutorials/data_structures/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.. _ref_tutorials_data_structures:

===================
DPF data structures
===================

DPF uses two main data structures to handle data: Fields and Collections.
Therefore, it is important to be aware of how the data is
structured in those containers.

The data containers can be:

- **Raw data storage structures**: Data arrays (a ``Field`` for example) or Data Maps (a ``DataTree`` for example)
- **Collections**: a group of same labeled objects from one DPF raw data storage structure (a ``FieldsContainer`` for example, that is a group of ``Fields`` with the same label)

These tutorials explains how these structures work and how you can manipulate data within.

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

.. grid-item-card:: DPF raw data storage structures
:link: ref_tutorials
:link-type: ref
:text-align: center

This tutorial shows how to create and work with some DPF data arrays:
Field, StringField and PropertyField


.. grid-item-card:: DPF collections
:link: ref_tutorials_language_and_usage
:link-type: ref
:text-align: center

This tutorial shows how to create and work with some DPF collections:
FieldsContainer, MeshesContainer and ScopingContainer

.. toctree::
:maxdepth: 2
:hidden:
31 changes: 31 additions & 0 deletions doc/source/user_guide/tutorials/distributed_files/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. _ref_tutorials_distributed_files:

==============================
Post-process distributed files
==============================

These tutorials show how to create workflows on different processes (possibly on different machines) and connect them.

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

.. grid-item-card:: Post process data on distributed processes
:link: ref_tutorials
:link-type: ref
:text-align: center

This tutorial

.. grid-item-card:: Create a custom workflow on distributed processes
:link: ref_tutorials
:link-type: ref
:text-align: center

This tutorial

.. toctree::
:maxdepth: 2
:hidden:

26 changes: 26 additions & 0 deletions doc/source/user_guide/tutorials/dpf_server/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. _ref_tutorials_dpf_server:

==========
DPF server
==========

This tutorial explains how to manipulate DPF client-server architecture

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

.. grid-item-card:: Switch between local and remote server
:link: user_guide_server_types
:link-type: ref
:text-align: center

explains how to manipulate DPF client-server architecture

.. toctree::
:maxdepth: 2
:hidden:

server_types.rst

Original file line number Diff line number Diff line change
Expand Up @@ -25,56 +25,64 @@ using the :class:`InProcess <ansys.dpf.core.server_types.InProcessServer>` class

from ansys.dpf import core as dpf
local_server = dpf.start_local_server()
local_server
print(local_server)

.. rst-class:: sphx-glr-script-out

.. code-block:: none

<ansys.dpf.core.server_types.InProcessServer object at ...>
.. jupyter-execute::
:hide-code:

from ansys.dpf import core as dpf
local_server = dpf.start_local_server()
print(local_server)

This DPF Server can now be used to instantiate models, operators, and more.

.. code-block::

# instantiate an operator
local_operator = dpf.operators.results.displacement(server=local_server)

# instantiate a model
from ansys.dpf.core import examples
local_model = dpf.Model(examples.find_simple_bar(), server=local_server)


DPF Server through the network using gRPC
-----------------------------------------

The :class:`GrpcServer <ansys.dpf.core.server_types.GrpcServer>` class is used
to enable gRPC communication:
to enable gRPC communication:

.. code-block::

from ansys.dpf import core as dpf
grpc_server_config = dpf.AvailableServerConfigs.GrpcServer
grpc_server = dpf.start_local_server(config=grpc_server_config)
grpc_server
print(grpc_server)

.. rst-class:: sphx-glr-script-out

.. code-block:: none

<ansys.dpf.core.server_types.GrpcServer object at ...>
.. jupyter-execute::
:hide-code:

from ansys.dpf import core as dpf
grpc_server_config = dpf.AvailableServerConfigs.GrpcServer
grpc_server = dpf.start_local_server(config=grpc_server_config)
print(grpc_server)

You can obtain the server port and IP address:

.. code-block::

print(grpc_server)

.. rst-class:: sphx-glr-script-out

.. code-block:: none
.. jupyter-execute::
:hide-code:

DPF Server: {'server_ip': '127.0.0.1', 'server_port': 50052, 'server_process_id': 9999, 'server_version': '6.0', 'os': 'nt'}
print(grpc_server)

From another machine, you can connect remotely to this DPF Server and instantiate models, operators, and more:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.. _ref_tutorials_enriching:

==========================
Enriching DPF capabilities
==========================

The available DPF capabilities loaded in a DPF application can be enhanced
by creating new operator’s libraries. DPF offers multiple development APIs
depending on your environment.

These tutorials demonstrate how to develop those plugins for PyDPF-Core (CPython based)

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

.. grid-item-card:: Create custom operators and plugins
:link: ref_tutorials
:link-type: ref
:text-align: center

This tutorial

.. grid-item-card:: Create a plug-in package with multiple operators
:link: ref_tutorials
:link-type: ref
:text-align: center

This tutorial

.. grid-item-card:: Create a plug-in package that has third-party dependencies
:link: ref_tutorials
:link-type: ref
:text-align: center

This tutorial

.. toctree::
:maxdepth: 2
:hidden:

28 changes: 28 additions & 0 deletions doc/source/user_guide/tutorials/export_data/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. _ref_tutorials_export_data:

===========
Export data
===========

Data in DPF can be exported to universal file formats, such as VTK, HDF5, and TXT files.
You can use it to generate TH-plots, screenshots, and animations or to create custom result
plots using the `numpy <https://numpy.org/>`_ and `matplotlib <https://matplotlib.org/>`_ packages.

These tutorials explains how to export data from your manipulations with PyDPF-Core.

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

.. grid-item-card:: HDF5 export
:link: ref_tutorials
:link-type: ref
:text-align: center

This tutorial

.. toctree::
:maxdepth: 2
:hidden:

Loading
Loading