compression:apply zfp
Last update: 31.07.2026Version: 0.0.0
Description
Compressing input data using one of zfp compression algorithm modes.
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 | dataIn | Required | field, fields_container |
| 1 | mode | Required | string, char |
| 2 | mode_parameter | Required | int32, double |
| 3 | dim | int32 |
|
| 4 | order | int32 |
|
| 5 | double_absthreshold | double |
|
| 6 | double_relthreshold | double |
dataIn (Pin 0)
- Required: Yes
- Expected type(s):
field,fields_container
field or fields container to be compressed
mode (Pin 1)
zfp mode: fixed-rate ('r'), fixed-precision ('p'), fixed-accuracy ('a')
mode_parameter (Pin 2)
mode-corresponding parameter: rate (double) / precision (int) / accuracy (double)
dim (Pin 3)
- Required: No
- Expected type(s):
int32
dimension (1D/2D/3D) for data organization before the compression (int; default: 2)
order (Pin 4)
- Required: No
- Expected type(s):
int32
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 (Pin 5)
- Required: No
- Expected type(s):
double
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 (Pin 6)
- Required: No
- Expected type(s):
double
Double relative threshold. Values smaller than (v1 - v2) < max(small value, v1 * relativeTol) are considered identical (default value: 1.0e-10).
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 | compress_speed | double |
| 1 | compress_ratio | double |
| 2 | dataOut | custom_type_fields_container |
compress_speed (Pin 0)
- Expected type(s):
double
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 (Pin 1)
- Expected type(s):
double
the output entity is a double, containing compression rate = initial/compressed
dataOut (Pin 2)
- Expected type(s):
custom_type_fields_container
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.
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.
num_threads
- Expected type(s):
int32 - Default value: 0
Number of threads to use to run in parallel
run_in_parallel
- Expected type(s):
bool - Default value: true
Loops are allowed to run in parallel if the value of this config is set to true.
use_cuda
- Expected type(s):
bool - Default value: false
If this option is set to true, zfp fixed-rate parallel (de)compression will use CUDA.
Scripting
This operator can be accessed through scripting interfaces using these identifiers.
Category: compression
Plugin: core
Scripting name: apply_zfp
Full name: compression.apply_zfp
Internal name: zfp
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("zfp"); // operator instantiation
op.connect(0, my_dataIn);
op.connect(1, my_mode);
op.connect(2, my_mode_parameter);
op.connect(3, my_dim);
op.connect(4, my_order);
op.connect(5, my_double_absthreshold);
op.connect(6, my_double_relthreshold);
double my_compress_speed = op.getOutput<double>(0);
double my_compress_ratio = op.getOutput<double>(1);
ansys::dpf::CustomTypeFieldsContainer my_dataOut = op.getOutput<ansys::dpf::CustomTypeFieldsContainer>(2);
CPython
import ansys.dpf.core as dpf
op = dpf.operators.compression.apply_zfp() # operator instantiation
op.inputs.dataIn.connect(my_dataIn)
op.inputs.mode.connect(my_mode)
op.inputs.mode_parameter.connect(my_mode_parameter)
op.inputs.dim.connect(my_dim)
op.inputs.order.connect(my_order)
op.inputs.double_absthreshold.connect(my_double_absthreshold)
op.inputs.double_relthreshold.connect(my_double_relthreshold)
my_compress_speed = op.outputs.compress_speed()
my_compress_ratio = op.outputs.compress_ratio()
my_dataOut = op.outputs.dataOut()
IPython
import mech_dpf
import Ans.DataProcessing as dpf
op = dpf.operators.compression.apply_zfp() # operator instantiation
op.inputs.dataIn.Connect(my_dataIn)
op.inputs.mode.Connect(my_mode)
op.inputs.mode_parameter.Connect(my_mode_parameter)
op.inputs.dim.Connect(my_dim)
op.inputs.order.Connect(my_order)
op.inputs.double_absthreshold.Connect(my_double_absthreshold)
op.inputs.double_relthreshold.Connect(my_double_relthreshold)
my_compress_speed = op.outputs.compress_speed.GetData()
my_compress_ratio = op.outputs.compress_ratio.GetData()
my_dataOut = op.outputs.dataOut.GetData()
Changelog
- Version 0.0.0: Initial release.