From 56c0cddc8876ea4ef95f85fe1e28211dfcc45435 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 29 Jun 2009 19:40:23 +0000 Subject: [PATCH] Document the concept of a distorted cell. git-svn-id: https://svn.dealii.org/trunk@19003 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/geometry_info.h | 17 +++-------- deal.II/deal.II/include/grid/grid_in.h | 24 +++++++-------- deal.II/deal.II/include/grid/tria.h | 15 +++++---- deal.II/doc/doxygen/headers/glossary.h | 32 ++++++++++++++++++++ deal.II/doc/doxygen/images/distorted_2d.fig | 15 +++++++++ deal.II/doc/doxygen/images/distorted_2d.png | Bin 0 -> 1708 bytes deal.II/doc/doxygen/images/distorted_3d.fig | 30 ++++++++++++++++++ deal.II/doc/doxygen/images/distorted_3d.png | Bin 0 -> 3836 bytes deal.II/doc/news/changes.h | 5 +-- 9 files changed, 105 insertions(+), 33 deletions(-) create mode 100644 deal.II/doc/doxygen/images/distorted_2d.fig create mode 100644 deal.II/doc/doxygen/images/distorted_2d.png create mode 100644 deal.II/doc/doxygen/images/distorted_3d.fig create mode 100644 deal.II/doc/doxygen/images/distorted_3d.png diff --git a/deal.II/base/include/base/geometry_info.h b/deal.II/base/include/base/geometry_info.h index 21275a4136..596c4fcc8f 100644 --- a/deal.II/base/include/base/geometry_info.h +++ b/deal.II/base/include/base/geometry_info.h @@ -2052,19 +2052,10 @@ struct GeometryInfo * coordinate system to another. * * This function is used in order to - * determine how distorted a cell is: if - * all of the determinants are of roughly - * equal value and on the order of - * $h^\text{dim}$ then the cell is - * well-shaped. For example, a square - * cell or face has determinants equal to - * $h^\text{dim}$ whereas a strongly - * sheared parallelogram has a - * determinant much smaller. Similarly, a - * cell with very unequal edge lengths - * will have widely varying - * determinants. Finally, an inverted - * cell will have negative determinants. + * determine how distorted a cell is (see + * the entry on + * @ref GlossDistorted "distorted cells" + * in the glossary). */ static void diff --git a/deal.II/deal.II/include/grid/grid_in.h b/deal.II/deal.II/include/grid/grid_in.h index 1ad1b5a97a..544a79e972 100644 --- a/deal.II/deal.II/include/grid/grid_in.h +++ b/deal.II/deal.II/include/grid/grid_in.h @@ -221,18 +221,18 @@ class SubCellData; *

Dealing with distorted mesh cells

