Skip to main content

DPF Framework 2026 R1

utility:merge fields by label

Last update: 31.07.2026

Version: 0.0.0

Description

Merges the fields of a fields container that share the same label value.

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 fields_container Required fields_container
1 label Required string
2 merged_field_support abstract_field_support
3 sum_merge bool

fields_container (Pin 0)

label (Pin 1)

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

Label identifier that should be merged.

merged_field_support (Pin 2)

  • Required: No
  • Expected type(s): abstract_field_support

The FieldsContainer's support that has already been merged.

sum_merge (Pin 3)

  • Required: No
  • Expected type(s): bool

Default is false. If true, redundant quantities are summed instead of being ignored.

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
1 merged_field_support abstract_field_support

fields_container (Pin 0)

merged_field_support (Pin 1)

  • Expected type(s): abstract_field_support

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: utility

Plugin: core

Scripting name: merge_fields_by_label

Full name: utility.merge_fields_by_label

Internal name: merge::fields_container_label

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("merge::fields_container_label"); // operator instantiation
op.connect(0, my_fields_container);
op.connect(1, my_label);
op.connect(2, my_merged_field_support);
op.connect(3, my_sum_merge);
ansys::dpf::FieldsContainer my_fields_container = op.getOutput<ansys::dpf::FieldsContainer>(0);
ansys::dpf::AbstractFieldSupport my_merged_field_support = op.getOutput<ansys::dpf::AbstractFieldSupport>(1);
CPython
import ansys.dpf.core as dpf

op = dpf.operators.utility.merge_fields_by_label() # operator instantiation
op.inputs.fields_container.connect(my_fields_container)
op.inputs.label.connect(my_label)
op.inputs.merged_field_support.connect(my_merged_field_support)
op.inputs.sum_merge.connect(my_sum_merge)
my_fields_container = op.outputs.fields_container()
my_merged_field_support = op.outputs.merged_field_support()
IPython
import mech_dpf
import Ans.DataProcessing as dpf

op = dpf.operators.utility.merge_fields_by_label() # operator instantiation
op.inputs.fields_container.Connect(my_fields_container)
op.inputs.label.Connect(my_label)
op.inputs.merged_field_support.Connect(my_merged_field_support)
op.inputs.sum_merge.Connect(my_sum_merge)
my_fields_container = op.outputs.fields_container.GetData()
my_merged_field_support = op.outputs.merged_field_support.GetData()

Changelog

  • Version 0.0.0: Initial release.

Connect with Ansys