Skip to main content

DPF Framework 2026 R1

math:linear combination

Last update: 31.07.2026

Version: 0.0.0

Description

Computes aXY + bZ where a,b (in 0, in 3) are scalar and X,Y,Z (in 1,2,4) are complex numbers.

Inputs

This table lists the input pins for this operator. Input pins define the data that the operator requires to perform its operation. Some inputs are required, while others are optional and provide additional configuration. Each parameter is detailed in the sections that follow the table.

Pin number Name Status Expected type(s)
0 a Required double
1 fields_containerA Required fields_container
2 fields_containerB Required fields_container
3 b Required double
4 fields_containerC Required fields_container

a (Pin 0)

  • Required: Yes
  • Expected type(s): double

Double

fields_containerA (Pin 1)

fields_containerB (Pin 2)

b (Pin 3)

  • Required: Yes
  • Expected type(s): double

Double

fields_containerC (Pin 4)

Outputs

This table lists the output pins for this operator. Output pins provide the results of the operator's computation and can be connected to inputs of other operators or retrieved for further processing. Each output is detailed in the sections that follow the table.

Pin number Name Expected type(s)
0 fields_container fields_container

fields_container (Pin 0)

Configurations

This operator supports configuration options that modify its behavior.

mutex

  • Expected type(s): bool
  • Default value: false

If this option is set to true, the shared memory is prevented from being simultaneously accessed by multiple threads.

Scripting

This operator can be accessed through scripting interfaces using these identifiers.

Category: math

Plugin: core

Scripting name: linear_combination

Full name: math.linear_combination

Internal name: CplxOp

License: None

Examples

These examples demonstrate how to use this operator in different programming environments. Each example shows how to instantiate the operator, connect the required inputs, and retrieve the output.

C++
#include "dpf_api.h"

ansys::dpf::Operator op("CplxOp"); // operator instantiation
op.connect(0, my_a);
op.connect(1, my_fields_containerA);
op.connect(2, my_fields_containerB);
op.connect(3, my_b);
op.connect(4, my_fields_containerC);
ansys::dpf::FieldsContainer my_fields_container = op.getOutput<ansys::dpf::FieldsContainer>(0);
CPython
import ansys.dpf.core as dpf

op = dpf.operators.math.linear_combination() # operator instantiation
op.inputs.a.connect(my_a)
op.inputs.fields_containerA.connect(my_fields_containerA)
op.inputs.fields_containerB.connect(my_fields_containerB)
op.inputs.b.connect(my_b)
op.inputs.fields_containerC.connect(my_fields_containerC)
my_fields_container = op.outputs.fields_container()
IPython
import mech_dpf
import Ans.DataProcessing as dpf

op = dpf.operators.math.linear_combination() # operator instantiation
op.inputs.a.Connect(my_a)
op.inputs.fields_containerA.Connect(my_fields_containerA)
op.inputs.fields_containerB.Connect(my_fields_containerB)
op.inputs.b.Connect(my_b)
op.inputs.fields_containerC.Connect(my_fields_containerC)
my_fields_container = op.outputs.fields_container.GetData()

Changelog

  • Version 0.0.0: Initial release.

Connect with Ansys