| @@ -260,9 +260,35 @@ if(output_format, html, | |||
| ]]) | |||
| divert(0) | |||
| forloop(i, 1, n_grids, [[ | |||
| ![Mesh for $n=[[]]i$](pipe-mesh-[[]]i.png){[[#]]fig:mesh[[]]i width=80%} | |||
| ]]) | |||
| dnl forloop(i, 1, n_grids, [[ | |||
| dnl ![Mesh for $n=[[]]i$](pipe-mesh-[[]]i.png){[[#]]fig:mesh[[]]i width=80%} | |||
| dnl ]]) | |||
| :::: {#fig:mesh12} | |||
| {#fig:mesh1 width=90%} | |||
| {#fig:mesh2 width=90%} | |||
| Parametric grids with\ $n$ elements through the pipe thickness. | |||
| :::: | |||
| :::: {#fig:mesh34} | |||
| {#fig:mesh3 width=90%} | |||
| {#fig:mesh4 width=90%} | |||
| Parametric grids with\ $n$ elements through the pipe thickness. | |||
| :::: | |||
| :::: {#fig:mesh56} | |||
| {#fig:mesh5 width=90%} | |||
| {#fig:mesh6 width=90%} | |||
| Parametric grids with\ $n$ elements through the pipe thickness. | |||
| :::: | |||
| {#fig:distorted} | |||
| @@ -287,10 +313,14 @@ Let us now switch to analyze the stresses, where the difference between first an | |||
| {#fig:sigmar} | |||
| :::: {#fig:sigmas-l-theta} | |||
| {#fig:sigmal} | |||
| {#fig:sigmatheta} | |||
| Longitudinal and tangential normal stresses | |||
| :::: | |||
| The reason of this behavior is that in first-order tetrahedra, the derivatives of the shape functions are uniform in space. Therefore, the stresses (that depend on the gradient of the displacements) are uniform throughout each element. The values of these uniform stresses are somehow an average of the contribution of each of the four nodes of the tetrahedron. For those elements that are in the bulk of the domain, the processes of computing the stresses at the nodes---which depends on the finite-element code implementation but in general involves averaging back the contributions of each of the elements that share a node---gives reasonable results because some of the element would contribute by defect and some by excess to the final nodal average. But those nodes that are located in the internal (external) faces of the pipe will have elements contributing only with values by excess (defect). Therefore, first-order elements will mostly give incorrect stresses at $r=a$ and $r=b$, overestimating them in the former and underestimating them in the latter. This is exactly the behavior of the first-order stresses obtained in [@fig:sigmar;@fig:sigmal;@fig:sigmatheta]. Second-order elements still have non-uniform spatial derivatives and they can recover (almost^[The rate of convergence of the stresses in the nodes located in the boundary of the domain is linear, while it is quadratic in the bulk.]) the real values for the stresses at the nodes located in the boundary of the domain. | |||
| ## Linearized stresses {#sec:linearized} | |||
| @@ -303,30 +333,49 @@ Figures [-@fig:M_tresca]--[-@fig:MB_3] show the membrane $\text{M}$ and membra | |||
| This last statement can be explained using the uniform-derivative reasoning explained in [@sec:stresses]. As the membrane stress is essentially an average along the stress classification line, the excess and defect errors committed by the first-order grids in $r=a$ and $r=b$ almost cancel out. Therefore, the error for computing $\text{M}$ with linear elements is not that relevant. However, the membrane plus bending stress is a first-order momentum of the stress distribution. This time, the deviations do not cancel out and they both contribute with the same sign to the value of linearized stress. It is this effect that gives such a slow convergence for $\text{MB}$. | |||
| :::: {#fig:tresca} | |||
| {#fig:M_tresca} | |||
| {#fig:MB_tresca} | |||
| Linearized Tresca stresses | |||
| :::: | |||
| :::: {#fig:vonmises} | |||
| {#fig:M_vonmises} | |||
| {#fig:MB_vonmises} | |||
| Linearized Von Mises stresses | |||
| :::: | |||
| :::: {#fig:principal1} | |||
| {#fig:M_1} | |||
| {#fig:MB_1} | |||
| Linearized principal stresses\ 1 | |||
| :::: | |||
| :::: {#fig:principal2} | |||
| {#fig:M_2} | |||
| {#fig:MB_2} | |||
| Linearized principal stresses\ 2 | |||
| :::: | |||
| :::: {#fig:principal3} | |||
| {#fig:M_3} | |||
| {#fig:MB_3} | |||
| Linearized principal stresses\ 3 | |||
| :::: | |||
| ## Computational resources {#sec:resources} | |||
| As evident as it it that second-order elements give far superior results than linear ones, any fair analysis needs to compare solutions that involve similar amounts of computational efforts both in [random-access memory](https://en.wikipedia.org/wiki/Random-access_memory) and number of [floating-point operations](https://en.wikipedia.org/wiki/FLOPS)---otherwise we would end up comparing apples and oranges. That is to say, we might be comparing results from a run that takes one week with a one-second execution and then conclude that the first scheme gives better results than the second. Yes, it does, but it is not a fair comparison. | |||
| @@ -335,14 +384,22 @@ Roughly speaking, the CPU and memory consumption depend non-linearly on the size | |||
| In effect, the number of elements as a function of $n$ is the same for both grids, as it can seen in [@fig:elements-vs-n]. But the number of nodes is far higher in the second-order grid for the same $n$ ([@fig:nodes-vs-n]). This leads to more CPU and memory, as shown in [@fig:cpu-vs-n; @fig:memory-vs-n]. | |||
| :::: {#fig:ele-nodes-vs-n} | |||
| {#fig:elements-vs-n} | |||
| {#fig:nodes-vs-n} | |||
| Elements and nodes vs.\ $n$ | |||
| :::: | |||
| :::: {#fig:cpu-mem-vs-n} | |||
| {#fig:cpu-vs-n} | |||
| {#fig:memory-vs-n} | |||
| CPU time and memory vs.\ $n$ | |||
| :::: | |||
| ## Error as a function of CPU time {#sec:error} | |||
| So, on the one hand, for a fixed $n$, second-order elements give far better results than linear elements. On the other hand, the former consume far more computational resources than the latter. Therefore, in order to compare apples and apples, in principle the comparison of results should be performed by fixing the number of _nodes_ (and, again, not the number of _elements_) as discussed above. But given that the problem we are solving does have analytical solutions, we can also analyze the errors associated to each of the finite-element formulations as a function of the computational effort. | |||
| @@ -351,10 +408,14 @@ Figures [-@fig:error-M-vs-cpu] and [-@fig:error-MB-vs-cpu] show a log-log plot o | |||
| These two figures quantitatively illustrate the effect discussed in [@sec:linearized] that the membrane and the membrane plus bending stress are zero and first-order moments respectively. In the former case, the excess and defect errors of the extreme nodes cancel out whereas in the latter case they do not. | |||
| :::: {#fig:errors-vs-n} | |||
| {#fig:error-M-vs-cpu} | |||
| {#fig:error-MB-vs-cpu} | |||
| Errors vs.\ $n$ | |||
| :::: | |||
| # Conclusions {#sec:conclusions} | |||
| There are a few conclusion we can draw out of the results obtained in this report: | |||