32 namespace TriangulationImplementation
37 const unsigned int new_objects_single)
43 reverse_order_next_free_single =
false;
47 unsigned int n_objects = 0;
48 unsigned int n_unused_pairs = 0;
49 unsigned int n_unused_singles = 0;
50 for (
unsigned int i = 0; i < used.size(); ++i)
54 else if (i + 1 < used.size())
59 if (next_free_single == 0)
65 if (next_free_pair == 0)
73 Assert(n_objects + 2 * n_unused_pairs + n_unused_singles == used.size(),
78 const int additional_single_objects =
79 new_objects_single - n_unused_singles;
81 unsigned int new_size =
82 used.size() + new_objects_in_pairs - 2 * n_unused_pairs;
83 if (additional_single_objects > 0)
84 new_size += additional_single_objects;
87 if (new_size > cells.size())
89 cells.reserve(new_size);
90 cells.insert(cells.end(), new_size - cells.size(), G());
92 used.reserve(new_size);
93 used.insert(used.end(), new_size - used.size(),
false);
95 user_flags.reserve(new_size);
96 user_flags.insert(user_flags.end(),
97 new_size - user_flags.size(),
100 const unsigned int factor =
102 children.reserve(factor * new_size);
103 children.insert(children.end(),
104 factor * new_size - children.size(),
107 if (G::dimension > 1)
109 refinement_cases.reserve(new_size);
110 refinement_cases.insert(
111 refinement_cases.end(),
112 new_size - refinement_cases.size(),
118 boundary_or_material_id.reserve(new_size);
119 boundary_or_material_id.resize(new_size);
121 user_data.reserve(new_size);
122 user_data.resize(new_size);
130 if (n_unused_singles == 0)
132 next_free_single = new_size - 1;
133 reverse_order_next_free_single =
true;
139 template <
int dim,
int spacedim>
140 typename ::Triangulation<dim, spacedim>::raw_hex_iterator
142 const ::Triangulation<dim, spacedim> &tria,
143 const unsigned int level)
148 int pos = next_free_pair, last = used.size() - 1;
149 for (; pos < last; ++pos)
158 return tria.end_hex();
160 next_free_pair = pos + 2;
163 typename ::Triangulation<dim, spacedim>::raw_hex_iterator(&tria,
172 const unsigned int new_size =
173 new_hexes + std::count(
used.begin(),
used.end(),
true);
176 if (new_size >
cells.size())
178 cells.reserve(new_size);
181 used.reserve(new_size);
209 new_size * GeometryInfo<3>::faces_per_cell -
218 face_flips.reserve(new_size * GeometryInfo<3>::faces_per_cell);
220 new_size * GeometryInfo<3>::faces_per_cell -
223 face_rotations.reserve(new_size * GeometryInfo<3>::faces_per_cell);
225 new_size * GeometryInfo<3>::faces_per_cell -
235 const unsigned int new_quads_single)
245 unsigned int n_quads = 0;
246 unsigned int n_unused_pairs = 0;
247 unsigned int n_unused_singles = 0;
248 for (
unsigned int i = 0; i <
used.size(); ++i)
252 else if (i + 1 <
used.size())
271 Assert(n_quads + 2 * n_unused_pairs + n_unused_singles ==
used.size(),
275 const int additional_single_quads = new_quads_single - n_unused_singles;
277 unsigned int new_size =
278 used.size() + new_quads_in_pairs - 2 * n_unused_pairs;
279 if (additional_single_quads > 0)
280 new_size += additional_single_quads;
283 if (new_size >
cells.size())
290 line_orientations.insert(line_orientations.end(),
291 new_size * GeometryInfo<2>::lines_per_cell -
292 line_orientations.size(),
296 if (n_unused_singles == 0)
381 line_orientations.size(),
383 line_orientations.size()));
388 template <
typename G>
418 line_orientations.clear();
422 template <
typename G>
461 # include "tria_objects.inst" void reserve_space(const unsigned int new_objs)
const types::manifold_id flat_manifold_id
static ::ExceptionBase & ExcMemoryInexact(int arg1, int arg2)
std::size_t memory_consumption() const
unsigned int next_free_single
unsigned int next_free_pair
std::size_t memory_consumption() const
std::vector< bool > face_rotations
std::size_t memory_consumption() const
bool reverse_order_next_free_single
std::vector< int > children
void monitor_memory(const unsigned int true_dimension) const
std::vector< BoundaryOrMaterialId > boundary_or_material_id
void monitor_memory(const unsigned int true_dimension) const
std::vector< bool > user_flags
std::vector< UserData > user_data
#define Assert(cond, exc)
std::vector< bool > face_orientations
#define DEAL_II_NAMESPACE_CLOSE
void reserve_space(const unsigned int new_objs_in_pairs, const unsigned int new_objs_single=0)
std::vector< RefinementCase< TriaObject< 3 > ::dimension > > refinement_cases
std::vector< bool > face_flips
void reserve_space(const unsigned int new_quads_in_pairs, const unsigned int new_quads_single=0)
#define DEAL_II_NAMESPACE_OPEN
std::vector< types::manifold_id > manifold_id
std::vector< TriaObject< 3 > > cells
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
UserDataType user_data_type
static ::ExceptionBase & ExcInternalError()