Skip to content

Commit 710dca7

Browse files
committed
update pendulum2D as describe in #150
1 parent 69b62cf commit 710dca7

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed
Loading
Loading

examples/modules/csm/pages/pendulum2D/index.adoc

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,82 @@ The pid helps to see how the mesh was partitioned for parallel processing.
137137
include::{examplesdir}/pendulum2D/pendulum2D.json[tags=exports]
138138
----
139139

140+
[source,python]
141+
----
142+
import pandas as pd
143+
df=pd.DataFrame(meas)
144+
print(df.head())
145+
146+
# prepare for plotting
147+
import plotly.graph_objects as go
148+
----
149+
150+
[%collapsible.result]
151+
.Results
152+
====
153+
----
154+
Paraview files are in /scratch/jupyter/feelppdb/np_1/np_1/solid.exports
155+
Statistics_disp_max Statistics_disp_mean_0 Statistics_disp_mean_1 \
156+
0 0.000000e+00 0.000000 0.000000
157+
1 -3.329553e-07 -0.000003 -0.000242
158+
2 -4.652734e-06 -0.000022 -0.001200
159+
3 1.084905e-05 -0.000097 -0.003076
160+
4 6.733757e-05 -0.000294 -0.005797
161+
162+
Statistics_disp_min Statistics_von-mises_max Statistics_von-mises_mean \
163+
0 0.000000 0.000000e+00 0.000000
164+
1 -0.000245 8.511694e+04 735.543752
165+
2 -0.001221 3.746634e+05 4510.381468
166+
3 -0.003151 8.814162e+05 13740.732376
167+
4 -0.005967 1.580571e+06 28332.568714
168+
169+
Statistics_von-mises_min time
170+
0 0.000000 0.00
171+
1 0.552184 0.01
172+
2 3.061166 0.02
173+
3 17.603125 0.03
174+
4 92.414719 0.04
175+
----
176+
====
177+
178+
=== Displacement
179+
180+
.Plot the max of the displacement over time
181+
[source,python]
182+
----
183+
fig = go.Figure()
184+
fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_disp_max"], name="max disp"))
185+
fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_disp_min"], name="min disp"))
186+
fig.update_layout(legend_title_text='Max displacement over time')
187+
fig.show()
188+
----
189+
190+
[%collapsible.result]
191+
.Results
192+
====
193+
image:{imagesprefix}pendulum/minmaxdisp.png[]
194+
====
195+
196+
=== Von-Mises Criterions
197+
198+
199+
.Plot the max of the von-mises criterion over time
200+
[source,python]
201+
----
202+
fig = go.Figure()
203+
fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_von-mises_max"],name="max"))
204+
fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_von-mises_min"],name="min"))
205+
fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_von-mises_mean"],name="mean"))
206+
fig.update_layout(legend_title_text='Von-Mises min,mean and max over time')
207+
fig.show()
208+
----
209+
210+
[%collapsible.result]
211+
.Results
212+
====
213+
image:{imagesprefix}pendulum/minmaxvonmises.png[]
214+
====
215+
140216
=== Video
141217

142218
The video below shows the oscillating motion of the pendulum.

0 commit comments

Comments
 (0)