run
#
- class ansys.dpf.core.operators.result.run.run(mapdl_exe_path=None, working_dir=None, number_of_processes=None, data_sources=None, server_mode=None, config=None, server=None)#
Bases:
ansys.dpf.core.dpf_operator.Operator
Solve in mapdl a dat/inp file and returns a datasources with the rst file.
- Parameters:
mapdl_exe_path (str, optional)
working_dir (str, optional)
number_of_processes (int, optional) – Set the number of mpi processes used for resolution (default is 2)
data_sources (DataSources) – Data sources containing the input file.
server_mode (bool, optional) – Used when a user includes commands in the input file allowing to launch dpf server inside mapdl to interact with mapdl using dpf client api
- Returns:
data_sources (DataSources) – Returns the data source if the server_mode pin is not set to yes
ip (str) – Returns the ip if the server_mode pin is set to yes
port (str) – Returns a port when the server mode pin is set to yes
Examples
>>> from ansys.dpf import core as dpf
>>> # Instantiate operator >>> op = dpf.operators.result.run()
>>> # Make input connections >>> my_mapdl_exe_path = str() >>> op.inputs.mapdl_exe_path.connect(my_mapdl_exe_path) >>> my_working_dir = str() >>> op.inputs.working_dir.connect(my_working_dir) >>> my_number_of_processes = int() >>> op.inputs.number_of_processes.connect(my_number_of_processes) >>> my_data_sources = dpf.DataSources() >>> op.inputs.data_sources.connect(my_data_sources) >>> my_server_mode = bool() >>> op.inputs.server_mode.connect(my_server_mode)
>>> # Instantiate operator and connect inputs in one line >>> op = dpf.operators.result.run( ... mapdl_exe_path=my_mapdl_exe_path, ... working_dir=my_working_dir, ... number_of_processes=my_number_of_processes, ... data_sources=my_data_sources, ... server_mode=my_server_mode, ... )
>>> # Get output data >>> result_data_sources = op.outputs.data_sources() >>> result_ip = op.outputs.ip() >>> result_port = op.outputs.port()
Overview#
Returns the default config of the operator. |
Import detail#
from ansys.dpf.core.operators.result.run import run
Property detail#
- property run.inputs#
Enables to connect inputs to the operator
- Returns:
inputs
- Return type:
- property run.outputs#
Enables to get outputs of the operator by evaluating it
- Returns:
outputs
- Return type:
Method detail#
- static run.default_config(server=None)#
Returns the default config of the operator.
This config can then be changed to the user needs and be used to instantiate the operator. The Configuration allows to customize how the operation will be processed by the operator.
- Parameters:
server (server.DPFServer, optional) – Server with channel connected to the remote or local instance. When
None
, attempts to use the global server.