libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
Public 成员函数 | 静态 Public 成员函数 | 静态 Public 属性 | Protected 类型 | Protected 成员函数 | Protected 属性 | 静态 Protected 属性 | Private 类型 | Private 成员函数 | Private 属性 | 静态 Private 属性 | 所有成员列表
libMesh::DofObject类 参考

The DofObject defines an abstract base class for objects that have degrees of freedom associated with them. 更多...

#include <dof_object.h>

类 libMesh::DofObject 继承关系图:
[图例]

Public 成员函数

 ~DofObject ()=default
 Destructor. 更多...
 
DofObjectget_old_dof_object ()
 Pointer accessor for previously public old_dof_object. 更多...
 
const DofObjectget_old_dof_object () const
 
DofObjectget_old_dof_object_ref ()
 As above, but do not use in situations where the old_dof_object may be nullptr, since this function asserts that the old_dof_object is valid before returning a reference to it. 更多...
 
const DofObjectget_old_dof_object_ref () const
 
void clear_old_dof_object ()
 Sets the old_dof_object to nullptr. 更多...
 
void set_old_dof_object ()
 Sets the old_dof_object to a copy of this. 更多...
 
void clear_dofs ()
 Clear the DofMap data structures holding degree of freedom data. 更多...
 
void invalidate_dofs (const unsigned int sys_num=libMesh::invalid_uint)
 Sets all degree of freedom numbers to invalid_id. 更多...
 
void invalidate_id ()
 Sets the id to invalid_id. 更多...
 
void invalidate_processor_id ()
 Sets the processor id to invalid_processor_id. 更多...
 
void invalidate ()
 Invalidates all the indices for this DofObject. 更多...
 
