16 #include <deal.II/base/memory_consumption.h>
18 #include <deal.II/hp/dof_level.h>
19 #include <deal.II/hp/fe_collection.h>
23 DEAL_II_NAMESPACE_OPEN
30 static_cast<DoFLevel::active_fe_index_type>(-1);
34 template <
int dim,
int spacedim>
37 const ::hp::FECollection<dim, spacedim> &fe_collection)
47 unsigned int new_size = 0;
48 for (
unsigned int cell = 0; cell <
dof_offsets.size();)
50 if (
dof_offsets[cell] != static_cast<offset_type>(-1))
53 unsigned int next_cell = cell + 1;
55 (
dof_offsets[next_cell] == static_cast<offset_type>(-1)))
58 const unsigned int next_offset =
64 .
template n_dofs_per_object<dim>(),
71 bool compressible =
true;
72 for (
unsigned int j =
dof_offsets[cell] + 1; j < next_offset;
79 if (compressible ==
true)
92 std::vector<types::global_dof_index> new_dof_indices;
93 new_dof_indices.reserve(new_size);
94 std::vector<offset_type> new_dof_offsets(
dof_offsets.size(),
95 static_cast<offset_type>(-1));
96 for (
unsigned int cell = 0; cell <
dof_offsets.size();)
98 if (
dof_offsets[cell] != static_cast<offset_type>(-1))
101 unsigned int next_cell = cell + 1;
103 (
dof_offsets[next_cell] == static_cast<offset_type>(-1)))
106 const unsigned int next_offset =
112 .
template n_dofs_per_object<dim>(),
115 new_dof_offsets[cell] = new_dof_indices.size();
121 bool compressible =
true;
122 for (
unsigned int j =
dof_offsets[cell] + 1; j < next_offset;
126 compressible =
false;
132 if (compressible ==
true)
147 for (
unsigned int i =
dof_offsets[cell]; i < next_offset; ++i)
165 template <
int dim,
int spacedim>
168 const ::hp::FECollection<dim, spacedim> &fe_collection)
175 unsigned int new_size = 0;
176 for (
unsigned int cell = 0; cell <
dof_offsets.size(); ++cell)
177 if (
dof_offsets[cell] != static_cast<offset_type>(-1))
182 .template n_dofs_per_object<dim>();
186 std::vector<types::global_dof_index> new_dof_indices;
187 new_dof_indices.reserve(new_size);
188 std::vector<offset_type> new_dof_offsets(
dof_offsets.size(),
189 static_cast<offset_type>(-1));
190 for (
unsigned int cell = 0; cell <
dof_offsets.size();)
192 if (
dof_offsets[cell] != static_cast<offset_type>(-1))
195 unsigned int next_cell = cell + 1;
197 (
dof_offsets[next_cell] == static_cast<offset_type>(-1)))
200 const unsigned int next_offset =
205 new_dof_offsets[cell] = new_dof_indices.size();
213 .
template n_dofs_per_object<dim>(),
215 for (
unsigned int i =
dof_offsets[cell]; i < next_offset; ++i)
223 const unsigned int dofs_per_object =
226 .template n_dofs_per_object<dim>();
227 for (
unsigned int i = 0; i < dofs_per_object; ++i)
301 DEAL_II_NAMESPACE_CLOSE