16 #include <deal.II/base/memory_consumption.h> 17 #include <deal.II/hp/dof_level.h> 18 #include <deal.II/hp/fe_collection.h> 21 DEAL_II_NAMESPACE_OPEN
27 template <
int dim,
int spacedim>
39 unsigned int new_size = 0;
40 for (
unsigned int cell=0; cell<
dof_offsets.size(); )
45 unsigned int next_cell = cell+1;
50 const unsigned int next_offset = (next_cell <
dof_offsets.size() ?
61 bool compressible =
true;
62 for (
unsigned int j=
dof_offsets[cell]+1; j<next_offset; ++j)
68 if (compressible ==
true)
81 std::vector<types::global_dof_index> new_dof_indices;
82 new_dof_indices.reserve(new_size);
84 for (
unsigned int cell=0; cell<
dof_offsets.size(); )
89 unsigned int next_cell = cell+1;
94 const unsigned int next_offset = (next_cell <
dof_offsets.size() ?
101 new_dof_offsets[cell] = new_dof_indices.size();
107 bool compressible =
true;
108 for (
unsigned int j=
dof_offsets[cell]+1; j<next_offset; ++j)
111 compressible =
false;
117 if (compressible ==
true)
130 for (
unsigned int i=
dof_offsets[cell]; i<next_offset; ++i)
148 template <
int dim,
int spacedim>
157 unsigned int new_size = 0;
158 for (
unsigned int cell=0; cell<
dof_offsets.size(); ++cell)
163 new_size += fe_collection[
active_fe_index(cell)].template n_dofs_per_object<dim>();
167 std::vector<types::global_dof_index> new_dof_indices;
168 new_dof_indices.reserve(new_size);
170 for (
unsigned int cell=0; cell<
dof_offsets.size(); )
175 unsigned int next_cell = cell+1;
180 const unsigned int next_offset = (next_cell <
dof_offsets.size() ?
185 new_dof_offsets[cell] = new_dof_indices.size();
193 for (
unsigned int i=
dof_offsets[cell]; i<next_offset; ++i)
201 const unsigned int dofs_per_object
203 .template n_dofs_per_object<dim>();
204 for (
unsigned int i=0; i<dofs_per_object; ++i)
264 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)
#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_cxx11::enable_if< std_cxx11::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
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
std::vector< active_fe_index_type > active_fe_indices
static ::ExceptionBase & ExcInternalError()