diff --git a/examples/modules/csm/assets/images/pendulum/minmaxdisp.png b/examples/modules/csm/assets/images/pendulum/minmaxdisp.png new file mode 100644 index 00000000..06ab4d08 Binary files /dev/null and b/examples/modules/csm/assets/images/pendulum/minmaxdisp.png differ diff --git a/examples/modules/csm/assets/images/pendulum/minmaxvonmises.png b/examples/modules/csm/assets/images/pendulum/minmaxvonmises.png new file mode 100644 index 00000000..3f0413f1 Binary files /dev/null and b/examples/modules/csm/assets/images/pendulum/minmaxvonmises.png differ 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..1ba89f6c 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/pendulum2D/pendulum2D.json b/examples/modules/csm/examples/pendulum2D/pendulum2D.json index 70f8983e..15409134 100644 --- a/examples/modules/csm/examples/pendulum2D/pendulum2D.json +++ b/examples/modules/csm/examples/pendulum2D/pendulum2D.json @@ -7,7 +7,7 @@ { "version": "1", "author": ["vincentchabannes","prudhomm","lberti","jobinhio"], - "date": "23/09/2022", + "date": "30/11/2022", "references":[""] }, "Models": @@ -76,7 +76,19 @@ }, "Measures": { - "VolumeVariation":"" + "VolumeVariation":"", + "Statistics": + { + "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/examples/pendulum3D/pendulum3D.json b/examples/modules/csm/examples/pendulum3D/pendulum3D.json index 18b7aaa9..d12cd866 100644 --- a/examples/modules/csm/examples/pendulum3D/pendulum3D.json +++ b/examples/modules/csm/examples/pendulum3D/pendulum3D.json @@ -5,7 +5,7 @@ { "version": "1", "author": ["vincentchabannes","prudhomm","lberti","jobinhio"], - "date": "23/09/2022", + "date": "30/11/2022", "references":[""] }, "Models": @@ -72,7 +72,19 @@ }, "Measures": { - "VolumeVariation":"" + "VolumeVariation":"", + "Statistics": + { + "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/examples/spring/spring.json b/examples/modules/csm/examples/spring/spring.json index 8aacc7f2..60575226 100644 --- a/examples/modules/csm/examples/spring/spring.json +++ b/examples/modules/csm/examples/spring/spring.json @@ -6,7 +6,7 @@ { "version": "1", "author": ["vincentchabannes","prudhomm","lberti","jobinhio"], - "date": "23/09/2022", + "date": "30/11/2022", "references":[""] }, "Models": @@ -77,6 +77,22 @@ "Exports": { "fields":["displacement","pressure","pid","von-mises-criterion"] + }, + "Measures": + { + "Statistics": + { + "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/examples/suspension/suspension.json b/examples/modules/csm/examples/suspension/suspension.json index 5d595098..b4ad11e3 100644 --- a/examples/modules/csm/examples/suspension/suspension.json +++ b/examples/modules/csm/examples/suspension/suspension.json @@ -6,7 +6,7 @@ { "version": "1", "author": ["vincentchabannes","prudhomm","lberti","jobinhio"], - "date": "23/09/2022", + "date": "30/11/2022", "references":[""] }, "Models": @@ -78,7 +78,22 @@ { "Exports": { - "fields":["displacement"] + "fields":["displacement","pid","von-mises-criterion"] + }, + "Measures": + { + "Statistics": + { + "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/examples/vierendeel-truss/Plate.json b/examples/modules/csm/examples/vierendeel-truss/Plate.json index 62d0bfe9..75f9ef25 100644 --- a/examples/modules/csm/examples/vierendeel-truss/Plate.json +++ b/examples/modules/csm/examples/vierendeel-truss/Plate.json @@ -5,7 +5,7 @@ { "version": "1", "author": ["vincentchabannes","prudhomm","lberti","jobinhio"], - "date": "23/09/2022", + "date": "30/11/2022", "references":[""] }, "Models": @@ -65,6 +65,22 @@ "Exports": { "fields":["displacement","von-mises-criterion","tresca-criterion","principal-stresses"] + }, + "Measures": + { + "Statistics": + { + "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" + } + } } } // TODO : Currently doesn't work diff --git a/examples/modules/csm/pages/pendulum2D/index.adoc b/examples/modules/csm/pages/pendulum2D/index.adoc index 4d419218..884920a6 100644 --- a/examples/modules/csm/pages/pendulum2D/index.adoc +++ b/examples/modules/csm/pages/pendulum2D/index.adoc @@ -25,6 +25,32 @@ mpirun -np 4 feelpp_toolbox_solid --case "github:{repo:toolbox,path:examples/mod NOTE: The report of the execution of the command above is available xref:pendulum2D/solid-information.adoc[here]. +=== Python interface +We start with the {feelpp} environment. + +[source,python] +---- +from feelpp import * +from feelpp.toolboxes.core import * +from feelpp.toolboxes.solid import * + +# create the application +# create a feelppdb subdirectory where the results are stored +app = Environment(['feelpp_toolbox_solid'], opts= toolboxes_options("solid"),config=localRepository("")) +---- + +Next we download the study configuration and simulate it + +[source,python] +---- +pendulum2Dcfg=feelpp.download("github:{repo:toolbox,path:examples/modules/csm/examples/pendulum2D/}", worldComm=app.worldCommPtr())[0] +pendulum2Dcfg+='/pendulum2D.cfg' + +if os.path.exists(pendulum2Dcfg): + app.setConfigFile(pendulum2Dcfg) + s = solid(dim=2) +---- + == Data files The case data files are available in Github link:{uri-data}/pendulum/[here] @@ -106,6 +132,82 @@ The pid helps to see how the mesh was partitioned for parallel processing. include::example$pendulum2D/pendulum2D.json[tags=exports] ---- +[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.000000e+00 0.000000 0.000000 +1 -3.329553e-07 -0.000003 -0.000242 +2 -4.652734e-06 -0.000022 -0.001200 +3 1.084905e-05 -0.000097 -0.003076 +4 6.733757e-05 -0.000294 -0.005797 + + Statistics_disp_min Statistics_von-mises_max Statistics_von-mises_mean \ +0 0.000000 0.000000e+00 0.000000 +1 -0.000245 8.511694e+04 735.543752 +2 -0.001221 3.746634e+05 4510.381468 +3 -0.003151 8.814162e+05 13740.732376 +4 -0.005967 1.580571e+06 28332.568714 + + Statistics_von-mises_min time +0 0.000000 0.00 +1 0.552184 0.01 +2 3.061166 0.02 +3 17.603125 0.03 +4 92.414719 0.04 +---- +==== + +=== 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}pendulum/minmaxdisp.png[] +==== + +=== 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}pendulum/minmaxvonmises.png[] +==== + === Video The video below shows the oscillating motion of the pendulum. diff --git a/examples/modules/csm/pages/spring/README.adoc b/examples/modules/csm/pages/spring/README.adoc index 551c9eb9..c06aee9e 100644 --- a/examples/modules/csm/pages/spring/README.adoc +++ b/examples/modules/csm/pages/spring/README.adoc @@ -24,6 +24,153 @@ mpirun -np 4 feelpp_toolbox_solid --case "github:{repo:toolbox,path:examples/mod NOTE: The report of the execution of the command above is available xref:spring/solid-information.adoc[here]. +=== Python interface +We start with the {feelpp} environment. + +[source,python] +---- +from feelpp import * +from feelpp.toolboxes.core import * +from feelpp.toolboxes.solid import * + +# create the application +# create a feelppdb subdirectory where the results are stored +app = Environment(['feelpp_toolbox_solid'], opts= toolboxes_options("solid"),config=localRepository("")) +---- + +Next we download the study configuration and simulate it + +[source,python] +---- +springcfg=feelpp.download("github:{repo:toolbox,path:examples/modules/csm/examples/spring/}", worldComm=app.worldCommPtr())[0] +springcfg+='/spring.cfg' + +if os.path.exists(springcfg): + app.setConfigFile(springcfg) + s = solid(dim=3) + ok,meas=simulate(s) + if ok: + # export in paraview format + s.exportResults() +---- +[%collapsible.result] +.Results +==== +---- +Reading /home/congo/Document/feelppdb/downloads/spring/spring.cfg... +solid(3,1) +[modelProperties] Loading Model Properties : "/home/congo/Document/feelppdb/downloads/spring/spring.json" +[loadMesh] Loading Gmsh compatible mesh: "/home/congo/Document/feelppdb/downloads/solid/meshes/spring.msh" +[loadMesh] Loading Gmsh compatible mesh: "/home/congo/Document/feelppdb/downloads/solid/meshes/spring.msh" done + 0 solid KSP Residual norm 2.666382e+03 + 1 solid KSP Residual norm 5.794911e+00 + 2 solid KSP Residual norm 1.438302e+00 + 3 solid KSP Residual norm 1.376460e+00 + 4 solid KSP Residual norm 3.529754e-02 + 5 solid KSP Residual norm 1.722303e-02 + 6 solid KSP Residual norm 8.446949e-03 + 7 solid KSP Residual norm 7.937000e-03 + 8 solid KSP Residual norm 5.918753e-03 + 9 solid KSP Residual norm 5.302495e-03 + 10 solid KSP Residual norm 5.287803e-03 + 11 solid KSP Residual norm 5.241817e-03 + 12 solid KSP Residual norm 5.231319e-03 + 13 solid KSP Residual norm 5.159547e-03 + 14 solid KSP Residual norm 5.122767e-03 + 15 solid KSP Residual norm 5.078984e-03 + 16 solid KSP Residual norm 5.037953e-03 + 17 solid KSP Residual norm 4.997618e-03 + 18 solid KSP Residual norm 4.958278e-03 + 19 solid KSP Residual norm 4.919848e-03 + 20 solid KSP Residual norm 4.882298e-03 + 21 solid KSP Residual norm 4.845595e-03 + 22 solid KSP Residual norm 4.809708e-03 + 23 solid KSP Residual norm 4.774606e-03 + 24 solid KSP Residual norm 4.740262e-03 + 25 solid KSP Residual norm 4.706648e-03 + 26 solid KSP Residual norm 4.673740e-03 + 27 solid KSP Residual norm 4.641512e-03 + 28 solid KSP Residual norm 4.609942e-03 + 29 solid KSP Residual norm 4.579007e-03 + 30 solid KSP Residual norm 1.418331e-02 + 31 solid KSP Residual norm 1.418331e-02 + 32 solid KSP Residual norm 1.414001e-02 + 33 solid KSP Residual norm 1.381685e-02 + 34 solid KSP Residual norm 1.381187e-02 + 35 solid KSP Residual norm 5.663386e-03 + 36 solid KSP Residual norm 4.546781e-03 + 37 solid KSP Residual norm 3.758845e-03 + 38 solid KSP Residual norm 3.620873e-03 + 39 solid KSP Residual norm 2.561403e-03 + 40 solid KSP Residual norm 2.309503e-03 + 41 solid KSP Residual norm 1.911301e-03 + 42 solid KSP Residual norm 1.709491e-03 + 43 solid KSP Residual norm 1.553256e-03 + 44 solid KSP Residual norm 1.434568e-03 + 45 solid KSP Residual norm 1.339276e-03 + 46 solid KSP Residual norm 1.260792e-03 + 47 solid KSP Residual norm 1.194658e-03 + 48 solid KSP Residual norm 1.137948e-03 + 49 solid KSP Residual norm 1.088615e-03 + 50 solid KSP Residual norm 1.045188e-03 + 51 solid KSP Residual norm 1.006576e-03 + 52 solid KSP Residual norm 9.719491e-04 + 53 solid KSP Residual norm 9.406664e-04 + 54 solid KSP Residual norm 9.122219e-04 + 55 solid KSP Residual norm 8.862111e-04 + 56 solid KSP Residual norm 8.623054e-04 + 57 solid KSP Residual norm 8.402355e-04 + 58 solid KSP Residual norm 8.197778e-04 + 59 solid KSP Residual norm 8.007451e-04 + 60 solid KSP Residual norm 3.473260e-03 + 61 solid KSP Residual norm 3.473260e-03 + 62 solid KSP Residual norm 2.645128e-03 + 63 solid KSP Residual norm 2.363871e-03 + 64 solid KSP Residual norm 2.217282e-03 + 65 solid KSP Residual norm 7.074701e-04 + 66 solid KSP Residual norm 2.915517e-04 + 67 solid KSP Residual norm 2.906449e-04 + 68 solid KSP Residual norm 2.777567e-04 + 69 solid KSP Residual norm 2.527710e-04 + 70 solid KSP Residual norm 2.441053e-04 + 71 solid KSP Residual norm 2.399597e-04 + 72 solid KSP Residual norm 2.321057e-04 + 73 solid KSP Residual norm 2.262180e-04 + 74 solid KSP Residual norm 2.204787e-04 + 75 solid KSP Residual norm 2.152092e-04 + 76 solid KSP Residual norm 2.102909e-04 + 77 solid KSP Residual norm 2.056966e-04 + 78 solid KSP Residual norm 2.013906e-04 + 79 solid KSP Residual norm 1.973442e-04 + 80 solid KSP Residual norm 1.935323e-04 + 81 solid KSP Residual norm 1.899331e-04 + 82 solid KSP Residual norm 1.865275e-04 + 83 solid KSP Residual norm 1.832988e-04 + 84 solid KSP Residual norm 1.802321e-04 + 85 solid KSP Residual norm 1.773144e-04 + 86 solid KSP Residual norm 1.745339e-04 + 87 solid KSP Residual norm 1.718803e-04 + 88 solid KSP Residual norm 1.693441e-04 + 89 solid KSP Residual norm 1.669170e-04 + 90 solid KSP Residual norm 6.821151e-04 + 91 solid KSP Residual norm 6.821150e-04 + 92 solid KSP Residual norm 6.681642e-04 + 93 solid KSP Residual norm 6.623689e-04 + 94 solid KSP Residual norm 5.422561e-04 + 95 solid KSP Residual norm 4.490976e-04 + 96 solid KSP Residual norm 3.576529e-04 + 97 solid KSP Residual norm 1.694319e-04 + 98 solid KSP Residual norm 1.144074e-04 + 99 solid KSP Residual norm 8.949649e-05 + 100 solid KSP Residual norm 6.916455e-05 + 101 solid KSP Residual norm 4.569727e-05 + 102 solid KSP Residual norm 3.767149e-05 + 103 solid KSP Residual norm 3.220917e-05 + 104 solid KSP Residual norm 2.862794e-05 + 105 solid KSP Residual norm 2.600897e-05 +Linear solve converged due to CONVERGED_RTOL iterations 105 +---- +==== == Data files The case data files are available in Github link:{uri-data}/spring/[here]: @@ -62,14 +209,14 @@ The coil spring is entirely made of steel. [source,json,indent=0] ---- -include::{examplesdir}/spring/spring.json[tags=materials] +include::example$spring/spring.json[tags=materials] ---- We also need gravity: [source,json,indent=0] ---- -include::{examplesdir}/spring/spring.json[tags=params] +include::example$spring/spring.json[tags=params] ---- === Boundary conditions @@ -94,24 +241,51 @@ Gravity is applied as a volumic force on all the elements of the mesh. [source,json,indent=0] ---- -include::{examplesdir}/spring/spring.json[tags=bc] +include::example$spring/spring.json[tags=bc] ---- == Results -The fields of interest are the displacement, the von Mises yield criterion and the parallel process id (pid). -The pid helps to see how the mesh was partitioned for parallel processing. -In the 3D view below, when selecting the pid in the first dropdown list, each color corresponds to a subdomain assigned to and processed by a CPU core. +[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.000134 -0.000076 -0.000056 + + Statistics_disp_mean_2 Statistics_disp_min Statistics_von-mises_max \ +0 -0.004154 -0.008009 3.154187e+06 + + Statistics_von-mises_mean Statistics_von-mises_min +0 498532.746557 9454.21631 +---- +==== + +The fields of interest are the displacement, the von Mises yield criterion and the parallel process id (pid). +The pid helps to see how the mesh was partitioned for parallel processing. + +In the 3D view below, when selecting the pid in the first dropdown list, each color corresponds to a subdomain assigned to and processed by a CPU core. [source,json] ---- -include::{examplesdir}/spring/spring.json[tags=params] +include::example$spring/spring.json[tags=params] ---- [source,json] ---- -include::{examplesdir}/spring/spring.json[tags=export] +include::example$spring/spring.json[tags=export] ---- === Pictures diff --git a/examples/modules/csm/pages/suspension/index.adoc b/examples/modules/csm/pages/suspension/index.adoc index dcacac41..08d8cc5a 100644 --- a/examples/modules/csm/pages/suspension/index.adoc +++ b/examples/modules/csm/pages/suspension/index.adoc @@ -30,6 +30,35 @@ mpirun -np 4 feelpp_toolbox_solid --case "github:{repo:toolbox,path:examples/mod NOTE: The report of the execution of the command above is available xref:suspension/solid.information.adoc[here]. +=== Python interface +We start with the {feelpp} environment. + +[source,python] +---- +from feelpp import * +from feelpp.toolboxes.core import * +from feelpp.toolboxes.solid import * + +# create the application +# create a feelppdb subdirectory where the results are stored +app = Environment(['feelpp_toolbox_solid'], opts= toolboxes_options("solid"),config=localRepository("")) +---- + +Next we download the study configuration and simulate it + +[source,python] +---- +suspensioncfg=feelpp.download("github:{repo:toolbox,path:examples/modules/csm/examples/suspension/}", worldComm=app.worldCommPtr())[0] +suspensioncfg+='/suspension.cfg' + +if os.path.exists(suspensioncfg): + app.setConfigFile(suspensioncfg) + s = solid(dim=3) + ok,meas=simulate(s) + if ok: + # export in paraview format + s.exportResults() +---- == Data files The case data files are available in Github link:{uri-data}/suspension/[here] @@ -67,9 +96,64 @@ image: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. @@ -78,9 +162,28 @@ a| image:suspension/image7.png[] a| image:suspension/image8.png[] a| image:suspe a| image:suspension/image10.png[] a| image:suspension/image11.png[] | |==== +=== 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%open.result] +.Results +==== +image::suspension/minmaxvonmises.png[] +==== Finally, we provide a 3D interactive model of the fishbone +.3D visualisation of the geometry and displacement field [vtkjs,https://girder.math.unistra.fr/api/v1/file/5ad4b768b0e9574027047d73/download] ---- { @@ -98,3 +201,4 @@ Finally, we provide a 3D interactive model of the fishbone } ---- + diff --git a/examples/modules/csm/pages/vierendeel-truss/index.adoc b/examples/modules/csm/pages/vierendeel-truss/index.adoc index 5e779e87..bc4e6ff4 100644 --- a/examples/modules/csm/pages/vierendeel-truss/index.adoc +++ b/examples/modules/csm/pages/vierendeel-truss/index.adoc @@ -25,6 +25,36 @@ feelpp_toolbox_solid --config-file Plate.cfg NOTE: The report of the execution of the command above is available xref:vierendeel-truss/solid-information.adoc[here]. +=== Python interface +We start with the {feelpp} environment. + +[source,python] +---- +from feelpp import * +from feelpp.toolboxes.core import * +from feelpp.toolboxes.solid import * + +# create the application +# create a feelppdb subdirectory where the results are stored +app = Environment(['feelpp_toolbox_solid'], opts= toolboxes_options("solid"),config=localRepository("")) +---- + +Next we download the study configuration and simulate it + +[source,python] +---- +vierendeelcfg=feelpp.download("github:{repo:toolbox,path:examples/modules/csm/examples/vierendeel-truss/}", worldComm=app.worldCommPtr())[0] +vierendeelcfg+='/Plate.cfg' + +if os.path.exists(vierendeelcfg): + app.setConfigFile(vierendeelcfg) + s = solid(dim=3) + ok,meas=simulate(s) + if ok: + # export in paraview format + s.exportResults() +---- + == Model/Geometry First, we need to build the model, which we are going to do using the Gmsh-software. @@ -58,6 +88,32 @@ image:vierendeel-truss/image3.png[image,width=509,height=279] == Results +[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 2.246600e-08 -7.968505e-12 -7.703508e-08 + + Statistics_disp_mean_2 Statistics_disp_min Statistics_von-mises_max \ +0 8.904803e-11 -1.442219e-07 103174.263982 + + Statistics_von-mises_mean Statistics_von-mises_min +0 14927.08173 1.839565 +---- +==== + === Displacement Maximum displacement: 1.498e-07 m