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>
40 unsigned int new_size = 0;
41 for (
unsigned int cell=0; cell<
dof_offsets.size(); )
46 unsigned int next_cell = cell+1;
51 const unsigned int next_offset = (next_cell <
dof_offsets.size() ?
62 bool compressible =
true;
63 for (
unsigned int j=
dof_offsets[cell]+1; j<next_offset; ++j)
69 if (compressible ==
true)
82 std::vector<types::global_dof_index> new_dof_indices;
83 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() ?
105 bool compressible =
true;
106 for (
unsigned int j=
dof_offsets[cell]+1; j<next_offset; ++j)
109 compressible =
false;
115 if (compressible ==
true)
127 for (
unsigned int i=
dof_offsets[cell]; i<next_offset; ++i)
138 Assert (new_dof_indices.size() == new_size, ExcInternalError());
144 template <
int dim,
int spacedim>
155 unsigned int new_size = 0;
156 for (
unsigned int cell=0; cell<
dof_offsets.size(); ++cell)
161 new_size += fe_collection[
active_fe_index(cell)].template n_dofs_per_object<dim>();
165 std::vector<types::global_dof_index> new_dof_indices;
166 new_dof_indices.reserve(new_size);
168 for (
unsigned int cell=0; cell<
dof_offsets.size(); )
173 unsigned int next_cell = cell+1;
178 const unsigned int next_offset = (next_cell <
dof_offsets.size() ?
183 new_dof_offsets[cell] = new_dof_indices.size();
191 for (
unsigned int i=
dof_offsets[cell]; i<next_offset; ++i)
199 for (
unsigned int i=0; i<fe_collection[
active_fe_indices[cell]].template n_dofs_per_object<dim>(); ++i)
210 Assert (new_dof_indices.size() == new_size, ExcInternalError());
244 DEAL_II_NAMESPACE_CLOSE
void uncompress_data(const ::hp::FECollection< dim, spacedim > &fe_collection)
std::size_t memory_consumption() const
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
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
signed short int signed_active_fe_index_type
std::vector< active_fe_index_type > active_fe_indices