diff --git a/examples/00-Overview/02-get_data_from_static_simulation.py b/examples/00-Overview/02-get_data_from_static_simulation.py index bd8cea123..5c1ae02a2 100644 --- a/examples/00-Overview/02-get_data_from_static_simulation.py +++ b/examples/00-Overview/02-get_data_from_static_simulation.py @@ -33,7 +33,7 @@ # Get and plot stresses # --------------------- # Request "XY" stress component averaged on nodes -stress = simulation.stress_nodal(component_ids="XY") +stress = simulation.stress_nodal(components="XY") ############################################################################### # Print information @@ -47,7 +47,7 @@ # Get stresses at only 5 nodes # ------------------------------ # Request stress only at the first 5 nodes using their IDs. -stress_nodes = simulation.stress_nodal(nodes=range(1, 6)) +stress_nodes = simulation.stress_nodal(node_ids=range(1, 6)) ############################################################################### # Print information @@ -63,7 +63,7 @@ # Get the name of the first named selection in the simulation ns = simulation.named_selections[0] # Request nodal stresses for this named selection -stress_named_sel = simulation.stress_nodal(named_selection=ns) +stress_named_sel = simulation.stress_nodal(named_selections=ns) ############################################################################### # Print information @@ -77,7 +77,7 @@ # Get stresses in a few elements # ------------------------------ # Request stress only for a few elements selected by their ID -stress_elements = simulation.stress_nodal(elements=[1, 2, 3]) +stress_elements = simulation.stress_nodal(element_ids=[1, 2, 3]) ############################################################################### # Print information diff --git a/src/ansys/dpf/post/common.py b/src/ansys/dpf/post/common.py index 9f9b97ee6..5c581c995 100644 --- a/src/ansys/dpf/post/common.py +++ b/src/ansys/dpf/post/common.py @@ -3,9 +3,9 @@ from ansys.dpf.post.simulation import ( HarmonicMechanicalSimulation, ModalMechanicalSimulation, - StaticMechanicalSimulation, - TransientMechanicalSimulation, ) +from ansys.dpf.post.static_mechanical_simulation import StaticMechanicalSimulation +from ansys.dpf.post.transient_mechanical_simulation import TransientMechanicalSimulation # class ElShapes(Enum): # """Class with Enum inheritance. This class must be used to diff --git a/src/ansys/dpf/post/data_object.py b/src/ansys/dpf/post/data_object.py index 2f548b915..ddcf542b9 100644 --- a/src/ansys/dpf/post/data_object.py +++ b/src/ansys/dpf/post/data_object.py @@ -69,7 +69,7 @@ def as_data_frame(self, columns=None, **kwargs): >>> from ansys.dpf.post import examples >>> simulation = post.load_simulation(examples.multishells_rst) >>> # Export the displacements vector field at step 1 as a DataFrame - >>> displacement = simulation.displacement(load_steps=[1], nodes=[1, 2, 3]) + >>> displacement = simulation.displacement(load_steps=[1], node_ids=[1, 2, 3]) >>> df = displacement.as_data_frame() >>> print(df) UX UY UZ @@ -113,7 +113,7 @@ def as_array(self): >>> from ansys.dpf.post import examples >>> simulation = post.load_simulation(examples.multishells_rst) >>> # Export the displacements vector field at step 1 as a DataFrame - >>> displacement = simulation.displacement(load_steps=[1], nodes=[1, 2, 3]) + >>> displacement = simulation.displacement(load_steps=[1], node_ids=[1, 2, 3]) >>> arr = displacement.as_array() >>> print(arr) [[ 0.39831985 -13.79737819 -0.16376683] diff --git a/src/ansys/dpf/post/simulation.py b/src/ansys/dpf/post/simulation.py index 785d39ce2..4fff3eb1b 100644 --- a/src/ansys/dpf/post/simulation.py +++ b/src/ansys/dpf/post/simulation.py @@ -2,14 +2,13 @@ from abc import ABC, abstractmethod from enum import Enum import re -from typing import List, Union -import warnings +from typing import List, Tuple, Union from ansys.dpf.core import DataSources, Model from ansys.dpf.core.plotter import DpfPlotter +import numpy as np from ansys.dpf import core -from ansys.dpf.post.data_object import DataObject from ansys.dpf.post.mesh import Mesh from ansys.dpf.post.selection import Selection @@ -55,6 +54,11 @@ def __init__(self, data_sources: DataSources, model: Model): self._active_selection = None self._named_selections = None self._mesh = None + self._units = { + "time/frequency": self.time_freq_support.time_frequencies.unit, + "distance": self._model.metadata.meshed_region.unit, + } + self._time_freq_precision = None @property def results(self) -> List[str]: @@ -264,11 +268,26 @@ def _time_frequencies(self): """Description of the temporal/frequency analysis of the model.""" return self._model.metadata.time_freq_support + @property + def _get_time_freq_precision(self): + """Computes a precision for times/frequencies requests based on the underlying support.""" + if self._time_freq_precision is None: + available_values = self.time_freq_support.time_frequencies.data + diff = np.diff(available_values, prepend=available_values[0] - 1.0) + minimum = np.min(diff) + self._time_freq_precision = minimum / 20.0 + return self._time_freq_precision + @property def time_freq_support(self): """Description of the temporal/frequency analysis of the model.""" return self._time_frequencies + @property + def units(self): + """Returns the current time/frequency and distance units used.""" + return self._units + def __str__(self): """Get the string representation of this class.""" txt = ( @@ -353,16 +372,17 @@ def _build_components_from_principal(self, base_name, components): return out, columns @abstractmethod - def _build_time_freq_scoping(self) -> core.time_freq_scoping_factory.Scoping: - """Generate a time_freq_scoping from input arguments.""" - pass - - @abstractmethod - def _build_mesh_scoping(self) -> core.mesh_scoping_factory.Scoping: + def _build_mesh_scoping(self) -> Union[core.Scoping, core.outputs.Output, None]: """Generate a mesh_scoping from input arguments.""" pass - def _build_result_operator(self, name, time_scoping, mesh_scoping, location): + def _build_result_operator( + self, + name: str, + time_scoping: core.Scoping, + mesh_scoping: Union[core.Scoping, core.outputs.Output], + location: core.locations, + ) -> core.Operator: op = self._model.operator(name=name) # Set the time_scoping if necessary if time_scoping: @@ -389,3728 +409,206 @@ def __init__(self, data_sources: core.DataSources, model: core.Model): def _build_mesh_scoping( self, selection=None, - nodes=None, - elements=None, - named_selection=None, + named_selections=None, + element_ids=None, + node_ids=None, location=core.locations.nodal, - ) -> Union[core.mesh_scoping_factory.Scoping, None]: - if (nodes is not None or elements is not None) and named_selection is not None: - raise ValueError( - "nodes/elements and named_selection are mutually exclusive" - ) + ) -> Union[core.Scoping, core.outputs.Output, None]: + """Generate a mesh_scoping from input arguments. + + Only one input is used, by order of priority: selection, named_selection, + element_ids, node_ids. + + Args: + selection: + Selection object to use. + named_selections: + Named selection to use. + element_ids: + Element IDs to use. + node_ids: + Node IDs to use. + location: + Requested location for the returned Scoping. - if selection is not None and ( - nodes is not None or named_selection is not None or elements is not None - ): + Returns + ------- + Returns a mesh Scoping or an operator Output giving a mesh Scoping. + """ + tot = ( + (node_ids is not None) + + (element_ids is not None) + + (named_selections is not None) + + (selection is not None) + ) + if tot > 1: raise ValueError( - "selection and nodes/elements/named_selection are mutually exclusive" + "Arguments selection, named_selections, element_ids, " + "and node_ids are mutually exclusive" ) + # Build the mesh_scoping mesh_scoping = None if selection: - mesh_scoping = selection.mesh_scoping + mesh_scoping = selection.mesh_scoping_output + + if named_selections: + if type(named_selections) == str: + mesh_scoping_op = self._model.operator("scoping_provider_by_ns") + mesh_scoping_op.connect(1, named_selections) + mesh_scoping = mesh_scoping_op.outputs.mesh_scoping + elif type(named_selections) == list: + merge_scopings_op = self._model.operator(name="merge::scoping") + for pin, named_selection in enumerate(named_selections): + mesh_scoping_on_ns_op = self._model.operator( + name="scoping_provider_by_ns" + ) + mesh_scoping_on_ns_op.connect(0, location) + mesh_scoping_on_ns_op.connect(1, named_selection) + merge_scopings_op.connect( + pin, mesh_scoping_on_ns_op.outputs.mesh_scoping + ) + mesh_scoping = merge_scopings_op.outputs.merged_scoping - if named_selection: - mesh_scoping = core.mesh_scoping_factory.named_selection_scoping( - named_selection, server=self._model._server, model=self._model + elif element_ids: + mesh_scoping = core.mesh_scoping_factory.elemental_scoping( + element_ids=element_ids, server=self._model._server ) - - if nodes: + # Transpose location if necessary + if location == core.locations.nodal: + transpose_op = self._model.operator(name="transpose_scoping") + transpose_op.connect(0, mesh_scoping) + transpose_op.connect(1, self.mesh._meshed_region) + transpose_op.connect(2, 0) + mesh_scoping = transpose_op.outputs.mesh_scoping_as_scoping + + elif node_ids: mesh_scoping = core.mesh_scoping_factory.nodal_scoping( - nodes, server=self._model._server - ) - - if elements: - mesh_scoping = core.mesh_scoping_factory.elemental_scoping( - element_ids=elements, server=self._model._server + node_ids, server=self._model._server ) - if mesh_scoping is None: - return mesh_scoping - - # Transpose location if necessary - if ( - location == core.locations.nodal - and mesh_scoping.location != core.locations.nodal - ) or ( - location == core.locations.elemental - and mesh_scoping.location != core.locations.elemental - ): - mesh_scoping = core.operators.scoping.transpose( - mesh_scoping=mesh_scoping, - meshed_region=self.mesh._meshed_region, - inclusive=1, - ).eval() - return mesh_scoping - -class StaticMechanicalSimulation(MechanicalSimulation): - """Provides methods for mechanical static simulations.""" - def _build_time_freq_scoping( self, selection: Union[Selection, None], - times: Union[float, List[float], None], set_ids: Union[int, List[int], None], - load_steps: Union[int, List[int], None], - sub_steps: Union[int, List[int], None], + times: Union[float, List[float], None], + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + all_sets: bool = False, ) -> core.time_freq_scoping_factory.Scoping: - """Generate a time_freq_scoping from input arguments.""" - # create from selection in priority + """Generate a time_freq_scoping from input arguments. + + Only one input is used, by order of priority: + all_sets, selection, set_ids, times, load_steps. + + Args: + selection: + Selection to use (used in priority). + set_ids: + List of set IDs to use, if no selection is defined. + times: + Time values to use, if no selection nor set_ids are defined. + load_steps: + Load step IDs (and sub-step if tuple) to use, if no other is defined. + all_sets: + Whether to force extraction of all sets. + + Returns + ------- + A Scoping corresponding to the requested input, with time location. + """ + tot = ( + (set_ids is not None) + + (all_sets is True) + + (times is not None) + + (load_steps is not None) + + (selection is not None) + ) + if tot > 1: + raise ValueError( + "Arguments all_sets, selection, set_ids, times, " + "and load_steps are mutually exclusive." + ) + if all_sets: + return core.time_freq_scoping_factory.scoping_on_all_time_freqs(self._model) + # create from selection if selection: return selection.time_freq_selection._evaluate_on(simulation=self) # else from set_ids - if set_ids: + if set_ids is not None: if isinstance(set_ids, int): set_ids = [set_ids] return core.time_freq_scoping_factory.scoping_by_sets( cumulative_sets=set_ids, server=self._model._server ) # else from times - if times: - if isinstance(times, float): + if times is not None: + # Check input + if isinstance(times, list): + if any([not (type(t) in [float, int]) for t in times]): + raise ValueError("Argument times must contain numeric values only.") + elif isinstance(times, float) or isinstance(times, int): times = [times] - raise NotImplementedError - # else from sub_steps and load_steps - if sub_steps: - if isinstance(sub_steps, int): - sub_steps = [sub_steps] - if isinstance(load_steps, int): - load_steps = [load_steps] - elif ( - not load_steps - or (isinstance(load_steps, list) and len(load_steps)) != 1 - ): - raise ValueError( - "Argument sub_steps requires argument load_steps to have one value." - ) - # Translate to cumulative indices (set IDs) - set_ids = [] - for sub_step in sub_steps: - set_id = ( + else: + raise TypeError("Argument times must be a number or a list of numbers.") + + # Get the set_ids for available time values matching the requested time values. + available_times = self.time_freq_support.time_frequencies.data + precision = self._get_time_freq_precision + available_times_to_extract_set_ids = [] + last_extracted_index = -1 + len_available = len(available_times) + for t in times: + found = False + i = last_extracted_index + 1 + while not found and i < len_available: + if abs(float(t) - available_times[i]) < precision: + last_extracted_index = i + available_times_to_extract_set_ids.append(i + 1) + found = True + i += 1 + if not found: + raise ValueError( + f"Could not find time={t}{self.units['time/frequency']} " + f"in the simulation." + ) + return core.time_freq_scoping_factory.scoping_by_sets( + cumulative_sets=available_times_to_extract_set_ids, + server=self._model._server, + ) + + # else from load_steps + if load_steps is not None: + # If load_steps and sub_steps + if len(load_steps) == 2: + # Translate to cumulative indices (set IDs) + set_ids = [] + sub_steps = load_steps[1] + if not isinstance(sub_steps, list): + sub_steps = [sub_steps] + set_id_0 = ( self._model.metadata.time_freq_support.get_cumulative_index( - step=load_steps[0] - 1, substep=sub_step + step=load_steps[0] - 1, substep=sub_steps[0] ) + 2 ) - set_ids.append(set_id) - return core.time_freq_scoping_factory.scoping_by_sets( - cumulative_sets=set_ids, server=self._model._server - ) - # else load_steps only - if load_steps: + set_ids.extend([set_id_0 + i for i in range(len(sub_steps))]) + return core.time_freq_scoping_factory.scoping_by_sets( + cumulative_sets=set_ids, server=self._model._server + ) if isinstance(load_steps, int): load_steps = [load_steps] return core.time_freq_scoping_factory.scoping_by_load_steps( load_steps=load_steps, server=self._model._server ) - # Otherwise, no argument was given, create a time_freq_scoping of the whole results - return core.time_freq_scoping_factory.scoping_on_all_time_freqs(self._model) - - def _get_result( - self, - base_name: str, - location: str, - category: ResultCategory, - components: Union[str, List[str], int, List[int], None] = None, - norm: bool = False, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract stress results from the simulation. - - Args: - base_name: - Base name for the requested result. - location: - Location requested. - category: - Type of result requested. See the :class:`ResultCategory` class. - components: - Components to get results for. - norm: - Whether to return the norm of the results. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - # Build the targeted time scoping - time_scoping = self._build_time_freq_scoping( - selection, times, set_ids, load_steps, sub_steps - ) - - # Build the targeted mesh scoping - mesh_scoping = self._build_mesh_scoping( - selection, - nodes, - elements, - named_selection, - location=location, - ) - - # Build the list of requested results - if category in [ResultCategory.scalar, ResultCategory.equivalent]: - # A scalar or equivalent result has no components - to_extract = None - columns = [base_name] - elif category in [ResultCategory.vector, ResultCategory.matrix]: - # A matrix or vector result can have components selected - to_extract, columns = self._build_components_from_components( - base_name=base_name, category=category, components=components - ) - elif category == ResultCategory.principal: - # A principal type of result can have components selected - to_extract, columns = self._build_components_from_principal( - base_name=base_name, components=components - ) - else: - raise ValueError(f"'{category}' is not a valid category value.") - - # Initialize a workflow - wf = core.Workflow(server=self._model._server) - wf.progress_bar = False - - # Instantiate the main result operator - result_op = self._build_result_operator( - name=base_name, - time_scoping=time_scoping, - mesh_scoping=mesh_scoping, - location=location, - ) - # Its output is selected as future workflow output for now - out = result_op.outputs.fields_container - - # Add a step to compute principal invariants if result is principal - if category == ResultCategory.principal: - # Instantiate the required operator - principal_op = self._model.operator(name="eig_values_fc") - principal_op.connect(0, out) - wf.add_operator(operator=principal_op) - # Set as future output of the workflow - out = principal_op.outputs.fields_container - - # Add a step to compute equivalent if result is equivalent - elif category == ResultCategory.equivalent: - # If a stress result, use one operator - if base_name[0] == "S": - equivalent_op = self._model.operator(name="segalmaneqv_fc") - # If a strain result, use another - elif base_name[0] == "E": - equivalent_op = self._model.operator(name="eqv_fc") - # Throw otherwise - else: - raise ValueError( - f"Category {ResultCategory.equivalent} " - "is only available for stress or strain results." - ) - equivalent_op.connect(0, out) - wf.add_operator(operator=equivalent_op) - # Set as future output of the workflow - out = equivalent_op.outputs.fields_container - - # Add an optional component selection step if result is vector, matrix, or principal - if ( - category - in [ResultCategory.vector, ResultCategory.matrix, ResultCategory.principal] - ) and (to_extract is not None): - # Instantiate a component selector operator - extract_op = self._model.operator(name="component_selector_fc") - # Feed it the current workflow output - extract_op.connect(0, out) - # Feed it the requested components - extract_op.connect(1, to_extract) - wf.add_operator(operator=extract_op) - # Set as future output of the workflow - out = extract_op.outputs.fields_container - - # Add an optional norm operation if requested - if norm: - norm_op = self._model.operator(name="norm_fc") - norm_op.connect(0, out) - wf.add_operator(operator=norm_op) - out = norm_op.outputs.fields_container - - # Set the workflow output - wf.set_output_name("out", out) - # Evaluate the workflow - fc = wf.get_output("out", core.types.fields_container) - - # Test for empty results - if (len(fc) == 0) or all([len(f) == 0 for f in fc]): - warnings.warn( - message=f"Returned Dataframe with columns {columns} is empty.", - category=UserWarning, - ) - # Return the result wrapped in a DPF_Dataframe - return DataObject( - fields_container=fc, - columns=columns, - mesh_scoping=mesh_scoping, - ) - - def displacement( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - norm: bool = False, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract displacement results from the simulation. - - Args: - component_ids: - Components to get results for. - norm: - Whether to return the norm of the results. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - Times to get results for. - set_ids: - Sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - Load steps to get results for. - sub_steps: - Sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements whose nodes to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="U", - location=core.locations.nodal, - category=ResultCategory.vector, - components=component_ids, - norm=norm, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def stress( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal stress results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="S", - location=core.locations.elemental_nodal, - category=ResultCategory.matrix, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def stress_elemental( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental stress results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="S", - location=core.locations.elemental, - category=ResultCategory.matrix, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def stress_nodal( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal stress results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="S", - location=core.locations.nodal, - category=ResultCategory.matrix, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def stress_principal( - self, - component_ids: Union[List[str], List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[List[float], None] = None, - set_ids: Union[List[int], None] = None, - load_steps: Union[List[int], None] = None, - sub_steps: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal principal stress results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="S", - location=core.locations.elemental_nodal, - category=ResultCategory.principal, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def stress_principal_elemental( - self, - component_ids: Union[List[str], List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[List[float], None] = None, - set_ids: Union[List[int], None] = None, - load_steps: Union[List[int], None] = None, - sub_steps: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental principal stress results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="S", - location=core.locations.elemental, - category=ResultCategory.principal, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def stress_principal_nodal( - self, - component_ids: Union[List[str], List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[List[float], None] = None, - set_ids: Union[List[int], None] = None, - load_steps: Union[List[int], None] = None, - sub_steps: Union[List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal principal stress results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="S", - location=core.locations.nodal, - category=ResultCategory.principal, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def stress_eqv_von_mises( - self, - selection: Union[Selection, None] = None, - times: Union[List[float], None] = None, - set_ids: Union[List[int], None] = None, - load_steps: Union[List[int], None] = None, - sub_steps: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal equivalent Von Mises stress results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="S", - location=core.locations.elemental_nodal, - category=ResultCategory.equivalent, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def stress_eqv_von_mises_elemental( - self, - selection: Union[Selection, None] = None, - times: Union[List[float], None] = None, - set_ids: Union[List[int], None] = None, - load_steps: Union[List[int], None] = None, - sub_steps: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental equivalent Von Mises stress results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="S", - location=core.locations.elemental, - category=ResultCategory.equivalent, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def stress_eqv_von_mises_nodal( - self, - selection: Union[Selection, None] = None, - times: Union[List[float], None] = None, - set_ids: Union[List[int], None] = None, - load_steps: Union[List[int], None] = None, - sub_steps: Union[List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal equivalent Von Mises stress results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="S", - location=core.locations.nodal, - category=ResultCategory.equivalent, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def elastic_strain( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract stress results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPEL", - location=core.locations.elemental_nodal, - category=ResultCategory.matrix, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, + # Otherwise, no argument was given, create a time_freq_scoping of the last set only + return core.time_freq_scoping_factory.scoping_by_set( + cumulative_set=self.time_freq_support.n_sets, server=self._model._server ) - def elastic_strain_nodal( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract stress results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPEL", - location=core.locations.nodal, - category=ResultCategory.matrix, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def elastic_strain_elemental( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract stress results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPEL", - location=core.locations.elemental, - category=ResultCategory.matrix, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def elastic_strain_principal( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal principal elastic strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPEL", - location=core.locations.elemental_nodal, - category=ResultCategory.principal, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def elastic_strain_principal_nodal( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal principal elastic strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPEL", - location=core.locations.nodal, - category=ResultCategory.principal, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def elastic_strain_principal_elemental( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental principal elastic strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPEL", - location=core.locations.elemental, - category=ResultCategory.principal, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def elastic_strain_eqv( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal equivalent elastic strain results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPEL", - location=core.locations.elemental_nodal, - category=ResultCategory.equivalent, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def elastic_strain_equivalent_nodal( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal equivalent elastic strain results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPEL", - location=core.locations.nodal, - category=ResultCategory.equivalent, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def elastic_strain_equivalent_elemental( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental equivalent elastic strain results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPEL", - location=core.locations.elemental, - category=ResultCategory.equivalent, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def plastic_state_variable( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal plastic state variable results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENL_PSV", - location=core.locations.elemental_nodal, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def plastic_state_variable_elemental( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental plastic state variable results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENL_PSV", - location=core.locations.elemental, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def plastic_state_variable_nodal( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal plastic state variable results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENL_PSV", - location=core.locations.nodal, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def plastic_strain( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal plastic strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPPL", - location=core.locations.elemental_nodal, - category=ResultCategory.matrix, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def plastic_strain_nodal( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal plastic strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPPL", - location=core.locations.nodal, - category=ResultCategory.matrix, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def plastic_strain_elemental( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental plastic strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPPL", - location=core.locations.elemental, - category=ResultCategory.matrix, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def plastic_strain_principal( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal principal plastic strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPPL", - location=core.locations.elemental_nodal, - category=ResultCategory.principal, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def plastic_strain_principal_nodal( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal principal plastic strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPPL", - location=core.locations.nodal, - category=ResultCategory.principal, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def plastic_strain_principal_elemental( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental principal plastic strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPPL", - location=core.locations.elemental, - category=ResultCategory.principal, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def plastic_strain_eqv( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal equivalent plastic strain results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPPL", - location=core.locations.elemental_nodal, - category=ResultCategory.equivalent, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def plastic_strain_equivalent_nodal( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal equivalent plastic strain results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPPL", - location=core.locations.nodal, - category=ResultCategory.equivalent, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def plastic_strain_equivalent_elemental( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental equivalent plastic strain results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EPPL", - location=core.locations.elemental, - category=ResultCategory.equivalent, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def creep_strain( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal creep strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ECR", - location=core.locations.elemental_nodal, - category=ResultCategory.matrix, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def creep_strain_nodal( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal creep strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ECR", - location=core.locations.nodal, - category=ResultCategory.matrix, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def creep_strain_elemental( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental creep strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ECR", - location=core.locations.elemental, - category=ResultCategory.matrix, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def creep_strain_principal( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal principal creep strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ECR", - location=core.locations.elemental_nodal, - category=ResultCategory.principal, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def creep_strain_principal_nodal( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal principal creep strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ECR", - location=core.locations.nodal, - category=ResultCategory.principal, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def creep_strain_principal_elemental( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental principal creep strain results from the simulation. - - Args: - component_ids: - Components to get results for. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ECR", - location=core.locations.elemental, - category=ResultCategory.principal, - components=component_ids, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def creep_strain_eqv( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal equivalent creep strain results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ECR", - location=core.locations.elemental_nodal, - category=ResultCategory.equivalent, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def creep_strain_equivalent_nodal( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal equivalent creep strain results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ECR", - location=core.locations.nodal, - category=ResultCategory.equivalent, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def creep_strain_equivalent_elemental( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental equivalent creep strain results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ECR", - location=core.locations.elemental, - category=ResultCategory.equivalent, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def reaction_force( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract reaction force results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="RF", - location=core.locations.nodal, - category=ResultCategory.vector, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def elemental_volume( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental volume results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENG_VOL", - location=core.locations.elemental, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def elemental_mass( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental mass results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ElementalMass", - location=core.locations.elemental, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def elemental_heat_generation( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental heat generation results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EHC", - location=core.locations.elemental, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def element_centroids( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract element centroids results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="centroids", - location=core.locations.elemental, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def thickness( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract element thickness results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="thickness", - location=core.locations.elemental, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def element_orientations( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental nodal element orientations results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EUL", - location=core.locations.elemental_nodal, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def element_orientations_elemental( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract elemental element orientations results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EUL", - location=core.locations.elemental, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def element_orientations_nodal( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal element orientations results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="EUL", - location=core.locations.nodal, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def stiffness_matrix_energy( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract stiffness matrix energy results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENG_SE", - location=core.locations.elemental, - category=ResultCategory.scalar, - components="", - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def artificial_hourglass_energy( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract artificial hourglass energy results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENG_AHO", - location=core.locations.elemental, - category=ResultCategory.scalar, - components="", - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def thermal_dissipation_energy( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract thermal dissipation energy results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENG_TH", - location=core.locations.elemental, - category=ResultCategory.scalar, - components="", - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def kinetic_energy( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract kinetic energy results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENG_KE", - location=core.locations.elemental, - category=ResultCategory.scalar, - components="", - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def hydrostatic_pressure( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract hydrostatic pressure element nodal results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENL_HPRES", - location=core.locations.elemental_nodal, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def hydrostatic_pressure_nodal( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract hydrostatic pressure nodal results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENL_HPRES", - location=core.locations.nodal, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def hydrostatic_pressure_elemental( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract hydrostatic pressure elemental results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENL_HPRES", - location=core.locations.elemental, - category=ResultCategory.scalar, - components=None, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def structural_temperature( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract structural temperature element nodal results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="BFE", - location=core.locations.elemental_nodal, - category=ResultCategory.scalar, - components="", - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def structural_temperature_nodal( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract structural temperature nodal results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="BFE", - location=core.locations.nodal, - category=ResultCategory.scalar, - components="", - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def structural_temperature_elemental( - self, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract structural temperature elemental results from the simulation. - - Args: - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="BFE", - location=core.locations.elemental, - category=ResultCategory.scalar, - components="", - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def element_nodal_forces( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - norm: bool = False, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract element nodal forces results from the simulation. - - Args: - component_ids: - Components to get results for. - norm: - Whether to return the norm of the results. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENF", - location=core.locations.elemental_nodal, - category=ResultCategory.vector, - components=component_ids, - norm=norm, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def element_nodal_forces_nodal( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - norm: bool = False, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract element nodal forces nodal results from the simulation. - - Args: - component_ids: - Components to get results for. - norm: - Whether to return the norm of the results. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENF", - location=core.locations.nodal, - category=ResultCategory.vector, - components=component_ids, - norm=norm, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def element_nodal_forces_elemental( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - norm: bool = False, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract element nodal forces elemental results from the simulation. - - Args: - component_ids: - Components to get results for. - norm: - Whether to return the norm of the results. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - List of times to get results for. - set_ids: - List of sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - List of load steps to get results for. - sub_steps: - List of sub-steps to get results for. Requires load_steps to be defined. - elements: - List of elements to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="ENF", - location=core.locations.elemental, - category=ResultCategory.vector, - components=component_ids, - norm=norm, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=None, - elements=elements, - named_selection=named_selection, - ) - - def nodal_force( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - norm: bool = False, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal force results from the simulation. - - Args: - component_ids: - Components to get results for. - norm: - Whether to return the norm of the results. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - Times to get results for. - set_ids: - Sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - Load steps to get results for. - sub_steps: - Sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements whose nodes to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="F", - location=core.locations.nodal, - category=ResultCategory.vector, - components=component_ids, - norm=norm, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - def nodal_moment( - self, - component_ids: Union[str, List[str], int, List[int], None] = None, - norm: bool = False, - selection: Union[Selection, None] = None, - times: Union[float, List[float], None] = None, - set_ids: Union[int, List[int], None] = None, - load_steps: Union[int, List[int], None] = None, - sub_steps: Union[int, List[int], None] = None, - nodes: Union[List[int], None] = None, - elements: Union[List[int], None] = None, - named_selection: Union[str, None] = None, - ) -> DataObject: - """Extract nodal moment results from the simulation. - - Args: - component_ids: - Components to get results for. - norm: - Whether to return the norm of the results. - selection: - Selection to get results for. - A Selection defines both spatial and time-like criteria for filtering. - times: - Times to get results for. - set_ids: - Sets to get results for. - A set is defined as a unique combination of {time, load step, sub-step}. - load_steps: - Load steps to get results for. - sub_steps: - Sub-steps to get results for. Requires load_steps to be defined. - nodes: - List of nodes to get results for. - elements: - List of elements whose nodes to get results for. - named_selection: - Named selection to get results for. - - Returns - ------- - Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. - - """ - return self._get_result( - base_name="M", - location=core.locations.nodal, - category=ResultCategory.vector, - components=component_ids, - norm=norm, - selection=selection, - times=times, - set_ids=set_ids, - load_steps=load_steps, - sub_steps=sub_steps, - nodes=nodes, - elements=elements, - named_selection=named_selection, - ) - - -class TransientMechanicalSimulation(MechanicalSimulation): - """Provides methods for mechanical transient simulations.""" - - def _build_time_freq_scoping(self) -> core.time_freq_scoping_factory.Scoping: - """Generate a time_freq_scoping from input arguments.""" - pass - class ModalMechanicalSimulation(MechanicalSimulation): """Provides methods for mechanical modal simulations.""" diff --git a/src/ansys/dpf/post/static_mechanical_simulation.py b/src/ansys/dpf/post/static_mechanical_simulation.py new file mode 100644 index 000000000..1550f0b5f --- /dev/null +++ b/src/ansys/dpf/post/static_mechanical_simulation.py @@ -0,0 +1,4053 @@ +"""Module containing the ``StaticMechanicalSimulation`` class.""" +from typing import List, Tuple, Union +import warnings + +from ansys.dpf import core +from ansys.dpf.post.data_object import DataObject +from ansys.dpf.post.selection import Selection +from ansys.dpf.post.simulation import MechanicalSimulation, ResultCategory + + +class StaticMechanicalSimulation(MechanicalSimulation): + """Provides methods for mechanical static simulations.""" + + def _get_result( + self, + base_name: str, + location: str, + category: ResultCategory, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + selection: Union[Selection, None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + named_selections: Union[List[str], str, None] = None, + ) -> DataObject: + """Extract stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + base_name: + Base name for the requested result. + location: + Location requested. + category: + Type of result requested. See the :class:`ResultCategory` class. + components: + Components to get results for. + norm: + Whether to return the norm of the results. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + times: + List of times to get results for. + set_ids: + List of sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + List of load steps to get results for. + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + named_selections: + Named selection or list of named selections to get results for. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + # Build the targeted time scoping + time_scoping = self._build_time_freq_scoping( + selection=selection, + set_ids=set_ids, + times=times, + load_steps=load_steps, + all_sets=all_sets, + ) + + # Build the targeted mesh scoping + mesh_scoping = self._build_mesh_scoping( + selection=selection, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + location=location, + ) + + # Build the list of requested results + if category in [ResultCategory.scalar, ResultCategory.equivalent]: + # A scalar or equivalent result has no components + to_extract = None + columns = [base_name] + elif category in [ResultCategory.vector, ResultCategory.matrix]: + # A matrix or vector result can have components selected + to_extract, columns = self._build_components_from_components( + base_name=base_name, category=category, components=components + ) + elif category == ResultCategory.principal: + # A principal type of result can have components selected + to_extract, columns = self._build_components_from_principal( + base_name=base_name, components=components + ) + else: + raise ValueError(f"'{category}' is not a valid category value.") + + # Initialize a workflow + wf = core.Workflow(server=self._model._server) + wf.progress_bar = False + + # Instantiate the main result operator + result_op = self._build_result_operator( + name=base_name, + time_scoping=time_scoping, + mesh_scoping=mesh_scoping, + location=location, + ) + # Its output is selected as future workflow output for now + out = result_op.outputs.fields_container + + # Add a step to compute principal invariants if result is principal + if category == ResultCategory.principal: + # Instantiate the required operator + principal_op = self._model.operator(name="eig_values_fc") + principal_op.connect(0, out) + wf.add_operator(operator=principal_op) + # Set as future output of the workflow + out = principal_op.outputs.fields_container + + # Add a step to compute equivalent if result is equivalent + elif category == ResultCategory.equivalent: + # If a stress result, use one operator + if base_name[0] == "S": + equivalent_op = self._model.operator(name="segalmaneqv_fc") + # If a strain result, use another + elif base_name[0] == "E": + equivalent_op = self._model.operator(name="eqv_fc") + # Throw otherwise + else: + raise ValueError( + f"Category {ResultCategory.equivalent} " + "is only available for stress or strain results." + ) + equivalent_op.connect(0, out) + wf.add_operator(operator=equivalent_op) + # Set as future output of the workflow + out = equivalent_op.outputs.fields_container + + # Add an optional component selection step if result is vector, matrix, or principal + if ( + category + in [ResultCategory.vector, ResultCategory.matrix, ResultCategory.principal] + ) and (to_extract is not None): + # Instantiate a component selector operator + extract_op = self._model.operator(name="component_selector_fc") + # Feed it the current workflow output + extract_op.connect(0, out) + # Feed it the requested components + extract_op.connect(1, to_extract) + wf.add_operator(operator=extract_op) + # Set as future output of the workflow + out = extract_op.outputs.fields_container + + # Add an optional norm operation if requested + if norm: + norm_op = self._model.operator(name="norm_fc") + norm_op.connect(0, out) + wf.add_operator(operator=norm_op) + out = norm_op.outputs.fields_container + + # Set the workflow output + wf.set_output_name("out", out) + # Evaluate the workflow + fc = wf.get_output("out", core.types.fields_container) + + # Test for empty results + if (len(fc) == 0) or all([len(f) == 0 for f in fc]): + warnings.warn( + message=f"Returned Dataframe with columns {columns} is empty.", + category=UserWarning, + ) + # Return the result wrapped in a DPF_Dataframe + return DataObject( + fields_container=fc, + columns=columns, + mesh_scoping=mesh_scoping, + ) + + def displacement( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract displacement results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements whose nodes to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="U", + location=core.locations.nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.elemental_nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.elemental, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_principal( + self, + element_ids: Union[List[int], None] = None, + times: Union[List[float], None] = None, + components: Union[List[str], List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal principal stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.elemental_nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_principal_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[List[float], None] = None, + components: Union[List[str], List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental principal stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.elemental, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_principal_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[List[float], None] = None, + components: Union[List[str], List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal principal stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_eqv_von_mises( + self, + element_ids: Union[List[int], None] = None, + times: Union[List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal equivalent Von Mises stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.elemental_nodal, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_eqv_von_mises_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental equivalent Von Mises stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.elemental, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_eqv_von_mises_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal equivalent Von Mises stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.nodal, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elastic_strain( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPEL", + location=core.locations.elemental_nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elastic_strain_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPEL", + location=core.locations.nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elastic_strain_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPEL", + location=core.locations.elemental, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elastic_strain_principal( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal principal elastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPEL", + location=core.locations.elemental_nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elastic_strain_principal_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal principal elastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPEL", + location=core.locations.nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elastic_strain_principal_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental principal elastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPEL", + location=core.locations.elemental, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_state_variable( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal plastic state variable results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENL_PSV", + location=core.locations.elemental_nodal, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_state_variable_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental plastic state variable results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENL_PSV", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_state_variable_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal plastic state variable results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENL_PSV", + location=core.locations.nodal, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.elemental_nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.elemental, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_principal( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal principal plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.elemental_nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_principal_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal principal plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_principal_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental principal plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.elemental, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_eqv( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal equivalent plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.elemental_nodal, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_eqv_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal equivalent plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.nodal, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_eqv_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental equivalent plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.elemental, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def creep_strain( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal creep strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ECR", + location=core.locations.elemental_nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def creep_strain_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal creep strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ECR", + location=core.locations.nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def creep_strain_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental creep strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ECR", + location=core.locations.elemental, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def creep_strain_principal( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal principal creep strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ECR", + location=core.locations.elemental_nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def creep_strain_principal_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal principal creep strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ECR", + location=core.locations.nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def creep_strain_principal_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental principal creep strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ECR", + location=core.locations.elemental, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def creep_strain_eqv( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal equivalent creep strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ECR", + location=core.locations.elemental_nodal, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def creep_strain_equivalent_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal equivalent creep strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ECR", + location=core.locations.nodal, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def creep_strain_equivalent_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental equivalent creep strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ECR", + location=core.locations.elemental, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def reaction_force( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract reaction force results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="RF", + location=core.locations.nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elemental_volume( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental volume results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENG_VOL", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elemental_mass( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental mass results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ElementalMass", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elemental_heat_generation( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental heat generation results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EHC", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_centroids( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract element centroids results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="centroids", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def thickness( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract element thickness results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="thickness", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_orientations( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal element orientations results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EUL", + location=core.locations.elemental_nodal, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_orientations_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental element orientations results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EUL", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_orientations_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal element orientations results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EUL", + location=core.locations.nodal, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stiffness_matrix_energy( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract stiffness matrix energy results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENG_SE", + location=core.locations.elemental, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def artificial_hourglass_energy( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract artificial hourglass energy results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENG_AHO", + location=core.locations.elemental, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def thermal_dissipation_energy( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract thermal dissipation energy results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENG_TH", + location=core.locations.elemental, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def kinetic_energy( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract kinetic energy results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENG_KE", + location=core.locations.elemental, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def hydrostatic_pressure( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract hydrostatic pressure element nodal results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENL_HPRES", + location=core.locations.elemental_nodal, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def hydrostatic_pressure_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract hydrostatic pressure nodal results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENL_HPRES", + location=core.locations.nodal, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def hydrostatic_pressure_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract hydrostatic pressure elemental results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENL_HPRES", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def structural_temperature( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract structural temperature element nodal results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="BFE", + location=core.locations.elemental_nodal, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def structural_temperature_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract structural temperature nodal results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="BFE", + location=core.locations.nodal, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def structural_temperature_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract structural temperature elemental results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of times to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="BFE", + location=core.locations.elemental, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_nodal_forces( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract element nodal forces results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENF", + location=core.locations.elemental_nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_nodal_forces_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract element nodal forces nodal results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENF", + location=core.locations.nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_nodal_forces_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract element nodal forces elemental results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENF", + location=core.locations.elemental, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def nodal_force( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal force results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements whose nodes to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="F", + location=core.locations.nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def nodal_moment( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal moment results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements whose nodes to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="M", + location=core.locations.nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) diff --git a/src/ansys/dpf/post/transient_mechanical_simulation.py b/src/ansys/dpf/post/transient_mechanical_simulation.py new file mode 100644 index 000000000..1931db0cb --- /dev/null +++ b/src/ansys/dpf/post/transient_mechanical_simulation.py @@ -0,0 +1,3568 @@ +"""Module containing the ``TransientMechanicalSimulation`` class.""" +from typing import List, Tuple, Union +import warnings + +from ansys.dpf import core +from ansys.dpf.post.data_object import DataObject +from ansys.dpf.post.selection import Selection +from ansys.dpf.post.simulation import MechanicalSimulation, ResultCategory + + +class TransientMechanicalSimulation(MechanicalSimulation): + """Provides methods for mechanical transient simulations.""" + + def _get_result( + self, + base_name: str, + location: str, + category: ResultCategory, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + selection: Union[Selection, None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + named_selections: Union[List[str], str, None] = None, + ) -> DataObject: + """Extract stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + base_name: + Base name for the requested result. + location: + Location requested. + category: + Type of result requested. See the :class:`ResultCategory` class. + components: + Components to get results for. + norm: + Whether to return the norm of the results. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + It takes precedence over any other filter argument. + times: + List of times to get results for. + set_ids: + List of sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + List of load steps to get results for. + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + named_selections: + Named selection or list of named selections to get results for. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + # Build the targeted time scoping + time_scoping = self._build_time_freq_scoping( + selection=selection, + set_ids=set_ids, + times=times, + load_steps=load_steps, + all_sets=all_sets, + ) + + # Build the targeted mesh scoping + mesh_scoping = self._build_mesh_scoping( + selection=selection, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + location=location, + ) + + # Build the list of requested results + if category in [ResultCategory.scalar, ResultCategory.equivalent]: + # A scalar or equivalent result has no components + to_extract = None + columns = [base_name] + elif category in [ResultCategory.vector, ResultCategory.matrix]: + # A matrix or vector result can have components selected + to_extract, columns = self._build_components_from_components( + base_name=base_name, category=category, components=components + ) + elif category == ResultCategory.principal: + # A principal type of result can have components selected + to_extract, columns = self._build_components_from_principal( + base_name=base_name, components=components + ) + else: + raise ValueError(f"'{category}' is not a valid category value.") + + # Initialize a workflow + wf = core.Workflow(server=self._model._server) + wf.progress_bar = False + + # Instantiate the main result operator + result_op = self._build_result_operator( + name=base_name, + time_scoping=time_scoping, + mesh_scoping=mesh_scoping, + location=location, + ) + # Its output is selected as future workflow output for now + out = result_op.outputs.fields_container + + # Add a step to compute principal invariants if result is principal + if category == ResultCategory.principal: + # Instantiate the required operator + principal_op = self._model.operator(name="eig_values_fc") + principal_op.connect(0, out) + wf.add_operator(operator=principal_op) + # Set as future output of the workflow + out = principal_op.outputs.fields_container + + # Add a step to compute equivalent if result is equivalent + elif category == ResultCategory.equivalent: + # If a stress result, use one operator + if base_name[0] == "S": + equivalent_op = self._model.operator(name="segalmaneqv_fc") + # If a strain result, use another + elif base_name[0] == "E": + equivalent_op = self._model.operator(name="eqv_fc") + # Throw otherwise + else: + raise ValueError( + f"Category {ResultCategory.equivalent} " + "is only available for stress or strain results." + ) + equivalent_op.connect(0, out) + wf.add_operator(operator=equivalent_op) + # Set as future output of the workflow + out = equivalent_op.outputs.fields_container + + # Add an optional component selection step if result is vector, matrix, or principal + if ( + category + in [ResultCategory.vector, ResultCategory.matrix, ResultCategory.principal] + ) and (to_extract is not None): + # Instantiate a component selector operator + extract_op = self._model.operator(name="component_selector_fc") + # Feed it the current workflow output + extract_op.connect(0, out) + # Feed it the requested components + extract_op.connect(1, to_extract) + wf.add_operator(operator=extract_op) + # Set as future output of the workflow + out = extract_op.outputs.fields_container + + # Add an optional norm operation if requested + if norm: + norm_op = self._model.operator(name="norm_fc") + norm_op.connect(0, out) + wf.add_operator(operator=norm_op) + out = norm_op.outputs.fields_container + + # Set the workflow output + wf.set_output_name("out", out) + # Evaluate the workflow + fc = wf.get_output("out", core.types.fields_container) + + # Test for empty results + if (len(fc) == 0) or all([len(f) == 0 for f in fc]): + warnings.warn( + message=f"Returned Dataframe with columns {columns} is empty.", + category=UserWarning, + ) + # Return the result wrapped in a DPF_Dataframe + return DataObject( + fields_container=fc, + columns=columns, + mesh_scoping=mesh_scoping, + ) + + def displacement( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract displacement results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements whose nodes to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="U", + location=core.locations.nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def velocity( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract velocity results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements whose nodes to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="V", + location=core.locations.nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def acceleration( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract acceleration results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements whose nodes to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="A", + location=core.locations.nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.elemental_nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.elemental, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_principal( + self, + element_ids: Union[List[int], None] = None, + times: Union[List[float], None] = None, + components: Union[List[str], List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal principal stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.elemental_nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_principal_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[List[float], None] = None, + components: Union[List[str], List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental principal stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.elemental, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_principal_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[List[float], None] = None, + components: Union[List[str], List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal principal stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs pf elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_eqv_von_mises( + self, + element_ids: Union[List[int], None] = None, + times: Union[List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal equivalent Von Mises stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.elemental_nodal, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_eqv_von_mises_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental equivalent Von Mises stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.elemental, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def stress_eqv_von_mises_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal equivalent Von Mises stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="S", + location=core.locations.nodal, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elastic_strain( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPEL", + location=core.locations.elemental_nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elastic_strain_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPEL", + location=core.locations.nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elastic_strain_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract stress results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPEL", + location=core.locations.elemental, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elastic_strain_principal( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal principal elastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPEL", + location=core.locations.elemental_nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elastic_strain_principal_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal principal elastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs pf elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPEL", + location=core.locations.nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elastic_strain_principal_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental principal elastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPEL", + location=core.locations.elemental, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_state_variable( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal plastic state variable results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENL_PSV", + location=core.locations.elemental_nodal, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_state_variable_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental plastic state variable results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENL_PSV", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_state_variable_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal plastic state variable results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENL_PSV", + location=core.locations.nodal, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.elemental_nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.nodal, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", "XX", "XY", + "XZ", and their respective equivalents 1, 2, 3, 4, 5, 6. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.elemental, + category=ResultCategory.matrix, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_principal( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal principal plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.elemental_nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_principal_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal principal plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs pf elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.nodal, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_principal_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental principal plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are: 1, 2, and 3. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.elemental, + category=ResultCategory.principal, + components=components, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_eqv( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal equivalent plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.elemental_nodal, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_eqv_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal equivalent plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.nodal, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def plastic_strain_eqv_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental equivalent plastic strain results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EPPL", + location=core.locations.elemental, + category=ResultCategory.equivalent, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def reaction_force( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract reaction force results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="RF", + location=core.locations.nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elemental_volume( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental volume results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENG_VOL", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elemental_mass( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental mass results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ElementalMass", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def elemental_heat_generation( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental heat generation results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EHC", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_centroids( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract element centroids results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="centroids", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def thickness( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract element thickness results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="thickness", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_orientations( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental nodal element orientations results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EUL", + location=core.locations.elemental_nodal, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_orientations_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract elemental element orientations results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EUL", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_orientations_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal element orientations results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="EUL", + location=core.locations.nodal, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def artificial_hourglass_energy( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract artificial hourglass energy results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENG_AHO", + location=core.locations.elemental, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def thermal_dissipation_energy( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract thermal dissipation energy results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENG_TH", + location=core.locations.elemental, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def kinetic_energy( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract kinetic energy results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENG_KE", + location=core.locations.elemental, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def hydrostatic_pressure( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract hydrostatic pressure element nodal results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENL_HPRES", + location=core.locations.elemental_nodal, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def hydrostatic_pressure_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract hydrostatic pressure nodal results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENL_HPRES", + location=core.locations.nodal, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def hydrostatic_pressure_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract hydrostatic pressure elemental results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENL_HPRES", + location=core.locations.elemental, + category=ResultCategory.scalar, + components=None, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def structural_temperature( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract structural temperature element nodal results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="BFE", + location=core.locations.elemental_nodal, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def structural_temperature_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract structural temperature nodal results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="BFE", + location=core.locations.nodal, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def structural_temperature_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract structural temperature elemental results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="BFE", + location=core.locations.elemental, + category=ResultCategory.scalar, + components="", + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_nodal_forces( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract element nodal forces results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENF", + location=core.locations.elemental_nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_nodal_forces_nodal( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract element nodal forces nodal results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENF", + location=core.locations.nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def element_nodal_forces_elemental( + self, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract element nodal forces elemental results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, and `element_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + element_ids: + List of IDs of elements to get results for. + times: + List of time values to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="ENF", + location=core.locations.elemental, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=None, + element_ids=element_ids, + named_selections=named_selections, + ) + + def nodal_force( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal force results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + times: + List of time values to get results for. + element_ids: + List of IDs of elements to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="F", + location=core.locations.nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) + + def nodal_moment( + self, + node_ids: Union[List[int], None] = None, + element_ids: Union[List[int], None] = None, + times: Union[float, List[float], None] = None, + components: Union[str, List[str], int, List[int], None] = None, + norm: bool = False, + set_ids: Union[int, List[int], None] = None, + all_sets: bool = False, + load_steps: Union[ + int, List[int], Tuple[int, Union[int, List[int]]], None + ] = None, + named_selections: Union[List[str], str, None] = None, + selection: Union[Selection, None] = None, + ) -> DataObject: + """Extract nodal moment results from the simulation. + + Arguments `selection`, `set_ids`, `all_sets`, `times`, and `load_steps` are mutually + exclusive. + If none of the above is given, only the last result will be returned. + + Arguments `selection`, `named_selections`, `element_ids`, and `node_ids` are mutually + exclusive. + If none of the above is given, results will be extracted for the whole mesh. + + Args: + node_ids: + List of IDs of nodes to get results for. + times: + List of time values to get results for. + element_ids: + List of IDs of elements to get results for. + components: + Components to get results for. Available components are "X", "Y", "Z", + and their respective equivalents 1, 2, 3. + norm: + Whether to return the norm of the results. + set_ids: + Sets to get results for. + A set is defined as a unique combination of {time, load step, sub-step}. + all_sets: + Whether to get results for all sets. + load_steps: + Load steps to get results for. + named_selections: + Named selection or list of named selections to get results for. + selection: + Selection to get results for. + A Selection defines both spatial and time-like criteria for filtering. + + Returns + ------- + Returns a :class:`ansys.dpf.post.data_object.DataObject` instance. + + """ + return self._get_result( + base_name="M", + location=core.locations.nodal, + category=ResultCategory.vector, + components=components, + norm=norm, + selection=selection, + times=times, + set_ids=set_ids, + all_sets=all_sets, + load_steps=load_steps, + node_ids=node_ids, + element_ids=element_ids, + named_selections=named_selections, + ) diff --git a/tests/test_load_simulation.py b/tests/test_load_simulation.py index 01bfdd501..1125211e8 100644 --- a/tests/test_load_simulation.py +++ b/tests/test_load_simulation.py @@ -5,9 +5,9 @@ from ansys.dpf.post.simulation import ( HarmonicMechanicalSimulation, ModalMechanicalSimulation, - StaticMechanicalSimulation, - TransientMechanicalSimulation, ) +from ansys.dpf.post.static_mechanical_simulation import StaticMechanicalSimulation +from ansys.dpf.post.transient_mechanical_simulation import TransientMechanicalSimulation def test_load_simulation_static_mechanical(simple_bar, complex_model): diff --git a/tests/test_simulation.py b/tests/test_simulation.py index ba01b88ed..323bae296 100644 --- a/tests/test_simulation.py +++ b/tests/test_simulation.py @@ -4,11 +4,23 @@ from pytest import fixture import ansys.dpf.post as dpf +from ansys.dpf.post.common import AvailableSimulationTypes @fixture def static_simulation(static_rst): - return dpf.load_simulation(data_sources=static_rst) + return dpf.load_simulation( + data_sources=static_rst, + simulation_type=AvailableSimulationTypes.static_mechanical, + ) + + +@fixture +def transient_simulation(plate_msup): + return dpf.load_simulation( + data_sources=plate_msup, + simulation_type=AvailableSimulationTypes.transient_mechanical, + ) def test_simulation_results(static_simulation): @@ -57,18 +69,38 @@ def test_simulation_plot(static_simulation): class TestStaticMechanicalSimulation: + def test_times_argument(self, static_simulation): + _ = static_simulation.displacement(times=1) + _ = static_simulation.displacement(times=1.0) + _ = static_simulation.displacement(times=[1]) + _ = static_simulation.displacement(times=[1.0]) + with pytest.raises( + ValueError, match="Argument times must contain numeric values only." + ): + _ = static_simulation.displacement(times=[0.0, 1, "test"]) + with pytest.raises( + TypeError, match="Argument times must be a number or a list of numbers." + ): + _ = static_simulation.displacement(times="test") + def test_warning_empty(self, static_simulation): with pytest.warns(expected_warning=UserWarning, match="empty"): _ = static_simulation.displacement( - component_ids=1, nodes=[1001, 1002, 1003] + components=1, node_ids=[1001, 1002, 1003] ) + def test_raise_mutually_exclusive(self, static_simulation): + with pytest.raises(ValueError, match="exclusive"): + _ = static_simulation.displacement(node_ids=[42], element_ids=[1]) + with pytest.raises(ValueError, match="exclusive"): + _ = static_simulation.displacement(load_steps=[1], set_ids=[1]) + def test_displacement(self, static_simulation): displacement_x = static_simulation.displacement( - component_ids=["X"], nodes=[42, 43, 44], set_ids=[1] + components=["X"], node_ids=[42, 43, 44] ) assert len(displacement_x._fc) == 1 - assert displacement_x._fc.time_freq_support.time_frequencies.data == 1 + assert displacement_x._fc.get_time_scoping().ids == [1] field = displacement_x._fc[0] op = static_simulation._model.operator("UX") mesh_scoping = core.mesh_scoping_factory.nodal_scoping( @@ -81,13 +113,12 @@ def test_displacement(self, static_simulation): assert np.allclose(field.data, field_ref.data) displacement_y = static_simulation.displacement( - component_ids=["2"], - named_selection=static_simulation.named_selections[0], - load_steps=[1], - sub_steps=[1], + components=["2"], + named_selections=static_simulation.named_selections[0], + load_steps=(1, 1), ) assert len(displacement_y._fc) == 1 - assert displacement_y._fc.time_freq_support.time_frequencies.data == 1 + assert displacement_y._fc.get_time_scoping().ids == [1] field = displacement_y._fc[0] op = static_simulation._model.operator("UY") mesh_scoping = core.mesh_scoping_factory.named_selection_scoping( @@ -102,13 +133,12 @@ def test_displacement(self, static_simulation): assert np.allclose(field.data, field_ref.data) displacement_z = static_simulation.displacement( - component_ids="Z", - named_selection=static_simulation.named_selections[0], - load_steps=1, - sub_steps=1, + components="Z", + named_selections=static_simulation.named_selections[0], + load_steps=(1, 1), ) assert len(displacement_z._fc) == 1 - assert displacement_z._fc.time_freq_support.time_frequencies.data == 1 + assert displacement_z._fc.get_time_scoping().ids == [1] field = displacement_z._fc[0] op = static_simulation._model.operator("UZ") mesh_scoping = core.mesh_scoping_factory.named_selection_scoping( @@ -123,12 +153,12 @@ def test_displacement(self, static_simulation): assert np.allclose(field.data, field_ref.data) displacement_z = static_simulation.displacement( - component_ids="Z", - elements=[1, 2, 3], + components="Z", + element_ids=[1, 2, 3], set_ids=1, ) assert len(displacement_z._fc) == 1 - assert displacement_z._fc.time_freq_support.time_frequencies.data == 1 + assert displacement_z._fc.get_time_scoping().ids == [1] field = displacement_z._fc[0] op = static_simulation._model.operator("UZ") mesh_scoping = core.mesh_scoping_factory.elemental_scoping( @@ -148,10 +178,10 @@ def test_displacement(self, static_simulation): assert np.allclose(field.data, field_ref.data) displacement_norm = static_simulation.displacement( - norm=True, nodes=[42, 43, 44], set_ids=[1] + norm=True, node_ids=[42, 43, 44], set_ids=[1] ) assert len(displacement_norm._fc) == 1 - assert displacement_norm._fc.time_freq_support.time_frequencies.data == 1 + assert displacement_norm._fc.get_time_scoping().ids == [1] field = displacement_norm._fc[0] op = static_simulation._model.operator("U") mesh_scoping = core.mesh_scoping_factory.nodal_scoping( @@ -166,9 +196,9 @@ def test_displacement(self, static_simulation): assert np.allclose(field.data, field_ref.data) def test_stress(self, static_simulation): - stress_x = static_simulation.stress(component_ids=1) + stress_x = static_simulation.stress(components=1) assert len(stress_x._fc) == 1 - assert stress_x._fc.time_freq_support.time_frequencies.data == 1 + assert stress_x._fc.get_time_scoping().ids == [1] field = stress_x._fc[0] op = static_simulation._model.operator("SX") op.connect(9, core.locations.elemental_nodal) @@ -178,9 +208,9 @@ def test_stress(self, static_simulation): assert np.allclose(field.data, field_ref.data) def test_stress_elemental(self, static_simulation): - stress_x = static_simulation.stress_elemental(component_ids=1) + stress_x = static_simulation.stress_elemental(components=1) assert len(stress_x._fc) == 1 - assert stress_x._fc.time_freq_support.time_frequencies.data == 1 + assert stress_x._fc.get_time_scoping().ids == [1] field = stress_x._fc[0] op = static_simulation._model.operator("SX") op.connect(9, core.locations.elemental) @@ -190,9 +220,9 @@ def test_stress_elemental(self, static_simulation): assert np.allclose(field.data, field_ref.data) def test_stress_nodal(self, static_simulation): - stress_x = static_simulation.stress_nodal(component_ids=1) + stress_x = static_simulation.stress_nodal(components=1) assert len(stress_x._fc) == 1 - assert stress_x._fc.time_freq_support.time_frequencies.data == 1 + assert stress_x._fc.get_time_scoping().ids == [1] field = stress_x._fc[0] op = static_simulation._model.operator("SX") op.connect(9, core.locations.nodal) @@ -202,9 +232,9 @@ def test_stress_nodal(self, static_simulation): assert np.allclose(field.data, field_ref.data) def test_stress_principal(self, static_simulation): - result = static_simulation.stress_principal(component_ids=1) + result = static_simulation.stress_principal(components=1) assert len(result._fc) == 1 - assert result._fc.time_freq_support.time_frequencies.data == 1 + assert result._fc.get_time_scoping().ids == [1] field = result._fc[0] op = static_simulation._model.operator("S1") op.connect(9, core.locations.elemental_nodal) @@ -214,9 +244,9 @@ def test_stress_principal(self, static_simulation): assert np.allclose(field.data, field_ref.data) def test_stress_principal_nodal(self, static_simulation): - result = static_simulation.stress_principal_nodal(component_ids=2) + result = static_simulation.stress_principal_nodal(components=2) assert len(result._fc) == 1 - assert result._fc.time_freq_support.time_frequencies.data == 1 + assert result._fc.get_time_scoping().ids == [1] field = result._fc[0] op = static_simulation._model.operator("S2") op.connect(9, core.locations.nodal) @@ -226,9 +256,9 @@ def test_stress_principal_nodal(self, static_simulation): assert np.allclose(field.data, field_ref.data) def test_stress_principal_elemental(self, static_simulation): - result = static_simulation.stress_principal_elemental(component_ids=3) + result = static_simulation.stress_principal_elemental(components=3) assert len(result._fc) == 1 - assert result._fc.time_freq_support.time_frequencies.data == 1 + assert result._fc.get_time_scoping().ids == [1] field = result._fc[0] op = static_simulation._model.operator("S3") op.connect(9, core.locations.elemental) @@ -240,7 +270,7 @@ def test_stress_principal_elemental(self, static_simulation): def test_stress_eqv_von_mises(self, static_simulation): result = static_simulation.stress_eqv_von_mises() assert len(result._fc) == 1 - assert result._fc.time_freq_support.time_frequencies.data == 1 + assert result._fc.get_time_scoping().ids == [1] field = result._fc[0] op = static_simulation._model.operator("S_eqv") op.connect(9, core.locations.elemental_nodal) @@ -252,7 +282,7 @@ def test_stress_eqv_von_mises(self, static_simulation): def test_stress_eqv_von_mises_elemental(self, static_simulation): stress_vm = static_simulation.stress_eqv_von_mises_elemental() assert len(stress_vm._fc) == 1 - assert stress_vm._fc.time_freq_support.time_frequencies.data == 1 + assert stress_vm._fc.get_time_scoping().ids == [1] field = stress_vm._fc[0] op = static_simulation._model.operator("S_eqv") op.connect(9, core.locations.elemental) @@ -264,7 +294,7 @@ def test_stress_eqv_von_mises_elemental(self, static_simulation): def test_stress_eqv_von_mises_nodal(self, static_simulation): stress_vm = static_simulation.stress_eqv_von_mises_nodal() assert len(stress_vm._fc) == 1 - assert stress_vm._fc.time_freq_support.time_frequencies.data == 1 + assert stress_vm._fc.get_time_scoping().ids == [1] field = stress_vm._fc[0] op = static_simulation._model.operator("S_eqv") op.connect(9, core.locations.nodal) @@ -276,7 +306,7 @@ def test_stress_eqv_von_mises_nodal(self, static_simulation): def test_reaction_force(self, static_simulation): reaction_force = static_simulation.reaction_force() assert len(reaction_force._fc) == 1 - assert reaction_force._fc.time_freq_support.time_frequencies.data == 1 + assert reaction_force._fc.get_time_scoping().ids == [1] field = reaction_force._fc[0] op = static_simulation._model.operator("RF") field_ref = op.eval()[0] @@ -287,7 +317,7 @@ def test_reaction_force(self, static_simulation): def test_elemental_volume(self, static_simulation): elemental_volume = static_simulation.elemental_volume() assert len(elemental_volume._fc) == 1 - assert elemental_volume._fc.time_freq_support.time_frequencies.data == 1 + assert elemental_volume._fc.get_time_scoping().ids == [1] field = elemental_volume._fc[0] op = static_simulation._model.operator("ENG_VOL") field_ref = op.eval()[0] @@ -299,7 +329,7 @@ def test_elemental_volume(self, static_simulation): def test_stiffness_matrix_energy(self, static_simulation): stiffness_matrix_energy = static_simulation.stiffness_matrix_energy() assert len(stiffness_matrix_energy._fc) == 1 - assert stiffness_matrix_energy._fc.time_freq_support.time_frequencies.data == 1 + assert stiffness_matrix_energy._fc.get_time_scoping().ids == [1] field = stiffness_matrix_energy._fc[0] op = static_simulation._model.operator("ENG_SE") field_ref = op.eval()[0] @@ -310,9 +340,7 @@ def test_stiffness_matrix_energy(self, static_simulation): def test_artificial_hourglass_energy(self, static_simulation): artificial_hourglass_energy = static_simulation.artificial_hourglass_energy() assert len(artificial_hourglass_energy._fc) == 1 - assert ( - artificial_hourglass_energy._fc.time_freq_support.time_frequencies.data == 1 - ) + assert artificial_hourglass_energy._fc.get_time_scoping().ids == [1] field = artificial_hourglass_energy._fc[0] op = static_simulation._model.operator("ENG_AHO") field_ref = op.eval()[0] @@ -323,9 +351,7 @@ def test_artificial_hourglass_energy(self, static_simulation): def test_thermal_dissipation_energy(self, static_simulation): thermal_dissipation_energy = static_simulation.thermal_dissipation_energy() assert len(thermal_dissipation_energy._fc) == 1 - assert ( - thermal_dissipation_energy._fc.time_freq_support.time_frequencies.data == 1 - ) + assert thermal_dissipation_energy._fc.get_time_scoping().ids == [1] field = thermal_dissipation_energy._fc[0] op = static_simulation._model.operator("ENG_TH") field_ref = op.eval()[0] @@ -336,7 +362,7 @@ def test_thermal_dissipation_energy(self, static_simulation): def test_kinetic_energy(self, static_simulation): kinetic_energy = static_simulation.kinetic_energy() assert len(kinetic_energy._fc) == 1 - assert kinetic_energy._fc.time_freq_support.time_frequencies.data == 1 + assert kinetic_energy._fc.get_time_scoping().ids == [1] field = kinetic_energy._fc[0] op = static_simulation._model.operator("ENG_KE") field_ref = op.eval()[0] @@ -347,7 +373,7 @@ def test_kinetic_energy(self, static_simulation): def test_structural_temperature(self, static_simulation): structural_temperature = static_simulation.structural_temperature() assert len(structural_temperature._fc) == 1 - assert structural_temperature._fc.time_freq_support.time_frequencies.data == 1 + assert structural_temperature._fc.get_time_scoping().ids == [1] field = structural_temperature._fc[0] op = static_simulation._model.operator("BFE") field_ref = op.eval()[0] @@ -358,10 +384,7 @@ def test_structural_temperature(self, static_simulation): def test_structural_temperature_nodal(self, static_simulation): structural_temperature_nodal = static_simulation.structural_temperature_nodal() assert len(structural_temperature_nodal._fc) == 1 - assert ( - structural_temperature_nodal._fc.time_freq_support.time_frequencies.data - == 1 - ) + assert structural_temperature_nodal._fc.get_time_scoping().ids == [1] field = structural_temperature_nodal._fc[0] op = static_simulation._model.operator("BFE") op.connect(9, core.locations.nodal) @@ -375,10 +398,7 @@ def test_structural_temperature_elemental(self, static_simulation): static_simulation.structural_temperature_elemental() ) assert len(structural_temperature_elemental._fc) == 1 - assert ( - structural_temperature_elemental._fc.time_freq_support.time_frequencies.data - == 1 - ) + assert structural_temperature_elemental._fc.get_time_scoping().ids == [1] field = structural_temperature_elemental._fc[0] op = static_simulation._model.operator("BFE") op.connect(9, core.locations.elemental) @@ -391,7 +411,7 @@ def test_element_nodal_forces(self, allkindofcomplexity): static_simulation = dpf.load_simulation(data_sources=allkindofcomplexity) element_nodal_forces = static_simulation.element_nodal_forces() assert len(element_nodal_forces._fc) == 1 - assert element_nodal_forces._fc.time_freq_support.time_frequencies.data == 1 + assert element_nodal_forces._fc.get_time_scoping().ids == [1] field = element_nodal_forces._fc[0] op = static_simulation._model.operator("ENF") field_ref = op.eval()[0] @@ -403,7 +423,7 @@ def test_element_nodal_forces_nodal(self, allkindofcomplexity): static_simulation = dpf.load_simulation(data_sources=allkindofcomplexity) element_nodal_forces = static_simulation.element_nodal_forces_nodal() assert len(element_nodal_forces._fc) == 3 - assert element_nodal_forces._fc.time_freq_support.time_frequencies.data == 1 + assert element_nodal_forces._fc.get_time_scoping().ids == [1] field = element_nodal_forces._fc[0] op = static_simulation._model.operator("ENF") op.connect(9, core.locations.nodal) @@ -416,7 +436,7 @@ def test_element_nodal_forces_elemental(self, allkindofcomplexity): static_simulation = dpf.load_simulation(data_sources=allkindofcomplexity) element_nodal_forces = static_simulation.element_nodal_forces_elemental() assert len(element_nodal_forces._fc) == 3 - assert element_nodal_forces._fc.time_freq_support.time_frequencies.data == 1 + assert element_nodal_forces._fc.get_time_scoping().ids == [1] field = element_nodal_forces._fc[0] op = static_simulation._model.operator("ENF") op.connect(9, core.locations.elemental) @@ -424,3 +444,477 @@ def test_element_nodal_forces_elemental(self, allkindofcomplexity): assert field.component_count == 3 assert field.data.shape == (9433, 3) assert np.allclose(field.data, field_ref.data) + + +class TestTransientMechanicalSimulation: + def test_times_argument(self, transient_simulation, static_simulation): + with pytest.raises( + ValueError, match="Could not find time=0.0s in the simulation." + ): + _ = transient_simulation.displacement(times=0.0) + + # Get reference field at t=0.15s + op = transient_simulation._model.operator("UX") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 15, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + field_ref = op.eval()[0] + # Test for times= exact float + result = transient_simulation.displacement(components=["X"], times=0.15) + field = result._fc[0] + assert np.allclose(field.data, field_ref.data) + # Test for times= near float + result = transient_simulation.displacement(components=["X"], times=0.1496) + field = result._fc[0] + assert np.allclose(field.data, field_ref.data) + # Test for times= just not near float + with pytest.raises( + ValueError, match="Could not find time=0.1495s in the simulation." + ): + _ = transient_simulation.displacement(components=["X"], times=0.1495) + + def test_displacement(self, transient_simulation): + result = transient_simulation.displacement( + components=["X"], + node_ids=[2, 3, 4], + all_sets=True, + ) + assert len(result._fc) == 20 + assert len(result._fc.get_time_scoping().ids) == 20 + result = transient_simulation.displacement(components=["X"], node_ids=[2, 3, 4]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [20] + field = result._fc[0] + op = transient_simulation._model.operator("UX") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 20, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + mesh_scoping = core.mesh_scoping_factory.nodal_scoping( + [2, 3, 4], server=transient_simulation._model._server + ) + op.connect(1, mesh_scoping) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert field.data.shape == (3,) + assert np.allclose(field.data, field_ref.data) + + result = transient_simulation.displacement( + components=1, + named_selections=transient_simulation.named_selections[:2], + set_ids=[2], + ) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + assert field.component_count == 1 + assert field.data.shape == (393,) + + def test_velocity(self, transient_simulation): + result = transient_simulation.velocity( + components=["X"], node_ids=[2, 3, 4], set_ids=[2] + ) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("VX") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + mesh_scoping = core.mesh_scoping_factory.nodal_scoping( + [2, 3, 4], server=transient_simulation._model._server + ) + op.connect(1, mesh_scoping) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert field.data.shape == (3,) + assert np.allclose(field.data, field_ref.data) + + def test_acceleration(self, transient_simulation): + result = transient_simulation.acceleration( + components=["X"], node_ids=[2, 3, 4], set_ids=[2] + ) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("AX") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + mesh_scoping = core.mesh_scoping_factory.nodal_scoping( + [2, 3, 4], server=transient_simulation._model._server + ) + op.connect(1, mesh_scoping) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert field.data.shape == (3,) + assert np.allclose(field.data, field_ref.data) + + def test_stress(self, transient_simulation): + result = transient_simulation.stress(components=1, set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("SX") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.elemental_nodal) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_stress_elemental(self, transient_simulation): + result = transient_simulation.stress_elemental(components=1, set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("SX") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.elemental) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_stress_nodal(self, transient_simulation): + result = transient_simulation.stress_nodal(components=1, set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("SX") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.nodal) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_stress_principal(self, transient_simulation): + result = transient_simulation.stress_principal(components=1, set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("S1") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.elemental_nodal) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_stress_principal_nodal(self, transient_simulation): + result = transient_simulation.stress_principal_nodal(components=2, set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("S2") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.nodal) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_stress_principal_elemental(self, transient_simulation): + result = transient_simulation.stress_principal_elemental( + components=3, set_ids=[2] + ) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("S3") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.elemental) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_stress_eqv_von_mises(self, transient_simulation): + result = transient_simulation.stress_eqv_von_mises(set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("S_eqv") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.elemental_nodal) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_stress_eqv_von_mises_elemental(self, transient_simulation): + result = transient_simulation.stress_eqv_von_mises_elemental(set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("S_eqv") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.elemental) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_stress_eqv_von_mises_nodal(self, transient_simulation): + result = transient_simulation.stress_eqv_von_mises_nodal(set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("S_eqv") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.nodal) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_elastic_strain(self, transient_simulation): + result = transient_simulation.elastic_strain(components=1, set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("EPELX") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.elemental_nodal) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_elastic_strain_elemental(self, transient_simulation): + result = transient_simulation.elastic_strain_elemental( + components=1, set_ids=[2] + ) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("EPELX") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.elemental) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_elastic_strain_nodal(self, transient_simulation): + result = transient_simulation.elastic_strain_nodal(components=1, set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("EPELX") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.nodal) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_elastic_strain_principal(self, transient_simulation): + result = transient_simulation.elastic_strain_principal( + components=1, set_ids=[2] + ) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("EPEL1") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.elemental_nodal) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_elastic_strain_principal_nodal(self, transient_simulation): + result = transient_simulation.elastic_strain_principal_nodal( + components=2, set_ids=[2] + ) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("EPEL2") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.nodal) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_elastic_strain_principal_elemental(self, transient_simulation): + result = transient_simulation.elastic_strain_principal_elemental( + components=3, set_ids=[2] + ) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("EPEL3") + time_scoping = core.time_freq_scoping_factory.scoping_by_set( + 2, server=transient_simulation._model._server + ) + op.connect(0, time_scoping) + op.connect(9, core.locations.elemental) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_reaction_force(self, allkindofcomplexity): + transient_simulation = dpf.load_simulation( + data_sources=allkindofcomplexity, + simulation_type=AvailableSimulationTypes.transient_mechanical, + ) + result = transient_simulation.reaction_force(set_ids=[1]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [1] + field = result._fc[0] + op = transient_simulation._model.operator("RF") + field_ref = op.eval()[0] + assert field.component_count == 3 + assert np.allclose(field.data, field_ref.data) + + def test_elemental_volume(self, transient_simulation): + result = transient_simulation.elemental_volume(set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("ENG_VOL") + field_ref = op.eval()[0] + print(field_ref) + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_artificial_hourglass_energy(self, transient_simulation): + result = transient_simulation.artificial_hourglass_energy(set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("ENG_AHO") + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_thermal_dissipation_energy(self, transient_simulation): + result = transient_simulation.thermal_dissipation_energy(set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("ENG_TH") + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_kinetic_energy(self, transient_simulation): + result = transient_simulation.kinetic_energy(set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("ENG_KE") + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_structural_temperature(self, transient_simulation): + result = transient_simulation.structural_temperature(set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("BFE") + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_structural_temperature_nodal(self, transient_simulation): + result = transient_simulation.structural_temperature_nodal(set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("BFE") + op.connect(9, core.locations.nodal) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_structural_temperature_elemental(self, transient_simulation): + result = transient_simulation.structural_temperature_elemental(set_ids=[2]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [2] + field = result._fc[0] + op = transient_simulation._model.operator("BFE") + op.connect(9, core.locations.elemental) + field_ref = op.eval()[0] + assert field.component_count == 1 + assert np.allclose(field.data, field_ref.data) + + def test_element_nodal_forces(self, allkindofcomplexity): + transient_simulation = dpf.load_simulation( + data_sources=allkindofcomplexity, + simulation_type=AvailableSimulationTypes.transient_mechanical, + ) + result = transient_simulation.element_nodal_forces(set_ids=[1]) + assert len(result._fc) == 1 + assert result._fc.get_time_scoping().ids == [1] + field = result._fc[0] + op = transient_simulation._model.operator("ENF") + field_ref = op.eval()[0] + assert field.component_count == 3 + assert np.allclose(field.data, field_ref.data) + + def test_element_nodal_forces_nodal(self, allkindofcomplexity): + transient_simulation = dpf.load_simulation( + data_sources=allkindofcomplexity, + simulation_type=AvailableSimulationTypes.transient_mechanical, + ) + result = transient_simulation.element_nodal_forces_nodal(set_ids=[1]) + assert len(result._fc) == 3 + assert result._fc.get_time_scoping().ids == [1] + field = result._fc[0] + op = transient_simulation._model.operator("ENF") + op.connect(9, core.locations.nodal) + field_ref = op.eval()[0] + assert field.component_count == 3 + assert np.allclose(field.data, field_ref.data) + + def test_element_nodal_forces_elemental(self, allkindofcomplexity): + transient_simulation = dpf.load_simulation( + data_sources=allkindofcomplexity, + simulation_type=AvailableSimulationTypes.transient_mechanical, + ) + result = transient_simulation.element_nodal_forces_elemental(set_ids=[1]) + assert len(result._fc) == 3 + assert result._fc.get_time_scoping().ids == [1] + field = result._fc[0] + op = transient_simulation._model.operator("ENF") + op.connect(9, core.locations.elemental) + field_ref = op.eval()[0] + assert field.component_count == 3 + assert np.allclose(field.data, field_ref.data)