ansys.dpf.core.operators.math.fft_approx#

class ansys.dpf.core.operators.math.fft_approx(time_scoping=None, mesh_scoping=None, entity_to_fit=None, component_number=None, first_derivative=None, second_derivative=None, fit_data=None, cutoff_fr=None, config=None, server=None)#

Bases: ansys.dpf.core.dpf_operator.Operator

Computes the fitting curve using FFT filtering and cubic fitting in space (node i: x=time, y=data), with the possibility to compute the first and the second derivatives of the curve.

Parameters:
  • time_scoping (Scoping, optional) – A time scoping to rescope / split the fields container given as input.

  • mesh_scoping (Scoping or ScopingsContainer, optional) – A space (mesh entities) scoping (or scopings container) to rescope / split the fields container given as input.

  • entity_to_fit (FieldsContainer) – Data changing in time to be fitted.

  • component_number (int) – Component number as an integer, for example ‘0’ for X-displacement, ‘1’ for Y-displacement, and so on.

  • first_derivative (bool) – Calculate the first derivative (bool). The default is false.

  • second_derivative (bool) – Calculate the second derivative (bool). The default is false.

  • fit_data (bool) – Calculate the fitted values (bool). The default is false

  • cutoff_fr (float or int, optional) – Cutoff frequency.

Returns:

  • fitted_entity_y (FieldsContainer) – The fitted entity is fitted using FFT along the space scoping (node i: x=time, y=data). Fitted Y is expected to be close to the input data.

  • first_der_dy (FieldsContainer) – The first derivative (dY) from the fitted Y.

  • second_der_d2y (FieldsContainer) – The second derivative (d2Y) from the fitted Y.

Examples

>>> from ansys.dpf import core as dpf
>>> # Instantiate operator
>>> op = dpf.operators.math.fft_approx()
>>> # Make input connections
>>> my_time_scoping = dpf.Scoping()
>>> op.inputs.time_scoping.connect(my_time_scoping)
>>> my_mesh_scoping = dpf.Scoping()
>>> op.inputs.mesh_scoping.connect(my_mesh_scoping)
>>> my_entity_to_fit = dpf.FieldsContainer()
>>> op.inputs.entity_to_fit.connect(my_entity_to_fit)
>>> my_component_number = int()
>>> op.inputs.component_number.connect(my_component_number)
>>> my_first_derivative = bool()
>>> op.inputs.first_derivative.connect(my_first_derivative)
>>> my_second_derivative = bool()
>>> op.inputs.second_derivative.connect(my_second_derivative)
>>> my_fit_data = bool()
>>> op.inputs.fit_data.connect(my_fit_data)
>>> my_cutoff_fr = float()
>>> op.inputs.cutoff_fr.connect(my_cutoff_fr)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.math.fft_approx(
...     time_scoping=my_time_scoping,
...     mesh_scoping=my_mesh_scoping,
...     entity_to_fit=my_entity_to_fit,
...     component_number=my_component_number,
...     first_derivative=my_first_derivative,
...     second_derivative=my_second_derivative,
...     fit_data=my_fit_data,
...     cutoff_fr=my_cutoff_fr,
... )
>>> # Get output data
>>> result_fitted_entity_y = op.outputs.fitted_entity_y()
>>> result_first_der_dy = op.outputs.first_der_dy()
>>> result_second_der_d2y = op.outputs.second_der_d2y()
_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: InputsFftApprox#

Enables to connect inputs to the operator

Returns:

An instance of InputsFftApprox.

Return type:

inputs

property outputs: OutputsFftApprox#

Enables to get outputs of the operator by evaluating it

Returns:

An instance of OutputsFftApprox.

Return type:

outputs