diff --git a/examples/modules/csm/assets/images/suspension/minmaxdisp.png b/examples/modules/csm/assets/images/suspension/minmaxdisp.png new file mode 100644 index 00000000..0c38ae5a Binary files /dev/null and b/examples/modules/csm/assets/images/suspension/minmaxdisp.png differ diff --git a/examples/modules/csm/assets/images/suspension/minmaxvonmises.png b/examples/modules/csm/assets/images/suspension/minmaxvonmises.png new file mode 100644 index 00000000..b78b82f8 Binary files /dev/null and b/examples/modules/csm/assets/images/suspension/minmaxvonmises.png differ diff --git a/examples/modules/csm/examples/suspension/suspension.json b/examples/modules/csm/examples/suspension/suspension.json index 36b3dcca..b4ad11e3 100644 --- a/examples/modules/csm/examples/suspension/suspension.json +++ b/examples/modules/csm/examples/suspension/suspension.json @@ -78,18 +78,21 @@ { "Exports": { - "fields":["displacement"] + "fields":["displacement","pid","von-mises-criterion"] }, - "Statistics": + "Measures": { - "disp": + "Statistics": { - "type":["min","max","mean"], - "field":"displacement" - }, - "von-mises": { - "type": ["min","max","mean"], - "expr": "sqrt(0.5*((solid_stress_P_00-solid_stress_P_11)^2+(solid_stress_P_11-solid_stress_P_22)^2+(solid_stress_P_22-solid_stress_P_11)^2+6*(solid_stress_P_12^2+solid_stress_P_23^2+solid_stress_P_31^2))):solid_stress_P_00:solid_stress_P_11:solid_stress_P_22:solid_stress_P_12:solid_stress_P_23:solid_stress_P_31" + "disp": + { + "type":["min","max","mean"], + "field":"displacement" + }, + "von-mises": { + "type": ["min","max","mean"], + "expr": "sqrt(0.5*((solid_stress_P_00-solid_stress_P_11)^2+(solid_stress_P_11-solid_stress_P_22)^2+(solid_stress_P_22-solid_stress_P_11)^2+6*(solid_stress_P_12^2+solid_stress_P_23^2+solid_stress_P_31^2))):solid_stress_P_00:solid_stress_P_11:solid_stress_P_22:solid_stress_P_12:solid_stress_P_23:solid_stress_P_31" + } } } } diff --git a/examples/modules/csm/pages/suspension/index.adoc b/examples/modules/csm/pages/suspension/index.adoc index 3dca30a0..b4a4c671 100644 --- a/examples/modules/csm/pages/suspension/index.adoc +++ b/examples/modules/csm/pages/suspension/index.adoc @@ -60,7 +60,11 @@ suspensioncfg+='/suspension.cfg' if os.path.exists(suspensioncfg): app.setConfigFile(suspensioncfg) - s = solid(dim=3) + s = solid(dim=3) + ok,meas=simulate(s) + if ok: + # export in paraview format + s.exportResults() ---- == Data files @@ -99,9 +103,64 @@ image:{imagesprefix}suspension/image6.png[1.png,width=209,height=188] NOTE: The result were run in time (two whole period, but in the pictures can be seen only a quarter period). +[source,python] +---- +import pandas as pd +df=pd.DataFrame(meas) +print(df.head()) + +# prepare for plotting +import plotly.graph_objects as go +---- + +[%collapsible.result] +.Results +==== +---- +Paraview files are in /scratch/jupyter/feelppdb/np_1/np_1/solid.exports + Statistics_disp_max Statistics_disp_mean_0 Statistics_disp_mean_1 \ +0 0.000000 0.000000 0.000000 +1 0.300347 0.133346 0.000059 +2 0.607255 0.271978 0.000166 +3 0.854034 0.379294 0.000305 +4 1.116512 0.499815 0.000475 + + Statistics_disp_mean_2 Statistics_disp_min Statistics_von-mises_max \ +0 0.000000 0.000000 0.000000 +1 -0.001735 -0.032935 208.036037 +2 -0.003278 -0.066174 419.853790 +3 -0.004200 -0.092967 594.509462 +4 -0.005155 -0.120885 775.939518 + + Statistics_von-mises_mean Statistics_von-mises_min time +0 0.000000 0.000000 0.0 +1 19.379505 0.049740 0.1 +2 39.259107 0.104465 0.2 +3 55.140414 0.167094 0.3 +4 72.230883 0.230105 0.4 +---- +==== + === Displacement +.Plot the max of the displacement over time +[source,python] +---- +fig = go.Figure() +fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_disp_max"], name="max disp")) +fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_disp_min"], name="min disp")) +fig.update_layout(legend_title_text='Max displacement over time') +fig.show() +---- + +[%collapsible.result] +.Results +==== +image:{imagesprefix}suspension/minmaxdisp.png[] +==== + + We display the displacement in the figures below. A 20x scale factor is used to make the displacement easy to see. The maximum displacement is 1.778 mm. The design of the wishbones is very good because there is only little displacement due to the force. @@ -128,3 +187,22 @@ feelppVtkJs.createSceneImporter( vtkVisuSection1, { ++++ **** + +=== Von-Mises Criterions + +.Plot the max of the von-mises criterion over time +[source,python] +---- +fig = go.Figure() +fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_von-mises_max"],name="max")) +fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_von-mises_min"],name="min")) +fig.add_trace(go.Scatter(x=df["time"], y=df["Statistics_von-mises_mean"],name="mean")) +fig.update_layout(legend_title_text='Von-Mises min,mean and max over time') +fig.show() +---- + +[%collapsible.result] +.Results +==== +image:{imagesprefix}suspension/minmaxvonmises.png[] +==== \ No newline at end of file