rescope#

class ansys.dpf.core.operators.scoping.rescope.rescope(fields=None, mesh_scoping=None, default_value=None, config=None, server=None)#

Bases: ansys.dpf.core.dpf_operator.Operator

Rescopes a field on the given scoping. If an ID does not exist in the original field, the default value (in 2) is used when defined.

Parameters:
  • fields (FieldsContainer or Field)

  • mesh_scoping (Scoping, optional)

  • default_value (float, optional) – If pin 2 is used, the ids not found in the field are added with this default value.

Returns:

fields

Return type:

FieldsContainer or Field

Examples

>>> from ansys.dpf import core as dpf
>>> # Instantiate operator
>>> op = dpf.operators.scoping.rescope()
>>> # Make input connections
>>> my_fields = dpf.FieldsContainer()
>>> op.inputs.fields.connect(my_fields)
>>> my_mesh_scoping = dpf.Scoping()
>>> op.inputs.mesh_scoping.connect(my_mesh_scoping)
>>> my_default_value = float()
>>> op.inputs.default_value.connect(my_default_value)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.scoping.rescope(
...     fields=my_fields,
...     mesh_scoping=my_mesh_scoping,
...     default_value=my_default_value,
... )
>>> # Get output data
>>> result_fields = op.outputs.fields()

Overview#

inputs

Enables to connect inputs to the operator

outputs

Enables to get outputs of the operator by evaluating it

default_config

Returns the default config of the operator.

Import detail#

from ansys.dpf.core.operators.scoping.rescope import rescope

Property detail#

property rescope.inputs#

Enables to connect inputs to the operator

Returns:

inputs

Return type:

InputsRescope

property rescope.outputs#

Enables to get outputs of the operator by evaluating it

Returns:

outputs

Return type:

OutputsRescope

Method detail#

static rescope.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.