* * For each of the mesh reading functions, the last call is always to - * Triangulation::create_triangulation(). That function checks whether - * all the cells it creates as part of the coarse mesh are distorted or - * not (where distortion here means that the Jacobian of the mapping - * from the reference cell to the real cell has a non-positive determinant, - * i.e. the cell is pinched or twisted). If it finds any such cells, it - * throws an exception. This exception is not caught in the grid reader - * functions of the current class, and so will propagate through to the - * function that called it. There, you can catch and ignore the - * exception if you are certain that there is no harm in dealing with - * such cells. If you were not aware that your mesh had such cells, your - * results will likely be of dubious quality at best if you ignore the - * exception. + * Triangulation::create_triangulation(). That function checks whether all the + * cells it creates as part of the coarse mesh are distorted or not (where + * distortion here means that the Jacobian of the mapping from the reference + * cell to the real cell has a non-positive determinant, i.e. the cell is + * pinched or twisted; see the entry on @ref GlossDistorted "distorted cells" + * in the glossary). If it finds any such cells, it throws an exception. This + * exception is not caught in the grid reader functions of the current class, + * and so will propagate through to the function that called it. There, you + * can catch and ignore the exception if you are certain that there is no harm + * in dealing with such cells. If you were not aware that your mesh had such + * cells, your results will likely be of dubious quality at best if you ignore + * the exception. * * * @ingroup grid diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index f09ca48a3d..7a573b3d7c 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -1364,11 +1364,12 @@ class Triangulation : public Subscriptor /** * A structure that is used as an * exception object by the - * create_triangulation() - * function to indicate which - * cells among the coarse mesh - * cells are inverted or severely - * distorted. + * create_triangulation() function to + * indicate which cells among the coarse + * mesh cells are inverted or severely + * distorted (see the entry on + * @ref GlossDistorted "distorted cells" + * in the glossary). * * Objects of this kind are * thrown by the @@ -1648,7 +1649,9 @@ class Triangulation : public Subscriptor * operation, this function walks * over all cells and verifies * that none of the cells is - * deformed, where we call a cell + * deformed (see + * the entry on @ref GlossDistorted in + * the glossary), where we call a cell * deformed if the determinant of * the Jacobian of the mapping * from reference cell to real diff --git a/deal.II/doc/doxygen/headers/glossary.h b/deal.II/doc/doxygen/headers/glossary.h index 1a9e02bee5..42927b0b92 100644 --- a/deal.II/doc/doxygen/headers/glossary.h +++ b/deal.II/doc/doxygen/headers/glossary.h @@ -64,6 +64,38 @@ * FiniteElementData::n_components() and the documentation of * FiniteElement * + * + *
@anchor GlossDistorted Distorted cells
+ * + *
A distorted cell is a cell for which the mapping from + * the reference cell to real cell has a Jacobian whose determinant is + * non-positive somewhere in the cell. Typically, we only check the sign + * of this determinant at the vertices of the cell. The function + * GeometryInfo::jacobian_determinants_at_vertices computes these + * determinants at the vertices, and the function + * Triangulation::create_triangulation (along with the various grid + * readers in the GridIn class) will reject meshes with distorted cells + * by default. + * + * By way of example, if all of the determinants are of roughly equal value + * and on the order of $h^\text{dim}$ then the cell is well-shaped. For + * example, a square cell or face has determinants equal to $h^\text{dim}$ + * whereas a strongly sheared parallelogram has a determinant much + * smaller. Similarly, a cell with very unequal edge lengths will have widely + * varying determinants. Conversely, a pinched cell in which the location of + * two or more vertices is collapsed to a single point has a zero determinant + * at this location. Finally, an inverted or twisted cell in which the + * location of two vertices is out of order will have negative determinants. + * + * The following two images show a well-formed, a pinched, and a twisted cell + * for both 2d and 3d: + * + * @image html distorted_2d.png "A well-formed, a pinched, and a twisted cell in 2d." + * + * @image html distorted_3d.png "A well-formed, a pinched, and a twisted cell in 3d." + *
+ * + * *
@anchor GlossFaceOrientation Face orientation
*
In a triangulation, the normal vector to a face * can be deduced from the face orientation by diff --git a/deal.II/doc/doxygen/images/distorted_2d.fig b/deal.II/doc/doxygen/images/distorted_2d.fig new file mode 100644 index 0000000000..c681447c66 --- /dev/null +++ b/deal.II/doc/doxygen/images/distorted_2d.fig @@ -0,0 +1,15 @@ +#FIG 3.2 Produced by xfig version 3.2.5 +Landscape +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +2 3 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 4050 450 4050 1800 5400 450 5400 1800 4050 450 +2 3 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 4 + 2250 450 2250 1800 3600 1800 2250 450 +2 3 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 + 450 450 450 1800 1800 1800 1800 450 450 450 diff --git a/deal.II/doc/doxygen/images/distorted_2d.png b/deal.II/doc/doxygen/images/distorted_2d.png new file mode 100644 index 0000000000000000000000000000000000000000..896460e9909b9fd8d81e7788acdd9dd724761aac GIT binary patch literal 1708 zcmd^u3UgXOsu982IFVXfh}ia6Mkr7!$eZ&8Mo-t)S;`7U zKqthRB21|5d;umP619{9mFOlO!iz8K27)4V6wp#?%xq|7Pm_JvKd?{xaGvwaeXi@e z?>r~DD>y8s4{jX}f*_yxIQjty@<;=G5W51L6J30N@LF9E#}h)3_kQ=|@o2Dx1&RSk zY%;>l&q2f)h1n33lR#qT<|R4QpM9_5+xU3kEfm;+v80i zNvd|`|KYG0VTS5DvxB!`foCLGsMeR^`w(jrQLtBs-) z8IIRz7(E7Kn!RGT2MP*4!_h(o*V^jP1=s2_a$b|P9@iW$w=sEI(zQ|1Tw{lGacq0J zLQ6F@UG1|Ap6g->^e=U+{hc+@Z<1KrOJRSBLQ%c5e}~u)bC}o074(>gNkG{_e(3t?z;J^8-w|W2Q>I0SC_ta+4mSA4o~z zFgC$K6+TWYdh%&=1?^~^iTB;8ePv(@o6yJY8l)nsz@^BK=s_#%=dUv|9Fu~hdkN<_ zy1}}WHFw@MhiR)l`L>t03?ntq@ybMtqQ-%a$pSXQ56UQ#+D^kPaeA$?6qI+Osq*Y7 z_(26l(w;t{$9_-Vz#tla50BOWoCcV@Ir7cdW*Y=+fHodGZgnKZPkWfwaEMk z>GbLu%DkNn<~>u#=SZkaHjq))^czMQj2r^KkDFLTq;l9N4JdBl_?$4>j<3Mri-qEt z4(xa}5GQ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738df77009 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -36,8 +36,9 @@ inconvenience this causes. accepted input meshes with inverted cells (i.e. cells with a zero or negative determinant of the Jacobian of the mapping from the reference cell to the real cell). This has been changed now: The function checks whether cells - are distorted or inverted, and may throw a list of cells for which this - is the case as an exception. If you know that this is harmless, for example + are distorted or inverted (see the entry on @ref GlossDistorted "distorted cells" + in the glossary), and may throw an exception containing a list of cells for which this + is the case. If you know that this is harmless, for example if you have cells with collapsed vertices in your mesh but you do not intend to integrate on them, then you can catch and ignore this message. In all other cases, the output of your computations are likely to be wrong anyway. -- 2.39.5