ansys.dpf.core.operators.math.linear_combination#
- class ansys.dpf.core.operators.math.linear_combination(a=None, fields_containerA=None, fields_containerB=None, b=None, fields_containerC=None, config=None, server=None)#
Bases:
ansys.dpf.core.dpf_operator.Operator
Computes aXY + bZ where a,b (in 0, in 3) are scalar and X,Y,Z (in 1,2,4) are complex numbers.
- Parameters:
a (float) – Double
fields_containerA (FieldsContainer)
fields_containerB (FieldsContainer)
b (float) – Double
fields_containerC (FieldsContainer)
- Returns:
fields_container
- Return type:
Examples
>>> from ansys.dpf import core as dpf
>>> # Instantiate operator >>> op = dpf.operators.math.linear_combination()
>>> # Make input connections >>> my_a = float() >>> op.inputs.a.connect(my_a) >>> my_fields_containerA = dpf.FieldsContainer() >>> op.inputs.fields_containerA.connect(my_fields_containerA) >>> my_fields_containerB = dpf.FieldsContainer() >>> op.inputs.fields_containerB.connect(my_fields_containerB) >>> my_b = float() >>> op.inputs.b.connect(my_b) >>> my_fields_containerC = dpf.FieldsContainer() >>> op.inputs.fields_containerC.connect(my_fields_containerC)
>>> # Instantiate operator and connect inputs in one line >>> op = dpf.operators.math.linear_combination( ... a=my_a, ... fields_containerA=my_fields_containerA, ... fields_containerB=my_fields_containerB, ... b=my_b, ... fields_containerC=my_fields_containerC, ... )
>>> # Get output data >>> result_fields_container = op.outputs.fields_container()
- _inputs#
- _outputs#
- static _spec() ansys.dpf.core.operators.specification.Specification #
- static default_config(server: ansys.dpf.core.server_types.AnyServerType = None) ansys.dpf.core.config.Config #
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 with channel connected to the remote or local instance. When
None
, attempts to use the global server.- Returns:
A new Config instance equivalent to the default config for this operator.
- Return type:
config
- property inputs: InputsLinearCombination#
Enables to connect inputs to the operator
- Returns:
An instance of InputsLinearCombination.
- Return type:
inputs
- property outputs: OutputsLinearCombination#
Enables to get outputs of the operator by evaluating it
- Returns:
An instance of OutputsLinearCombination.
- Return type:
outputs