unsigned int n_dofs (const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
 
dof_id_type id () const
 
dof_id_typeset_id ()
 
unique_id_type unique_id () const
 
unique_id_typeset_unique_id ()
 
void set_unique_id (unique_id_type new_id)
 Sets the unique_id for this DofObject. 更多...
 
void set_id (const dof_id_type dofid)
 Sets the id for this DofObject. 更多...
 
bool valid_id () const
 
bool valid_unique_id () const
 
processor_id_type processor_id () const
 
processor_id_typeprocessor_id ()
 
void processor_id (const processor_id_type pid)
 Sets the processor_id for this DofObject. 更多...
 
bool valid_processor_id () const
 
unsigned int n_systems () const
 
unsigned int n_pseudo_systems () const
 
void set_n_systems (const unsigned int s)
 Sets the number of systems for this DofObject. 更多...
 
void set_extra_integer (const unsigned int index, const dof_id_type value)
 Sets the value on this object of the extra integer associated with index, which should have been obtained via a call to MeshBase::add_elem_integer or MeshBase::add_node_integer. 更多...
 
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 obtained via a call to MeshBase::add_elem_integer or MeshBase::add_node_integer. 更多...
 
template<typename T >
void set_extra_datum (const unsigned int index, const T value)
 Sets the value on this object of the extra datum associated with index, which should have been obtained via a call to MeshBase::add_elem_datum or MeshBase::add_node_datum using the same type T. 更多...
 
template<typename T >
get_extra_datum (const unsigned int index) const
 Gets the value on this object of the extra datum associated with index, which should have been obtained via a call to MeshBase::add_elem_datum or MeshBase::add_node_datum using the same type T. 更多...
 
void add_system ()
 Adds an additional system to the DofObject. 更多...
 
unsigned int n_var_groups (const unsigned int s) const
 
unsigned int n_vars (const unsigned int s, const unsigned int vg) const
 
unsigned int n_vars (const unsigned int s) const
 
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. 更多...
 
unsigned int n_comp (const unsigned int s, const unsigned int var) const
 
unsigned int n_comp_group (const unsigned int s, const unsigned int vg) const
 
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. 更多...
 
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. 更多...
 
dof_id_type dof_number (const unsigned int s, const unsigned int var, const unsigned int comp) const
 
dof_id_type dof_number (const unsigned int s, const unsigned int vg, const unsigned int vig, const unsigned int comp, const unsigned int n_comp) const
 
std::pair< unsigned int,
unsigned int > 
var_to_vg_and_offset (const unsigned int s, const unsigned int var) const
 
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 with this DofObject. 更多...
 
bool has_dofs (const unsigned int s=libMesh::invalid_uint) const
 
void set_vg_dof_base (const unsigned int s, const unsigned int vg, const dof_id_type db)
 VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base. 更多...
 
dof_id_type vg_dof_base (const unsigned int s, const unsigned int vg) const
 VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base. 更多...
 
void add_extra_integers (const unsigned int n_integers)
 Assigns a set of extra integers to this DofObject. 更多...
 
void add_extra_integers (const unsigned int n_integers, const std::vector< dof_id_type > &default_values)
 Assigns a set of extra integers to this DofObject. 更多...
 
unsigned int n_extra_integers () const
 Returns how many extra integers are associated to the DofObject. 更多...
 
bool has_extra_integers () const
 Returns whether extra integers are associated to the DofObject. 更多...
 
unsigned int packed_indexing_size () const
 If we pack our indices into an buffer for communications, how many ints do we need? 更多...
 
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 we investigate the size term and then copy. 更多...
 
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 our current implementation. 更多...
 
void debug_buffer () const
 Print our buffer for debugging. 更多...
 
void print_dof_info () const
 Print out info for debugging. 更多...
 
void set_buffer (const std::vector< dof_id_type > &buf)
 

静态 Public 成员函数

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 dof object? 更多...
 
static std::string get_info ()
 Gets a string containing the reference information. 更多...
 
static void print_info (std::ostream &out_stream=libMesh::out)
 Prints the reference information, by default to libMesh::out. 更多...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. 更多...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() 更多...
 
static void disable_print_counter_info ()
 

静态 Public 属性

static const dof_id_type invalid_id = static_cast<dof_id_type>(-1)
 An invalid id to distinguish an uninitialized DofObject. 更多...
 
static const unique_id_type invalid_unique_id = static_cast<unique_id_type>(-1)
 An invalid unique_id to distinguish an uninitialized DofObject. 更多...
 
static const processor_id_type invalid_processor_id = static_cast<processor_id_type>(-1)
 An invalid processor_id to distinguish DoFs that have not been assigned to a processor. 更多...
 

Protected 类型

typedef std::map< std::string,
std::pair< unsigned int,
unsigned int > > 
Counts
 Data structure to log the information. 更多...
 

Protected 成员函数

 DofObject ()
 Constructor. 更多...
 
void increment_constructor_count (const std::string &name) noexcept
 Increments the construction counter. 更多...
 
void increment_destructor_count (const std::string &name) noexcept
 Increments the destruction counter. 更多...
 

Protected 属性

std::unique_ptr< DofObjectold_dof_object
 This object on the last mesh. 更多...
 

静态 Protected 属性

static Counts _counts
 Actually holds the data. 更多...
 
static Threads::atomic
< unsigned int > 
_n_objects
 The number of objects. 更多...
 
static Threads::spin_mutex _mutex
 Mutual exclusion object to enable thread-safe reference counting. 更多...
 
static bool _enable_print_counter = true
 Flag to control whether reference count information is printed when print_info is called. 更多...
 

Private 类型

typedef dof_id_type index_t
 DoF index information. 更多...
 
typedef std::vector< index_tindex_buffer_t
 

Private 成员函数

 DofObject (const DofObject &)
 "Copy"-constructor. 更多...
 
std::unique_ptr< DofObjectconstruct (const DofObject *other=nullptr)
 Convenient factory function that calls either the (deep) copy constructor or the default constructor depending on the input arg. 更多...
 
DofObjectoperator= (const DofObject &dof_obj)
 Deep-copying assignment operator. 更多...
 
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. 更多...
 
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. 更多...
 
unsigned int start_idx (const unsigned int s) const
 The starting index for system s. 更多...
 
unsigned int end_idx (const unsigned int s) const
 The ending index for system s. 更多...
 
unsigned int start_idx_ints () const
 The starting index for an extra_integers pseudosystem. 更多...
 
unsigned int end_idx_ints () const
 The ending index for an extra_integers pseudosystem. 更多...
 

Private 属性

unique_id_type _unique_id
 A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted. 更多...
 
dof_id_type _id
 The id of the DofObject. 更多...
 
processor_id_type _processor_id
 The processor_id of the DofObject. 更多...
 
index_buffer_t _idx_buf
 

静态 Private 属性

static const index_t ncv_magic = 256
 Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv are the number of identical variables of a given type, and nc is the number of components for this set of variables. 更多...
 
static const index_t ncv_magic_exp = 8
 

详细描述

The DofObject defines an abstract base class for objects that have degrees of freedom associated with them.

Examples of such objects are the Node and Elem classes. This class can not be instantiated, only derived from.

作者
Benjamin S. Kirk
日期
2003, 2011

在文件 dof_object.h54 行定义.

成员类型定义说明

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information.

The log is identified by the class name.

在文件 reference_counter.h119 行定义.

typedef std::vector<index_t> libMesh::DofObject::index_buffer_t
private

在文件 dof_object.h674 行定义.

DoF index information.

This is packed into a contiguous buffer of the following format:

* [hdr end_0 end_1 ... end_{nps-2} (ncv_0 idx_0 ncv_1 idx_1 ... ncv_nv idx_nv)_0
*                                  (ncv_0 idx_0 ncv_1 idx_1 ... ncv_nv idx_nv)_1
*                                   ...
*                                  (ncv_0 idx_0 ncv_1 idx_1 ... ncv_nv idx_nv)_{nps-2} ]
* 

'hdr' determines whether this DofObject has_extra_integers() associated with it; iff so then it is negative.

The total number of "pseudo systems" is nps := abs(hdr).

The total number of true systems is

* ns = hdr,            hdr >= 0
*    = abs(hdr) - 1,   otherwise.
* 

'end_s' is the index past the end of the variable group (or integer) storage for (pseudo) system s.

注解
We specifically do not store the end for the last (pseudo) system - this always _idx_buf.size().

As a first example, consider the case of 4 systems, with 3, 0, 1, 2 variable groups, respectively. The _idx_buf then looks like:

* [4 10 10 12 () (ncv_0 idx_0 ncv_1 idx_1 ncv_2 idx_2) () (ncv_0 idx_0) (ncv_0 idx_0 ncv_1 idx_1)]
* [0  1  2  3         4     5     6     7     8     9         10    11      12    13    14    15]
* 

The ending index for each (pseudo) system is then given by:

* end_s = _idx_buf.size(),                        s == (nps-1),
*       = _idx_buf[s+1] + has_extra_integers(),   otherwise.
* 

The starting indices are not specifically stored, but rather inferred as follows:

start_s = abs(_idx_buf[s])

Now, the defining characteristic of the VariableGroup is that it supports an arbitrary number of variables of the same type. At the DofObject level, what that means is that each Variable in the VariableGroup will have the same number of nonzero components, and they can all be indexed from the same base number. We use this information in the ncv_# and idx_# entries as follows:

ncv_# = n_vars*ncv_magic + n_comp for variable group # idx_# = base_offset for variable group #

the DoF index for a particular component c of variable v within that group is then given by

idx_var = idx_# + n_comp*v + c

注解
There is a subtlety here - "variable v within that group" usually means nothing to the user. This class is either indexed with variable group numbers, or variable numbers counted within the system. So for a system with 2 variable groups, 4 and 8 variables each, the 5th variable in the system is the 1st variable in 2nd variable group. (Now of course 0-base everything... but you get the idea.)

When hdr is negative when cast to a signed type, then we interpret that to mean there exists one pseudo-system following the true systems, one for which the _idx_buf data stores the values associated with add_extra_integer entries, not ncv and idx data associated with system variables. We still return only the number of true systems for n_systems(), but we report has_extra_integers() as true iff hdr is negative, and abs(hdr) will reflect the total number of pseudo-systems, n_systems()+1.

E.g. if we had added two extra integers to the example case above, the _idx_buf then looks like:

* [-5 11 11 13 17 () (ncv_0 idx_0 ncv_1 idx_1 ncv_2 idx_2) () (ncv_0 idx_0) (ncv_0 idx_0 ncv_1 idx_1) (xtra1 xtra2)]
* [0   1  2  3  4         5     6     7     8     9    10         11    12      13    14    15    16      17    18]
* 

在文件 dof_object.h673 行定义.

构造及析构函数说明

libMesh::DofObject::DofObject ( )
inlineprotected

Constructor.

Protected so that you can't instantiate one of these except as a part of a Node or Elem.

在文件 dof_object.h722 行定义.

参考 invalidate().

参考自 construct().

722  :
723 #ifdef LIBMESH_ENABLE_UNIQUE_ID
725 #endif
726  _id (invalid_id),
728 {
729  this->invalidate();
730 }
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:578
void invalidate()
Invalidates all the indices for this DofObject.
Definition: dof_object.h:783
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:572
static const unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:488
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:589
libMesh::DofObject::~DofObject ( )
default

Destructor.

libMesh::DofObject::DofObject ( const DofObject dof_obj)
private

"Copy"-constructor.

Does not copy old_dof_object, but leaves it null in the new object.

在文件 dof_object.C35 行定义.

参考 dof_number(), n_comp(), n_systems(), n_var_groups() , 以及 n_vars().

35  :
36  ReferenceCountedObject<DofObject>(),
37 #ifdef LIBMESH_ENABLE_UNIQUE_ID
38  _unique_id (dof_obj._unique_id),
39 #endif
40  _id (dof_obj._id),
41  _processor_id (dof_obj._processor_id),
42  _idx_buf (dof_obj._idx_buf)
43 {
44  // DO NOT copy old_dof_object, because this isn't a *real* copy
45  // constructor, it's a "copy almost everything" constructor that
46  // is intended to be used solely for internal construction of
47  // old_dof_object, never for a true deep copy where the newly
48  // created object really matches the source object.
49 
50  // Check that everything worked
51 #ifdef DEBUG
52 
53  libmesh_assert_equal_to (this->n_systems(), dof_obj.n_systems());
54 
55  for (auto s : make_range(this->n_systems()))
56  {
57  libmesh_assert_equal_to (this->n_vars(s), dof_obj.n_vars(s));
58  libmesh_assert_equal_to (this->n_var_groups(s), dof_obj.n_var_groups(s));
59 
60  for (auto vg : make_range(this->n_var_groups(s)))
61  libmesh_assert_equal_to (this->n_vars(s,vg), dof_obj.n_vars(s,vg));
62 
63  for (auto v : make_range(this->n_vars(s)))
64  {
65  libmesh_assert_equal_to (this->n_comp(s,v), dof_obj.n_comp(s,v));
66 
67  for (auto c : make_range(this->n_comp(s,v)))
68  libmesh_assert_equal_to (this->dof_number(s,v,c), dof_obj.dof_number(s,v,c));
69  }
70  }
71 
72 #endif
73 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:1025
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:578
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:572
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
unsigned int n_systems() const
Definition: dof_object.h:930
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:589

成员函数说明

void libMesh::DofObject::add_extra_integers ( const unsigned int  n_integers)

Assigns a set of extra integers to this DofObject.

There will now be n_integers associated; this replaces, not augments, any previous count.

Any newly-added values will initially be DofObject::invalid_id

If non-integer data is in the set, each datum of type T should be counted sizeof(T)/sizeof(dof_id_type) times in n_integers.

在文件 dof_object.C490 行定义.

参考 _idx_buf, invalid_id , 以及 n_extra_integers().

参考自 add_extra_integers().

491 {
492  if (_idx_buf.empty())
493  {
494  if (n_integers)
495  {
496  _idx_buf.resize(n_integers+1, DofObject::invalid_id);
497  _idx_buf[0] = dof_id_type(-1);
498  }
499  return;
500  }
501  else
502  {
503  const int hdr = dof_id_signed_type(_idx_buf[0]);
504 
505  // We already have some extra integers, but may need more or
506  // less now.
507  if (hdr < 0)
508  {
509  const unsigned int old_n_integers = this->n_extra_integers();
510  if (n_integers != old_n_integers)
511  {
512  // Make or remove space as needed by count change
513  _idx_buf.resize(_idx_buf.size()+n_integers-old_n_integers, DofObject::invalid_id);
514 
515  // The start index for the extra integers is unchanged.
516  }
517  }
518  else if (n_integers)
519  // We had no extra integers, but need to add some
520  {
521  // Mark the DofObject as holding extra integers
522  _idx_buf[0] = dof_id_type(-hdr-1);
523 
524  // Insert the integer start position
525  DofObject::index_buffer_t::iterator it = _idx_buf.begin() + hdr;
526  _idx_buf.insert(it, _idx_buf.size()+1);
527 
528  // Increment the previous system start positions to account
529  // for the new header entry creating an offset
530  for (int i=1; i<hdr; i++)
531  _idx_buf[i]++;
532 
533  // Append space for extra integers
534  _idx_buf.resize(_idx_buf.size()+n_integers, DofObject::invalid_id);
535  }
536  }
537 }
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
int8_t dof_id_signed_type
Definition: id_types.h:68
index_buffer_t _idx_buf
Definition: dof_object.h:675
uint8_t dof_id_type
Definition: id_types.h:67
void libMesh::DofObject::add_extra_integers ( const unsigned int  n_integers,
const std::vector< dof_id_type > &  default_values 
)

Assigns a set of extra integers to this DofObject.

There will now be n_integers associated; this replaces, not augments, any previous count.

Any newly-added values will be copied from default_values.

If non-integer data is in the set, each datum of type T should be counted sizeof(T)/sizeof(dof_id_type) times in n_integers, and its data should be expressed in default_values as per memcpy.

在文件 dof_object.C542 行定义.

参考 _idx_buf, add_extra_integers() , 以及 n_extra_integers().

544 {
545  libmesh_assert_equal_to(n_integers, default_values.size());
546 
547  const unsigned int n_old_integers = this->n_extra_integers();
548  this->add_extra_integers(n_integers);
549  if (n_integers > n_old_integers)
550  {
551  const unsigned int n_more_integers = n_integers - n_old_integers;
552  std::copy(default_values.begin()+n_old_integers,
553  default_values.end(),
554  _idx_buf.end()-n_more_integers);
555  }
556 }
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
void add_extra_integers(const unsigned int n_integers)
Assigns a set of extra integers to this DofObject.
Definition: dof_object.C:490
index_buffer_t _idx_buf
Definition: dof_object.h:675
void libMesh::DofObject::add_system ( )

Adds an additional system to the DofObject.

在文件 dof_object.C195 行定义.

参考 _idx_buf, has_extra_integers(), n_systems(), n_var_groups(), n_vars() , 以及 set_n_systems().

196 {
197  // quick return?
198  if (this->n_systems() == 0)
199  {
200  this->set_n_systems(1);
201  return;
202  }
203 
204  // cache this value before we screw it up!
205  const unsigned int ns_orig = this->n_systems();
206 
207  DofObject::index_buffer_t::iterator it = _idx_buf.begin() + ns_orig;
208 
209  // Create the entry for the new system indicating 0 variables.
210  //
211  // increment the number of systems and the offsets for each of
212  // the systems including the new one we just added.
213  if (this->has_extra_integers())
214  {
215  // this inserts the extra_integers' start position as the start
216  // position for the new system. We'll increment all those
217  // counts in one sweep next, to account for header expansion.
218  _idx_buf.insert(it, *it);
219 
220  _idx_buf[0]--;
221  for (unsigned int i=1; i<ns_orig+2; i++)
222  {
223  libmesh_assert_less(i, _idx_buf.size());
224  _idx_buf[i]++;
225  }
226  }
227  else
228  {
229  // this inserts the current vector size at the position for the
230  // new system
231  _idx_buf.insert(it, cast_int<dof_id_type>(_idx_buf.size()));
232 
233  for (unsigned int i=0; i<ns_orig+1; i++)
234  {
235  libmesh_assert_less(i, _idx_buf.size());
236  _idx_buf[i]++;
237  }
238  }
239 
240  libmesh_assert_equal_to (this->n_systems(), (ns_orig+1));
241  libmesh_assert_equal_to (this->n_vars(ns_orig), 0);
242  libmesh_assert_equal_to (this->n_var_groups(ns_orig), 0);
243 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
bool has_extra_integers() const
Returns whether extra integers are associated to the DofObject.
Definition: dof_object.h:1181
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
void set_n_systems(const unsigned int s)
Sets the number of systems for this DofObject.
Definition: dof_object.C:150
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_systems() const
Definition: dof_object.h:930
void libMesh::DofObject::clear_dofs ( )
inline

Clear the DofMap data structures holding degree of freedom data.

If any extra integers are associated with this DofObject, their count and values are unchanged.

在文件 dof_object.h793 行定义.

参考 set_n_systems().

794 {
795  this->set_n_systems(0);
796 }
void set_n_systems(const unsigned int s)
Sets the number of systems for this DofObject.
Definition: dof_object.C:150
void libMesh::DofObject::clear_old_dof_object ( )

Sets the old_dof_object to nullptr.

在文件 dof_object.C128 行定义.

参考 old_dof_object.

参考自 operator=(), set_old_dof_object() , 以及 unpack_indexing().

129 {
130  this->old_dof_object.reset(nullptr);
131 }
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
std::unique_ptr< DofObject > libMesh::DofObject::construct ( const DofObject other = nullptr)
inlineprivate

Convenient factory function that calls either the (deep) copy constructor or the default constructor depending on the input arg.

Like the copy constructor, this function is also private. We can't use std::make_unique to construct a DofObject since the copy constructor is private, but we can at least encapsulate the code which calls "new" directly.

在文件 dof_object.h736 行定义.

参考 DofObject().

参考自 operator=(), set_old_dof_object() , 以及 unpack_indexing().

737 {
738  return other
739  ? std::unique_ptr<DofObject>(new DofObject(*other))
740  : std::unique_ptr<DofObject>(new DofObject());
741 }
DofObject()
Constructor.
Definition: dof_object.h:722
void libMesh::DofObject::debug_buffer ( ) const

Print our buffer for debugging.

在文件 dof_object.C660 行定义.

参考 _idx_buf , 以及 libMesh::out.

661 {
662  libMesh::out << " [ ";
663  for (const auto & idx : _idx_buf)
664  libMesh::out << idx << " ";
665  libMesh::out << "]\n";
666 }
OStreamProxy out
index_buffer_t _idx_buf
Definition: dof_object.h:675
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

在文件 reference_counter.C100 行定义.

参考 libMesh::ReferenceCounter::_enable_print_counter.

101 {
102  _enable_print_counter = false;
103  return;
104 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
dof_id_type libMesh::DofObject::dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp 
) const
inline
返回
The global degree of freedom number for variable var, component comp for system s associated with this DofObject

When partitioning and DoF numbering have been performed by libMesh, every current DoF on this DofObject will belong to its processor.

在文件 dof_object.h1025 行定义.

参考 n_comp(), n_comp_group(), n_systems(), n_vars() , 以及 var_to_vg_and_offset().

参考自 libMesh::DofMap::_node_dof_indices(), libMesh::DofMap::distribute_dofs(), DofObject(), libMesh::DofMap::old_dof_indices(), operator=(), print_dof_info(), set_dof_number() , 以及 libMesh::DofMap::set_nonlocal_dof_objects().

1028 {
1029  libmesh_assert_less (s, this->n_systems());
1030  libmesh_assert_less (var, this->n_vars(s));
1031  libmesh_assert_less (comp, this->n_comp(s,var));
1032 
1033  const std::pair<unsigned int, unsigned int>
1034  vg_vig = this->var_to_vg_and_offset(s,var);
1035 
1036  const unsigned int
1037  n_comp = this->n_comp_group(s,vg_vig.first);
1038 
1039  return this->dof_number(s, vg_vig.first, vg_vig.second,
1040  comp, n_comp);
1041 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1008
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:1025
std::pair< unsigned int, unsigned int > var_to_vg_and_offset(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1193
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
unsigned int n_systems() const
Definition: dof_object.h:930
dof_id_type libMesh::DofObject::dof_number ( const unsigned int  s,
const unsigned int  vg,
const unsigned int  vig,
const unsigned int  comp,
const unsigned int  n_comp 
) const
inline
返回
The global degree of freedom number for variable group vg, variable index vig within the group, component comp out of n_comp, for system s on this DofObject

Even users who need to call dof_number from user code probably don't want to call this overload.

在文件 dof_object.h1046 行定义.

参考 _idx_buf, invalid_id, n_systems(), n_var_groups(), n_vars() , 以及 start_idx().

1051 {
1052  libmesh_assert_less (s, this->n_systems());
1053  libmesh_assert_less (vg, this->n_var_groups(s));
1054  libmesh_assert_less (vig, this->n_vars(s,vg));
1055 
1056  const unsigned int
1057  start_idx_sys = this->start_idx(s);
1058 
1059  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1060 
1061  const dof_id_type
1062  base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
1063 
1064  // if the first component is invalid, they
1065  // are all invalid
1066  if (base_idx == invalid_id)
1067  return invalid_id;
1068 
1069  // otherwise the index is the first component
1070  // index augmented by the component number
1071  else
1072  return cast_int<dof_id_type>(base_idx + vig*n_comp + comp);
1073 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
unsigned int n_systems() const
Definition: dof_object.h:930
uint8_t dof_id_type
Definition: id_types.h:67
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

在文件 reference_counter.C94 行定义.

参考 libMesh::ReferenceCounter::_enable_print_counter.

95 {
96  _enable_print_counter = true;
97  return;
98 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
unsigned int libMesh::DofObject::end_idx ( const unsigned int  s) const
inlineprivate

The ending index for system s.

在文件 dof_object.h1253 行定义.

参考 _idx_buf, n_pseudo_systems() , 以及 n_systems().

参考自 n_var_groups() , 以及 set_n_vars_per_group().

1254 {
1255  libmesh_assert_less (s, this->n_systems());
1256  libmesh_assert_less (s, _idx_buf.size());
1257 
1258  return ((s+1) == this->n_pseudo_systems()) ?
1259  cast_int<unsigned int>(_idx_buf.size()) :
1260  cast_int<unsigned int>(_idx_buf[s+1]);
1261 }
unsigned int n_pseudo_systems() const
Definition: dof_object.h:940
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int libMesh::DofObject::end_idx_ints ( ) const
inlineprivate

The ending index for an extra_integers pseudosystem.

在文件 dof_object.h1280 行定义.

参考 _idx_buf , 以及 has_extra_integers().

1281 {
1282  libmesh_assert (this->has_extra_integers());
1283 
1284  return cast_int<unsigned int>(_idx_buf.size());
1285 }
bool has_extra_integers() const
Returns whether extra integers are associated to the DofObject.
Definition: dof_object.h:1181
index_buffer_t _idx_buf
Definition: dof_object.h:675
template<typename T >
T libMesh::DofObject::get_extra_datum ( const unsigned int  index) const
inline

Gets the value on this object of the extra datum associated with index, which should have been obtained via a call to MeshBase::add_elem_datum or MeshBase::add_node_datum using the same type T.

在文件 dof_object.h1139 行定义.

参考 _idx_buf, n_extra_integers(), n_systems() , 以及 start_idx_ints().

1140 {
1141 #ifndef NDEBUG
1142  const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1143 #endif
1144  libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1145  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1146 
1147  const unsigned int start_idx_i = this->start_idx_ints();
1148 
1149  libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1150  T returnval;
1151  std::memcpy(&returnval, &_idx_buf[start_idx_i+index], sizeof(T));
1152  return returnval;
1153 }
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1266
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_systems() const
Definition: dof_object.h:930
uint8_t dof_id_type
Definition: id_types.h:67
dof_id_type libMesh::DofObject::get_extra_integer ( const unsigned int  index) const
inline

Gets the value on this object of the extra integer associated with index, which should have been obtained via a call to MeshBase::add_elem_integer or MeshBase::add_node_integer.

在文件 dof_object.h1095 行定义.

参考 _idx_buf, n_extra_integers(), n_systems() , 以及 start_idx_ints().

参考自 set_n_vars_per_group().

1096 {
1097  libmesh_assert_less(index, this->n_extra_integers());
1098  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1099 
1100  const unsigned int start_idx_i = this->start_idx_ints();
1101 
1102  libmesh_assert_less(start_idx_i+index, _idx_buf.size());
1103  return _idx_buf[start_idx_i+index];
1104 }
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1266
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_systems() const
Definition: dof_object.h:930
std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

在文件 reference_counter.C47 行定义.

参考 libMesh::ReferenceCounter::_counts.

参考自 libMesh::ReferenceCounter::print_info().

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (const auto & [name, cd] : _counts)
59  oss << "| " << name << " reference count information:\n"
60  << "| Creations: " << cd.first << '\n'
61  << "| Destructions: " << cd.second << '\n';
62 
63  oss << " ---------------------------------------------------------------------------- \n";
64 
65  return oss.str();
66 
67 #else
68 
69  return "";
70 
71 #endif
72 }
static Counts _counts
Actually holds the data.
DofObject* libMesh::DofObject::get_old_dof_object ( )
inline

Pointer accessor for previously public old_dof_object.

If you want to assert that the old_dof_object pointer is valid as well, consider using the get_old_dof_object_ref() accessor instead.

在文件 dof_object.h96 行定义.

参考 old_dof_object.

参考自 operator=().

96 { return old_dof_object.get(); }
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
const DofObject* libMesh::DofObject::get_old_dof_object ( ) const
inline

在文件 dof_object.h97 行定义.

参考 old_dof_object.

97 { return old_dof_object.get(); }
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
DofObject& libMesh::DofObject::get_old_dof_object_ref ( )
inline

As above, but do not use in situations where the old_dof_object may be nullptr, since this function asserts that the old_dof_object is valid before returning a reference to it.

在文件 dof_object.h104 行定义.

参考 old_dof_object.

参考自 libMesh::DofMap::old_dof_indices().

105  {
106  libmesh_assert(old_dof_object);
107  return *old_dof_object;
108  }
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
const DofObject& libMesh::DofObject::get_old_dof_object_ref ( ) const
inline

在文件 dof_object.h110 行定义.

参考 old_dof_object.

111  {
112  libmesh_assert(old_dof_object);
113  return *old_dof_object;
114  }
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
bool libMesh::DofObject::has_dofs ( const unsigned int  s = libMesh::invalid_uint) const
inline
返回
true if any system has variables which have been assigned, false otherwise.

在文件 dof_object.h1219 行定义.

参考 libMesh::invalid_uint, n_systems() , 以及 n_vars().

1220 {
1221  if (sys == libMesh::invalid_uint)
1222  {
1223  for (auto s : make_range(this->n_systems()))
1224  if (this->n_vars(s))
1225  return true;
1226  }
1227 
1228  else
1229  {
1230  libmesh_assert_less (sys, this->n_systems());
1231 
1232  if (this->n_vars(sys))
1233  return true;
1234  }
1235 
1236  return false;
1237 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:254
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_systems() const
Definition: dof_object.h:930
bool libMesh::DofObject::has_extra_integers ( ) const
inline

Returns whether extra integers are associated to the DofObject.

在文件 dof_object.h1181 行定义.

参考 _idx_buf.

参考自 add_system(), end_idx_ints(), set_n_vars_per_group() , 以及 start_idx_ints().

1182 {
1183  if (_idx_buf.empty())
1184  return 0;
1185 
1186  return (dof_id_signed_type(_idx_buf[0]) < 0);
1187 }
int8_t dof_id_signed_type
Definition: id_types.h:68
index_buffer_t _idx_buf
Definition: dof_object.h:675
dof_id_type libMesh::DofObject::id ( ) const
inline
返回
The id for this DofObject

在文件 dof_object.h823 行定义.

参考 _id.

参考自 libMesh::CompareDofObjectsByID::operator()(), libMesh::CompareDofObjectsByPIDAndThenID::operator()(), print_dof_info() , 以及 libMesh::DofMap::set_nonlocal_dof_objects().

824 {
825  return _id;
826 }
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:578
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectednoexceptinherited

Increments the construction counter.

Should be called in the constructor of any derived class that will be reference counted.

在文件 reference_counter.h183 行定义.

参考 libMesh::err.

参考自 libMesh::ReferenceCountedObject< SparseMatrix< T > >::ReferenceCountedObject().

184 {
185  libmesh_try
186  {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189  p.first++;
190  }
191  libmesh_catch (...)
192  {
193  auto stream = libMesh::err.get();
194  stream->exceptions(stream->goodbit); // stream must not throw
195  libMesh::err << "Encountered unrecoverable error while calling "
196  << "ReferenceCounter::increment_constructor_count() "
197  << "for a(n) " << name << " object." << std::endl;
198  std::terminate();
199  }
200 }
OStreamProxy err
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectednoexceptinherited

Increments the destruction counter.

Should be called in the destructor of any derived class that will be reference counted.

在文件 reference_counter.h207 行定义.

参考 libMesh::err.

参考自 libMesh::ReferenceCountedObject< SparseMatrix< T > >::~ReferenceCountedObject().

208 {
209  libmesh_try
210  {
211  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
212  std::pair<unsigned int, unsigned int> & p = _counts[name];
213  p.second++;
214  }
215  libmesh_catch (...)
216  {
217  auto stream = libMesh::err.get();
218  stream->exceptions(stream->goodbit); // stream must not throw
219  libMesh::err << "Encountered unrecoverable error while calling "
220  << "ReferenceCounter::increment_destructor_count() "
221  << "for a(n) " << name << " object." << std::endl;
222  std::terminate();
223  }
224 }
OStreamProxy err
static Counts _counts
Actually holds the data.
void libMesh::DofObject::invalidate ( )
inline

Invalidates all the indices for this DofObject.

在文件 dof_object.h783 行定义.

参考 invalidate_dofs(), invalidate_id() , 以及 invalidate_processor_id().

参考自 DofObject().

784 {
785  this->invalidate_dofs ();
786  this->invalidate_id ();
787  this->invalidate_processor_id ();
788 }
void invalidate_id()
Sets the id to invalid_id.
Definition: dof_object.h:767
void invalidate_processor_id()
Sets the processor id to invalid_processor_id.
Definition: dof_object.h:775
void invalidate_dofs(const unsigned int sys_num=libMesh::invalid_uint)
Sets all degree of freedom numbers to invalid_id.
Definition: dof_object.h:746
void libMesh::DofObject::invalidate_dofs ( const unsigned int  sys_num = libMesh::invalid_uint)
inline

Sets all degree of freedom numbers to invalid_id.

在文件 dof_object.h746 行定义.

参考 invalid_id, n_comp_group(), n_systems(), n_var_groups() , 以及 set_vg_dof_base().

参考自 invalidate().

747 {
748  const unsigned int n_sys = this->n_systems();
749  // If the user does not specify the system number...
750  if (sys_num >= n_sys)
751  {
752  for (auto s : make_range(n_sys))
753  for (auto vg : make_range(this->n_var_groups(s)))
754  if (this->n_comp_group(s,vg))
755  this->set_vg_dof_base(s,vg,invalid_id);
756  }
757  // ...otherwise invalidate the dofs for all systems
758  else
759  for (auto vg : make_range(this->n_var_groups(sys_num)))
760  if (this->n_comp_group(sys_num,vg))
761  this->set_vg_dof_base(sys_num,vg,invalid_id);
762 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1008
void set_vg_dof_base(const unsigned int s, const unsigned int vg, const dof_id_type db)
VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for di...
Definition: dof_object.h:1290
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
unsigned int n_systems() const
Definition: dof_object.h:930
void libMesh::DofObject::invalidate_id ( )
inline

Sets the id to invalid_id.

在文件 dof_object.h767 行定义.

参考 invalid_id , 以及 set_id().

参考自 invalidate().

768 {
769  this->set_id (invalid_id);
770 }
dof_id_type & set_id()
Definition: dof_object.h:831
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
void libMesh::DofObject::invalidate_processor_id ( )
inline

Sets the processor id to invalid_processor_id.

在文件 dof_object.h775 行定义.

参考 invalid_processor_id , 以及 processor_id().

参考自 invalidate().

776 {
778 }
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:488
processor_id_type processor_id() const
Definition: dof_object.h:898
unsigned int libMesh::DofObject::n_comp ( const unsigned int  s,
const unsigned int  var 
) const
inline
返回
The number of components for variable var of system s associated with this DofObject. For example, the HIERARCHIC shape functions may have multiple DoFs associated with one node. Another example is the MONOMIALs, where only the elements hold the DoFs. For the different spatial directions, and orders, see FE.

在文件 dof_object.h995 行定义.

参考 n_comp_group(), n_systems(), n_vars() , 以及 var_to_vg().

参考自 libMesh::DofMap::distribute_dofs(), dof_number(), DofObject(), n_dofs(), operator=(), print_dof_info(), set_dof_number(), set_n_vars_per_group() , 以及 libMesh::DofMap::set_nonlocal_dof_objects().

997 {
998  libmesh_assert_less (s, this->n_systems());
999  libmesh_assert_less (var, this->n_vars(s));
1000 
1001  return this->n_comp_group(s,this->var_to_vg(s,var));
1002 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1008
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
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...
Definition: dof_object.h:1334
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int libMesh::DofObject::n_comp_group ( const unsigned int  s,
const unsigned int  vg 
) const
inline
返回
The number of components for VariableGroup vg of system s associated with this DofObject. For example, the HIERARCHIC shape functions may have multiple DoFs associated with one node. Another example is the MONOMIALs, where only the elements hold the DoFs. For the different spatial directions, and orders, see FE.

在文件 dof_object.h1008 行定义.

参考 _idx_buf, n_systems(), n_var_groups(), ncv_magic , 以及 start_idx().

参考自 libMesh::DofMap::_node_dof_indices(), dof_number(), invalidate_dofs(), n_comp(), libMesh::DofMap::old_dof_indices(), set_dof_number(), set_n_comp_group(), set_n_vars_per_group() , 以及 libMesh::DofMap::set_nonlocal_dof_objects().

1010 {
1011  libmesh_assert_less (s, this->n_systems());
1012  libmesh_assert_less (vg, this->n_var_groups(s));
1013 
1014  const unsigned int
1015  start_idx_sys = this->start_idx(s);
1016 
1017  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
1018 
1019  return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
1020 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_systems() const
Definition: dof_object.h:930
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:686
unsigned int libMesh::DofObject::n_dofs ( const unsigned int  s,
const unsigned int  var = libMesh::invalid_uint 
) const
inline
返回
The number of degrees of freedom associated with system s for this object. Optionally only counts degrees of freedom for variable number var

在文件 dof_object.h801 行定义.

参考 libMesh::invalid_uint, n_comp(), n_systems() , 以及 n_vars().

803 {
804  libmesh_assert_less (s, this->n_systems());
805 
806  unsigned int num = 0;
807 
808  // Count all variables
809  if (var == libMesh::invalid_uint)
810  for (auto v : make_range(this->n_vars(s)))
811  num += this->n_comp(s,v);
812 
813  // Only count specified variable
814  else
815  num = this->n_comp(s,var);
816 
817  return num;
818 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:254
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int libMesh::DofObject::n_extra_integers ( ) const
inline

Returns how many extra integers are associated to the DofObject.

If non-integer data has been associated, each datum of type T counts for sizeof(T)/sizeof(dof_id_type) times in the return value.

在文件 dof_object.h1163 行定义.

参考 _idx_buf , 以及 start_idx_ints().

参考自 add_extra_integers(), get_extra_datum(), get_extra_integer(), set_extra_datum(), set_extra_integer(), set_n_systems() , 以及 set_n_vars_per_group().

1164 {
1165  if (_idx_buf.empty())
1166  return 0;
1167 
1168  const int hdr = dof_id_signed_type(_idx_buf[0]);
1169  if (hdr >= 0)
1170  return 0;
1171 
1172  const unsigned int start_idx_i = this->start_idx_ints();
1173 
1174  return _idx_buf.size() - start_idx_i;
1175 }
int8_t dof_id_signed_type
Definition: id_types.h:68
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1266
index_buffer_t _idx_buf
Definition: dof_object.h:675
static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

Prints the number of outstanding (created, but not yet destroyed) objects.

在文件 reference_counter.h85 行定义.

参考 libMesh::ReferenceCounter::_n_objects.

参考自 libMesh::LibMeshInit::~LibMeshInit().

86  { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects
The number of objects.
unsigned int libMesh::DofObject::n_pseudo_systems ( ) const
inline
返回
The total number of pseudo-systems associated with this DofObject : n_systems(), plus one iff this->has_extra_integers()

在文件 dof_object.h940 行定义.

参考 _idx_buf , 以及 std::abs().

参考自 end_idx(), set_extra_datum() , 以及 set_extra_integer().

941 {
942  const int hdr = _idx_buf.empty() ?
943  0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
944  return std::abs(hdr);
945 }
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的绝对值。
Definition: type_vector.h:112
int8_t dof_id_signed_type
Definition: id_types.h:68
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int libMesh::DofObject::n_systems ( ) const
inline
返回
The number of systems associated with this DofObject

在文件 dof_object.h930 行定义.

参考 _idx_buf.

参考自 add_system(), dof_number(), DofObject(), end_idx(), get_extra_datum(), get_extra_integer(), has_dofs(), invalidate_dofs(), n_comp(), n_comp_group(), n_dofs(), n_var_groups(), n_vars(), libMesh::DofMap::old_dof_indices(), operator=(), print_dof_info(), set_dof_number(), set_n_comp(), set_n_comp_group(), set_n_systems(), set_n_vars_per_group(), set_vg_dof_base(), start_idx(), start_idx_ints() , 以及 vg_dof_base().

931 {
932  const int hdr = _idx_buf.empty() ?
933  0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
934  return hdr >= 0 ? hdr : (-hdr-1);
935 }
int8_t dof_id_signed_type
Definition: id_types.h:68
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int libMesh::DofObject::n_var_groups ( const unsigned int  s) const
inline
返回
The number of VariableGroup variable groups associated with system s for this DofObject

在文件 dof_object.h950 行定义.

参考 end_idx(), n_systems() , 以及 start_idx().

参考自 add_system(), dof_number(), DofObject(), invalidate_dofs(), n_comp_group(), n_vars(), operator=(), set_n_comp_group(), set_n_systems(), set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), set_vg_dof_base(), var_to_vg(), var_to_vg_and_offset() , 以及 vg_dof_base().

951 {
952  libmesh_assert_less (s, this->n_systems());
953 
954  return (this->end_idx(s) - this->start_idx(s)) / 2;
955 }
unsigned int end_idx(const unsigned int s) const
The ending index for system s.
Definition: dof_object.h:1253
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int libMesh::DofObject::n_vars ( const unsigned int  s,
const unsigned int  vg 
) const
inline
返回
The number of Variable variables associated with VariableGroup vg in system s for this DofObject

在文件 dof_object.h960 行定义.

参考 _idx_buf, n_systems(), n_var_groups(), ncv_magic_exp , 以及 start_idx().

参考自 add_system(), libMesh::DofMap::distribute_dofs(), dof_number(), DofObject(), has_dofs(), n_comp(), n_dofs(), n_vars(), operator=(), print_dof_info(), set_dof_number(), set_n_comp(), set_n_comp_group(), set_n_systems(), set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), system_var_to_vg_var(), var_to_vg() , 以及 var_to_vg_and_offset().

962 {
963  libmesh_assert_less (s, this->n_systems());
964  libmesh_assert_less (vg, this->n_var_groups(s));
965 
966  const unsigned int start_idx_sys = this->start_idx(s);
967 
968  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
969 
970  return (cast_int<unsigned int>
971  (_idx_buf[start_idx_sys + 2*vg]) >> ncv_magic_exp);
972 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_systems() const
Definition: dof_object.h:930
static const index_t ncv_magic_exp
Definition: dof_object.h:687
unsigned int libMesh::DofObject::n_vars ( const unsigned int  s) const
inline
返回
The number of Variable variables associated with system s for this DofObject

在文件 dof_object.h977 行定义.

参考 n_systems(), n_var_groups() , 以及 n_vars().

978 {
979  libmesh_assert_less (s, this->n_systems());
980 
981  const unsigned int nvg = this->n_var_groups(s);
982 
983  unsigned int val=0;
984 
985  for (unsigned int vg=0; vg<nvg; vg++)
986  val += this->n_vars(s,vg);
987 
988  return val;
989 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int n_systems() const
Definition: dof_object.h:930
DofObject & libMesh::DofObject::operator= ( const DofObject dof_obj)
private

Deep-copying assignment operator.

在文件 dof_object.C77 行定义.

参考 _id, _idx_buf, _processor_id, _unique_id, clear_old_dof_object(), construct(), dof_number(), get_old_dof_object(), n_comp(), n_systems(), n_var_groups(), n_vars() , 以及 old_dof_object.

78 {
79  if (&dof_obj == this)
80  return *this;
81 
82 #ifdef LIBMESH_ENABLE_AMR
83  this->clear_old_dof_object();
84  this->old_dof_object = this->construct(dof_obj.get_old_dof_object());
85 #endif
86 
87  _id = dof_obj._id;
88 #ifdef LIBMESH_ENABLE_UNIQUE_ID
89  _unique_id = dof_obj._unique_id;
90 #endif
91  _processor_id = dof_obj._processor_id;
92  _idx_buf = dof_obj._idx_buf;
93 
94 
95  // Check that everything worked
96 #ifdef DEBUG
97 
98  libmesh_assert_equal_to (this->n_systems(), dof_obj.n_systems());
99 
100  for (auto s : make_range(this->n_systems()))
101  {
102  libmesh_assert_equal_to (this->n_vars(s), dof_obj.n_vars(s));
103  libmesh_assert_equal_to (this->n_var_groups(s), dof_obj.n_var_groups(s));
104 
105  for (auto vg : make_range(this->n_var_groups(s)))
106  libmesh_assert_equal_to (this->n_vars(s,vg), dof_obj.n_vars(s,vg));
107 
108  for (auto v : make_range(this->n_vars(s)))
109  {
110  libmesh_assert_equal_to (this->n_comp(s,v), dof_obj.n_comp(s,v));
111 
112  for (auto c : make_range(this->n_comp(s,v)))
113  libmesh_assert_equal_to (this->dof_number(s,v,c), dof_obj.dof_number(s,v,c));
114  }
115  }
116 
117 #endif
118 
119  return *this;
120 }
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:736
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:1025
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:578
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:572
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
void clear_old_dof_object()
Sets the old_dof_object to nullptr.
Definition: dof_object.C:128
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
unsigned int n_systems() const
Definition: dof_object.h:930
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:589
void libMesh::DofObject::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 our current implementation.

在文件 dof_object.C642 行定义.

参考 _idx_buf , 以及 old_dof_object.

643 {
644 #ifdef LIBMESH_ENABLE_AMR
645  // We might need to pack old_dof_object too
646  *target++ = (old_dof_object == nullptr) ? 0 : 1;
647 #endif
648 
649  *target++ = _idx_buf.size();
650  std::copy(_idx_buf.begin(), _idx_buf.end(), target);
651 
652 #ifdef LIBMESH_ENABLE_AMR
653  if (old_dof_object)
654  old_dof_object->pack_indexing(target);
655 #endif
656 }
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int libMesh::DofObject::packed_indexing_size ( ) const

If we pack our indices into an buffer for communications, how many ints do we need?

在文件 dof_object.C560 行定义.

参考 _idx_buf , 以及 old_dof_object.

561 {
562  return
563  cast_int<unsigned int> (
564 #ifdef LIBMESH_ENABLE_AMR
565  ((old_dof_object == nullptr) ? 0 : old_dof_object->packed_indexing_size()) + 2 +
566 #else
567  1 +
568 #endif
569  _idx_buf.size());
570 }
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
index_buffer_t _idx_buf
Definition: dof_object.h:675
void libMesh::DofObject::print_dof_info ( ) const

Print out info for debugging.

在文件 dof_object.C670 行定义.

参考 dof_number(), id(), n_comp(), n_systems(), n_vars() , 以及 libMesh::out.

671 {
672  libMesh::out << this->id() << " [ ";
673 
674  for (auto s : make_range(this->n_systems()))
675  {
676  libMesh::out << "s:" << s << " ";
677  for (auto var : make_range(this->n_vars(s)))
678  {
679  libMesh::out << "v:" << var << " ";
680  for (auto comp : make_range(this->n_comp(s,var)))
681  {
682  libMesh::out << "c:" << comp << " dof:" << this->dof_number(s,var,comp) << " ";
683  }
684  }
685  }
686 
687  libMesh::out << "]\n";
688 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:1025
OStreamProxy out
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
dof_id_type id() const
Definition: dof_object.h:823
unsigned int n_systems() const
Definition: dof_object.h:930
void libMesh::ReferenceCounter::print_info ( std::ostream &  out_stream = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

在文件 reference_counter.C81 行定义.

参考 libMesh::ReferenceCounter::_enable_print_counter , 以及 libMesh::ReferenceCounter::get_info().

参考自 libMesh::LibMeshInit::~LibMeshInit().

82 {
84  out_stream << ReferenceCounter::get_info();
85 }
static std::string get_info()
Gets a string containing the reference information.
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
processor_id_type libMesh::DofObject::processor_id ( ) const
inline
返回
The processor that this DofObject belongs to.

When partitioning and DoF numbering have been performed by libMesh, every current DoF on this DofObject will belong to its processor.

在文件 dof_object.h898 行定义.

参考 _processor_id.

参考自 libMesh::DofMap::distribute_dofs(), invalidate_processor_id(), libMesh::CompareDofObjectsByPIDAndThenID::operator()(), processor_id() , 以及 libMesh::DofMap::set_nonlocal_dof_objects().

899 {
900  return _processor_id;
901 }
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:589
processor_id_type & libMesh::DofObject::processor_id ( )
inline
返回
The processor that this DofObject belongs to as a writable reference.

在文件 dof_object.h906 行定义.

参考 _processor_id.

907 {
908  return _processor_id;
909 }
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:589
void libMesh::DofObject::processor_id ( const processor_id_type  pid)
inline

Sets the processor_id for this DofObject.

在文件 dof_object.h914 行定义.

参考 processor_id().

915 {
916  this->processor_id() = pid;
917 }
processor_id_type processor_id() const
Definition: dof_object.h:898
void libMesh::DofObject::set_buffer ( const std::vector< dof_id_type > &  buf)
inline

在文件 dof_object.h712 行定义.

参考 _idx_buf.

713  { _idx_buf = buf; }
index_buffer_t _idx_buf
Definition: dof_object.h:675
void libMesh::DofObject::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 with this DofObject.

在文件 dof_object.C454 行定义.

参考 _idx_buf, dof_number(), invalid_id, n_comp(), n_comp_group(), n_systems(), n_vars(), start_idx(), system_var_to_vg_var() , 以及 var_to_vg().

458 {
459  libmesh_assert_less (s, this->n_systems());
460  libmesh_assert_less (var, this->n_vars(s));
461  libmesh_assert_less (comp, this->n_comp(s,var));
462 
463  const unsigned int
464  vg = this->var_to_vg(s,var),
465 #ifndef NDEBUG
466  ncg = this->n_comp_group(s,vg),
467 #endif
468  vig = this->system_var_to_vg_var(s,vg,var),
469  start_idx_sys = this->start_idx(s);
470 
471  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
472 
473  dof_id_type & base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
474 
475  // We intend to change all dof numbers together or not at all
476  if (comp || vig)
477  libmesh_assert ((dn == invalid_id && base_idx == invalid_id) ||
478  (dn == base_idx + vig*ncg + comp));
479 
480  // only explicitly store the base index for vig==0, comp==0
481  else
482  base_idx = dn;
483 
484  libmesh_assert_equal_to (this->dof_number(s, var, comp), dn);
485 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1008
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:1025
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...
Definition: dof_object.h:1352
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
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...
Definition: dof_object.h:1334
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
unsigned int n_systems() const
Definition: dof_object.h:930
uint8_t dof_id_type
Definition: id_types.h:67
template<typename T >
void libMesh::DofObject::set_extra_datum ( const unsigned int  index,
const T  value 
)
inline

Sets the value on this object of the extra datum associated with index, which should have been obtained via a call to MeshBase::add_elem_datum or MeshBase::add_node_datum using the same type T.

在文件 dof_object.h1119 行定义.

参考 _idx_buf, n_extra_integers(), n_pseudo_systems() , 以及 start_idx_ints().

1121 {
1122 #ifndef NDEBUG
1123  const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1124 #endif
1125  libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1126  libmesh_assert_less(this->n_pseudo_systems(), _idx_buf.size());
1127 
1128  const unsigned int start_idx_i = this->start_idx_ints();
1129 
1130  libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1131  std::memcpy(&_idx_buf[start_idx_i+index], &value, sizeof(T));
1132 }
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
unsigned int n_pseudo_systems() const
Definition: dof_object.h:940
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1266
index_buffer_t _idx_buf
Definition: dof_object.h:675
uint8_t dof_id_type
Definition: id_types.h:67
void libMesh::DofObject::set_extra_integer ( const unsigned int  index,
const dof_id_type  value 
)
inline

Sets the value on this object of the extra integer associated with index, which should have been obtained via a call to MeshBase::add_elem_integer or MeshBase::add_node_integer.

在文件 dof_object.h1079 行定义.

参考 _idx_buf, n_extra_integers(), n_pseudo_systems() , 以及 start_idx_ints().

1081 {
1082  libmesh_assert_less(index, this->n_extra_integers());
1083  libmesh_assert_less(this->n_pseudo_systems(), _idx_buf.size());
1084 
1085  const unsigned int start_idx_i = this->start_idx_ints();
1086 
1087  libmesh_assert_less(start_idx_i+index, _idx_buf.size());
1088  _idx_buf[start_idx_i+index] = value;
1089 }
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
unsigned int n_pseudo_systems() const
Definition: dof_object.h:940
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1266
index_buffer_t _idx_buf
Definition: dof_object.h:675
dof_id_type & libMesh::DofObject::set_id ( )
inline
返回
The id for this DofObject as a writable reference.

在文件 dof_object.h831 行定义.

参考 _id.

参考自 invalidate_id() , 以及 set_id().

832 {
833  return _id;
834 }
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:578
void libMesh::DofObject::set_id ( const dof_id_type  dofid)
inline

Sets the id for this DofObject.

在文件 dof_object.h196 行定义.

参考 set_id().

197  { this->set_id() = dofid; }
dof_id_type & set_id()
Definition: dof_object.h:831
void libMesh::DofObject::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.

在文件 dof_object.C385 行定义.

参考 n_systems(), n_vars(), set_n_comp_group() , 以及 var_to_vg().

388 {
389  libmesh_assert_less (s, this->n_systems());
390  libmesh_assert_less (var, this->n_vars(s));
391 
392  this->set_n_comp_group(s, this->var_to_vg(s,var), ncomp);
393 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
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:397
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...
Definition: dof_object.h:1334
unsigned int n_systems() const
Definition: dof_object.h:930
void libMesh::DofObject::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.

在文件 dof_object.C397 行定义.

参考 _idx_buf, invalid_id, n_comp_group(), n_systems(), n_var_groups(), n_vars(), ncv_magic , 以及 start_idx().

参考自 set_n_comp(), set_n_vars_per_group() , 以及 libMesh::DofMap::set_nonlocal_dof_objects().

400 {
401  libmesh_assert_less (s, this->n_systems());
402  libmesh_assert_less (vg, this->n_var_groups(s));
403 
404  // Check for trivial return
405  if (ncomp == this->n_comp_group(s,vg)) return;
406 
407 #ifndef NDEBUG
408  if (ncomp >= ncv_magic)
409  {
410  const index_t ncvm = ncv_magic;
411  libmesh_error_msg("ERROR: ncomp must be less than DofObject::ncv_magic!\n" \
412  << "ncomp = " \
413  << ncomp \
414  << ", ncv_magic = " \
415  << ncvm \
416  << "\nrecompile and try again!");
417  }
418 #endif
419 
420  const unsigned int
421  start_idx_sys = this->start_idx(s),
422  n_vars_group = this->n_vars(s,vg),
423  base_offset = start_idx_sys + 2*vg;
424 
425  libmesh_assert_less ((base_offset + 1), _idx_buf.size());
426 
427  // if (ncomp)
428  // libMesh::out << "s,vg,ncomp="
429  // << s << ","
430  // << vg << ","
431  // << ncomp << '\n';
432 
433  // set the number of components, maintaining the number
434  // of variables in the group
435  _idx_buf[base_offset] = ncv_magic*n_vars_group + ncomp;
436 
437  // We use (invalid_id - 1) to signify no
438  // components for this object
439  _idx_buf[base_offset + 1] = (ncomp == 0) ? invalid_id - 1 : invalid_id;
440 
441  // this->debug_buffer();
442  // libMesh::out << "s,vg = " << s << "," << vg << '\n'
443  // << "base_offset=" << base_offset << '\n'
444  // << "this->n_comp(s,vg)=" << this->n_comp(s,vg) << '\n'
445  // << "this->n_comp_group(s,vg)=" << this->n_comp_group(s,vg) << '\n'
446  // << "this->n_vars(s,vg)=" << this->n_vars(s,vg) << '\n'
447  // << "this->n_var_groups(s)=" << this->n_var_groups(s) << '\n';
448 
449  libmesh_assert_equal_to (ncomp, this->n_comp_group(s,vg));
450 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1008
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
dof_id_type index_t
DoF index information.
Definition: dof_object.h:673
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_systems() const
Definition: dof_object.h:930
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:686
void libMesh::DofObject::set_n_systems ( const unsigned int  s)

Sets the number of systems for this DofObject.

If this number is a change, also clears all variable count and DoF indexing associated with this DofObject.

If any extra integers are associated with this DofObject, their count and values are unchanged.

在文件 dof_object.C150 行定义.

参考 _idx_buf, n_extra_integers(), n_systems(), n_var_groups(), n_vars() , 以及 start_idx_ints().

参考自 add_system() , 以及 clear_dofs().

151 {
152  const unsigned int old_ns = this->n_systems();
153 
154  // Check for trivial return
155  if (ns == old_ns)
156  return;
157 
158  const unsigned int nei = this->n_extra_integers();
159  const dof_id_type header_size = ns + bool(nei);
160  const dof_id_type hdr = nei ?
161  static_cast<dof_id_type>(-static_cast<std::ptrdiff_t>(header_size))
162  : header_size;
163  index_buffer_t new_buf(header_size + nei, hdr);
164  if (nei)
165  {
166  const unsigned int start_idx_ints = old_ns ?
167  cast_int<unsigned int>(_idx_buf[old_ns]) :
168  1;
169  libmesh_assert_less(start_idx_ints, _idx_buf.size());
170  std::copy(_idx_buf.begin()+start_idx_ints,
171  _idx_buf.end(),
172  new_buf.begin()+header_size);
173  if (ns)
174  std::fill(new_buf.begin()+1, new_buf.begin()+ns+1, ns+1);
175  }
176 
177  // vector swap trick to force deallocation when shrinking
178  new_buf.swap(_idx_buf);
179 
180 #ifdef DEBUG
181  libmesh_assert_equal_to(nei, this->n_extra_integers());
182 
183  // check that all systems now exist and that they have 0 size
184  libmesh_assert_equal_to (ns, this->n_systems());
185  for (auto s : make_range(this->n_systems()))
186  {
187  libmesh_assert_equal_to (this->n_vars(s), 0);
188  libmesh_assert_equal_to (this->n_var_groups(s), 0);
189  }
190 #endif
191 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
std::vector< index_t > index_buffer_t
Definition: dof_object.h:674
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1266
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_systems() const
Definition: dof_object.h:930
uint8_t dof_id_type
Definition: id_types.h:67
void libMesh::DofObject::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.

Implicit in this is also setting the number of VariableGroup variable groups for the system. Has the effect of setting the number of components to 0 even when called even with (nvg == this->n_var_groups(s)).

在文件 dof_object.C247 行定义.

参考 _idx_buf, end_idx(), get_extra_integer(), has_extra_integers(), invalid_id, n_comp(), n_comp_group(), n_extra_integers(), n_systems(), n_var_groups(), n_vars(), ncv_magic, set_n_comp_group() , 以及 start_idx().

249 {
250  const unsigned int n_sys = this->n_systems();
251 
252  libmesh_assert_less (s, n_sys);
253 
254  // number of variable groups for this system - inferred
255  const unsigned int nvg = cast_int<unsigned int>(nvpg.size());
256 
257  // BSK - note that for compatibility with the previous implementation
258  // calling this method when (nvars == this->n_vars()) requires that
259  // we invalidate the DOF indices and set the number of components to 0.
260  // Note this was a bit of a surprise to me - there was no quick return in
261  // the old method, which caused removal and readdition of the DOF indices
262  // even in the case of (nvars == this->n_vars()), resulting in n_comp(s,v)
263  // implicitly becoming 0 regardless of any previous value.
264  // quick return?
265  if (nvg == this->n_var_groups(s))
266  {
267  for (unsigned int vg=0; vg<nvg; vg++)
268  {
269  this->set_n_comp_group(s,vg,0);
270  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
271  }
272  return;
273  }
274 
275  const bool hei = this->has_extra_integers();
276 
277  // since there is ample opportunity to screw up other systems, let us
278  // cache their current sizes and later assert that they are unchanged.
279 #ifdef DEBUG
280  const unsigned int nei = this->n_extra_integers();
281 
282  DofObject::index_buffer_t old_system_sizes, old_extra_integers;
283  old_system_sizes.reserve(n_sys);
284  old_extra_integers.reserve(nei);
285 
286  for (unsigned int s_ctr=0; s_ctr<n_sys; s_ctr++)
287  old_system_sizes.push_back(this->n_var_groups(s_ctr));
288 
289  for (unsigned int ei=0; ei != nei; ++ei)
290  old_extra_integers.push_back(this->get_extra_integer(ei));
291 #endif
292 
293  // remove current indices if we have some
294  if (this->n_var_groups(s) != 0)
295  {
296  const unsigned int old_nvg_s = this->n_var_groups(s);
297 
298  DofObject::index_buffer_t::iterator
299  it = _idx_buf.begin(),
300  end = _idx_buf.begin();
301 
302  std::advance(it, this->start_idx(s));
303  std::advance(end, this->end_idx(s));
304  _idx_buf.erase(it,end);
305 
306  for (unsigned int ctr=(s+1); ctr<n_sys; ctr++)
307  _idx_buf[ctr] -= 2*old_nvg_s;
308 
309  if (hei)
310  _idx_buf[n_sys] -= 2*old_nvg_s;
311  }
312 
313  // better not have any now!
314  libmesh_assert_equal_to (this->n_var_groups(s), 0);
315 
316  // Make sure we didn't screw up any of our sizes!
317 #ifdef DEBUG
318  for (auto s_ctr : make_range(this->n_systems()))
319  if (s_ctr != s)
320  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
321 
322  libmesh_assert_equal_to (nei, this->n_extra_integers());
323 
324  for (unsigned int ei=0; ei != nei; ++ei)
325  libmesh_assert_equal_to(old_extra_integers[ei], this->get_extra_integer(ei));
326 #endif
327 
328  // OK, if the user requested 0 that is what we have
329  if (nvg == 0)
330  return;
331 
332  {
333  // array to hold new indices
334  DofObject::index_buffer_t var_idxs(2*nvg);
335  for (unsigned int vg=0; vg<nvg; vg++)
336  {
337  var_idxs[2*vg ] = ncv_magic*nvpg[vg] + 0;
338  var_idxs[2*vg + 1] = invalid_id - 1;
339  }
340 
341  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
342  std::advance(it, this->end_idx(s));
343  _idx_buf.insert(it, var_idxs.begin(), var_idxs.end());
344 
345  for (unsigned int ctr=(s+1); ctr<n_sys; ctr++)
346  _idx_buf[ctr] += 2*nvg;
347 
348  if (hei)
349  _idx_buf[n_sys] += 2*nvg;
350 
351  // resize _idx_buf to fit so no memory is wasted.
353  }
354 
355  libmesh_assert_equal_to (nvg, this->n_var_groups(s));
356 
357 #ifdef DEBUG
358 
359  libmesh_assert_equal_to (this->n_var_groups(s), nvpg.size());
360 
361  for (auto vg : make_range(this->n_var_groups(s)))
362  {
363  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
364  libmesh_assert_equal_to (this->n_comp_group(s,vg), 0);
365  }
366 
367  for (auto v : make_range(this->n_vars(s)))
368  libmesh_assert_equal_to (this->n_comp(s,v), 0);
369 
370  // again, all other system sizes should be unchanged!
371  for (auto s_ctr : make_range(this->n_systems()))
372  if (s_ctr != s)
373  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
374 
375  // Extra integers count and values should also be unchanged!
376  libmesh_assert_equal_to (nei, this->n_extra_integers());
377 
378  for (unsigned int ei=0; ei != nei; ++ei)
379  libmesh_assert_equal_to(old_extra_integers[ei], this->get_extra_integer(ei));
380 #endif
381 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:1008
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
bool has_extra_integers() const
Returns whether extra integers are associated to the DofObject.
Definition: dof_object.h:1181
unsigned int end_idx(const unsigned int s) const
The ending index for system s.
Definition: dof_object.h:1253
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1163
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
std::vector< index_t > index_buffer_t
Definition: dof_object.h:674
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:397
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...
Definition: dof_object.h:1095
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:995
unsigned int n_systems() const
Definition: dof_object.h:930
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:686
void libMesh::DofObject::set_old_dof_object ( )

Sets the old_dof_object to a copy of this.

在文件 dof_object.C135 行定义.

参考 clear_old_dof_object(), construct() , 以及 old_dof_object.

136 {
137  this->clear_old_dof_object();
138 
139  libmesh_assert (!this->old_dof_object);
140 
141  // Make a new DofObject, assign a copy of \p this.
142  // Make sure the copy ctor for DofObject works!!
143  this->old_dof_object = this->construct(this);
144 }
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:736
void clear_old_dof_object()
Sets the old_dof_object to nullptr.
Definition: dof_object.C:128
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
unique_id_type & libMesh::DofObject::set_unique_id ( )
inline
返回
The globally unique_id for this DofObject as a writable reference. Deprecated; use the API taking an input instead.

在文件 dof_object.h852 行定义.

参考 _unique_id.

853 {
854 #ifdef LIBMESH_ENABLE_UNIQUE_ID
855  libmesh_deprecated();
856  return _unique_id;
857 #else
858  libmesh_not_implemented();
859 #endif
860 }
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:572
void libMesh::DofObject::set_unique_id ( unique_id_type  new_id)
inline

Sets the unique_id for this DofObject.

在文件 dof_object.h865 行定义.

参考 _unique_id , 以及 libMesh::libmesh_ignore().

866 {
867 #ifdef LIBMESH_ENABLE_UNIQUE_ID
868  _unique_id = new_id;
869 #else
870  libmesh_ignore(new_id);
871  libmesh_not_implemented();
872 #endif
873 }
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:572
void libmesh_ignore(const Args &...)
void libMesh::DofObject::set_vg_dof_base ( const unsigned int  s,
const unsigned int  vg,
const dof_id_type  db 
)
inline

VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base.

在文件 dof_object.h1290 行定义.

参考 _idx_buf, n_systems(), n_var_groups(), start_idx() , 以及 vg_dof_base().

参考自 invalidate_dofs() , 以及 libMesh::DofMap::set_nonlocal_dof_objects().

1293 {
1294  libmesh_assert_less (s, this->n_systems());
1295  libmesh_assert_less (vg, this->n_var_groups(s));
1296 
1297  const unsigned int
1298  start_idx_sys = this->start_idx(s);
1299 
1300  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1301 
1302  _idx_buf[start_idx_sys + 2*vg + 1] = db;
1303 
1304  libmesh_assert_equal_to (this->vg_dof_base(s,vg), db);
1305 }
dof_id_type vg_dof_base(const unsigned int s, const unsigned int vg) const
VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for di...
Definition: dof_object.h:1310
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int libMesh::DofObject::start_idx ( const unsigned int  s) const
inlineprivate

The starting index for system s.

在文件 dof_object.h1242 行定义.

参考 _idx_buf, std::abs() , 以及 n_systems().

参考自 dof_number(), n_comp_group(), n_var_groups(), n_vars(), set_dof_number(), set_n_comp_group(), set_n_vars_per_group(), set_vg_dof_base() , 以及 vg_dof_base().

1243 {
1244  libmesh_assert_less (s, this->n_systems());
1245  libmesh_assert_less (s, _idx_buf.size());
1246 
1247  return cast_int<unsigned int>(std::abs(dof_id_signed_type(_idx_buf[s])));
1248 }
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的绝对值。
Definition: type_vector.h:112
int8_t dof_id_signed_type
Definition: id_types.h:68
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int libMesh::DofObject::start_idx_ints ( ) const
inlineprivate

The starting index for an extra_integers pseudosystem.

在文件 dof_object.h1266 行定义.

参考 _idx_buf, has_extra_integers() , 以及 n_systems().

参考自 get_extra_datum(), get_extra_integer(), n_extra_integers(), set_extra_datum(), set_extra_integer() , 以及 set_n_systems().

1267 {
1268  libmesh_assert (this->has_extra_integers());
1269 
1270  unsigned int n_sys = this->n_systems();
1271 
1272  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1273  return n_sys ? cast_int<unsigned int>(_idx_buf[this->n_systems()]) :
1274  (n_sys+1);
1275 }
bool has_extra_integers() const
Returns whether extra integers are associated to the DofObject.
Definition: dof_object.h:1181
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_systems() const
Definition: dof_object.h:930
unsigned int libMesh::DofObject::system_var_to_vg_var ( const unsigned int  s,
const unsigned int  vg,
const unsigned int  var 
) const
inlineprivate

Utility function - for variable var in system s, figure out what variable group it lives in.

在文件 dof_object.h1352 行定义.

参考 n_vars().

参考自 set_dof_number().

1355 {
1356  unsigned int accumulated_sum=0;
1357 
1358  for (unsigned int vgc=0; vgc<vg; vgc++)
1359  accumulated_sum += this->n_vars(s,vgc);
1360 
1361  libmesh_assert_less_equal (accumulated_sum, var);
1362 
1363  return (var - accumulated_sum);
1364 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unique_id_type libMesh::DofObject::unique_id ( ) const
inline
返回
The globally unique_id for this DofObject

在文件 dof_object.h839 行定义.

参考 _unique_id, invalid_unique_id , 以及 valid_unique_id().

840 {
841 #ifdef LIBMESH_ENABLE_UNIQUE_ID
842  libmesh_assert (this->valid_unique_id());
843  return _unique_id;
844 #else
845  return invalid_unique_id;
846 #endif
847 }
bool valid_unique_id() const
Definition: dof_object.h:886
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:572
static const unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482
void libMesh::DofObject::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 we investigate the size term and then copy.

在文件 dof_object.C595 行定义.

参考 _idx_buf, std::abs(), clear_old_dof_object(), construct() , 以及 old_dof_object.

596 {
597  _idx_buf.clear();
598 
599 #ifdef LIBMESH_ENABLE_AMR
600  this->clear_old_dof_object();
601  const bool has_old_dof_object = cast_int<bool>(*begin++);
602 #endif
603 
604  const largest_id_type size = *begin++;
605  _idx_buf.reserve(size);
606  std::copy(begin, begin+size, back_inserter(_idx_buf));
607 
608  // Check as best we can for internal consistency now
609  libmesh_assert(_idx_buf.empty() ||
611  cast_int<dof_id_signed_type>(_idx_buf.size())));
612 #ifdef DEBUG
613  if (!_idx_buf.empty())
614  {
615  const int hdr = cast_int<int>(dof_id_signed_type(_idx_buf[0]));
616  const unsigned int ns = hdr >= 0 ? hdr : (-hdr-1);
617  for (unsigned int i=1; i < ns; ++i)
618  {
619  if (hdr > 0 || i > 1)
620  libmesh_assert_greater_equal (_idx_buf[i], _idx_buf[i-1]);
621  else
622  libmesh_assert_greater_equal (_idx_buf[i], ns);
623  libmesh_assert_equal_to ((_idx_buf[i] - _idx_buf[i-1])%2, 0);
624  libmesh_assert_less_equal (_idx_buf[i], _idx_buf.size());
625  }
626  if (hdr < 0 && ns > 0)
627  libmesh_assert_less_equal(_idx_buf[ns], _idx_buf.size());
628  }
629 #endif
630 
631 #ifdef LIBMESH_ENABLE_AMR
632  if (has_old_dof_object)
633  {
634  this->old_dof_object = this->construct();
635  this->old_dof_object->unpack_indexing(begin+size);
636  }
637 #endif
638 }
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:736
uint64_t largest_id_type
Definition: id_types.h:148
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的绝对值。
Definition: type_vector.h:112
void clear_old_dof_object()
Sets the old_dof_object to nullptr.
Definition: dof_object.C:128
int8_t dof_id_signed_type
Definition: id_types.h:68
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition: dof_object.h:88
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int libMesh::DofObject::unpackable_indexing_size ( std::vector< largest_id_type >::const_iterator  begin)
static

If we have indices packed into an buffer for communications, how much of that buffer applies to this dof object?

在文件 dof_object.C575 行定义.

576 {
577 #ifdef LIBMESH_ENABLE_AMR
578  const bool has_old_dof_object = cast_int<bool>(*begin++);
579 
580  static const int dof_header_size = 2;
581 #else
582  static const bool has_old_dof_object = false;
583  static const int dof_header_size = 1;
584 #endif
585 
586  const largest_id_type this_indexing_size = *begin++;
587 
588  return cast_int<unsigned int>
589  (dof_header_size + this_indexing_size +
590  (has_old_dof_object ?
591  unpackable_indexing_size(begin+this_indexing_size) : 0));
592 }
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:575
uint64_t largest_id_type
Definition: id_types.h:148
bool libMesh::DofObject::valid_id ( ) const
inline
返回
true if this DofObject has a valid id set, false otherwise.

在文件 dof_object.h878 行定义.

参考 _id , 以及 invalid_id.

879 {
880  return (DofObject::invalid_id != _id);
881 }
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:578
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:477
bool libMesh::DofObject::valid_processor_id ( ) const
inline
返回
true if this DofObject has a valid id set, false otherwise.

在文件 dof_object.h922 行定义.

参考 _processor_id , 以及 invalid_processor_id.

923 {
925 }
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:488
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:589
bool libMesh::DofObject::valid_unique_id ( ) const
inline
返回
true if this DofObject has a valid unique_id set, false otherwise.

在文件 dof_object.h886 行定义.

参考 _unique_id , 以及 invalid_unique_id.

参考自 unique_id().

887 {
888 #ifdef LIBMESH_ENABLE_UNIQUE_ID
890 #else
891  return false;
892 #endif
893 }
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:572
static const unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition: dof_object.h:482
unsigned int libMesh::DofObject::var_to_vg ( const unsigned int  s,
const unsigned int  var 
) const
inlineprivate

Utility function - for variable var in system s, figure out what variable group it lives in.

在文件 dof_object.h1334 行定义.

参考 n_var_groups() , 以及 n_vars().

参考自 n_comp(), set_dof_number() , 以及 set_n_comp().

1336 {
1337  const unsigned int
1338  nvg = this->n_var_groups(s);
1339 
1340  for (unsigned int vg=0, vg_end=0; vg<nvg; vg++)
1341  {
1342  vg_end += this->n_vars(s,vg);
1343  if (var < vg_end) return vg;
1344  }
1345 
1346  libmesh_error_msg("Error: could not map variable " << var << " to variable group.");
1347 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
std::pair< unsigned int, unsigned int > libMesh::DofObject::var_to_vg_and_offset ( const unsigned int  s,
const unsigned int  var 
) const
inline
返回
A pair consisting of the variable group number and the offset index from the start of that group for variable var on system s associated with this DofObject

在文件 dof_object.h1193 行定义.

参考 n_var_groups() , 以及 n_vars().

参考自 libMesh::DofMap::_node_dof_indices() , 以及 dof_number().

1195 {
1196  std::pair<unsigned int, unsigned int> returnval(0,0);
1197 
1198  unsigned int & vg = returnval.first;
1199  unsigned int & offset = returnval.second;
1200 
1201  unsigned int vg_start = 0;
1202  for (; ; vg++)
1203  {
1204  libmesh_assert_less(vg, this->n_var_groups(s));
1205 
1206  const unsigned int vg_end = vg_start + this->n_vars(s,vg);
1207  if (var < vg_end)
1208  {
1209  offset = var - vg_start;
1210  return returnval;
1211  }
1212  vg_start = vg_end;
1213  }
1214 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:960
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
dof_id_type libMesh::DofObject::vg_dof_base ( const unsigned int  s,
const unsigned int  vg 
) const
inline

VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base.

在文件 dof_object.h1310 行定义.

参考 _idx_buf, n_systems(), n_var_groups() , 以及 start_idx().

参考自 libMesh::DofMap::set_nonlocal_dof_objects() , 以及 set_vg_dof_base().

1312 {
1313  libmesh_assert_less (s, this->n_systems());
1314  libmesh_assert_less (vg, this->n_var_groups(s));
1315 
1316  const unsigned int
1317  start_idx_sys = this->start_idx(s);
1318 
1319  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1320 
1321  // #ifdef DEBUG
1322  // std::cout << " [ ";
1323  // for (auto i : _idx_buf)
1324  // std::cout << i << " ";
1325  // std::cout << "]\n";
1326  // #endif
1327 
1328  return _idx_buf[start_idx_sys + 2*vg + 1];
1329 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:950
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1242
index_buffer_t _idx_buf
Definition: dof_object.h:675
unsigned int n_systems() const
Definition: dof_object.h:930

类成员变量说明

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

Actually holds the data.

在文件 reference_counter.h124 行定义.

参考自 libMesh::ReferenceCounter::get_info().

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

在文件 reference_counter.h143 行定义.

参考自 libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info() , 以及 libMesh::ReferenceCounter::print_info().

dof_id_type libMesh::DofObject::_id
private

The id of the DofObject.

在文件 dof_object.h578 行定义.

参考自 id(), operator=(), set_id() , 以及 valid_id().

index_buffer_t libMesh::DofObject::_idx_buf
private
Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

在文件 reference_counter.h137 行定义.

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects.

Print the reference count information when the number returns to 0.

在文件 reference_counter.h132 行定义.

参考自 libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter() , 以及 libMesh::ReferenceCounter::~ReferenceCounter().

processor_id_type libMesh::DofObject::_processor_id
private

The processor_id of the DofObject.

Degrees of freedom are wholly owned by processors, however they may be duplicated on other processors.

This is stored as an unsigned short int since we cannot expect to be solving on 65000+ processors any time soon, can we??

在文件 dof_object.h589 行定义.

参考自 operator=(), processor_id() , 以及 valid_processor_id().

unique_id_type libMesh::DofObject::_unique_id
private

A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.

在文件 dof_object.h572 行定义.

参考自 operator=(), set_unique_id(), unique_id() , 以及 valid_unique_id().

const dof_id_type libMesh::DofObject::invalid_id = static_cast<dof_id_type>(-1)
static
const processor_id_type libMesh::DofObject::invalid_processor_id = static_cast<processor_id_type>(-1)
static

An invalid processor_id to distinguish DoFs that have not been assigned to a processor.

在文件 dof_object.h488 行定义.

参考自 invalidate_processor_id(), libMesh::SparsityPattern::Build::operator()(), libMesh::DofMap::set_nonlocal_dof_objects() , 以及 valid_processor_id().

const unique_id_type libMesh::DofObject::invalid_unique_id = static_cast<unique_id_type>(-1)
static

An invalid unique_id to distinguish an uninitialized DofObject.

在文件 dof_object.h482 行定义.

参考自 unique_id() , 以及 valid_unique_id().

const index_t libMesh::DofObject::ncv_magic = 256
staticprivate

Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv are the number of identical variables of a given type, and nc is the number of components for this set of variables.

It is hoped that by setting this to a power of two, an optimizing compiler will recognize later that #/ncv_magic is simply a bitshift

在文件 dof_object.h686 行定义.

参考自 n_comp_group(), set_n_comp_group() , 以及 set_n_vars_per_group().

const index_t libMesh::DofObject::ncv_magic_exp = 8
staticprivate

在文件 dof_object.h687 行定义.

参考自 n_vars().

std::unique_ptr<DofObject> libMesh::DofObject::old_dof_object
protected

This object on the last mesh.

Useful for projecting solutions from one mesh to another.

Public access to old_dof_object is now officially deprecated and will be removed in future libMesh versions. Use the get_old_dof_object() accessor instead.

在文件 dof_object.h88 行定义.

参考自 clear_old_dof_object(), get_old_dof_object(), get_old_dof_object_ref(), operator=(), pack_indexing(), packed_indexing_size(), set_old_dof_object() , 以及 unpack_indexing().


该类的文档由以下文件生成: