Skip to content

Add server tutorials to the main tutorials branch #1891

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

Open
wants to merge 26 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
26 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
50698e4
Merge branch 'doc/new-tutorials-section' into tutorials/dpf_server/2-…
PProfizi May 22, 2025
f0f90a3
Delete doc/source/user_guide/tutorials/transform_data/index.rst
PProfizi May 22, 2025
d216631
Apply suggestions from code review
PProfizi May 22, 2025
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
5 changes: 3 additions & 2 deletions doc/source/user_guide/tutorials/dpf_server/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ This tutorial explains how to manipulate DPF client-server architecture
:margin: 2

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

This tutorial
This tutorial 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
2 changes: 1 addition & 1 deletion doc/source/user_guide/tutorials/import_data/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ From result files
import_result_file.rst
extract_and_explore_results_metadata.rst
extract_and_explore_results_data.rst
narrow_down_data.rst
narrow_down_data.rst
2 changes: 1 addition & 1 deletion doc/source/user_guide/tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,4 @@ of our package background so you can understand how to work with it.
:link-type: ref
:text-align: center

Understand how to access the Entry and Premium licensing capabilities
Understand how to access the Entry and Premium licensing capabilities
3 changes: 0 additions & 3 deletions doc/source/user_guide/tutorials/mathematics/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,3 @@ PyDPF-Core API and data structures.
:hidden:

basic_maths.rst



2 changes: 1 addition & 1 deletion doc/source/user_guide/tutorials/plot/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ These tutorials demonstrate different ways one can visualize the data in plots u
plot_mesh.rst
plot_deformed_mesh.rst
plot_contour.rst
plot_a_graph.rst
plot_a_graph.rst
Loading