ansys.dpf.core.operators.averaging.elemental_difference#

class ansys.dpf.core.operators.averaging.elemental_difference(field=None, mesh_scoping=None, mesh=None, through_layers=None, config=None, server=None)#

Bases: ansys.dpf.core.dpf_operator.Operator

Transforms an Elemental Nodal or Nodal field into an Elemental field. Each elemental value is the maximum difference between the computed result for all nodes in this element. The result is computed on a given element scoping.

Parameters:
  • field (Field or FieldsContainer) – field or fields container with only one field is expected

  • mesh_scoping (Scoping, optional) – average only on these entities

  • mesh (MeshedRegion, optional)

  • through_layers (bool, optional) – The maximum elemental difference is taken through the different shell layers if true (default is false).

Returns:

field

Return type:

Field

Examples

>>> from ansys.dpf import core as dpf
>>> # Instantiate operator
>>> op = dpf.operators.averaging.elemental_difference()
>>> # Make input connections
>>> my_field = dpf.Field()
>>> op.inputs.field.connect(my_field)
>>> my_mesh_scoping = dpf.Scoping()
>>> op.inputs.mesh_scoping.connect(my_mesh_scoping)
>>> my_mesh = dpf.MeshedRegion()
>>> op.inputs.mesh.connect(my_mesh)
>>> my_through_layers = bool()
>>> op.inputs.through_layers.connect(my_through_layers)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.averaging.elemental_difference(
...     field=my_field,
...     mesh_scoping=my_mesh_scoping,
...     mesh=my_mesh,
...     through_layers=my_through_layers,
... )
>>> # Get output data
>>> result_field = op.outputs.field()
_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: InputsElementalDifference#

Enables to connect inputs to the operator

Returns:

An instance of InputsElementalDifference.

Return type:

inputs

property outputs: OutputsElementalDifference#

Enables to get outputs of the operator by evaluating it

Returns:

An instance of OutputsElementalDifference.

Return type:

outputs