]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Partial merge from the parallel_mg branch: introduce level subdomain ids.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 5 Nov 2012 00:38:43 +0000 (00:38 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 5 Nov 2012 00:38:43 +0000 (00:38 +0000)
git-svn-id: https://svn.dealii.org/trunk@27377 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/doxygen/headers/glossary.h
deal.II/doc/news/changes.h
deal.II/include/deal.II/grid/tria_accessor.h
deal.II/include/deal.II/grid/tria_levels.h
deal.II/source/grid/tria_accessor.cc
deal.II/source/grid/tria_levels.cc

index 61e76626e007dfda4e3596be380f1c96bfba0a7a..b16d3bdcabd17ec580aa38b16188f5db117ad7df 100644 (file)
@@ -1024,7 +1024,9 @@ Article{JK10,
  * <dd>Each cell of a triangulation has associated with it a property called
  * the "subdomain id" that can be queried using a call like
  * <code>cell-@>subdomain_id()</code> and that can be set for example by using
- * <code>cell-@>set_subdomain_id(13)</code>. While in principle this property
+ * <code>cell-@>set_subdomain_id(13)</code>. (These calls resolve to
+ * CellAccessor::subdomain_id() and CellAccessor::set_subdomain_id(), respectively.)
+ * While in principle this property
  * can be used in any way application programs deem useful (it is simply an
  * integer associated with each cell that can indicate whatever you want), at
  * least for programs that run in %parallel it usually denotes the processor a
@@ -1058,6 +1060,14 @@ Article{JK10,
  * one refinement level. These cells are called "artificial" (see
  * @ref GlossArtificialCell "here") and have the special subdomain id value
  * types::artificial_subdomain_id.
+ *
+ * In addition to regular subdomain ids, there is a second, closely related set
+ * of flags that are associated with each cell: "level subdomain ids."
+ * These exist not only for active cells but, in fact, for every cell in
+ * a mesh hierarchy. Their meaning is entirely analogous to the regular
+ * subdomain ids, but they are read and written by the
+ * CellAccessor::level_subdomain_id() and CellAccessor::set_level_subdomain_id()
+ * functions.
  * </dd>
  *
  *
index 3b3c5f43f4bfc8432bb3639df84a846f4114cd38..fe01bd696fd63fc623c8b3a62433f841efbf70a9 100644 (file)
@@ -154,6 +154,13 @@ DoFHandler, in particular removal of specializations.
 <h3>Specific improvements</h3>
 
 <ol>
+<li> New: In addition to the regular subdomain ids (see
+@ref GlossSubdomainId) there is now a second set of flags called
+"level subdomain ids" that also assigns a subdomain to every cell
+in a multigrid hierarchy.
+<br>
+(Timo Heister, 2012/11/04)
+
 <li> Changed: GridOut::write_xfig has been improved in a number
 of ways. In particular, one can now color cells based on a number
 of different criteria that can be set in GridOutFlags::XFig.
index 62003d3cd0df0d585e83cf7f6a388a0265a3cc4e..0da7234b2cdccb8dc11d7317bc5e52a9f7ee537c 100644 (file)
@@ -2699,6 +2699,17 @@ class CellAccessor :  public TriaAccessor<dim,dim,spacedim>
                                       */
     void set_subdomain_id (const types::subdomain_id new_subdomain_id) const;
 
+    /**
+     * Get the level subdomain id of this cell. This is used for parallel multigrid.
+     */
+    types::subdomain_id_t level_subdomain_id () const;
+
+    /**
+     * Set the level subdomain id of this cell. This is used for parallel multigrid.
+     */
+    void set_level_subdomain_id (const types::subdomain_id_t new_level_subdomain_id) const;
+
+
                                      /**
                                       * Set the subdomain id of this
                                       * cell and all its children (and
index 24bf5a87a72431ace226f2ef2e48083d2f4d62a7..e5df347d2086517f7960dea5b8c152c5e3ae3761 100644 (file)
@@ -140,6 +140,11 @@ namespace internal
                                           */
         std::vector<types::subdomain_id> subdomain_ids;
 
+        /**
+         * for parallel multigrid
+         */
+        std::vector<types::subdomain_id_t> level_subdomain_ids;
+
                                          /**
                                           * One integer for every consecutive
                                           * pair of cells to store which
@@ -243,6 +248,7 @@ namespace internal
         std::vector<bool> coarsen_flags;
         std::vector<std::pair<int,int> > neighbors;
         std::vector<types::subdomain_id> subdomain_ids;
+        std::vector<types::subdomain_id_t> level_subdomain_ids;
         std::vector<int> parents;
 
                                          // The following is not used
@@ -296,6 +302,7 @@ namespace internal
       ar & refine_flags & coarsen_flags;
       ar & neighbors;
       ar & subdomain_ids;
+      ar & level_subdomain_ids;
       ar & parents;
       ar & direction_flags;
       ar & cells;
index 8607915042480a91f1e52a299b45b761a7664ae8..ae18629a532c82684788cb074bbe5ed2d5caed80 100644 (file)
@@ -1332,6 +1332,25 @@ CellAccessor<dim, spacedim>::set_subdomain_id (const types::subdomain_id new_sub
 }
 
 
+template <int dim, int spacedim>
+types::subdomain_id_t CellAccessor<dim, spacedim>::level_subdomain_id () const
+{
+  Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
+  return this->tria->levels[this->present_level]->level_subdomain_ids[this->present_index];
+}
+
+
+
+template <int dim, int spacedim>
+void
+CellAccessor<dim, spacedim>::set_level_subdomain_id (const types::subdomain_id_t new_level_subdomain_id) const
+{
+  Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
+  this->tria->levels[this->present_level]->level_subdomain_ids[this->present_index]
+    = new_level_subdomain_id;
+}
+
+
 template <int dim, int spacedim>
 bool CellAccessor<dim, spacedim>::direction_flag () const
 {
index ab18a3da8167eff93323b4de1a8d12dc39320c8d..7962a9a5613fc99d81183c779545d5523c091875 100644 (file)
@@ -52,6 +52,11 @@ namespace internal
                                 total_cells - subdomain_ids.size(),
                                 0);
 
+          level_subdomain_ids.reserve (total_cells);
+          level_subdomain_ids.insert (level_subdomain_ids.end(),
+                                total_cells - level_subdomain_ids.size(),
+                                0);
+
           if (dimension < space_dimension)
             {
               direction_flags.reserve (total_cells);
@@ -122,6 +127,7 @@ namespace internal
               MemoryConsumption::memory_consumption (coarsen_flags) +
               MemoryConsumption::memory_consumption (neighbors) +
               MemoryConsumption::memory_consumption (subdomain_ids) +
+              MemoryConsumption::memory_consumption (level_subdomain_ids) +
               MemoryConsumption::memory_consumption (parents) +
               MemoryConsumption::memory_consumption (direction_flags) +
               MemoryConsumption::memory_consumption (cells));
@@ -159,6 +165,11 @@ namespace internal
                                 total_cells - subdomain_ids.size(),
                                 0);
 
+          level_subdomain_ids.reserve (total_cells);
+          level_subdomain_ids.insert (level_subdomain_ids.end(),
+                                total_cells - level_subdomain_ids.size(),
+                                0);
+
           if (dimension < space_dimension)
             {
               direction_flags.reserve (total_cells);

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.