libMesh
Loading...
Searching...
No Matches
dof_object.C
Go to the documentation of this file.
1// The libMesh Finite Element Library.
2// Copyright (C) 2002-2026 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3
4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public
6// License as published by the Free Software Foundation; either
7// version 2.1 of the License, or (at your option) any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// Lesser General Public License for more details.
13
14// You should have received a copy of the GNU Lesser General Public
15// License along with this library; if not, write to the Free Software
16// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18
19
20// Local includes
21#include "libmesh/dof_object.h"
22
23namespace libMesh
24{
25
26// Copy Constructor
29#ifdef LIBMESH_ENABLE_UNIQUE_ID
30 _unique_id (dof_obj._unique_id),
31#endif
32 _id (dof_obj._id),
33 _processor_id (dof_obj._processor_id),
34 _idx_buf (dof_obj._idx_buf)
35{
36 // DO NOT copy old_dof_object, because this isn't a *real* copy
37 // constructor, it's a "copy almost everything" constructor that
38 // is intended to be used solely for internal construction of
39 // old_dof_object, never for a true deep copy where the newly
40 // created object really matches the source object.
41
42 // Check that everything worked
43#ifdef DEBUG
44
45 libmesh_assert_equal_to (this->n_systems(), dof_obj.n_systems());
46
47 for (auto s : make_range(this->n_systems()))
48 {
49 libmesh_assert_equal_to (this->n_vars(s), dof_obj.n_vars(s));
50 libmesh_assert_equal_to (this->n_var_groups(s), dof_obj.n_var_groups(s));
51
52 for (auto vg : make_range(this->n_var_groups(s)))
53 libmesh_assert_equal_to (this->n_vars(s,vg), dof_obj.n_vars(s,vg));
54
55 for (auto v : make_range(this->n_vars(s)))
56 {
57 libmesh_assert_equal_to (this->n_comp(s,v), dof_obj.n_comp(s,v));
58
59 for (auto c : make_range(this->n_comp(s,v)))
60 libmesh_assert_equal_to (this->dof_number(s,v,c), dof_obj.dof_number(s,v,c));
61 }
62 }
63
64#endif
65}
66
67
68// Deep-copying assignment operator
70{
71 if (&dof_obj == this)
72 return *this;
73
74#ifdef LIBMESH_ENABLE_AMR
76 this->old_dof_object = this->construct(dof_obj.get_old_dof_object());
77#endif
78
79 _id = dof_obj._id;
80#ifdef LIBMESH_ENABLE_UNIQUE_ID
81 _unique_id = dof_obj._unique_id;
82#endif
84 _idx_buf = dof_obj._idx_buf;
85
86
87 // Check that everything worked
88#ifdef DEBUG
89
90 libmesh_assert_equal_to (this->n_systems(), dof_obj.n_systems());
91
92 for (auto s : make_range(this->n_systems()))
93 {
94 libmesh_assert_equal_to (this->n_vars(s), dof_obj.n_vars(s));
95 libmesh_assert_equal_to (this->n_var_groups(s), dof_obj.n_var_groups(s));
96
97 for (auto vg : make_range(this->n_var_groups(s)))
98 libmesh_assert_equal_to (this->n_vars(s,vg), dof_obj.n_vars(s,vg));
99
100 for (auto v : make_range(this->n_vars(s)))
101 {
102 libmesh_assert_equal_to (this->n_comp(s,v), dof_obj.n_comp(s,v));
103
104 for (auto c : make_range(this->n_comp(s,v)))
105 libmesh_assert_equal_to (this->dof_number(s,v,c), dof_obj.dof_number(s,v,c));
106 }
107 }
108
109#endif
110
111 return *this;
112}
113
114
115
116
117
118#ifdef LIBMESH_ENABLE_AMR
119
121{
122 this->old_dof_object.reset(nullptr);
123}
124
125
126
128{
129 this->clear_old_dof_object();
130
132
133 // Make a new DofObject, assign a copy of \p this.
134 // Make sure the copy ctor for DofObject works!!
135 this->old_dof_object = this->construct(this);
136}
137
138#endif
139
140
141
142void DofObject::set_n_systems (const unsigned int ns)
143{
144 const unsigned int old_ns = this->n_systems();
145
146 // Check for trivial return
147 if (ns == old_ns)
148 return;
149
150 const unsigned int nei = this->n_extra_integers();
151 const dof_id_type header_size = ns + bool(nei);
152 const dof_id_type hdr = nei ?
153 static_cast<dof_id_type>(-static_cast<std::ptrdiff_t>(header_size))
154 : header_size;
155 index_buffer_t new_buf(header_size + nei, hdr);
156 if (nei)
157 {
158 const unsigned int start_idx_ints = old_ns ?
159 cast_int<unsigned int>(_idx_buf[old_ns]) :
160 1;
161 libmesh_assert_less(start_idx_ints, _idx_buf.size());
162 std::copy(_idx_buf.begin()+start_idx_ints,
163 _idx_buf.end(),
164 new_buf.begin()+header_size);
165 if (ns)
166 std::fill(new_buf.begin()+1, new_buf.begin()+ns+1, ns+1);
167 }
168
169 // vector swap trick to force deallocation when shrinking
170 new_buf.swap(_idx_buf);
171
172#ifdef DEBUG
173 libmesh_assert_equal_to(nei, this->n_extra_integers());
174
175 // check that all systems now exist and that they have 0 size
176 libmesh_assert_equal_to (ns, this->n_systems());
177 for (auto s : make_range(this->n_systems()))
178 {
179 libmesh_assert_equal_to (this->n_vars(s), 0);
180 libmesh_assert_equal_to (this->n_var_groups(s), 0);
181 }
182#endif
183}
184
185
186
188{
189 // quick return?
190 if (this->n_systems() == 0)
191 {
192 this->set_n_systems(1);
193 return;
194 }
195
196 // cache this value before we screw it up!
197 const unsigned int ns_orig = this->n_systems();
198
199 DofObject::index_buffer_t::iterator it = _idx_buf.begin() + ns_orig;
200
201 // Create the entry for the new system indicating 0 variables.
202 //
203 // increment the number of systems and the offsets for each of
204 // the systems including the new one we just added.
205 if (this->has_extra_integers())
206 {
207 // this inserts the extra_integers' start position as the start
208 // position for the new system. We'll increment all those
209 // counts in one sweep next, to account for header expansion.
210 _idx_buf.insert(it, *it);
211
212 _idx_buf[0]--;
213 for (unsigned int i=1; i<ns_orig+2; i++)
214 {
215 libmesh_assert_less(i, _idx_buf.size());
216 _idx_buf[i]++;
217 }
218 }
219 else
220 {
221 // this inserts the current vector size at the position for the
222 // new system
223 _idx_buf.insert(it, cast_int<dof_id_type>(_idx_buf.size()));
224
225 for (unsigned int i=0; i<ns_orig+1; i++)
226 {
227 libmesh_assert_less(i, _idx_buf.size());
228 _idx_buf[i]++;
229 }
230 }
231
232 libmesh_assert_equal_to (this->n_systems(), (ns_orig+1));
233 libmesh_assert_equal_to (this->n_vars(ns_orig), 0);
234 libmesh_assert_equal_to (this->n_var_groups(ns_orig), 0);
235}
236
237
238
239void DofObject::set_n_vars_per_group(const unsigned int s,
240 const std::vector<unsigned int> & nvpg)
241{
242 const unsigned int n_sys = this->n_systems();
243
244 libmesh_assert_less (s, n_sys);
245
246 // number of variable groups for this system - inferred
247 const unsigned int nvg = cast_int<unsigned int>(nvpg.size());
248
249 // BSK - note that for compatibility with the previous implementation
250 // calling this method when (nvars == this->n_vars()) requires that
251 // we invalidate the DOF indices and set the number of components to 0.
252 // Note this was a bit of a surprise to me - there was no quick return in
253 // the old method, which caused removal and readdition of the DOF indices
254 // even in the case of (nvars == this->n_vars()), resulting in n_comp(s,v)
255 // implicitly becoming 0 regardless of any previous value.
256 // quick return?
257 if (nvg == this->n_var_groups(s))
258 {
259 for (unsigned int vg=0; vg<nvg; vg++)
260 {
261 this->set_n_comp_group(s,vg,0);
262 libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
263 }
264 return;
265 }
266
267 const bool hei = this->has_extra_integers();
268
269 // since there is ample opportunity to screw up other systems, let us
270 // cache their current sizes and later assert that they are unchanged.
271#ifdef DEBUG
272 const unsigned int nei = this->n_extra_integers();
273
274 DofObject::index_buffer_t old_system_sizes, old_extra_integers;
275 old_system_sizes.reserve(n_sys);
276 old_extra_integers.reserve(nei);
277
278 for (unsigned int s_ctr=0; s_ctr<n_sys; s_ctr++)
279 old_system_sizes.push_back(this->n_var_groups(s_ctr));
280
281 for (unsigned int ei=0; ei != nei; ++ei)
282 old_extra_integers.push_back(this->get_extra_integer(ei));
283#endif
284
285 // remove current indices if we have some
286 if (this->n_var_groups(s) != 0)
287 {
288 const unsigned int old_nvg_s = this->n_var_groups(s);
289
290 DofObject::index_buffer_t::iterator
291 it = _idx_buf.begin(),
292 end = _idx_buf.begin();
293
294 std::advance(it, this->start_idx(s));
295 std::advance(end, this->end_idx(s));
296 _idx_buf.erase(it,end);
297
298 for (unsigned int ctr=(s+1); ctr<n_sys; ctr++)
299 _idx_buf[ctr] -= 2*old_nvg_s;
300
301 if (hei)
302 _idx_buf[n_sys] -= 2*old_nvg_s;
303 }
304
305 // better not have any now!
306 libmesh_assert_equal_to (this->n_var_groups(s), 0);
307
308 // Make sure we didn't screw up any of our sizes!
309#ifdef DEBUG
310 for (auto s_ctr : make_range(this->n_systems()))
311 if (s_ctr != s)
312 libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
313
314 libmesh_assert_equal_to (nei, this->n_extra_integers());
315
316 for (unsigned int ei=0; ei != nei; ++ei)
317 libmesh_assert_equal_to(old_extra_integers[ei], this->get_extra_integer(ei));
318#endif
319
320 // OK, if the user requested 0 that is what we have
321 if (nvg == 0)
322 return;
323
324 {
325 // array to hold new indices
326 DofObject::index_buffer_t var_idxs(2*nvg);
327 for (unsigned int vg=0; vg<nvg; vg++)
328 {
329 var_idxs[2*vg ] = ncv_magic*nvpg[vg] + 0;
330 var_idxs[2*vg + 1] = invalid_id - 1;
331 }
332
333 DofObject::index_buffer_t::iterator it = _idx_buf.begin();
334 std::advance(it, this->end_idx(s));
335 _idx_buf.insert(it, var_idxs.begin(), var_idxs.end());
336
337 for (unsigned int ctr=(s+1); ctr<n_sys; ctr++)
338 _idx_buf[ctr] += 2*nvg;
339
340 if (hei)
341 _idx_buf[n_sys] += 2*nvg;
342
343 // resize _idx_buf to fit so no memory is wasted.
345 }
346
347 libmesh_assert_equal_to (nvg, this->n_var_groups(s));
348
349#ifdef DEBUG
350
351 libmesh_assert_equal_to (this->n_var_groups(s), nvpg.size());
352
353 for (auto vg : make_range(this->n_var_groups(s)))
354 {
355 libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
356 libmesh_assert_equal_to (this->n_comp_group(s,vg), 0);
357 }
358
359 for (auto v : make_range(this->n_vars(s)))
360 libmesh_assert_equal_to (this->n_comp(s,v), 0);
361
362 // again, all other system sizes should be unchanged!
363 for (auto s_ctr : make_range(this->n_systems()))
364 if (s_ctr != s)
365 libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
366
367 // Extra integers count and values should also be unchanged!
368 libmesh_assert_equal_to (nei, this->n_extra_integers());
369
370 for (unsigned int ei=0; ei != nei; ++ei)
371 libmesh_assert_equal_to(old_extra_integers[ei], this->get_extra_integer(ei));
372#endif
373}
374
375
376
377void DofObject::set_n_comp(const unsigned int s,
378 const unsigned int var,
379 const unsigned int ncomp)
380{
381 libmesh_assert_less (s, this->n_systems());
382 libmesh_assert_less (var, this->n_vars(s));
383
384 this->set_n_comp_group(s, this->var_to_vg(s,var), ncomp);
385}
386
387
388
389void DofObject::set_n_comp_group(const unsigned int s,
390 const unsigned int vg,
391 const unsigned int ncomp)
392{
393 libmesh_assert_less (s, this->n_systems());
394 libmesh_assert_less (vg, this->n_var_groups(s));
395
396 // Check for trivial return
397 if (ncomp == this->n_comp_group(s,vg)) return;
398
399#ifndef NDEBUG
400 if (ncomp >= ncv_magic)
401 {
402 const index_t ncvm = ncv_magic;
403 libmesh_error_msg("ERROR: ncomp must be less than DofObject::ncv_magic!\n" \
404 << "ncomp = " \
405 << ncomp \
406 << ", ncv_magic = " \
407 << ncvm \
408 << "\nrecompile and try again!");
409 }
410#endif
411
412 const unsigned int
413 start_idx_sys = this->start_idx(s),
414 n_vars_group = this->n_vars(s,vg),
415 base_offset = start_idx_sys + 2*vg;
416
417 libmesh_assert_less ((base_offset + 1), _idx_buf.size());
418
419 // if (ncomp)
420 // libMesh::out << "s,vg,ncomp="
421 // << s << ","
422 // << vg << ","
423 // << ncomp << '\n';
424
425 // set the number of components, maintaining the number
426 // of variables in the group
427 _idx_buf[base_offset] = ncv_magic*n_vars_group + ncomp;
428
429 // We use (invalid_id - 1) to signify no
430 // components for this object
431 _idx_buf[base_offset + 1] = (ncomp == 0) ? invalid_id - 1 : invalid_id;
432
433 // this->debug_buffer();
434 // libMesh::out << "s,vg = " << s << "," << vg << '\n'
435 // << "base_offset=" << base_offset << '\n'
436 // << "this->n_comp(s,vg)=" << this->n_comp(s,vg) << '\n'
437 // << "this->n_comp_group(s,vg)=" << this->n_comp_group(s,vg) << '\n'
438 // << "this->n_vars(s,vg)=" << this->n_vars(s,vg) << '\n'
439 // << "this->n_var_groups(s)=" << this->n_var_groups(s) << '\n';
440
441 libmesh_assert_equal_to (ncomp, this->n_comp_group(s,vg));
442}
443
444
445
446void DofObject::set_dof_number(const unsigned int s,
447 const unsigned int var,
448 const unsigned int comp,
449 const dof_id_type dn)
450{
451 libmesh_assert_less (s, this->n_systems());
452 libmesh_assert_less (var, this->n_vars(s));
453 libmesh_assert_less (comp, this->n_comp(s,var));
454
455 const unsigned int
456 vg = this->var_to_vg(s,var),
457#ifndef NDEBUG
458 ncg = this->n_comp_group(s,vg),
459#endif
460 vig = this->system_var_to_vg_var(s,vg,var),
461 start_idx_sys = this->start_idx(s);
462
463 libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
464
465 dof_id_type & base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
466
467 // We intend to change all dof numbers together or not at all
468 if (comp || vig)
469 libmesh_assert ((dn == invalid_id && base_idx == invalid_id) ||
470 (dn == base_idx + vig*ncg + comp));
471
472 // only explicitly store the base index for vig==0, comp==0
473 else
474 base_idx = dn;
475
476 libmesh_assert_equal_to (this->dof_number(s, var, comp), dn);
477}
478
479
480
481void
482DofObject::add_extra_integers (const unsigned int n_integers)
483{
484 if (_idx_buf.empty())
485 {
486 if (n_integers)
487 {
488 _idx_buf.resize(n_integers+1, DofObject::invalid_id);
489 _idx_buf[0] = dof_id_type(-1);
490 }
491 return;
492 }
493 else
494 {
495 const int hdr = dof_id_signed_type(_idx_buf[0]);
496
497 // We already have some extra integers, but may need more or
498 // less now.
499 if (hdr < 0)
500 {
501 const unsigned int old_n_integers = this->n_extra_integers();
502 if (n_integers != old_n_integers)
503 {
504 // Make or remove space as needed by count change
505 _idx_buf.resize(_idx_buf.size()+n_integers-old_n_integers, DofObject::invalid_id);
506
507 // The start index for the extra integers is unchanged.
508 }
509 }
510 else if (n_integers)
511 // We had no extra integers, but need to add some
512 {
513 // Mark the DofObject as holding extra integers
514 _idx_buf[0] = dof_id_type(-hdr-1);
515
516 // Insert the integer start position
517 DofObject::index_buffer_t::iterator it = _idx_buf.begin() + hdr;
518 _idx_buf.insert(it, _idx_buf.size()+1);
519
520 // Increment the previous system start positions to account
521 // for the new header entry creating an offset
522 for (int i=1; i<hdr; i++)
523 _idx_buf[i]++;
524
525 // Append space for extra integers
526 _idx_buf.resize(_idx_buf.size()+n_integers, DofObject::invalid_id);
527 }
528 }
529}
530
531
532
533void
534DofObject::add_extra_integers (const unsigned int n_integers,
535 const std::vector<dof_id_type> & default_values)
536{
537 libmesh_assert_equal_to(n_integers, default_values.size());
538
539 const unsigned int n_old_integers = this->n_extra_integers();
540 this->add_extra_integers(n_integers);
541 if (n_integers > n_old_integers)
542 {
543 const unsigned int n_more_integers = n_integers - n_old_integers;
544 std::copy(default_values.begin()+n_old_integers,
545 default_values.end(),
546 _idx_buf.end()-n_more_integers);
547 }
548}
549
550
551
553{
554 return
555 cast_int<unsigned int> (
556#ifdef LIBMESH_ENABLE_AMR
557 ((old_dof_object == nullptr) ? 0 : old_dof_object->packed_indexing_size()) + 2 +
558#else
559 1 +
560#endif
561 _idx_buf.size());
562}
563
564
565
566unsigned int
567DofObject::unpackable_indexing_size(std::vector<largest_id_type>::const_iterator begin)
568{
569#ifdef LIBMESH_ENABLE_AMR
570 const bool has_old_dof_object = cast_int<bool>(*begin++);
571
572 static const int dof_header_size = 2;
573#else
574 static const bool has_old_dof_object = false;
575 static const int dof_header_size = 1;
576#endif
577
578 const largest_id_type this_indexing_size = *begin++;
579
580 return cast_int<unsigned int>
581 (dof_header_size + this_indexing_size +
582 (has_old_dof_object ?
583 unpackable_indexing_size(begin+this_indexing_size) : 0));
584}
585
586
587void DofObject::unpack_indexing(std::vector<largest_id_type>::const_iterator begin)
588{
589 _idx_buf.clear();
590
591#ifdef LIBMESH_ENABLE_AMR
592 this->clear_old_dof_object();
593 const bool has_old_dof_object = cast_int<bool>(*begin++);
594#endif
595
596 const largest_id_type size = *begin++;
597 _idx_buf.reserve(size);
598 std::copy(begin, begin+size, back_inserter(_idx_buf));
599
600 // Check as best we can for internal consistency now
601 libmesh_assert(_idx_buf.empty() ||
602 (std::abs(dof_id_signed_type(_idx_buf[0])) <=
603 cast_int<dof_id_signed_type>(_idx_buf.size())));
604#ifdef DEBUG
605 if (!_idx_buf.empty())
606 {
607 const int hdr = cast_int<int>(dof_id_signed_type(_idx_buf[0]));
608 const unsigned int ns = hdr >= 0 ? hdr : (-hdr-1);
609 for (unsigned int i=1; i < ns; ++i)
610 {
611 if (hdr > 0 || i > 1)
612 libmesh_assert_greater_equal (_idx_buf[i], _idx_buf[i-1]);
613 else
614 libmesh_assert_greater_equal (_idx_buf[i], ns);
615 libmesh_assert_equal_to ((_idx_buf[i] - _idx_buf[i-1])%2, 0);
616 libmesh_assert_less_equal (_idx_buf[i], _idx_buf.size());
617 }
618 if (hdr < 0 && ns > 0)
619 libmesh_assert_less_equal(_idx_buf[ns], _idx_buf.size());
620 }
621#endif
622
623#ifdef LIBMESH_ENABLE_AMR
624 if (has_old_dof_object)
625 {
626 this->old_dof_object = this->construct();
627 this->old_dof_object->unpack_indexing(begin+size);
628 }
629#endif
630}
631
632
633void
634DofObject::pack_indexing(std::back_insert_iterator<std::vector<largest_id_type>> target) const
635{
636#ifdef LIBMESH_ENABLE_AMR
637 // We might need to pack old_dof_object too
638 *target++ = (old_dof_object == nullptr) ? 0 : 1;
639#endif
640
641 *target++ = _idx_buf.size();
642 std::copy(_idx_buf.begin(), _idx_buf.end(), target);
643
644#ifdef LIBMESH_ENABLE_AMR
645 if (old_dof_object)
646 old_dof_object->pack_indexing(target);
647#endif
648}
649
650
651
653{
654 libMesh::out << " [ ";
655 for (const auto & idx : _idx_buf)
656 libMesh::out << idx << " ";
657 libMesh::out << "]\n";
658}
659
660
661
663{
664 libMesh::out << this->id() << " [ ";
665
666 for (auto s : make_range(this->n_systems()))
667 {
668 libMesh::out << "s:" << s << " ";
669 for (auto var : make_range(this->n_vars(s)))
670 {
671 libMesh::out << "v:" << var << " ";
672 for (auto comp : make_range(this->n_comp(s,var)))
673 {
674 libMesh::out << "c:" << comp << " dof:" << this->dof_number(s,var,comp) << " ";
675 }
676 }
677 }
678
679 libMesh::out << "]\n";
680}
681
682
683
684} // namespace libMesh
unsigned int n_vars
The DofObject defines an abstract base class for objects that have degrees of freedom associated with...
Definition dof_object.h:55
unsigned int end_idx(const unsigned int s) const
The ending index for system s.
processor_id_type _processor_id
The processor_id of the DofObject.
Definition dof_object.h:585
static unsigned int unpackable_indexing_size(std::vector< largest_id_type >::const_iterator begin)
If we have indices packed into an buffer for communications, how much of that buffer applies to this ...
Definition dof_object.C:567
void set_old_dof_object()
Sets the old_dof_object to a copy of this.
Definition dof_object.C:127
unsigned int n_systems() const
Definition dof_object.h:913
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition dof_object.h:978
void set_n_comp(const unsigned int s, const unsigned int var, const unsigned int ncomp)
Sets the number of components for Variable var of system s associated with this DofObject.
Definition dof_object.C:377
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition dof_object.h:991
bool has_extra_integers() const
Returns whether extra integers are associated to the DofObject.
dof_id_type get_extra_integer(const unsigned int index) const
Gets the value on this object of the extra integer associated with index, which should have been obta...
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
void set_n_comp_group(const unsigned int s, const unsigned int vg, const unsigned int ncomp)
Sets the number of components for VariableGroup vg of system s associated with this DofObject.
Definition dof_object.C:389
DofObject()
Constructor.
Definition dof_object.h:718
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
void debug_buffer() const
Print our buffer for debugging.
Definition dof_object.C:652
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
dof_id_type _id
The id of the DofObject.
Definition dof_object.h:574
void print_dof_info() const
Print out info for debugging.
Definition dof_object.C:662
std::vector< index_t > index_buffer_t
Definition dof_object.h:670
void set_n_vars_per_group(const unsigned int s, const std::vector< unsigned int > &nvpg)
Sets number of variables in each group associated with system s for this DofObject.
Definition dof_object.C:239
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in.
void add_system()
Adds an additional system to the DofObject.
Definition dof_object.C:187
void set_dof_number(const unsigned int s, const unsigned int var, const unsigned int comp, const dof_id_type dn)
Sets the global degree of freedom number for variable var, component comp for system s associated wit...
Definition dof_object.C:446
unsigned int n_var_groups(const unsigned int s) const
Definition dof_object.h:933
unsigned int system_var_to_vg_var(const unsigned int s, const unsigned int vg, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in.
DofObject & operator=(const DofObject &dof_obj)
Deep-copying assignment operator.
Definition dof_object.C:69
void add_extra_integers(const unsigned int n_integers)
Assigns a set of extra integers to this DofObject.
Definition dof_object.C:482
static const index_t ncv_magic
Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv a...
Definition dof_object.h:682
static constexpr dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition dof_object.h:473
index_buffer_t _idx_buf
Definition dof_object.h:671
void pack_indexing(std::back_insert_iterator< std::vector< largest_id_type > > target) const
A method for creating packed data from our index buffer - basically a copy with prepended size with o...
Definition dof_object.C:634
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition dof_object.h:88
DofObject * get_old_dof_object()
Pointer accessor for previously public old_dof_object.
Definition dof_object.h:96
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition dof_object.h:568
dof_id_type id() const
Definition dof_object.h:819
dof_id_type index_t
DoF index information.
Definition dof_object.h:669
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition dof_object.h:943
std::unique_ptr< DofObject > construct(const DofObject *other=nullptr)
Convenient factory function that calls either the (deep) copy constructor or the default constructor ...
Definition dof_object.h:732
void clear_old_dof_object()
Sets the old_dof_object to nullptr.
Definition dof_object.C:120
unsigned int packed_indexing_size() const
If we pack our indices into an buffer for communications, how many ints do we need?
Definition dof_object.C:552
void set_n_systems(const unsigned int s)
Sets the number of systems for this DofObject.
Definition dof_object.C:142
void unpack_indexing(std::vector< largest_id_type >::const_iterator begin)
A method for creating our index buffer from packed data - basically with our current implementation w...
Definition dof_object.C:587
This class implements reference counting.
The libMesh namespace provides an interface to certain functionality in the library.
int8_t dof_id_signed_type
Definition id_types.h:68
libmesh_assert(ctx)
OStreamProxy out
uint64_t largest_id_type
Definition id_types.h:148
uint8_t dof_id_type
Definition id_types.h:67
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition int_range.h:176