16 #include <deal.II/base/memory_consumption.h> 17 #include <deal.II/grid/tria_levels.h> 19 DEAL_II_NAMESPACE_OPEN
29 const unsigned int dimension,
30 const unsigned int space_dimension)
38 if (total_cells > refine_flags.size())
40 refine_flags.reserve (total_cells);
41 refine_flags.insert (refine_flags.end(),
42 total_cells - refine_flags.size(),
45 coarsen_flags.reserve (total_cells);
46 coarsen_flags.insert (coarsen_flags.end(),
47 total_cells - coarsen_flags.size(),
50 active_cell_indices.reserve (total_cells);
51 active_cell_indices.insert (active_cell_indices.end(),
52 total_cells - active_cell_indices.size(),
55 subdomain_ids.reserve (total_cells);
56 subdomain_ids.insert (subdomain_ids.end(),
57 total_cells - subdomain_ids.size(),
60 level_subdomain_ids.reserve (total_cells);
61 level_subdomain_ids.insert (level_subdomain_ids.end(),
62 total_cells - level_subdomain_ids.size(),
65 if (dimension < space_dimension)
67 direction_flags.reserve (total_cells);
68 direction_flags.insert (direction_flags.end(),
69 total_cells - direction_flags.size(),
73 direction_flags.clear ();
75 parents.reserve ((
int) (total_cells + 1) / 2);
76 parents.insert (parents.end (),
77 (total_cells + 1) / 2 - parents.size (),
80 neighbors.reserve (total_cells*(2*dimension));
81 neighbors.insert (neighbors.end(),
82 total_cells*(2*dimension) - neighbors.size(),
83 std::make_pair(-1,-1));
93 Assert (2*true_dimension*refine_flags.size() == neighbors.size(),
94 ExcMemoryInexact (refine_flags.size(), neighbors.size()));
95 Assert (2*true_dimension*coarsen_flags.size() == neighbors.size(),
96 ExcMemoryInexact (coarsen_flags.size(), neighbors.size()));
120 const unsigned int dimension,
121 const unsigned int space_dimension)
157 if (dimension < space_dimension)
167 parents.reserve ((
int) (total_cells + 1) / 2);
169 (total_cells + 1) / 2 -
parents.size (),
172 neighbors.reserve (total_cells*(2*dimension));
174 total_cells*(2*dimension) -
neighbors.size(),
175 std::make_pair(-1,-1));
183 (void)true_dimension;
210 DEAL_II_NAMESPACE_CLOSE
std::vector< int > parents
static const unsigned int invalid_unsigned_int
std::size_t memory_consumption() const
std::vector< bool > direction_flags
static ::ExceptionBase & ExcMemoryInexact(int arg1, int arg2)
std::vector< unsigned char > refine_flags
#define Assert(cond, exc)
void monitor_memory(const unsigned int true_dimension) const
std::vector< bool > coarsen_flags
std::vector< types::subdomain_id > subdomain_ids
std_cxx11::enable_if< std_cxx11::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
std::vector< std::pair< int, int > > neighbors
std::vector< unsigned int > active_cell_indices
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)
TriaObjects< TriaObject< dim > > cells