ansys.dpf.core.operators.compression.apply_zfp#

class ansys.dpf.core.operators.compression.apply_zfp(dataIn=None, mode=None, mode_parameter=None, dim=None, order=None, double_absthreshold=None, double_relthreshold=None, config=None, server=None)#

Bases: ansys.dpf.core.dpf_operator.Operator

Compressing input data using one of zfp compression algorithm modes.

Parameters:
  • dataIn (Field or FieldsContainer) – field or fields container to be compressed

  • mode (str or Char) – zfp mode: fixed-rate (‘r’), fixed-precision (‘p’), fixed-accuracy (‘a’)

  • mode_parameter (int or float) – mode-corresponding parameter: rate (double) / precision (int) / accuracy (double)

  • dim (int, optional) – dimension (1D/2D/3D) for data organization before the compression (int; default: 2)

  • order (int, optional) – xyz dimensions order, where x (row) corresponds to number of elementary data, y (col) - number of time steps, z - number of components (applicable only for 3d data) : 0=xyz, 1=yxz (int; default: 0)

  • double_absthreshold (float, optional) – Double positive small value. All the values smaller than max(small value, max(vi) * relative threshold) are considered as zero values, (default value: 1.0e-18).

  • double_relthreshold (float, optional) – Double relative threshold. Values smaller than (v1 - v2) < max(small value, v1 * relativeTol) are considered identical (default value: 1.0e-10).

Returns:

  • compress_speed (float) – the output entity is a double, containing compression speed of the input data: for ElementalNodal location - [elements/sec], for Nodal location - [nodes/sec]

  • compress_ratio (float) – the output entity is a double, containing compression rate = initial/compressed

  • dataOut (CustomTypeFieldsContainer) – the output entity is a ‘custom type field container’; each output field containing compressed results corresponding to one component data (ie. input vector field/fc contains 3 components will give 3 output fields), this is not the case when input pin3 is set to 3, all components will be compressed into one field.

Examples

>>> from ansys.dpf import core as dpf
>>> # Instantiate operator
>>> op = dpf.operators.compression.apply_zfp()
>>> # Make input connections
>>> my_dataIn = dpf.Field()
>>> op.inputs.dataIn.connect(my_dataIn)
>>> my_mode = str()
>>> op.inputs.mode.connect(my_mode)
>>> my_mode_parameter = int()
>>> op.inputs.mode_parameter.connect(my_mode_parameter)
>>> my_dim = int()
>>> op.inputs.dim.connect(my_dim)
>>> my_order = int()
>>> op.inputs.order.connect(my_order)
>>> my_double_absthreshold = float()
>>> op.inputs.double_absthreshold.connect(my_double_absthreshold)
>>> my_double_relthreshold = float()
>>> op.inputs.double_relthreshold.connect(my_double_relthreshold)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.compression.apply_zfp(
...     dataIn=my_dataIn,
...     mode=my_mode,
...     mode_parameter=my_mode_parameter,
...     dim=my_dim,
...     order=my_order,
...     double_absthreshold=my_double_absthreshold,
...     double_relthreshold=my_double_relthreshold,
... )
>>> # Get output data
>>> result_compress_speed = op.outputs.compress_speed()
>>> result_compress_ratio = op.outputs.compress_ratio()
>>> result_dataOut = op.outputs.dataOut()
_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: InputsApplyZfp#

Enables to connect inputs to the operator

Returns:

An instance of InputsApplyZfp.

Return type:

inputs

property outputs: OutputsApplyZfp#

Enables to get outputs of the operator by evaluating it

Returns:

An instance of OutputsApplyZfp.

Return type:

outputs