ansys.dpf.core.operators.result.compute_stress#
- class ansys.dpf.core.operators.result.compute_stress(scoping=None, streams_container=None, data_sources=None, requested_location=None, strain=None, config=None, server=None)#
Bases:
ansys.dpf.core.dpf_operator.Operator
Computes the stress from an elastic strain field. compute_total_strain limitations are applicable for stress computation
- Parameters:
scoping (Scoping, optional) – The element scoping on which the result is computed.
streams_container (StreamsContainer, optional) – Needed to get mesh and material ids. Optional if a data_sources have been connected.
data_sources (DataSources, optional) – Needed to get mesh and material ids. Optional if a streams_container have been connected.
requested_location (str, optional) – Average the Elemental Nodal result to the requested location.
strain (FieldsContainer or Field) – Field/or fields container containing only the elastic strain field (element nodal).
- Returns:
fields_container – The computed result fields container (elemental nodal).
- Return type:
Examples
>>> from ansys.dpf import core as dpf
>>> # Instantiate operator >>> op = dpf.operators.result.compute_stress()
>>> # Make input connections >>> my_scoping = dpf.Scoping() >>> op.inputs.scoping.connect(my_scoping) >>> my_streams_container = dpf.StreamsContainer() >>> op.inputs.streams_container.connect(my_streams_container) >>> my_data_sources = dpf.DataSources() >>> op.inputs.data_sources.connect(my_data_sources) >>> my_requested_location = str() >>> op.inputs.requested_location.connect(my_requested_location) >>> my_strain = dpf.FieldsContainer() >>> op.inputs.strain.connect(my_strain)
>>> # Instantiate operator and connect inputs in one line >>> op = dpf.operators.result.compute_stress( ... scoping=my_scoping, ... streams_container=my_streams_container, ... data_sources=my_data_sources, ... requested_location=my_requested_location, ... strain=my_strain, ... )
>>> # Get output data >>> result_fields_container = op.outputs.fields_container()
- _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: InputsComputeStress#
Enables to connect inputs to the operator
- Returns:
An instance of InputsComputeStress.
- Return type:
inputs
- property outputs: OutputsComputeStress#
Enables to get outputs of the operator by evaluating it
- Returns:
An instance of OutputsComputeStress.
- Return type:
outputs