From e081f8888a34ccd5f8c466de3290f8980d8a181a Mon Sep 17 00:00:00 2001 From: luisaFelixSalles Date: Thu, 7 Nov 2024 14:23:14 +0100 Subject: [PATCH 1/3] adapts the "server types" how to into a licensing tutorial --- .../user_guide/tutorials/dpf_server/index.rst | 2 ++ .../dpf_server}/server_types.rst | 36 +++++++++++-------- 2 files changed, 24 insertions(+), 14 deletions(-) rename doc/source/user_guide/{ => tutorials/dpf_server}/server_types.rst (91%) diff --git a/doc/source/user_guide/tutorials/dpf_server/index.rst b/doc/source/user_guide/tutorials/dpf_server/index.rst index efc4e1bfdb..d4b3b64806 100644 --- a/doc/source/user_guide/tutorials/dpf_server/index.rst +++ b/doc/source/user_guide/tutorials/dpf_server/index.rst @@ -22,3 +22,5 @@ This tutorial explains how to manipulate DPF client-server architecture :maxdepth: 2 :hidden: + server_types.rst + diff --git a/doc/source/user_guide/server_types.rst b/doc/source/user_guide/tutorials/dpf_server/server_types.rst similarity index 91% rename from doc/source/user_guide/server_types.rst rename to doc/source/user_guide/tutorials/dpf_server/server_types.rst index 8ee493a7bd..a72c0e3b82 100644 --- a/doc/source/user_guide/server_types.rst +++ b/doc/source/user_guide/tutorials/dpf_server/server_types.rst @@ -29,30 +29,33 @@ using the :class:`InProcess ` class .. rst-class:: sphx-glr-script-out - .. code-block:: none - - + .. jupyter-execute:: + :hide-code: + + from ansys.dpf import core as dpf + local_server = dpf.start_local_server() + 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 ` 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) @@ -60,21 +63,26 @@ to enable gRPC communication: .. rst-class:: sphx-glr-script-out - .. code-block:: none - - + .. 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) + 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: From a186370bf7d7b9f401f5798722649d4fd7393ecd Mon Sep 17 00:00:00 2001 From: luisaFelixSalles Date: Tue, 12 Nov 2024 16:41:14 +0100 Subject: [PATCH 2/3] update dpf server index --- doc/source/user_guide/tutorials/dpf_server/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/user_guide/tutorials/dpf_server/index.rst b/doc/source/user_guide/tutorials/dpf_server/index.rst index d4b3b64806..8031a9a19e 100644 --- a/doc/source/user_guide/tutorials/dpf_server/index.rst +++ b/doc/source/user_guide/tutorials/dpf_server/index.rst @@ -12,11 +12,11 @@ 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 + explains how to manipulate DPF client-server architecture .. toctree:: :maxdepth: 2 From 9b9e26ec5d8a9396944928e43e7b7a578775635f Mon Sep 17 00:00:00 2001 From: luisaFelixSalles Date: Fri, 15 Nov 2024 16:10:36 +0100 Subject: [PATCH 3/3] update --- .../user_guide/tutorials/dpf_server/server_types.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/source/user_guide/tutorials/dpf_server/server_types.rst b/doc/source/user_guide/tutorials/dpf_server/server_types.rst index a72c0e3b82..8e1ebdc0b1 100644 --- a/doc/source/user_guide/tutorials/dpf_server/server_types.rst +++ b/doc/source/user_guide/tutorials/dpf_server/server_types.rst @@ -25,7 +25,7 @@ using the :class:`InProcess ` 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 @@ -34,7 +34,7 @@ using the :class:`InProcess ` class from ansys.dpf import core as dpf local_server = dpf.start_local_server() - local_server + print(local_server) This DPF Server can now be used to instantiate models, operators, and more. @@ -59,7 +59,7 @@ to enable gRPC communication: 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 @@ -69,7 +69,7 @@ to enable gRPC communication: 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) You can obtain the server port and IP address: