add_rigid_body_motion

class ansys.dpf.core.operators.result.add_rigid_body_motion.add_rigid_body_motion(displacement_field=None, translation_field=None, rotation_field=None, center_field=None, mesh=None, config=None, server=None)

Adds a given rigid translation, center and rotation from a displacement field. The rotation is given in terms of rotations angles. Note that the displacement field has to be in the global coordinate sytem

available inputs:
  • displacement_field (Field)

  • translation_field (Field)

  • rotation_field (Field)

  • center_field (Field)

  • mesh (MeshedRegion) (optional)

available outputs:
  • field (Field)

Examples

>>> from ansys.dpf import core as dpf
>>> # Instantiate operator
>>> op = dpf.operators.result.add_rigid_body_motion()
>>> # Make input connections
>>> my_displacement_field = dpf.Field()
>>> op.inputs.displacement_field.connect(my_displacement_field)
>>> my_translation_field = dpf.Field()
>>> op.inputs.translation_field.connect(my_translation_field)
>>> my_rotation_field = dpf.Field()
>>> op.inputs.rotation_field.connect(my_rotation_field)
>>> my_center_field = dpf.Field()
>>> op.inputs.center_field.connect(my_center_field)
>>> my_mesh = dpf.MeshedRegion()
>>> op.inputs.mesh.connect(my_mesh)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.result.add_rigid_body_motion(displacement_field=my_displacement_field,translation_field=my_translation_field,rotation_field=my_rotation_field,center_field=my_center_field,mesh=my_mesh)
>>> # Get output data
>>> result_field = op.outputs.field()
static default_config()

Returns the default config for a given operator. This config can then be changed to the user needs and be used to instantiate the given operator

Parameters
  • name (str) – Name of the operator. For example ‘U’.

  • server (server.DPFServer, optional) – Server with channel connected to the remote or local instance. When None, attempts to use the the global server.

property inputs

Enables to connect inputs to the operator

Returns

inputs

Return type

InputsAddRigidBodyMotion

property outputs

Enables to get outputs of the operator by evaluationg it

Returns

outputs

Return type

OutputsAddRigidBodyMotion

property config

Returns a copy of the current config of the operator. To use the config that you modify, please use operator.config = new_config or create an operator with the new config as a parameter.

Returns

config

Return type

Config

connect(pin, inpt, pin_out=0)

Connect an input on the operator using a pin number.

Parameters

Examples

Compute the minimum of displacement by chaining the 'U' and 'min_max_fc' operators.

>>> from ansys.dpf import core as dpf
>>> from ansys.dpf.core import examples
>>> data_src = dpf.DataSources(examples.multishells_rst)
>>> disp_op = dpf.operators.result.displacement()
>>> disp_op.inputs.data_sources(data_src)
>>> max_fc_op = dpf.operators.min_max.min_max_fc()
>>> max_fc_op.inputs.connect(disp_op.outputs)
>>> max_field = max_fc_op.outputs.field_max()
>>> max_field.data
array([[0.59428386, 0.00201751, 0.0006032 ]])
get_output(pin=0, output_type=None)

Returns the output of the operator on the pin number.

Parameters
  • pin (int, optional) – Number of the output pin.

  • output_type (core.type enum, optional) – The requested type of the output.

run()

Evaluate this operator

class ansys.dpf.core.operators.result.add_rigid_body_motion.InputsAddRigidBodyMotion(op: ansys.dpf.core.dpf_operator.Operator)

Intermediate class used to connect user inputs to add_rigid_body_motion operator

Examples

>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.add_rigid_body_motion()
>>> my_displacement_field = dpf.Field()
>>> op.inputs.displacement_field.connect(my_displacement_field)
>>> my_translation_field = dpf.Field()
>>> op.inputs.translation_field.connect(my_translation_field)
>>> my_rotation_field = dpf.Field()
>>> op.inputs.rotation_field.connect(my_rotation_field)
>>> my_center_field = dpf.Field()
>>> op.inputs.center_field.connect(my_center_field)
>>> my_mesh = dpf.MeshedRegion()
>>> op.inputs.mesh.connect(my_mesh)
property displacement_field

Allows to connect displacement_field input to the operator

Parameters

my_displacement_field (Field,) –

Examples

>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.add_rigid_body_motion()
>>> op.inputs.displacement_field.connect(my_displacement_field)
>>> #or
>>> op.inputs.displacement_field(my_displacement_field)
property translation_field

Allows to connect translation_field input to the operator

Parameters

my_translation_field (Field,) –

Examples

>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.add_rigid_body_motion()
>>> op.inputs.translation_field.connect(my_translation_field)
>>> #or
>>> op.inputs.translation_field(my_translation_field)
property rotation_field

Allows to connect rotation_field input to the operator

Parameters

my_rotation_field (Field,) –

Examples

>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.add_rigid_body_motion()
>>> op.inputs.rotation_field.connect(my_rotation_field)
>>> #or
>>> op.inputs.rotation_field(my_rotation_field)
property center_field

Allows to connect center_field input to the operator

Parameters

my_center_field (Field,) –

Examples

>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.add_rigid_body_motion()
>>> op.inputs.center_field.connect(my_center_field)
>>> #or
>>> op.inputs.center_field(my_center_field)
property mesh

Allows to connect mesh input to the operator

  • pindoc: default is the mesh in the support

Parameters

my_mesh (MeshedRegion,) –

Examples

>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.add_rigid_body_motion()
>>> op.inputs.mesh.connect(my_mesh)
>>> #or
>>> op.inputs.mesh(my_mesh)
connect(inpt)

Allows you to connect any input (an entity or an operator output) to any input pin of this operator.

The matching input type corresponding to the output is looked for.

Parameters

inpt (str, int, double, Field, FieldsContainer, Scoping, DataSources, MeshedRegion, ScopingsContainer, CyclicSupport, ..., Output, Outputs, Operator) – input of the operator

class ansys.dpf.core.operators.result.add_rigid_body_motion.OutputsAddRigidBodyMotion(op: ansys.dpf.core.dpf_operator.Operator)

Intermediate class used to get outputs from add_rigid_body_motion operator .. rubric:: Examples

>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.add_rigid_body_motion()
>>> # Connect inputs : op.inputs. ...
>>> result_field = op.outputs.field()
property field

Allows to get field output of the operator

Returns

my_field

Return type

Field,

Examples

>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.result.add_rigid_body_motion()
>>> # Connect inputs : op.inputs. ...
>>> result_field = op.outputs.field()