ansys.dpf.core.operators.serialization.deserializer#

class ansys.dpf.core.operators.serialization.deserializer(stream_type=None, file_path=None, config=None, server=None)#

Bases: ansys.dpf.core.dpf_operator.Operator

Takes a file generated by the serializer and deserializes it into DPF’s entities.

Parameters:
  • stream_type (int) – 0 for ASCII (default), and 1 for binary

  • file_path (str) – file path

Returns:

  • any_output1 (Any) – number and types of outputs corresponding of the inputs used in the serialization

  • any_output2 (Any) – number and types of outputs corresponding of the inputs used in the serialization

Examples

>>> from ansys.dpf import core as dpf
>>> # Instantiate operator
>>> op = dpf.operators.serialization.deserializer()
>>> # Make input connections
>>> my_stream_type = int()
>>> op.inputs.stream_type.connect(my_stream_type)
>>> my_file_path = str()
>>> op.inputs.file_path.connect(my_file_path)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.serialization.deserializer(
...     stream_type=my_stream_type,
...     file_path=my_file_path,
... )
>>> # Get output data
>>> result_any_output1 = op.outputs.any_output1()
>>> result_any_output2 = op.outputs.any_output2()
_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: InputsDeserializer#

Enables to connect inputs to the operator

Returns:

An instance of InputsDeserializer.

Return type:

inputs

property outputs: OutputsDeserializer#

Enables to get outputs of the operator by evaluating it

Returns:

An instance of OutputsDeserializer.

Return type:

outputs