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
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(),
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(),
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
void uncompress_data(const ::hp::FECollection< dim, spacedim > &fe_collection)
std::size_t memory_consumption() const
static active_fe_index_type get_toggled_compression_state(const active_fe_index_type active_fe_index)
std::vector< offset_type > cell_cache_offsets
void compress_data(const ::hp::FECollection< dim, spacedim > &fe_collection)
unsigned short int active_fe_index_type
#define Assert(cond, exc)
std::vector< offset_type > dof_offsets
static bool is_compressed_entry(const active_fe_index_type active_fe_index)
void normalize_active_fe_indices()
std::vector< types::global_dof_index > dof_indices
std::vector< types::global_dof_index > cell_dof_indices_cache
unsigned int active_fe_index(const unsigned int obj_index) const
static const active_fe_index_type invalid_active_fe_index
std::vector< active_fe_index_type > future_fe_indices
std::vector< active_fe_index_type > active_fe_indices
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
static ::ExceptionBase & ExcInternalError()