@@ -196,15 +196,31 @@ The following code postprocesses results from the solve of this basic ball plate
196
196
.. code :: python
197
197
198
198
from ansys.dpf import core as dpf
199
+ import os
199
200
200
201
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()
208
224
209
225
For more examples, see `Examples <https://dyna.docs.pyansys.com/version/stable/examples/index.html >`_
210
226
in the PyDYNA documentation.
0 commit comments