]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rene's comments.
authorLuca Heltai <luca.heltai@sissa.it>
Thu, 14 Sep 2017 08:42:19 +0000 (10:42 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Thu, 14 Sep 2017 08:42:47 +0000 (10:42 +0200)
include/deal.II/grid/tria_info_cache.h
include/deal.II/grid/tria_info_cache_flags.h
source/grid/tria_info_cache.cc
source/grid/tria_info_cache.inst.in

index 9a9febfe82eaef77cd8cf8cc9a5427942ccb5ee6..d48b5209d0ab29ae9d644e2d38431b52a24a27e9 100644 (file)
@@ -44,7 +44,7 @@ DEAL_II_NAMESPACE_OPEN
  * missing TriangulationInfoCacheFlags flag), an Assertion is thrown.
  *
  * Notice that this class only notices if the underlying Triangulation has
- * changed due to a Triangulation::Signals::any_change() signal beeing triggered.
+ * changed due to a Triangulation::Signals::any_change() signal being triggered.
  *
  * If the triangulation changes due to a MappingQEulerian being passed to this
  * class, or because you manually change some vertex locations, then some of
@@ -64,7 +64,7 @@ public:
    * TriangulationInfoCacheFlags. If you provide the optional `mapping`
    * argument, then this is used whenever a mapping is required.
    *
-   * @param tria The triangulation to work on
+   * @param tria The triangulation for which to store information
    * @param flags TriangulationInfoCacheFlags that specify what to cache
    * @param mapping The mapping to use when computing cached objects
    */
index ddc0234b6ce1dda84724a6cd2b58707eba3addc6..181b2f38151eedc04ed3552742d09ac504c3181e 100644 (file)
 DEAL_II_NAMESPACE_OPEN
 
 /**
  * The enum type given to the TriangulationInfoCache class to select what
  * information to cache.
  *
  * You can select more than one flag by concatenation using the bitwise or
  * <code>operator|(TriangulationInfoCacheFlags,TriangulationInfoCacheFlags)</code>.
  *
  * @author Luca Heltai, 2017.
  */
