ansys.dpf.core.operators.logic.split_streams#
- class ansys.dpf.core.operators.logic.split_streams(streams=None, output_count=None, config=None, server=None)#
Bases:
ansys.dpf.core.dpf_operator.Operator
Splits a Streams into multiple coherent streams, actual number of outputs is always less or equal to the given desired number of ouputs.
- Parameters:
streams (StreamsContainer) – Streams to split.
output_count (int) – Number of desired outputs.
- Returns:
output_count (int) – Actual number of outputs.
outputs1 (StreamsContainer) – Streams outputs.
outputs2 (StreamsContainer) – Streams outputs.
Examples
>>> from ansys.dpf import core as dpf
>>> # Instantiate operator >>> op = dpf.operators.logic.split_streams()
>>> # Make input connections >>> my_streams = dpf.StreamsContainer() >>> op.inputs.streams.connect(my_streams) >>> my_output_count = int() >>> op.inputs.output_count.connect(my_output_count)
>>> # Instantiate operator and connect inputs in one line >>> op = dpf.operators.logic.split_streams( ... streams=my_streams, ... output_count=my_output_count, ... )
>>> # Get output data >>> result_output_count = op.outputs.output_count() >>> result_outputs1 = op.outputs.outputs1() >>> result_outputs2 = op.outputs.outputs2()
- _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: InputsSplitStreams#
Enables to connect inputs to the operator
- Returns:
An instance of InputsSplitStreams.
- Return type:
inputs
- property outputs: OutputsSplitStreams#
Enables to get outputs of the operator by evaluating it
- Returns:
An instance of OutputsSplitStreams.
- Return type:
outputs