Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement TransientMechanicalSimulation results #282

Merged
merged 33 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7872421
Use the time_scoping of the FieldsContainer and not its TimeFreqSupport
PProfizi Feb 10, 2023
863b71e
Add TransientMechanicalSimulation.displacement
PProfizi Feb 10, 2023
83a262a
Add TransientMechanicalSimulation.velocity and acceleration
PProfizi Feb 10, 2023
062cb03
Add TransientMechanicalSimulation.stress and all variants
PProfizi Feb 10, 2023
3bdba4b
Add TransientMechanicalSimulation.elastic_strain and all variants
PProfizi Feb 10, 2023
63774ea
Move TransientMechanicalSimulation and StaticMechanicalSimulation to …
PProfizi Feb 10, 2023
3dd2322
Confirm a first set of results for TransientMechanicalSimulation
PProfizi Feb 10, 2023
93f99ca
Specify available component IDs for vectorial results.
PProfizi Feb 13, 2023
2d57660
Specify available component IDs for matrix results.
PProfizi Feb 13, 2023
95c5386
Specify available component IDs for principal results. Rework all.
PProfizi Feb 13, 2023
cd5f8f4
Switching to node_ids and element_ids.
PProfizi Feb 13, 2023
e7f2b76
Add the case of list of named selections
PProfizi Feb 13, 2023
ad599e8
Switch to node_ids in TestTransientMechanicalSimulation.
PProfizi Feb 13, 2023
b19f453
Add testing for list of named_selections.
PProfizi Feb 13, 2023
27905f8
Specify precedence of "selection" argument.
PProfizi Feb 13, 2023
04bfee1
Mention priority order for filtering arguments.
PProfizi Feb 13, 2023
4eb49bd
Switch to node_ids, element_ids and named_selections in static_mechan…
PProfizi Feb 13, 2023
0c6d34a
Add component info for vector results in static_mechanical_simulation.py
PProfizi Feb 13, 2023
e1e569d
Add component info for matrix results in static_mechanical_simulation.py
PProfizi Feb 13, 2023
0d5d470
Add component info for principal results in static_mechanical_simulat…
PProfizi Feb 13, 2023
0faa1b0
Fix tests
PProfizi Feb 13, 2023
e32deef
Fix DataObject docstring
PProfizi Feb 13, 2023
b4c1378
Fix 02-get_data_from_static_simulation.py
PProfizi Feb 13, 2023
e439c52
component_ids -> components
PProfizi Feb 14, 2023
9df3114
Also use set_ids, load_steps, and sub_steps, in signatures for transi…
PProfizi Feb 14, 2023
409869b
_build_mesh_scoping now returns either a Scoping or an operator Outpu…
PProfizi Feb 14, 2023
3e9e062
sub_steps is now declared using a tuple for load_steps.
PProfizi Feb 14, 2023
6c8762d
sub_steps is now declared using a tuple for load_steps.
PProfizi Feb 14, 2023
98a032b
Force mutual exclusivity of timefreq arguments, as well as of mesh sc…
PProfizi Feb 14, 2023
8b53835
Add an "all_sets" argument which is set to True means all sets will b…
PProfizi Feb 15, 2023
36a9b2c
Improve docstrings to explain extraction defaults in case of no argum…
PProfizi Feb 15, 2023
cb8d763
Add implementation for "times" input.
PProfizi Feb 15, 2023
81dc806
Reorder and fix all result methods signatures and docstrings.
PProfizi Feb 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/00-Overview/02-get_data_from_static_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/dpf/post/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/dpf/post/data_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
Loading