44 #ifdef LIBMESH_ENABLE_AMR
45 old_dof_object (nullptr),
47 #ifdef LIBMESH_ENABLE_UNIQUE_ID
48 _unique_id (dof_obj._unique_id),
52 _idx_buf (dof_obj._idx_buf)
68 for (
unsigned int s=0; s<this->
n_systems(); s++)
70 libmesh_assert_equal_to (this->
n_vars(s), dof_obj.
n_vars(s));
74 libmesh_assert_equal_to (this->
n_vars(s,vg), dof_obj.
n_vars(s,vg));
76 for (
unsigned int v=0; v<this->
n_vars(s); v++)
78 libmesh_assert_equal_to (this->
n_comp(s,v), dof_obj.
n_comp(s,v));
80 for (
unsigned int c=0; c<this->
n_comp(s,v); c++)
95 #ifdef LIBMESH_ENABLE_AMR 102 #ifdef LIBMESH_ENABLE_UNIQUE_ID 114 for (
unsigned int s=0; s<this->
n_systems(); s++)
116 libmesh_assert_equal_to (this->
n_vars(s), dof_obj.
n_vars(s));
120 libmesh_assert_equal_to (this->
n_vars(s,vg), dof_obj.
n_vars(s,vg));
122 for (
unsigned int v=0; v<this->
n_vars(s); v++)
124 libmesh_assert_equal_to (this->
n_comp(s,v), dof_obj.
n_comp(s,v));
126 for (
unsigned int c=0; c<this->
n_comp(s,v); c++)
140 #ifdef LIBMESH_ENABLE_AMR 183 libmesh_assert_equal_to (ns, this->
n_systems());
184 for (
unsigned int s=0; s<this->
n_systems(); s++)
186 libmesh_assert_equal_to (this->
n_vars(s), 0);
204 DofObject::index_buffer_t::iterator it =
_idx_buf.begin();
213 const unsigned int ns_orig = this->
n_systems();
217 for (
unsigned int i=0; i<ns_orig+1; i++)
220 libmesh_assert_equal_to (this->
n_systems(), (ns_orig+1));
221 libmesh_assert_equal_to (this->
n_vars(ns_orig), 0);
222 libmesh_assert_equal_to (this->
n_var_groups(ns_orig), 0);
228 const std::vector<unsigned int> & nvpg)
231 libmesh_assert_less (s, this->
n_systems());
234 const unsigned int nvg = cast_int<unsigned int>(nvpg.size());
246 for (
unsigned int vg=0; vg<nvg; vg++)
249 libmesh_assert_equal_to (this->
n_vars(s,vg), nvpg[vg]);
258 old_system_sizes.reserve(this->
n_systems());
260 for (
unsigned int s_ctr=0; s_ctr<this->
n_systems(); s_ctr++)
261 old_system_sizes.push_back(this->n_var_groups(s_ctr));
269 DofObject::index_buffer_t::iterator
277 for (
unsigned int ctr=(s+1); ctr<this->
n_systems(); ctr++)
286 for (
unsigned int s_ctr=0; s_ctr<this->
n_systems(); s_ctr++)
288 libmesh_assert_equal_to (this->
n_var_groups(s_ctr), old_system_sizes[s_ctr]);
298 for (
unsigned int vg=0; vg<nvg; vg++)
300 var_idxs[2*vg ] =
ncv_magic*nvpg[vg] + 0;
304 DofObject::index_buffer_t::iterator it =
_idx_buf.begin();
305 std::advance(it, this->
end_idx(s));
306 _idx_buf.insert(it, var_idxs.begin(), var_idxs.end());
308 for (
unsigned int ctr=(s+1); ctr<this->
n_systems(); ctr++)
319 libmesh_assert_equal_to (this->
n_var_groups(s), nvpg.size());
323 libmesh_assert_equal_to (this->
n_vars(s,vg), nvpg[vg]);
327 for (
unsigned int v=0; v<this->
n_vars(s); v++)
328 libmesh_assert_equal_to (this->
n_comp(s,v), 0);
331 for (
unsigned int s_ctr=0; s_ctr<this->
n_systems(); s_ctr++)
333 libmesh_assert_equal_to (this->
n_var_groups(s_ctr), old_system_sizes[s_ctr]);
341 const unsigned int var,
342 const unsigned int ncomp)
344 libmesh_assert_less (s, this->
n_systems());
345 libmesh_assert_less (var, this->
n_vars(s));
353 const unsigned int vg,
354 const unsigned int ncomp)
356 libmesh_assert_less (s, this->
n_systems());
366 libmesh_error_msg(
"ERROR: ncomp must be less than DofObject::ncv_magic!\n" \
369 <<
", ncv_magic = " \
371 <<
"\nrecompile and try again!");
377 n_vars_group = this->
n_vars(s,vg),
378 base_offset = start_idx_sys + 2*vg;
380 libmesh_assert_less ((base_offset + 1),
_idx_buf.size());
404 libmesh_assert_equal_to (ncomp, this->
n_comp_group(s,vg));
410 const unsigned int var,
411 const unsigned int comp,
414 libmesh_assert_less (s, this->
n_systems());
415 libmesh_assert_less (var, this->
n_vars(s));
416 libmesh_assert_less (comp, this->
n_comp(s,var));
426 libmesh_assert_less ((start_idx_sys + 2*vg + 1),
_idx_buf.size());
433 (dn == base_idx + vig*ncg + comp));
439 libmesh_assert_equal_to (this->
dof_number(s, var, comp), dn);
448 cast_int<unsigned int> (
449 #ifdef LIBMESH_ENABLE_AMR 463 #ifdef LIBMESH_ENABLE_AMR 464 const bool has_old_dof_object = cast_int<bool>(*begin++);
466 static const int dof_header_size = 2;
468 static const bool has_old_dof_object =
false;
469 static const int dof_header_size = 1;
474 return cast_int<unsigned int>
475 (dof_header_size + this_indexing_size +
476 (has_old_dof_object ?
486 #ifdef LIBMESH_ENABLE_AMR 488 const bool has_old_dof_object = cast_int<bool>(*begin++);
493 std::copy(begin, begin+size, back_inserter(
_idx_buf));
500 for (
unsigned int i=1; i <
_idx_buf[0]; ++i)
508 #ifdef LIBMESH_ENABLE_AMR 509 if (has_old_dof_object)
522 #ifdef LIBMESH_ENABLE_AMR 530 #ifdef LIBMESH_ENABLE_AMR 552 for (
unsigned int s=0; s<this->
n_systems(); s++)
555 for (
unsigned int var=0; var<this->
n_vars(s); var++)
558 for (
unsigned int comp=0; comp<this->
n_comp(s,var); comp++)
void set_n_comp(const unsigned int s, const unsigned int var, const unsigned int ncomp)
unsigned int system_var_to_vg_var(const unsigned int s, const unsigned int vg, const unsigned int var) const
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
void set_old_dof_object()
static unsigned int unpackable_indexing_size(std::vector< largest_id_type >::const_iterator begin)
unsigned int n_comp(const unsigned int s, const unsigned int var) const
unsigned int n_var_groups(const unsigned int s) const
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
uint8_t processor_id_type
unique_id_type _unique_id
unsigned int end_idx(const unsigned int s) const
DofObject & operator=(const DofObject &dof_obj)
static const unique_id_type invalid_unique_id
static const processor_id_type invalid_processor_id
void set_dof_number(const unsigned int s, const unsigned int var, const unsigned int comp, const dof_id_type dn)
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
unsigned int n_systems() const
processor_id_type _processor_id
void print_dof_info() const
void clear_old_dof_object()
static const dof_id_type invalid_id
std::vector< index_t > index_buffer_t
void set_n_comp_group(const unsigned int s, const unsigned int vg, const unsigned int ncomp)
void set_n_systems(const unsigned int s)
void set_n_vars_per_group(const unsigned int s, const std::vector< unsigned int > &nvpg)
DofObject * old_dof_object
unsigned int start_idx(const unsigned int s) const
unsigned int packed_indexing_size() const
void pack_indexing(std::back_insert_iterator< std::vector< largest_id_type >> target) const
void unpack_indexing(std::vector< largest_id_type >::const_iterator begin)
void debug_buffer() const
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
OStreamProxy out(std::cout)
processor_id_type _processor_id
static const index_t ncv_magic