add
#
- class ansys.dpf.core.operators.math.add.add(fieldA=None, fieldB=None, config=None, server=None)#
Bases:
ansys.dpf.core.dpf_operator.Operator
Computes the sum of two fields. If one field’s scoping has ‘overall’ location, then these field’s values are applied on the entire other field. If one of the input field is empty, the remaining is forwarded to the output. When using a constant or ‘work_by_index’, it’s possible to use ‘inplace’ to reuse one of the fields.
- Parameters:
fieldA (Field or FieldsContainer or float) – Field or fields container with only one field is expected
fieldB (Field or FieldsContainer or float) – Field or fields container with only one field is expected
- Returns:
field
- Return type:
Examples
>>> from ansys.dpf import core as dpf
>>> # Instantiate operator >>> op = dpf.operators.math.add()
>>> # Make input connections >>> my_fieldA = dpf.Field() >>> op.inputs.fieldA.connect(my_fieldA) >>> my_fieldB = dpf.Field() >>> op.inputs.fieldB.connect(my_fieldB)
>>> # Instantiate operator and connect inputs in one line >>> op = dpf.operators.math.add( ... fieldA=my_fieldA, ... fieldB=my_fieldB, ... )
>>> # Get output data >>> result_field = op.outputs.field()
Overview#
Returns the default config of the operator. |
Import detail#
from ansys.dpf.core.operators.math.add import add
Property detail#
- property add.inputs#
Enables to connect inputs to the operator
- Returns:
inputs
- Return type:
- property add.outputs#
Enables to get outputs of the operator by evaluating it
- Returns:
outputs
- Return type:
Method detail#
- static add.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.