16 #include <deal.II/base/memory_consumption.h> 18 #include <deal.II/grid/tria_levels.h> 20 DEAL_II_NAMESPACE_OPEN
25 namespace TriangulationImplementation
30 const unsigned int dimension,
31 const unsigned int space_dimension)
39 if (total_cells > refine_flags.size())
41 refine_flags.reserve(total_cells);
42 refine_flags.insert(refine_flags.end(),
43 total_cells - refine_flags.size(),
46 coarsen_flags.reserve(total_cells);
47 coarsen_flags.insert(coarsen_flags.end(),
48 total_cells - coarsen_flags.size(),
51 active_cell_indices.reserve(total_cells);
52 active_cell_indices.insert(active_cell_indices.end(),
53 total_cells - active_cell_indices.size(),
56 subdomain_ids.reserve(total_cells);
57 subdomain_ids.insert(subdomain_ids.end(),
58 total_cells - subdomain_ids.size(),
61 level_subdomain_ids.reserve(total_cells);
62 level_subdomain_ids.insert(level_subdomain_ids.end(),
63 total_cells - level_subdomain_ids.size(),
66 if (dimension < space_dimension)
68 direction_flags.reserve(total_cells);
69 direction_flags.insert(direction_flags.end(),
70 total_cells - direction_flags.size(),
74 direction_flags.clear();
76 parents.reserve((total_cells + 1) / 2);
77 parents.insert(parents.end(),
78 (total_cells + 1) / 2 - parents.size(),
81 neighbors.reserve(total_cells * (2 * dimension));
82 neighbors.insert(neighbors.end(),
83 total_cells * (2 * dimension) - neighbors.size(),
84 std::make_pair(-1, -1));
94 Assert(2 * true_dimension * refine_flags.size() == neighbors.size(),
95 ExcMemoryInexact(refine_flags.size(), neighbors.size()));
96 Assert(2 * true_dimension * coarsen_flags.size() == neighbors.size(),
97 ExcMemoryInexact(coarsen_flags.size(), neighbors.size()));
121 const unsigned int dimension,
122 const unsigned int space_dimension)
158 if (dimension < space_dimension)
168 parents.reserve((total_cells + 1) / 2);
170 (total_cells + 1) / 2 -
parents.size(),
173 neighbors.reserve(total_cells * (2 * dimension));
175 total_cells * (2 * dimension) -
neighbors.size(),
176 std::make_pair(-1, -1));
184 (void)true_dimension;
211 DEAL_II_NAMESPACE_CLOSE
TriaObjects< TriaObject< dim > > cells
static const unsigned int invalid_unsigned_int
std::vector< int > parents
std::size_t memory_consumption() const
std::vector< bool > direction_flags
void monitor_memory(const unsigned int true_dimension) const
std::vector< std::pair< int, int > > neighbors
std::vector< types::subdomain_id > level_subdomain_ids
void reserve_space(const unsigned int total_cells, const unsigned int dimension, const unsigned int space_dimension)
std::vector< std::uint8_t > refine_flags
std::vector< unsigned int > active_cell_indices
std::vector< types::subdomain_id > subdomain_ids
#define Assert(cond, exc)
static ::ExceptionBase & ExcMemoryInexact(int arg1, int arg2)
std::vector< bool > coarsen_flags
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)