+ * The enum type given to the TriangulationInfoCache class to select what
+ * information to cache.
+ *
+ * You can select more than one flag by concatenation using the bitwise or
+ * <code>operator|(TriangulationInfoCacheFlags,TriangulationInfoCacheFlags)</code>.
+ *
+ * @author Luca Heltai, 2017.
+ */
 enum TriangulationInfoCacheFlags
 {
   /**
@@ -45,10 +45,10 @@ enum TriangulationInfoCacheFlags
 
 
 /**
  * Output operator which outputs assemble flags as a set of or'd text values.
  *
  * @ref TriangulationInfoCacheFlags
  */
+ * Output operator which outputs assemble flags as a set of or'd text values.
+ *
+ * @ref TriangulationInfoCacheFlags
+ */
 template <class StreamType>
 inline
 StreamType &operator << (StreamType &s, TriangulationInfoCacheFlags u)
@@ -60,14 +60,14 @@ StreamType &operator << (StreamType &s, TriangulationInfoCacheFlags u)
 
 
 /**
  * Global operator which returns an object in which all bits are set which are
  * either set in the first or the second argument. This operator exists since
  * if it did not then the result of the bit-or <tt>operator |</tt> would be an
  * integer which would in turn trigger a compiler warning when we tried to
  * assign it to an object of type TriangulationInfoCacheFlags.
  *
  * @ref TriangulationInfoCacheFlags
  */
+ * Global operator which returns an object in which all bits are set which are
+ * either set in the first or the second argument. This operator exists since
+ * if it did not then the result of the bit-or <tt>operator |</tt> would be an
+ * integer which would in turn trigger a compiler warning when we tried to
+ * assign it to an object of type TriangulationInfoCacheFlags.
+ *
+ * @ref TriangulationInfoCacheFlags
+ */
 inline
 TriangulationInfoCacheFlags
 operator | (TriangulationInfoCacheFlags f1, TriangulationInfoCacheFlags f2)
@@ -81,11 +81,11 @@ operator | (TriangulationInfoCacheFlags f1, TriangulationInfoCacheFlags f2)
 
 
 /**
  * Global operator which sets the bits from the second argument also in the
  * first one.
  *
  * @ref TriangulationInfoCacheFlags
  */
+ * Global operator which sets the bits from the second argument also in the
+ * first one.
+ *
+ * @ref TriangulationInfoCacheFlags
+ */
 inline
 TriangulationInfoCacheFlags &
 operator |= (TriangulationInfoCacheFlags &f1, TriangulationInfoCacheFlags f2)
@@ -96,14 +96,14 @@ operator |= (TriangulationInfoCacheFlags &f1, TriangulationInfoCacheFlags f2)
 
 
 /**
  * Global operator which returns an object in which all bits are set which are
  * set in the first as well as the second argument. This operator exists since
  * if it did not then the result of the bit-and <tt>operator &</tt> would be
  * an integer which would in turn trigger a compiler warning when we tried to
  * assign it to an object of type TriangulationInfoCacheFlags.
  *
  * @ref TriangulationInfoCacheFlags
  */
+ * Global operator which returns an object in which all bits are set which are
+ * set in the first as well as the second argument. This operator exists since
+ * if it did not then the result of the bit-and <tt>operator &</tt> would be
+ * an integer which would in turn trigger a compiler warning when we tried to
+ * assign it to an object of type TriangulationInfoCacheFlags.
+ *
+ * @ref TriangulationInfoCacheFlags
+ */
 inline
 TriangulationInfoCacheFlags
 operator & (TriangulationInfoCacheFlags f1, TriangulationInfoCacheFlags f2)
@@ -115,11 +115,11 @@ operator & (TriangulationInfoCacheFlags f1, TriangulationInfoCacheFlags f2)
 
 
 /**
  * Global operator which clears all the bits in the first argument if they are
  * not also set in the second argument.
  *
  * @ref TriangulationInfoCacheFlags
  */
+ * Global operator which clears all the bits in the first argument if they are
+ * not also set in the second argument.
+ *
+ * @ref TriangulationInfoCacheFlags
+ */
 inline
 TriangulationInfoCacheFlags &
 operator &= (TriangulationInfoCacheFlags &f1, TriangulationInfoCacheFlags f2)
index 3f4c759e624fdba4128609ecb4ba6ea25f1fee57..5be00323a021b18748fcec85566f57725e17a221 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2016 by the deal.II authors
+// Copyright (C) 2017 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -19,7 +19,8 @@
 DEAL_II_NAMESPACE_OPEN
 
 template<int dim, int spacedim>
-TriangulationInfoCache<dim,spacedim>::TriangulationInfoCache(const Triangulation<dim, spacedim> &tria,
+TriangulationInfoCache<dim,spacedim>::TriangulationInfoCache(
+    const Triangulation<dim, spacedim> &tria,
     const TriangulationInfoCacheFlags &flags,
     const Mapping<dim, spacedim> &mapping) :
   tria(&tria),
@@ -30,15 +31,20 @@ TriangulationInfoCache<dim,spacedim>::TriangulationInfoCache(const Triangulation
   {
     update();
   });
+
+  if(tria.n_active_cells()>0)
+    update();
 }
 
+
+
 template<int dim, int spacedim>
 void TriangulationInfoCache<dim,spacedim>::update(bool topology_is_unchanged)
 {
-  if (cache_vertex_to_cell_map & flags)
-    {
-      vertex_to_cells = GridTools::vertex_to_cell_map(*tria);
-    }
+  if(topology_is_unchanged == false) {
+    if (cache_vertex_to_cell_map & flags)
+        vertex_to_cells = GridTools::vertex_to_cell_map(*tria);
+  }
 }
 
 template<int dim, int spacedim>
index b55e5ef22386943e5a20dd8c0d21908118ed49e2..7f03011ace9a8fcdb5a2ce45583901358c0588d5 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2010 - 2016 by the deal.II authors
+// Copyright (C) 2017 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -15,7 +15,7 @@
 
 
 
-for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
 {
 #if deal_II_dimension <= deal_II_space_dimension
     template class TriangulationInfoCache<deal_II_dimension, deal_II_space_dimension>;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.