@@ -29,52 +29,60 @@ using the :class:`InProcess <ansys.dpf.core.server_types.InProcessServer>` class
2929
3030 .. rst-class :: sphx-glr-script-out
3131
32- .. code-block :: none
33-
34- <ansys.dpf.core.server_types.InProcessServer object at ...>
32+ .. jupyter-execute ::
33+ :hide-code:
34+
35+ from ansys.dpf import core as dpf
36+ local_server = dpf.start_local_server()
37+ local_server
3538
3639This DPF Server can now be used to instantiate models, operators, and more.
3740
3841.. code-block ::
39-
42+
4043 # instantiate an operator
4144 local_operator = dpf.operators.results.displacement(server=local_server)
42-
45+
4346 # instantiate a model
4447 from ansys.dpf.core import examples
4548 local_model = dpf.Model(examples.find_simple_bar(), server=local_server)
46-
49+
4750
4851 DPF Server through the network using gRPC
4952-----------------------------------------
5053
5154The :class: `GrpcServer <ansys.dpf.core.server_types.GrpcServer> ` class is used
52- to enable gRPC communication:
55+ to enable gRPC communication:
5356
5457.. code-block ::
55-
58+
5659 from ansys.dpf import core as dpf
5760 grpc_server_config = dpf.AvailableServerConfigs.GrpcServer
5861 grpc_server = dpf.start_local_server(config=grpc_server_config)
5962 grpc_server
6063
6164 .. rst-class :: sphx-glr-script-out
6265
63- .. code-block :: none
64-
65- <ansys.dpf.core.server_types.GrpcServer object at ...>
66+ .. jupyter-execute ::
67+ :hide-code:
68+
69+ from ansys.dpf import core as dpf
70+ grpc_server_config = dpf.AvailableServerConfigs.GrpcServer
71+ grpc_server = dpf.start_local_server(config=grpc_server_config)
72+ grpc_server
6673
6774You can obtain the server port and IP address:
6875
6976.. code-block ::
7077
7178 print(grpc_server)
72-
79+
7380 .. rst-class :: sphx-glr-script-out
7481
75- .. code-block :: none
82+ .. jupyter-execute ::
83+ :hide-code:
7684
77- DPF Server: {'server_ip': '127.0.0.1', 'server_port': 50052, 'server_process_id': 9999, 'server_version': '6.0', 'os': 'nt'}
85+ print(grpc_server)
7886
7987From another machine, you can connect remotely to this DPF Server and instantiate models, operators, and more:
8088
0 commit comments