Skip to content

Commit 2fcd066

Browse files
committed
Merge remote-tracking branch 'origin/zzqbranch'
2 parents fc9f09d + 3c40a85 commit 2fcd066

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

README.rst

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,31 @@ The following code postprocesses results from the solve of this basic ball plate
196196
.. code:: python
197197
198198
from ansys.dpf import core as dpf
199+
import os
199200
200201
ds = dpf.DataSources()
201-
ds.set_result_file_path(r'./d3plot', 'd3plot')
202-
203-
resultOp = dpf.Operator("lsdyna::d3plot::stress_von_mises")
204-
resultOp.inputs.data_sources(ds)
205-
# set the time
206-
resultOp.inputs.time_scoping.connect([3])
207-
result = resultOp.outputs.stress_von_mises()
202+
data_path = os.path.join(os.getcwd(), 'd3plot')
203+
ds.set_result_file_path(data_path, 'd3plot')
204+
205+
model = dpf.Model(ds)
206+
# Extract displacements for all time steps from d3plot
207+
D = model.results.displacement.on_all_time_freqs().eval()
208+
D.animate()
209+
210+
stress = dpf.operators.result.stress()
211+
stress.inputs.data_sources(ds)
212+
stress.inputs.time_scoping([12])
213+
stress.connect(25, [1])
214+
stress.inputs.requested_location.connect("Nodal")
215+
fields = stress.outputs.fields_container()
216+
217+
shell_layer_extract = dpf.operators.utility.change_shell_layers()
218+
shell_layer_extract.inputs.fields_container.connect(fields)
219+
print(shell_layer_extract.inputs.e_shell_layer)
220+
shell_layer_extract.inputs.e_shell_layer.connect(0)
221+
fields_top = shell_layer_extract.outputs.fields_container_as_fields_container()
222+
print(fields_top)
223+
fields_top.animate()
208224
209225
For more examples, see `Examples <https://dyna.docs.pyansys.com/version/stable/examples/index.html>`_
210226
in the PyDYNA documentation.

0 commit comments

Comments
 (0)