From: bangerth Technical details
@@ -1388,7 +1388,13 @@ class Triangulation : public Subscriptor
* execute_coarsening_and_refinement()
* functions, and they can be
* caught in user code if this
- * condition is to be ignored.
+ * condition is to be
+ * ignored. Note, however, that
+ * such exceptions are only
+ * produced if the necessity for
+ * this check was indicated when
+ * calling the constructor of the
+ * Triangulation class.
*
* A cell is called
* deformed if the
@@ -1443,8 +1449,30 @@ class Triangulation : public Subscriptor
* Create an empty
* triangulation. Do not create
* any cells.
+ *
+ * @param smooth_grid Determines
+ * the level of smoothness of the
+ * mesh size function that should
+ * be enforced upon mesh
+ * refinement.
+ *
+ * @param
+ * check_for_distorted_cells
+ * Determines whether the
+ * triangulation should check
+ * whether any of the cells that
+ * are created by
+ * create_triangulation() or
+ * execute_coarsening_and_refinement()
+ * are distorted (see @ref
+ * GlossDistorted "distorted
+ * cells"). If set, these two
+ * functions may throw an
+ * exception if they encounter
+ * distorted cells.
*/
- Triangulation (const MeshSmoothing smooth_grid = none);
+ Triangulation (const MeshSmoothing smooth_grid = none,
+ const bool check_for_distorted_cells = false);
/**
* Copy constructor.
@@ -1672,19 +1700,24 @@ class Triangulation : public Subscriptor
* and the GridIn and
* GridReordering class.
*
- * At the very end of its
- * operation, this function walks
+ * If the
+ * check_for_distorted_cells
+ * flag was specified upon
+ * creation of this object, at
+ * the very end of its operation,
+ * the current function walks
* over all cells and verifies
* that none of the cells is
- * 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
- * cell is negative at least at
- * one of the vertices (this
- * computation is done using the
+ * deformed (see the entry on
+ * @ref GlossDistorted "distorted
+ * cells" in the glossary), where
+ * we call a cell deformed if the
+ * determinant of the Jacobian of
+ * the mapping from reference
+ * cell to real cell is negative
+ * at least at one of the
+ * vertices (this computation is
+ * done using the
* GeometryInfo::jacobian_determinants_at_vertices
* function). If there are
* deformed cells, this function
@@ -1829,6 +1862,12 @@ class Triangulation : public Subscriptor
* does not create such an
* exception if no cells have
* created distorted children.
+ * Note that for the check for
+ * distorted cells to happen, the
+ * check_for_distorted_cells
+ * flag has to be specified upon
+ * creation of a triangulation
+ * object.
*
* See the general docs for more
* information.
@@ -3202,7 +3241,11 @@ class Triangulation : public Subscriptor
* of cells that have produced
* children that satisfy the
* criteria of
- * @ref GlossDistorted "distorted cells".
+ * @ref GlossDistorted "distorted cells"
+ * if the
+ * check_for_distorted_cells
+ * flag was specified upon
+ * creation of this object, at
*/
DistortedCellList execute_refinement ();
@@ -3289,6 +3332,14 @@ class Triangulation : public Subscriptor
*/
MeshSmoothing smooth_grid;
+ /**
+ * A flag that determines whether
+ * we are to check for distorted
+ * cells upon creation and
+ * refinement of a mesh.
+ */
+ const bool check_for_distorted_cells;
+
/**
* Cache to hold the numbers of lines,
* quads, hexes, etc. These numbers
diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc
index d2dc8a9ffb..335b99e467 100644
--- a/deal.II/deal.II/source/grid/tria.cc
+++ b/deal.II/deal.II/source/grid/tria.cc
@@ -2,7 +2,7 @@
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
@@ -4063,7 +4063,8 @@ namespace internal
template
(GK 2009/08/04)
- Changed: Previously, the Triangulation::create_triangulation
- function silently 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 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.
-
- The same is true for the Triangulation::execute_coarsening_and_refinement
- function: if it creates cells that are distorted, it throws a list of cells
- whose children are distorted.
-
- The whole issue is described in some detail in the entry on
- @ref GlossDistorted "distorted cells" in the glossary.
-
- (WB 2009/06/29)
-
New: The class MGTransferSelect is prepared for use on adaptively refined meshes.
- (Bärbel Janssen 2010/02/05)
+ (Bärbel Janssen 2010/02/05)
+ New: Previously, the Triangulation::create_triangulation
+ function silently 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 can been
+ changed now: By passing the appropriate flag to the constructor of
+ the Triangulation class, the Triangulation::create_triangulation
+ function checks whether cells are distorted or
+ inverted, 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.
+
+ The same is true for the Triangulation::execute_coarsening_and_refinement
+ function: if it creates cells that are distorted, it throws a list of cells
+ whose children are distorted.
+
+ The whole issue is described in some detail in the entry on
+ @ref GlossDistorted "distorted cells" in the glossary.
+
+ (WB 2009/06/29)
+
New: The new hp::DoFHandler::set_active_fe_indices function allows