| 1 |
<h1>Results</h1> |
| 2 |
|
| 3 |
<h3>Mini example 0</h3> |
| 4 |
|
| 5 |
We present a part of the terminal output. It shows, for each point, the |
| 6 |
determined cell and reference position. Also, one can see that |
| 7 |
the values evaluated with FEValues, FEPointEvaluation, and |
| 8 |
VectorTools::point_values() are identical, as expected. |
| 9 |
|
| 10 |
@verbatim |
| 11 |
Running: example 0 |
| 12 |
- Found point with real coordinates: 0 0.5 |
| 13 |
- in cell with vertices: (0 0.4) (0.2 0.4) (0 0.6) (0.2 0.6) |
| 14 |
- with coordinates on the unit cell: (0 0.5) |
| 15 |
- Values at point: |
| 16 |
- 0.25002 (w. FEValues) |
| 17 |
- 0.25002 (w. FEPointEvaluation) |
| 18 |
- 0.25002 (w. VectorTools::point_value()) |
| 19 |
|
| 20 |
- Found point with real coordinates: 0.05 0.5 |
| 21 |
- in cell with vertices: (0 0.4) (0.2 0.4) (0 0.6) (0.2 0.6) |
| 22 |
- with coordinates on the unit cell: (0.25 0.5) |
| 23 |
- Values at point: |
| 24 |
- 0.20003 (w. FEValues) |
| 25 |
- 0.20003 (w. FEPointEvaluation) |
| 26 |
- 0.20003 (w. VectorTools::point_value()) |
| 27 |
|
| 28 |
... |
| 29 |
|
| 30 |
- Found point with real coordinates: 1 0.5 |
| 31 |
- in cell with vertices: (0.8 0.4) (1 0.4) (0.8 0.6) (1 0.6) |
| 32 |
- with coordinates on the unit cell: (1 0.5) |
| 33 |
- Values at point: |
| 34 |
- 0.25002 (w. FEValues) |
| 35 |
- 0.25002 (w. FEPointEvaluation) |
| 36 |
- 0.25002 (w. VectorTools::point_value()) |
| 37 |
|
| 38 |
- writing csv file |
| 39 |
@endverbatim |
| 40 |
|
| 41 |
The CSV output is as follows and contains, in the |
| 42 |
first column, the distances with respect to the first point, |
| 43 |
the second and the third column represent the coordinates |
| 44 |
of the points and the fourth column the evaluated solution |
| 45 |
values at those points. |
| 46 |
|
| 47 |
@verbatim |
| 48 |
0.000 0.000 0.500 0.250 |
| 49 |
0.050 0.050 0.500 0.200 |
| 50 |
0.100 0.100 0.500 0.150 |
| 51 |
0.150 0.150 0.500 0.100 |
| 52 |
0.200 0.200 0.500 0.050 |
| 53 |
0.250 0.250 0.500 0.000 |
| 54 |
0.300 0.300 0.500 -0.050 |
| 55 |
0.350 0.350 0.500 -0.099 |
| 56 |
0.400 0.400 0.500 -0.148 |
| 57 |
0.450 0.450 0.500 -0.195 |
| 58 |
0.500 0.500 0.500 -0.211 |
| 59 |
0.550 0.550 0.500 -0.195 |
| 60 |
0.600 0.600 0.500 -0.148 |
| 61 |
0.650 0.650 0.500 -0.099 |
| 62 |
0.700 0.700 0.500 -0.050 |
| 63 |
0.750 0.750 0.500 0.000 |
| 64 |
0.800 0.800 0.500 0.050 |
| 65 |
0.850 0.850 0.500 0.100 |
| 66 |
0.900 0.900 0.500 0.150 |
| 67 |
0.950 0.950 0.500 0.200 |
| 68 |
1.000 1.000 0.500 0.250 |
| 69 |
@endverbatim |
| 70 |
|
| 71 |
<h3>Mini example 1</h3> |
| 72 |
|
| 73 |
We show the terminal output. |
| 74 |
|
| 75 |
@verbatim |
| 76 |
Running: example 1 |
| 77 |
- writing csv file |
| 78 |
@endverbatim |
| 79 |
|
| 80 |
The CSV output is as follows and identical to the results |
| 81 |
of the serial case presented in mini example 0. |
| 82 |
The fifth column shows the |
| 83 |
user quantity evaluated additionally in this mini example. |
| 84 |
|
| 85 |
@verbatim |
| 86 |
0.000 0.000 0.500 0.250 0.000 |
| 87 |
0.050 0.050 0.500 0.200 0.050 |
| 88 |
0.100 0.100 0.500 0.150 0.100 |
| 89 |
0.150 0.150 0.500 0.100 0.150 |
| 90 |
0.200 0.200 0.500 0.050 0.200 |
| 91 |
0.250 0.250 0.500 0.000 0.250 |
| 92 |
0.300 0.300 0.500 -0.050 0.300 |
| 93 |
0.350 0.350 0.500 -0.100 0.350 |
| 94 |
0.400 0.400 0.500 -0.149 0.400 |
| 95 |
0.450 0.450 0.500 -0.200 0.450 |
| 96 |
0.500 0.500 0.500 -0.222 0.500 |
| 97 |
0.550 0.550 0.500 -0.200 0.550 |
| 98 |
0.600 0.600 0.500 -0.149 0.600 |
| 99 |
0.650 0.650 0.500 -0.100 0.650 |
| 100 |
0.700 0.700 0.500 -0.050 0.700 |
| 101 |
0.750 0.750 0.500 0.000 0.750 |
| 102 |
0.800 0.800 0.500 0.050 0.800 |
| 103 |
0.850 0.850 0.500 0.100 0.850 |
| 104 |
0.900 0.900 0.500 0.150 0.900 |
| 105 |
0.950 0.950 0.500 0.200 0.950 |
| 106 |
1.000 1.000 0.500 0.250 1.000 |
| 107 |
@endverbatim |
| 108 |
|
| 109 |
|
| 110 |
<h3>Mini example 2</h3> |
| 111 |
|
| 112 |
We show the terminal output. |
| 113 |
@verbatim |
| 114 |
Running: example 2 |
| 115 |
- create system |
| 116 |
- determine narrow band |
| 117 |
- determine closest point iteratively |
| 118 |
- iteration 0: 7076 -> 7076 |
| 119 |
- iteration 1: 7076 -> 104 |
| 120 |
- iteration 2: 104 -> 0 |
| 121 |
- determine distance in narrow band |
| 122 |
- perform extrapolation in narrow band |
| 123 |
- output results |
| 124 |
@endverbatim |
| 125 |
|
| 126 |
The following three plots, representing the performed iterations of the |
| 127 |
closest-point projection, show the current position of the closest |
| 128 |
points exceeding the required tolerance of the discrete interface |
| 129 |
of the circle and still need to |
| 130 |
be corrected. |
| 131 |
It can be seen that the numbers of points to be processed decrease |
| 132 |
from iteration to iteration. |
| 133 |
<table align="center" class="doxtable"> |
| 134 |
<tr> |
| 135 |
<td> |
| 136 |
@image html https://www.dealii.org/images/steps/developer/step_87_ex_2_p_0.png |
| 137 |
</td> |
| 138 |
<td> |
| 139 |
@image html https://www.dealii.org/images/steps/developer/step_87_ex_2_p_1.png |
| 140 |
</td> |
| 141 |
<td> |
| 142 |
@image html https://www.dealii.org/images/steps/developer/step_87_ex_2_p_2.png |
| 143 |
</td> |
| 144 |
</tr> |
| 145 |
</table> |
| 146 |
|
| 147 |
The output visualized in Paraview looks like the following: On the |
| 148 |
left, the original distance function is shown as the light gray surface. |
| 149 |
In addition, the contour values refer to the distance values determined |
| 150 |
from calculation of the distance to the closest points at the interface |
| 151 |
in the narrow band. It can be seen that the two functions coincide. |
| 152 |
Similarly, on the right, the original solution and the extrapolated |
| 153 |
solution from the interface is shown. |
| 154 |
|
| 155 |
<table align="center" class="doxtable"> |
| 156 |
<tr> |
| 157 |
<td> |
| 158 |
@image html https://www.dealii.org/images/steps/developer/step_87_ex_2_res_0.png |
| 159 |
</td> |
| 160 |
<td> |
| 161 |
@image html https://www.dealii.org/images/steps/developer/step_87_ex_2_res_1.png |
| 162 |
</td> |
| 163 |
</tr> |
| 164 |
</table> |
| 165 |
|
| 166 |
<h3>Mini example 3</h3> |
| 167 |
|
| 168 |
We show a shortened version of the terminal output. |
| 169 |
|
| 170 |
@verbatim |
| 171 |
Running: example 3 |
| 172 |
- creating background mesh |
| 173 |
- creating immersed mesh |
| 174 |
time: 0 |
| 175 |
- compute to be tested values (immersed mesh) |
| 176 |
- test values (background mesh) |
| 177 |
- write data (background mesh) |
| 178 |
- write mesh (immersed mesh) |
| 179 |
|
| 180 |
time: 0.01 |
| 181 |
- move support points (immersed mesh) |
| 182 |
- compute to be tested values (immersed mesh) |
| 183 |
- test values (background mesh) |
| 184 |
|
| 185 |
time: 0.02 |
| 186 |
- move support points (immersed mesh) |
| 187 |
- compute to be tested values (immersed mesh) |
| 188 |
- test values (background mesh) |
| 189 |
|
| 190 |
... |
| 191 |
|
| 192 |
time: 2 |
| 193 |
- move support points (immersed mesh) |
| 194 |
- compute to be tested values (immersed mesh) |
| 195 |
- test values (background mesh) |
| 196 |
- write data (background mesh) |
| 197 |
- write mesh (immersed mesh) |
| 198 |
@endverbatim |
| 199 |
|
| 200 |
The output visualized in Paraview looks like the following: The deformation of |
| 201 |
the immersed mesh by the reversible vortex flow can be seen. Due to |
| 202 |
discretization errors, the shape is not exactly circular at the end, illustrated |
| 203 |
in the right figure. The sharp nature of the surface-tension force vector, shown |
| 204 |
as vector plots, can be seen by its restriction to cells that are intersected by |
| 205 |
the immersed mesh. |
| 206 |
|
| 207 |
<table align="center" class="doxtable"> |
| 208 |
<tr> |
| 209 |
<td> |
| 210 |
@image html https://www.dealii.org/images/steps/developer/step_87_ex_3_force.0000.png |
| 211 |
</td> |
| 212 |
<td> |
| 213 |
@image html https://www.dealii.org/images/steps/developer/step_87_ex_3_force.0010.png |
| 214 |
</td> |
| 215 |
<td> |
| 216 |
@image html https://www.dealii.org/images/steps/developer/step_87_ex_3_force.0020.png |
| 217 |
</td> |
| 218 |
</tr> |
| 219 |
</table> |
| 220 |
|
| 221 |
<h3>Possibilities for extension</h3> |
| 222 |
|
| 223 |
This program highlights some of the main capabilities |
| 224 |
of the distributed evaluation routines in deal.II. However, there are many |
| 225 |
related topics worth mentioning: |
| 226 |
- Performing a distributed search is an expensive step. That is why we suggest |
| 227 |
to provide hints to Utilities::MPI::RemotePointEvaluation and to reuse |
| 228 |
Utilities::MPI::RemotePointEvaluation |
| 229 |
instances in the case that the communication pattern has not changed. |
| 230 |
Furthermore, there are instances where no search is needed and the points are |
| 231 |
already sorted into the right cells. This is the case if the points are |
| 232 |
generated on the cell level (see step-85; CutFEM) or the points are |
| 233 |
automatically sorted into the correct (neighboring) cell (see step-68; PIC with |
| 234 |
Particles::ParticleHandler). Having said that, the |
| 235 |
Particles::ParticleHandler::insert_global_particles() function uses |
| 236 |
the described infrastructure to perform the initial sorting of particles into |
| 237 |
cells. |
| 238 |
- We concentrated on parallelization aspects in this tutorial. However, we would |
| 239 |
like to point out the need for fast evaluation on cell level. |
| 240 |
The task for this in deal.II is FEPointEvaluation. It exploits the structure of |
| 241 |
@f[ |
| 242 |
\hat{u}(\hat{\boldsymbol{x}}) = \sum_i \hat{N}_i(\hat{\boldsymbol{x}}) \hat{u}_i |
| 243 |
@f] |
| 244 |
to derive fast implementations, e.g., for tensor-product elements |
| 245 |
@f[ |
| 246 |
\hat{u}(\hat{x}_0, \hat{x}_1, \hat{x}_2) = |
| 247 |
\sum_k \hat{N}^{\text{1D}}_k(\hat{x}_2) |
| 248 |
\sum_j \hat{N}^{\text{1D}}_j(\hat{x}_1) |
| 249 |
\sum_i \hat{N}^{\text{1D}}_i(\hat{x}_0) |
| 250 |
\hat{u}_{ijk}. |
| 251 |
@f] |
| 252 |
Since only 1D shape functions are queried and are re-used in re-occurring terms, |
| 253 |
this formulation is faster than without exploitation of the structure. |
| 254 |
- Utilities::MPI::RemotePointEvaluation is used in multiple places in deal.II. |
| 255 |
The class DataOutResample allows to output results on a different mesh than |
| 256 |
the computational mesh. This is useful if one wants to output the results |
| 257 |
on a coarser mesh or one does not want to output 3D results but instead 2D |
| 258 |
slices. In addition, MGTwoLevelTransferNonNested allows to prolongate solutions |
| 259 |
and restrict residuals between two independent meshes. By passing a sequence |
| 260 |
of such two-level transfer operators to MGTransferMF and, finally, to Multigrid, |
| 261 |
non-nested multigrid can be computed. |
| 262 |
- Utilities::MPI::RemotePointEvaluation can be used to couple non-matching |
| 263 |
grids via surfaces (example: fluid-structure interaction, independently created |
| 264 |
grids). The evaluation points can come from any side (pointwise interpolation) |
| 265 |
or are defined on intersected meshes (Nitsche-type mortaring |
| 266 |
@cite heinz2022high). Concerning the creation of such intersected meshes and the |
| 267 |
corresponding evaluation points, see |
| 268 |
GridTools::internal::distributed\_compute_intersection_locations(). |
| 269 |
- Alternatively to the coupling via Utilities::MPI::RemotePointEvaluation, |
| 270 |
preCICE @cite bungartz2016precice @cite chourdakis2021precice can be used. The |
| 271 |
code-gallery program "Laplace equation coupled to an external simulation |
| 272 |
program" shows how to use this library with deal.II. |