]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Introduce arrays to store active_cell_index values for each cell.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 10 Apr 2015 12:41:52 +0000 (07:41 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 13 Apr 2015 00:10:17 +0000 (19:10 -0500)
include/deal.II/grid/tria_levels.h
source/grid/tria_levels.cc

index 86a7f742f005bebd3ef83e4de77ba942578bfe4a..a29050e498587f8fa15a77da0ba151bdccaf6e8d 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -70,6 +70,14 @@ namespace internal
        */
       std::vector<bool> coarsen_flags;
 
+
+      /**
+       * An integer that, for every active cell, stores the how
+       * many-th active cell this is. For non-active cells, this value
+       * is unused and set to an invalid value.
+       */
+      std::vector<unsigned int> active_cell_indices;
+
       /**
        * Levels and indices of the neighbors of the cells. Convention is, that
        * the neighbors of the cell with index @p i are stored in the fields
@@ -200,9 +208,9 @@ namespace internal
 //TODO: Replace TriaObjectsHex to avoid this specialization
 
     /**
-     * Specialization of TriaLevels for 3D. Since we need TriaObjectsHex
-     * instead of TriaObjects. Refer to the documentation of the template for
-     * details.
+     * Specialization of TriaLevels for 3D. Since we need
+     * TriaObjectsHex instead of TriaObjects. Refer to the
+     * documentation of the general class template for details.
      */
     template<>
     class TriaLevel<3>
@@ -210,6 +218,7 @@ namespace internal
     public:
       std::vector<unsigned char> refine_flags;
       std::vector<bool> coarsen_flags;
+      std::vector<unsigned int> active_cell_indices;
       std::vector<std::pair<int,int> > neighbors;
       std::vector<types::subdomain_id> subdomain_ids;
       std::vector<types::subdomain_id> level_subdomain_ids;
@@ -265,6 +274,7 @@ namespace internal
                                    const unsigned int)
     {
       ar &refine_flags &coarsen_flags;
+      ar &active_cell_indices;
       ar &neighbors;
       ar &subdomain_ids;
       ar &level_subdomain_ids;
@@ -280,6 +290,7 @@ namespace internal
                                  const unsigned int)
     {
       ar &refine_flags &coarsen_flags;
+      ar &active_cell_indices;
       ar &neighbors;
       ar &subdomain_ids;
       ar &level_subdomain_ids;
index 944021dcd24a5e30dbc296277e424646be653b42..7f8879a970622e794544b72db24f7f9f9adfefc1 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2006 - 2014 by the deal.II authors
+// Copyright (C) 2006 - 2015 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -47,6 +47,11 @@ namespace internal
                                 total_cells - coarsen_flags.size(),
                                 false);
 
+          active_cell_indices.reserve (total_cells);
+          active_cell_indices.insert (active_cell_indices.end(),
+                                      total_cells - active_cell_indices.size(),
+                                      numbers::invalid_unsigned_int);
+
           subdomain_ids.reserve (total_cells);
           subdomain_ids.insert (subdomain_ids.end(),
                                 total_cells - subdomain_ids.size(),
@@ -97,6 +102,7 @@ namespace internal
     {
       return (MemoryConsumption::memory_consumption (refine_flags) +
               MemoryConsumption::memory_consumption (coarsen_flags) +
+              MemoryConsumption::memory_consumption (active_cell_indices) +
               MemoryConsumption::memory_consumption (neighbors) +
               MemoryConsumption::memory_consumption (subdomain_ids) +
               MemoryConsumption::memory_consumption (level_subdomain_ids) +
@@ -132,6 +138,11 @@ namespace internal
                                 total_cells - coarsen_flags.size(),
                                 false);
 
+          active_cell_indices.reserve (total_cells);
+          active_cell_indices.insert (active_cell_indices.end(),
+                                      total_cells - active_cell_indices.size(),
+                                      numbers::invalid_unsigned_int);
+
           subdomain_ids.reserve (total_cells);
           subdomain_ids.insert (subdomain_ids.end(),
                                 total_cells - subdomain_ids.size(),
@@ -180,6 +191,7 @@ namespace internal
     {
       return (MemoryConsumption::memory_consumption (refine_flags) +
               MemoryConsumption::memory_consumption (coarsen_flags) +
+              MemoryConsumption::memory_consumption (active_cell_indices) +
               MemoryConsumption::memory_consumption (neighbors) +
               MemoryConsumption::memory_consumption (subdomain_ids) +
               MemoryConsumption::memory_consumption (parents) +

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.