ansys.dpf.core.operators.math.scale_fc#

class ansys.dpf.core.operators.math.scale_fc(fields_container=None, weights=None, boolean=None, algorithm=None, config=None, server=None, ponderation=None)#

Bases: ansys.dpf.core.dpf_operator.Operator

Scales a fields container by a constant factor. This factor can be a scalar, a vector a field, a fields container, where each value of the vector represents a scaler per component. Number of the components are corresponding to the input field dimensionality

Parameters:
  • fields_container (FieldsContainer) – fields container to be scaled

  • weights (float or Field or FieldsContainer) – Double/Vector of doubles/Field/FieldsContainer. When scoped on overall, same value(s) applied on all the data, when scoped elsewhere, corresponding values will be multiplied due to the scoping

  • boolean (bool, optional) – Default is false. If set to true, output of scale is made dimensionless

  • algorithm (int, optional) – Default is 0 use mkl. If set to 1, don’t

Returns:

fields_container

Return type:

FieldsContainer

Examples

>>> from ansys.dpf import core as dpf
>>> # Instantiate operator
>>> op = dpf.operators.math.scale_fc()
>>> # Make input connections
>>> my_fields_container = dpf.FieldsContainer()
>>> op.inputs.fields_container.connect(my_fields_container)
>>> my_weights = float()
>>> op.inputs.weights.connect(my_weights)
>>> my_boolean = bool()
>>> op.inputs.boolean.connect(my_boolean)
>>> my_algorithm = int()
>>> op.inputs.algorithm.connect(my_algorithm)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.math.scale_fc(
...     fields_container=my_fields_container,
...     weights=my_weights,
...     boolean=my_boolean,
...     algorithm=my_algorithm,
... )
>>> # 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: InputsScaleFc#

Enables to connect inputs to the operator

Returns:

An instance of InputsScaleFc.

Return type:

inputs

property outputs: OutputsScaleFc#

Enables to get outputs of the operator by evaluating it

Returns:

An instance of OutputsScaleFc.

Return type:

outputs