libMesh
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
libMesh::Node Class Reference

A Node is like a Point, but with more information. More...

#include <node.h>

Inheritance diagram for libMesh::Node:
[legend]

Public Types

typedef Real value_type
 Helper typedef for C++98 generic programming. More...
 
typedef unsigned int index_type
 Helper typedef for generic index programming. More...
 

Public Member Functions

 Node (const Real x=0, const Real y=0, const Real z=0, const dof_id_type id=invalid_id)
 Constructor. More...
 
 Node (const Node &n)
 Copy-constructor. More...
 
 Node (const Point &p, const dof_id_type id=invalid_id)
 Copy-constructor from a Point. More...
 
template<typename T , typename = typename boostcopy::enable_if_c<ScalarTraits<T>::value,void>::type>
 Node (const T x)
 Disambiguate constructing from non-Real scalars. More...
 
 ~Node ()
 Destructor. More...
 
Nodeoperator= (const Point &p)
 Assign to a node from a point. More...
 
bool active () const
 
bool operator== (const Node &rhs) const
 
void print_info (std::ostream &os=libMesh::out) const
 Prints relevant information about the node. More...
 
std::string get_info () const
 Prints relevant information about the node to a string. More...
 
unsigned int packed_size () const
 
unsigned int valence () const
 
void set_valence (unsigned int val)
 Sets the number of nodes connected with this node. More...
 
processor_id_type choose_processor_id (processor_id_type pid1, processor_id_type pid2) const
 Return which of pid1 and pid2 would be preferred by the current load-balancing heuristic applied to this node. More...
 
void assign (const TypeVector< T2 > &)
 Assign to this vector without creating a temporary. More...
 
const Realoperator() (const unsigned int i) const
 
Realoperator() (const unsigned int i)
 
const Realslice (const unsigned int i) const
 
Realslice (const unsigned int i)
 
TypeVector< typename CompareTypes< Real, T2 >::supertype > operator+ (const TypeVector< T2 > &) const
 Add two vectors. More...
 
const TypeVector< Real > & operator+= (const TypeVector< T2 > &)
 Add to this vector. More...
 
void add (const TypeVector< T2 > &)
 Add to this vector without creating a temporary. More...
 
void add_scaled (const TypeVector< T2 > &, const Real &)
 Add a scaled value to this vector without creating a temporary. More...
 
TypeVector< typename CompareTypes< Real, T2 >::supertype > operator- (const TypeVector< T2 > &) const
 Subtract from this vector. More...
 
TypeVector< Realoperator- () const
 
const TypeVector< Real > & operator-= (const TypeVector< T2 > &)
 Subtract from this vector. More...
 
void subtract (const TypeVector< T2 > &)
 Subtract from this vector without creating a temporary. More...
 
void subtract_scaled (const TypeVector< T2 > &, const Real &)
 Subtract a scaled value from this vector without creating a temporary. More...
 
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< Real, Scalar >::supertype > >::type operator* (const Scalar &) const
 Multiply this vector by a scalar value. More...
 
CompareTypes< Real, T2 >::supertype operator* (const TypeVector< T2 > &) const
 
const TypeVector< Real > & operator*= (const Real &)
 Multiply this vector by a scalar value. More...
 
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< Real, Scalar >::supertype > >::type operator/ (const Scalar &) const
 Divide each entry of this vector by scalar value. More...
 
const TypeVector< Real > & operator/= (const Real &)
 Divide each entry of this vector by scalar value. More...
 
CompareTypes< Real, T2 >::supertype contract (const TypeVector< T2 > &) const
 
TypeVector< typename CompareTypes< Real, T2 >::supertype > cross (const TypeVector< T2 > &v) const
 
TypeVector< Realunit () const
 
auto size () const -> decltype(std::norm(Real()))
 
auto norm () const -> decltype(std::norm(Real()))
 
auto size_sq () const -> decltype(std::norm(Real()))
 
auto norm_sq () const -> decltype(std::norm(Real()))
 
bool is_zero () const
 
void zero ()
 Set all entries of the vector to 0. More...
 
bool relative_fuzzy_equals (const TypeVector< Real > &rhs, Real tol=TOLERANCE) const
 
bool absolute_fuzzy_equals (const TypeVector< Real > &rhs, Real tol=TOLERANCE) const
 
bool operator== (const TypeVector< Real > &rhs) const
 
bool operator!= (const TypeVector< Real > &rhs) const
 
bool operator< (const TypeVector< Real > &rhs) const
 
bool operator< (const TypeVector< Complex > &rhs) const
 
bool operator<= (const TypeVector< Real > &rhs) const
 
bool operator<= (const TypeVector< Complex > &rhs) const
 
bool operator> (const TypeVector< Real > &rhs) const
 
bool operator> (const TypeVector< Complex > &rhs) const
 
bool operator>= (const TypeVector< Real > &rhs) const
 
bool operator>= (const TypeVector< Complex > &rhs) const
 
void print (std::ostream &os=libMesh::out) const
 Formatted print, by default to libMesh::out. More...
 
void write_unformatted (std::ostream &out, const bool newline=true) const
 Unformatted print to the stream out. More...
 
void clear_old_dof_object ()
 Sets the old_dof_object to nullptr. More...
 
void set_old_dof_object ()
 Sets the old_dof_object to a copy of this. More...
 
void clear_dofs ()
 Clear the DofMap data structures holding degree of freedom data. More...
 
void invalidate_dofs (const unsigned int sys_num=libMesh::invalid_uint)
 Sets all degree of freedom numbers to invalid_id. More...
 
void invalidate_id ()
 Sets the id to invalid_id. More...
 
void invalidate_processor_id ()
 Sets the processor id to invalid_processor_id. More...
 
void invalidate ()
 Invalidates all the indices for this DofObject. More...
 
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 ()
 
void set_id (const dof_id_type dofid)
 Sets the id for this DofObject. More...
 
unique_id_type unique_id () const
 
unique_id_typeset_unique_id ()
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void add_system ()
 Adds an additional system to the DofObject. More...
 
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. More...
 
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. More...
 
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. More...
 
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 intvar_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. More...
 
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. More...
 
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. More...
 
void add_extra_integers (const unsigned int n_integers)
 Assigns a set of extra integers to this DofObject. More...
 
unsigned int n_extra_integers () const
 Returns how many extra integers are associated to the DofObject. More...
 
bool has_extra_integers () const
 Returns whether extra integers are associated to the DofObject. More...
 
unsigned int packed_indexing_size () const
 If we pack our indices into an buffer for communications, how many ints do we need? More...
 
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. More...
 
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. More...
 
void debug_buffer () const
 Print our buffer for debugging. More...
 
void print_dof_info () const
 Print out info for debugging. More...
 
void set_buffer (const std::vector< dof_id_type > &buf)
 

Static Public Member Functions

static std::unique_ptr< Nodebuild (const Node &n)
 
static std::unique_ptr< Nodebuild (const Point &p, const dof_id_type id)
 
static std::unique_ptr< Nodebuild (const Real x, const Real y, const Real z, const dof_id_type id)
 
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? More...
 
static std::string get_info ()
 Gets a string containing the reference information. More...
 
static void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void disable_print_counter_info ()
 
static std::string get_info ()
 Gets a string containing the reference information. More...
 
static void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void disable_print_counter_info ()
 

Public Attributes

DofObjectold_dof_object
 This object on the last mesh. More...
 

Static Public Attributes

static const dof_id_type invalid_id = static_cast<dof_id_type>(-1)
 An invalid id to distinguish an uninitialized DofObject. More...
 
static const unique_id_type invalid_unique_id = static_cast<unique_id_type>(-1)
 An invalid unique_id to distinguish an uninitialized DofObject. More...
 
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. More...
 

Protected Types

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

Protected Member Functions

void increment_constructor_count (const std::string &name)
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name)
 Increments the destruction counter. More...
 
void increment_constructor_count (const std::string &name)
 Increments the construction counter. More...
 
void increment_destructor_count (const std::string &name)
 Increments the destruction counter. More...
 

Protected Attributes

Real _coords [LIBMESH_DIM]
 The coordinates of the TypeVector. More...
 

Static Protected Attributes

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

Private Types

typedef unsigned char valence_idx_t
 Type used to store node valence. More...
 
typedef dof_id_type index_t
 DoF index information. More...
 
typedef std::vector< index_tindex_buffer_t
 

Private Member Functions

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. More...
 
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. More...
 
unsigned int start_idx (const unsigned int s) const
 The starting index for system s. More...
 
unsigned int end_idx (const unsigned int s) const
 The ending index for system s. More...
 
unsigned int start_idx_ints () const
 The starting index for an extra_integers pseudosystem. More...
 
unsigned int end_idx_ints () const
 The ending index for an extra_integers pseudosystem. More...
 

Private Attributes

valence_idx_t _valence
 The number of nodes connected with this node. More...
 
unique_id_type _unique_id
 A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted. More...
 
dof_id_type _id
 The id of the DofObject. More...
 
processor_id_type _processor_id
 The processor_id of the DofObject. More...
 
index_buffer_t _idx_buf
 

Static Private Attributes

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. More...
 
static const index_t ncv_magic_exp = 8
 

Friends

class MeshRefinement
 This class need access to the node key information, but no one else should be able to mess with it. More...
 
class Elem
 

Detailed Description

A Node is like a Point, but with more information.

A Node is located in space and is associated with some (x,y,z) coordinates. Additionally, a Node may be enumerated with a global id. Finally, a Node may have an arbitrary number of degrees of freedom associated with it.

Author
Benjamin S. Kirk
Date
2003

A geometric point in (x,y,z) space associated with a DOF.

Definition at line 52 of file node.h.

Member Typedef Documentation

◆ Counts [1/2]

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.

Definition at line 117 of file reference_counter.h.

◆ Counts [2/2]

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.

Definition at line 117 of file reference_counter.h.

◆ index_buffer_t

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

Definition at line 612 of file dof_object.h.

◆ index_t

typedef dof_id_type libMesh::DofObject::index_t
privateinherited

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.

Note
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

Note
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]
* 

Definition at line 611 of file dof_object.h.

◆ index_type

typedef unsigned int libMesh::TypeVector< Real >::index_type
inherited

Helper typedef for generic index programming.

Definition at line 141 of file type_vector.h.

◆ valence_idx_t

typedef unsigned char libMesh::Node::valence_idx_t
private

Type used to store node valence.

Definition at line 210 of file node.h.

◆ value_type

typedef Real libMesh::TypeVector< Real >::value_type
inherited

Helper typedef for C++98 generic programming.

Definition at line 136 of file type_vector.h.

Constructor & Destructor Documentation

◆ Node() [1/4]

libMesh::Node::Node ( const Real  x = 0,
const Real  y = 0,
const Real  z = 0,
const dof_id_type  id = invalid_id 
)
inlineexplicit

Constructor.

By default sets all entries to 0. Gives the point 0 in LIBMESH_DIM dimensions with an id of Node::invalid_id.

Definition at line 238 of file node.h.

241  :
242  Point(x,y,z)
243 #ifdef LIBMESH_ENABLE_NODE_VALENCE
244  ,
245  _valence(0)
246 #endif
247 {
248  this->set_id() = dofid;
249 }
250 
251 
252 
253 #ifdef LIBMESH_ENABLE_DEPRECATED
254 inline
255 Node::Node (const Node & n) :
256  Point(n),
257  DofObject(n),
259 #ifdef LIBMESH_ENABLE_NODE_VALENCE
260  ,
261  _valence(n._valence)
262 #endif
263 {
264  libmesh_deprecated();
265 }
266 #endif
267 
268 
269 
270 inline
271 Node::Node (const Point & p,
272  const dof_id_type dofid) :
273  Point(p)
274 #ifdef LIBMESH_ENABLE_NODE_VALENCE
275  ,
276  _valence(0)
277 #endif
278 {
279  // optionally assign the id. We have
280  // to do it like this otherwise
281  // Node n = Point p would erase
282  // the id!
283  if (dofid != invalid_id)
284  this->set_id() = dofid;
285 }
286 
287 
288 
289 inline
290 Node::~Node ()
291 {
292 }

References libMesh::DofObject::set_id().

◆ Node() [2/4]

libMesh::Node::Node ( const Node n)

Copy-constructor.

◆ Node() [3/4]

libMesh::Node::Node ( const Point p,
const dof_id_type  id = invalid_id 
)
explicit

Copy-constructor from a Point.

Optionally assigned the id.

◆ Node() [4/4]

template<typename T , typename = typename boostcopy::enable_if_c<ScalarTraits<T>::value,void>::type>
libMesh::Node::Node ( const T  x)
inline

Disambiguate constructing from non-Real scalars.

Definition at line 92 of file node.h.

92  :
93  Point (x,0,0)
94  { this->set_id() = invalid_id; }

References libMesh::DofObject::invalid_id, and libMesh::DofObject::set_id().

◆ ~Node()

libMesh::Node::~Node ( )

Destructor.

Member Function Documentation

◆ absolute_fuzzy_equals()

bool libMesh::TypeVector< Real >::absolute_fuzzy_equals ( const TypeVector< Real > &  rhs,
Real  tol = TOLERANCE 
) const
inlineinherited
Returns
true if two vectors are equal to within an absolute tolerance of tol.

Definition at line 1017 of file type_vector.h.

1018 {
1019 #if LIBMESH_DIM == 1
1020  return (std::abs(_coords[0] - rhs._coords[0])
1021  <= tol);
1022 #endif
1023 
1024 #if LIBMESH_DIM == 2
1025  return (std::abs(_coords[0] - rhs._coords[0]) +
1026  std::abs(_coords[1] - rhs._coords[1])
1027  <= tol);
1028 #endif
1029 
1030 #if LIBMESH_DIM == 3
1031  return (std::abs(_coords[0] - rhs._coords[0]) +
1032  std::abs(_coords[1] - rhs._coords[1]) +
1033  std::abs(_coords[2] - rhs._coords[2])
1034  <= tol);
1035 #endif
1036 }

◆ active()

bool libMesh::Node::active ( ) const
inline
Returns
true if the node is active. An active node is defined as one for which id() is not Node::invalid_id. Inactive nodes are nodes that are in the mesh but are not connected to any elements.

Definition at line 344 of file node.h.

345 {
346  return (this->id() != Node::invalid_id);
347 }

References libMesh::DofObject::invalid_id.

◆ add()

void libMesh::TypeVector< Real >::add ( const TypeVector< T2 > &  p)
inlineinherited

Add to this vector without creating a temporary.

Definition at line 641 of file type_vector.h.

642 {
643 #if LIBMESH_DIM == 1
644  _coords[0] += p._coords[0];
645 #endif
646 
647 #if LIBMESH_DIM == 2
648  _coords[0] += p._coords[0];
649  _coords[1] += p._coords[1];
650 #endif
651 
652 #if LIBMESH_DIM == 3
653  _coords[0] += p._coords[0];
654  _coords[1] += p._coords[1];
655  _coords[2] += p._coords[2];
656 #endif
657 
658 }

◆ add_extra_integers()

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

Assigns a set of extra integers to this DofObject.

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

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.

Definition at line 503 of file dof_object.C.

504 {
505  if (_idx_buf.empty())
506  {
507  if (n_integers)
508  {
509  _idx_buf.resize(n_integers+1, DofObject::invalid_id);
510  _idx_buf[0] = dof_id_type(-1);
511  }
512  return;
513  }
514  else
515  {
516  const int hdr = dof_id_signed_type(_idx_buf[0]);
517 
518  // We already have some extra integers, but may need more or
519  // less now.
520  if (hdr < 0)
521  {
522  const unsigned int old_n_integers = this->n_extra_integers();
523  if (n_integers != old_n_integers)
524  {
525  // Make or remove space as needed by count change
526  _idx_buf.resize(_idx_buf.size()+n_integers-old_n_integers, DofObject::invalid_id);
527 
528  // The start index for the extra integers is unchanged.
529  }
530  }
531  else if (n_integers)
532  // We had no extra integers, but need to add some
533  {
534  // Mark the DofObject as holding extra integers
535  _idx_buf[0] = dof_id_type(-hdr-1);
536 
537  // Insert the integer start position
538  DofObject::index_buffer_t::iterator it = _idx_buf.begin() + hdr;
539  _idx_buf.insert(it, _idx_buf.size()+1);
540 
541  // Increment the previous system start positions to account
542  // for the new header entry creating an offset
543  for (int i=1; i<hdr; i++)
544  _idx_buf[i]++;
545 
546  // Append space for extra integers
547  _idx_buf.resize(_idx_buf.size()+n_integers, DofObject::invalid_id);
548  }
549  }
550 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::invalid_id, and libMesh::DofObject::n_extra_integers().

Referenced by libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

◆ add_scaled()

void libMesh::TypeVector< Real >::add_scaled ( const TypeVector< T2 > &  p,
const Real &  factor 
)
inlineinherited

Add a scaled value to this vector without creating a temporary.

Definition at line 665 of file type_vector.h.

666 {
667 #if LIBMESH_DIM == 1
668  _coords[0] += factor*p(0);
669 #endif
670 
671 #if LIBMESH_DIM == 2
672  _coords[0] += factor*p(0);
673  _coords[1] += factor*p(1);
674 #endif
675 
676 #if LIBMESH_DIM == 3
677  _coords[0] += factor*p(0);
678  _coords[1] += factor*p(1);
679  _coords[2] += factor*p(2);
680 #endif
681 
682 }

◆ add_system()

void libMesh::DofObject::add_system ( )
inherited

Adds an additional system to the DofObject.

Definition at line 208 of file dof_object.C.

209 {
210  // quick return?
211  if (this->n_systems() == 0)
212  {
213  this->set_n_systems(1);
214  return;
215  }
216 
217  // cache this value before we screw it up!
218  const unsigned int ns_orig = this->n_systems();
219 
220  DofObject::index_buffer_t::iterator it = _idx_buf.begin() + ns_orig;
221 
222  // Create the entry for the new system indicating 0 variables.
223  //
224  // increment the number of systems and the offsets for each of
225  // the systems including the new one we just added.
226  if (this->has_extra_integers())
227  {
228  // this inserts the extra_integers' start position as the start
229  // position for the new system. We'll increment all those
230  // counts in one sweep next, to account for header expansion.
231  _idx_buf.insert(it, *it);
232 
233  _idx_buf[0]--;
234  for (unsigned int i=1; i<ns_orig+2; i++)
235  {
236  libmesh_assert_less(i, _idx_buf.size());
237  _idx_buf[i]++;
238  }
239  }
240  else
241  {
242  // this inserts the current vector size at the position for the
243  // new system
244  _idx_buf.insert(it, cast_int<dof_id_type>(_idx_buf.size()));
245 
246  for (unsigned int i=0; i<ns_orig+1; i++)
247  {
248  libmesh_assert_less(i, _idx_buf.size());
249  _idx_buf[i]++;
250  }
251  }
252 
253  libmesh_assert_equal_to (this->n_systems(), (ns_orig+1));
254  libmesh_assert_equal_to (this->n_vars(ns_orig), 0);
255  libmesh_assert_equal_to (this->n_var_groups(ns_orig), 0);
256 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::has_extra_integers(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), and libMesh::DofObject::set_n_systems().

Referenced by DofObjectTest< Node >::testAddSystemExtraInts().

◆ assign()

void libMesh::TypeVector< Real >::assign ( const TypeVector< T2 > &  p)
inlineinherited

Assign to this vector without creating a temporary.

Definition at line 570 of file type_vector.h.

571 {
572  for (unsigned int i=0; i<LIBMESH_DIM; i++)
573  _coords[i] = p._coords[i];
574 }

◆ build() [1/3]

std::unique_ptr< Node > libMesh::Node::build ( const Node n)
inlinestatic
Returns
A Node copied from n and wrapped in a smart pointer.

Definition at line 314 of file node.h.

315 {
316  libmesh_deprecated();
317  return libmesh_make_unique<Node>(n);
318 }

Referenced by libMesh::ReplicatedMesh::add_point(), and libMesh::DistributedMesh::add_point().

◆ build() [2/3]

std::unique_ptr< Node > libMesh::Node::build ( const Point p,
const dof_id_type  id 
)
inlinestatic
Returns
A Node copied from p with id == id and wrapped in a smart pointer.

Definition at line 324 of file node.h.

326 {
327  return libmesh_make_unique<Node>(p,id);
328 }

◆ build() [3/3]

std::unique_ptr< Node > libMesh::Node::build ( const Real  x,
const Real  y,
const Real  z,
const dof_id_type  id 
)
inlinestatic
Returns
A Node created from the specified (x,y,z) positions with id == id and wrapped in a smart pointer.

Definition at line 333 of file node.h.

337 {
338  return libmesh_make_unique<Node>(x,y,z,id);
339 }

◆ choose_processor_id()

processor_id_type libMesh::Node::choose_processor_id ( processor_id_type  pid1,
processor_id_type  pid2 
) const

Return which of pid1 and pid2 would be preferred by the current load-balancing heuristic applied to this node.

Definition at line 78 of file node.C.

79 {
81  return pid2;
82 
83  // Do we want the new load-balanced node partitioning heuristic
84  // instead of the default partitioner-friendlier heuristic?
85  static bool load_balanced_nodes =
86  libMesh::on_command_line ("--load-balanced-nodes");
87 
88  // For better load balancing, we can use the min
89  // even-numberered nodes and the max for odd-numbered.
90  if (load_balanced_nodes)
91  {
92  if (this->id() % 2 &&
94  return std::max(pid1, pid2);
95  else
96  return std::min(pid1, pid2);
97  }
98 
99  // Our default behavior, which puts too many nodes on lower MPI
100  // ranks but which keeps elements' nodes on the same partition more
101  // often, is simply:
102  return std::min(pid1, pid2);
103 }

References libMesh::DofObject::invalid_processor_id, and libMesh::on_command_line().

Referenced by libMesh::MeshTools::correct_node_proc_ids().

◆ clear_dofs()

void libMesh::DofObject::clear_dofs ( )
inlineinherited

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.

Definition at line 737 of file dof_object.h.

738 {
739  this->set_n_systems(0);
740 }

References libMesh::DofObject::set_n_systems().

Referenced by libMesh::DofObject::~DofObject().

◆ clear_old_dof_object()

void libMesh::DofObject::clear_old_dof_object ( )
inherited

Sets the old_dof_object to nullptr.

Definition at line 142 of file dof_object.C.

143 {
144  delete this->old_dof_object;
145  this->old_dof_object = nullptr;
146 }

References libMesh::DofObject::old_dof_object.

Referenced by libMesh::DofObject::operator=(), libMesh::DofObject::set_old_dof_object(), libMesh::DofObject::unpack_indexing(), and libMesh::DofObject::~DofObject().

◆ contract()

CompareTypes< Real , T2 >::supertype libMesh::TypeVector< Real >::contract ( const TypeVector< T2 > &  p) const
inlineinherited
Returns
The result of TypeVector::operator*().

Definition at line 910 of file type_vector.h.

911 {
912  return (*this)*(p);
913 }

◆ cross()

TypeVector< typename CompareTypes< Real , T2 >::supertype > libMesh::TypeVector< Real >::cross ( const TypeVector< T2 > &  v) const
inherited
Returns
The cross product of this vector with v.

Definition at line 920 of file type_vector.h.

921 {
922  typedef typename CompareTypes<T, T2>::supertype TS;
923  libmesh_assert_equal_to (LIBMESH_DIM, 3);
924 
925  // | i j k |
926  // |(*this)(0) (*this)(1) (*this)(2)|
927  // | p(0) p(1) p(2) |
928 
929 #if LIBMESH_DIM == 3
930  return TypeVector<TS>( _coords[1]*p._coords[2] - _coords[2]*p._coords[1],
931  -_coords[0]*p._coords[2] + _coords[2]*p._coords[0],
932  _coords[0]*p._coords[1] - _coords[1]*p._coords[0]);
933 #else
934  libmesh_ignore(p);
935  return TypeVector<TS>(0);
936 #endif
937 }

◆ debug_buffer()

void libMesh::DofObject::debug_buffer ( ) const
inherited

Print our buffer for debugging.

Definition at line 654 of file dof_object.C.

655 {
656  libMesh::out << " [ ";
657  for (const auto & idx : _idx_buf)
658  libMesh::out << idx << " ";
659  libMesh::out << "]\n";
660 }

References libMesh::DofObject::_idx_buf, libMesh::MeshTools::Generation::Private::idx(), and libMesh::out.

◆ disable_print_counter_info() [1/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 106 of file reference_counter.C.

107 {
108  _enable_print_counter = false;
109  return;
110 }

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::LibMeshInit::LibMeshInit().

◆ disable_print_counter_info() [2/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 106 of file reference_counter.C.

107 {
108  _enable_print_counter = false;
109  return;
110 }

References libMesh::ReferenceCounter::_enable_print_counter.

Referenced by libMesh::LibMeshInit::LibMeshInit().

◆ dof_number() [1/2]

dof_id_type libMesh::DofObject::dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp 
) const
inlineinherited
Returns
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.

Definition at line 956 of file dof_object.h.

959 {
960  libmesh_assert_less (s, this->n_systems());
961  libmesh_assert_less (var, this->n_vars(s));
962  libmesh_assert_less (comp, this->n_comp(s,var));
963 
964  const std::pair<unsigned int, unsigned int>
965  vg_vig = this->var_to_vg_and_offset(s,var);
966 
967  const unsigned int
968  n_comp = this->n_comp_group(s,vg_vig.first);
969 
970  return this->dof_number(s, vg_vig.first, vg_vig.second,
971  comp, n_comp);
972 }

References libMesh::DofObject::n_comp(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), and libMesh::DofObject::var_to_vg_and_offset().

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::DynaIO::add_spline_constraints(), libMesh::DofMap::allgather_recursive_constraints(), assemble_matrix_and_rhs(), assemble_shell(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::dof_indices(), libMesh::DofObject::DofObject(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), fill_dirichlet_bc(), get_info(), libMesh::Elem::get_info(), libMesh::DofMap::local_variable_indices(), main(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectSides::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectInteriors::operator()(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::HPCoarsenTest::select_refinement(), libMesh::DofObject::set_dof_number(), libMesh::DofMap::set_nonlocal_dof_objects(), ParsedFEMFunctionTest::setUp(), DofObjectTest< Node >::testJensEftangBug(), DofObjectTest< Node >::testManualDofCalculation(), libMesh::BoundaryVolumeSolutionTransfer::transfer_boundary_volume(), libMesh::DTKAdapter::update_variable_values(), and libMesh::Nemesis_IO_Helper::write_nodal_solution().

◆ dof_number() [2/2]

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
inlineinherited
Returns
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.

Definition at line 977 of file dof_object.h.

982 {
983  libmesh_assert_less (s, this->n_systems());
984  libmesh_assert_less (vg, this->n_var_groups(s));
985  libmesh_assert_less (vig, this->n_vars(s,vg));
986 
987  const unsigned int
988  start_idx_sys = this->start_idx(s);
989 
990  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
991 
992  const dof_id_type
993  base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
994 
995  // if the first component is invalid, they
996  // are all invalid
997  if (base_idx == invalid_id)
998  return invalid_id;
999 
1000  // otherwise the index is the first component
1001  // index augmented by the component number
1002  else
1003  return cast_int<dof_id_type>(base_idx + vig*n_comp + comp);
1004 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::invalid_id, libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), and libMesh::DofObject::start_idx().

◆ enable_print_counter_info() [1/2]

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 100 of file reference_counter.C.

101 {
102  _enable_print_counter = true;
103  return;
104 }

References libMesh::ReferenceCounter::_enable_print_counter.

◆ enable_print_counter_info() [2/2]

void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 100 of file reference_counter.C.

101 {
102  _enable_print_counter = true;
103  return;
104 }

References libMesh::ReferenceCounter::_enable_print_counter.

◆ end_idx()

unsigned int libMesh::DofObject::end_idx ( const unsigned int  s) const
inlineprivateinherited

The ending index for system s.

Definition at line 1172 of file dof_object.h.

1173 {
1174  libmesh_assert_less (s, this->n_systems());
1175  libmesh_assert_less (s, _idx_buf.size());
1176 
1177  return ((s+1) == this->n_pseudo_systems()) ?
1178  cast_int<unsigned int>(_idx_buf.size()) :
1179  cast_int<unsigned int>(_idx_buf[s+1]);
1180 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_pseudo_systems(), and libMesh::DofObject::n_systems().

Referenced by libMesh::DofObject::n_var_groups(), and libMesh::DofObject::set_n_vars_per_group().

◆ end_idx_ints()

unsigned int libMesh::DofObject::end_idx_ints ( ) const
inlineprivateinherited

The ending index for an extra_integers pseudosystem.

Definition at line 1199 of file dof_object.h.

1200 {
1202 
1203  return cast_int<unsigned int>(_idx_buf.size());
1204 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::has_extra_integers(), and libMesh::libmesh_assert().

◆ get_extra_datum()

template<typename T >
T libMesh::DofObject::get_extra_datum ( const unsigned int  index) const
inlineinherited

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.

Definition at line 1062 of file dof_object.h.

1063 {
1064 #ifndef NDEBUG
1065  const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1066 #endif
1067  libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1068  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1069 
1070  const unsigned int start_idx_i = this->start_idx_ints();
1071 
1072  libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1073  T returnval;
1074  std::memcpy(&returnval, &_idx_buf[start_idx_i+index], sizeof(T));
1075  return returnval;
1076 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), and libMesh::DofObject::start_idx_ints().

Referenced by libMesh::FE< Dim, LAGRANGE_VEC >::shape(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_deriv(), libMesh::FE< Dim, LAGRANGE_VEC >::shape_second_deriv(), and DofObjectTest< Node >::testAddExtraData().

◆ get_extra_integer()

dof_id_type libMesh::DofObject::get_extra_integer ( const unsigned int  index) const
inlineinherited

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.

Definition at line 1026 of file dof_object.h.

1027 {
1028  libmesh_assert_less(index, this->n_extra_integers());
1029  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1030 
1031  const unsigned int start_idx_i = this->start_idx_ints();
1032 
1033  libmesh_assert_less(start_idx_i+index, _idx_buf.size());
1034  return _idx_buf[start_idx_i+index];
1035 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), and libMesh::DofObject::start_idx_ints().

Referenced by libMesh::CheckpointIO::read_connectivity(), libMesh::DofObject::set_n_vars_per_group(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

◆ get_info() [1/3]

std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

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 & pr : _counts)
59  {
60  const std::string name(pr.first);
61  const unsigned int creations = pr.second.first;
62  const unsigned int destructions = pr.second.second;
63 
64  oss << "| " << name << " reference count information:\n"
65  << "| Creations: " << creations << '\n'
66  << "| Destructions: " << destructions << '\n';
67  }
68 
69  oss << " ---------------------------------------------------------------------------- \n";
70 
71  return oss.str();
72 
73 #else
74 
75  return "";
76 
77 #endif
78 }

References libMesh::ReferenceCounter::_counts, and libMesh::Quality::name().

Referenced by libMesh::ReferenceCounter::print_info().

◆ get_info() [2/3]

std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

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 & pr : _counts)
59  {
60  const std::string name(pr.first);
61  const unsigned int creations = pr.second.first;
62  const unsigned int destructions = pr.second.second;
63 
64  oss << "| " << name << " reference count information:\n"
65  << "| Creations: " << creations << '\n'
66  << "| Destructions: " << destructions << '\n';
67  }
68 
69  oss << " ---------------------------------------------------------------------------- \n";
70 
71  return oss.str();
72 
73 #else
74 
75  return "";
76 
77 #endif
78 }

References libMesh::ReferenceCounter::_counts, and libMesh::Quality::name().

Referenced by libMesh::ReferenceCounter::print_info().

◆ get_info() [3/3]

std::string libMesh::Node::get_info ( ) const

Prints relevant information about the node to a string.

Definition at line 53 of file node.C.

54 {
55  std::ostringstream oss;
56 
57  oss << " Node id()=";
58 
59  if (this->valid_id())
60  oss << this->id();
61  else
62  oss << "invalid";
63 
64  oss << ", processor_id()=" << this->processor_id() <<
65  ", Point=" << *static_cast<const Point *>(this) << '\n';
66 
67  oss << " DoFs=";
68  for (auto s : IntRange<unsigned int>(0, this->n_systems()))
69  for (auto v : IntRange<unsigned int>(0, this->n_vars(s)))
70  for (auto c : IntRange<unsigned int>(0, this->n_comp(s,v)))
71  oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";
72 
73  return oss.str();
74 }

References libMesh::DofObject::dof_number(), libMesh::DofObject::id(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), libMesh::DofObject::processor_id(), and libMesh::DofObject::valid_id().

Referenced by print_info().

◆ has_dofs()

bool libMesh::DofObject::has_dofs ( const unsigned int  s = libMesh::invalid_uint) const
inlineinherited
Returns
true if any system has variables which have been assigned, false otherwise.

Definition at line 1138 of file dof_object.h.

1139 {
1140  if (sys == libMesh::invalid_uint)
1141  {
1142  for (auto s : IntRange<unsigned int>(0, this->n_systems()))
1143  if (this->n_vars(s))
1144  return true;
1145  }
1146 
1147  else
1148  {
1149  libmesh_assert_less (sys, this->n_systems());
1150 
1151  if (this->n_vars(sys))
1152  return true;
1153  }
1154 
1155  return false;
1156 }

References libMesh::invalid_uint, libMesh::DofObject::n_systems(), and libMesh::DofObject::n_vars().

Referenced by libMesh::DofMap::old_dof_indices(), and libMesh::Parallel::Packing< Node * >::unpack().

◆ has_extra_integers()

bool libMesh::DofObject::has_extra_integers ( ) const
inlineinherited

◆ id()

dof_id_type libMesh::DofObject::id ( ) const
inlineinherited
Returns
The id for this DofObject

Definition at line 767 of file dof_object.h.

768 {
769  libmesh_assert (this->valid_id());
770  return _id;
771 }

References libMesh::DofObject::_id, libMesh::libmesh_assert(), and libMesh::DofObject::valid_id().

Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), add_cube_convex_hull_to_mesh(), libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::TopologyMap::add_node(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::DistributedMesh::add_point(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), assemble_ellipticdg(), assemble_SchroedingerEquation(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), compute_jacobian(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), compute_residual(), libMesh::FEMap::compute_single_point_map(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::ReplicatedMesh::delete_elem(), libMesh::DistributedMesh::delete_elem(), libMesh::ReplicatedMesh::delete_node(), libMesh::DistributedMesh::delete_node(), libMesh::DistributedMesh::DistributedMesh(), libMesh::DTKAdapter::DTKAdapter(), libMesh::UNVIO::elements_out(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshTools::Modification::flatten(), libMesh::ReplicatedMesh::get_boundary_points(), libMesh::ReplicatedMesh::get_disconnected_subdomains(), get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::ParmetisPartitioner::initialize(), libMesh::TreeNode< N >::insert(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), libMesh::FEMap::inverse_map(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Tri3Subdivision::local_node_number(), main(), LinearElasticityWithContact::move_mesh(), libMesh::Elem::node_id(), libMesh::VTKIO::nodes_to_vtk(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::DistributedMesh::own_node(), libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::MetisPartitioner::partition_range(), libMesh::DofObject::print_dof_info(), libMesh::DistributedMesh::query_elem_ptr(), libMesh::DistributedMesh::query_node_ptr(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read_elements(), libMesh::DynaIO::read_mesh(), libMesh::DistributedMesh::renumber_elem(), libMesh::DistributedMesh::renumber_node(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::MeshTools::Modification::smooth(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), DefaultCouplingTest::testCoupling(), MixedDimensionMeshTest::testPointLocatorTree(), DofObjectTest< Node >::testSetId(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::GmshIO::write_mesh(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), and libMesh::XdrIO::write_serialized_nodes().

◆ increment_constructor_count() [1/2]

void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the construction counter.

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

Definition at line 181 of file reference_counter.h.

182 {
183  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
184  std::pair<unsigned int, unsigned int> & p = _counts[name];
185 
186  p.first++;
187 }

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

◆ increment_constructor_count() [2/2]

void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the construction counter.

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

Definition at line 181 of file reference_counter.h.

182 {
183  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
184  std::pair<unsigned int, unsigned int> & p = _counts[name];
185 
186  p.first++;
187 }

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

◆ increment_destructor_count() [1/2]

void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the destruction counter.

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

Definition at line 194 of file reference_counter.h.

195 {
196  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
197  std::pair<unsigned int, unsigned int> & p = _counts[name];
198 
199  p.second++;
200 }

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

◆ increment_destructor_count() [2/2]

void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectedinherited

Increments the destruction counter.

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

Definition at line 194 of file reference_counter.h.

195 {
196  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
197  std::pair<unsigned int, unsigned int> & p = _counts[name];
198 
199  p.second++;
200 }

References libMesh::ReferenceCounter::_counts, libMesh::Quality::name(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

◆ invalidate()

void libMesh::DofObject::invalidate ( )
inlineinherited

Invalidates all the indices for this DofObject.

Definition at line 727 of file dof_object.h.

728 {
729  this->invalidate_dofs ();
730  this->invalidate_id ();
731  this->invalidate_processor_id ();
732 }

References libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::invalidate_id(), and libMesh::DofObject::invalidate_processor_id().

Referenced by libMesh::DofObject::DofObject().

◆ invalidate_dofs()

void libMesh::DofObject::invalidate_dofs ( const unsigned int  sys_num = libMesh::invalid_uint)
inlineinherited

Sets all degree of freedom numbers to invalid_id.

Definition at line 690 of file dof_object.h.

691 {
692  const unsigned int n_sys = this->n_systems();
693  // If the user does not specify the system number...
694  if (sys_num >= n_sys)
695  {
696  for (auto s : IntRange<unsigned int>(0, n_sys))
697  for (auto vg : IntRange<unsigned int>(0, this->n_var_groups(s)))
698  if (this->n_comp_group(s,vg))
699  this->set_vg_dof_base(s,vg,invalid_id);
700  }
701  // ...otherwise invalidate the dofs for all systems
702  else
703  for (auto vg : IntRange<unsigned int>(0, this->n_var_groups(sys_num)))
704  if (this->n_comp_group(sys_num,vg))
705  this->set_vg_dof_base(sys_num,vg,invalid_id);
706 }

References libMesh::DofObject::invalid_id, libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), and libMesh::DofObject::set_vg_dof_base().

Referenced by libMesh::DofObject::invalidate().

◆ invalidate_id()

void libMesh::DofObject::invalidate_id ( )
inlineinherited

Sets the id to invalid_id.

Definition at line 711 of file dof_object.h.

712 {
713  this->set_id (invalid_id);
714 }

References libMesh::DofObject::invalid_id, and libMesh::DofObject::set_id().

Referenced by libMesh::DofObject::invalidate(), and DofObjectTest< Node >::testInvalidateId().

◆ invalidate_processor_id()

void libMesh::DofObject::invalidate_processor_id ( )
inlineinherited

◆ is_zero()

bool libMesh::TypeVector< Real >::is_zero ( ) const
inlineinherited
Returns
True if all values in the vector are zero

Definition at line 1007 of file type_vector.h.

1008 {
1009  for (const auto & val : _coords)
1010  if (val != T(0))
1011  return false;
1012  return true;
1013 }

◆ n_comp()

unsigned int libMesh::DofObject::n_comp ( const unsigned int  s,
const unsigned int  var 
) const
inlineinherited
Returns
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.

Definition at line 926 of file dof_object.h.

928 {
929  libmesh_assert_less (s, this->n_systems());
930  libmesh_assert_less (var, this->n_vars(s));
931 
932  return this->n_comp_group(s,this->var_to_vg(s,var));
933 }

References libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), and libMesh::DofObject::var_to_vg().

Referenced by libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::DofMap::distribute_dofs(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), get_info(), libMesh::Elem::get_info(), libMesh::DofMap::local_variable_indices(), main(), libMesh::DofObject::n_dofs(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

◆ n_comp_group()

unsigned int libMesh::DofObject::n_comp_group ( const unsigned int  s,
const unsigned int  vg 
) const
inlineinherited
Returns
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.

Definition at line 939 of file dof_object.h.

941 {
942  libmesh_assert_less (s, this->n_systems());
943  libmesh_assert_less (vg, this->n_var_groups(s));
944 
945  const unsigned int
946  start_idx_sys = this->start_idx(s);
947 
948  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
949 
950  return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
951 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::ncv_magic, and libMesh::DofObject::start_idx().

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::n_comp(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), libMesh::DofMap::reinit(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

◆ n_dofs()

unsigned int libMesh::DofObject::n_dofs ( const unsigned int  s,
const unsigned int  var = libMesh::invalid_uint 
) const
inlineinherited
Returns
The number of degrees of freedom associated with system s for this object. Optionally only counts degrees of freedom for variable number var

Definition at line 745 of file dof_object.h.

747 {
748  libmesh_assert_less (s, this->n_systems());
749 
750  unsigned int num = 0;
751 
752  // Count all variables
753  if (var == libMesh::invalid_uint)
754  for (auto v : IntRange<unsigned int>(0, this->n_vars(s)))
755  num += this->n_comp(s,v);
756 
757  // Only count specified variable
758  else
759  num = this->n_comp(s,var);
760 
761  return num;
762 }

References libMesh::invalid_uint, libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), and libMesh::DofObject::n_vars().

Referenced by libMesh::PetscDMWrapper::add_dofs_helper().

◆ n_extra_integers()

unsigned int libMesh::DofObject::n_extra_integers ( ) const
inlineinherited

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.

Definition at line 1082 of file dof_object.h.

1083 {
1084  if (_idx_buf.empty())
1085  return 0;
1086 
1087  const int hdr = dof_id_signed_type(_idx_buf[0]);
1088  if (hdr >= 0)
1089  return 0;
1090 
1091  const unsigned int start_idx_i = this->start_idx_ints();
1092 
1093  return _idx_buf.size() - start_idx_i;
1094 }

References libMesh::DofObject::_idx_buf, and libMesh::DofObject::start_idx_ints().

Referenced by libMesh::DofObject::add_extra_integers(), libMesh::DofObject::get_extra_datum(), libMesh::DofObject::get_extra_integer(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_nodes(), libMesh::Elem::refine(), libMesh::DofObject::set_extra_datum(), libMesh::DofObject::set_extra_integer(), libMesh::DofObject::set_n_systems(), libMesh::DofObject::set_n_vars_per_group(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

◆ n_objects() [1/2]

static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

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

Definition at line 83 of file reference_counter.h.

84  { return _n_objects; }

References libMesh::ReferenceCounter::_n_objects.

◆ n_objects() [2/2]

static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

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

Definition at line 83 of file reference_counter.h.

84  { return _n_objects; }

References libMesh::ReferenceCounter::_n_objects.

◆ n_pseudo_systems()

unsigned int libMesh::DofObject::n_pseudo_systems ( ) const
inlineinherited
Returns
The total number of pseudo-systems associated with this DofObject : n_systems(), plus one iff this->has_extra_integers()

Definition at line 871 of file dof_object.h.

872 {
873  const int hdr = _idx_buf.empty() ?
874  0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
875  return std::abs(hdr);
876 }

References libMesh::DofObject::_idx_buf, and std::abs().

Referenced by libMesh::DofObject::end_idx(), libMesh::DofObject::set_extra_datum(), and libMesh::DofObject::set_extra_integer().

◆ n_systems()

unsigned int libMesh::DofObject::n_systems ( ) const
inlineinherited
Returns
The number of systems associated with this DofObject

Definition at line 861 of file dof_object.h.

862 {
863  const int hdr = _idx_buf.empty() ?
864  0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
865  return hdr >= 0 ? hdr : (-hdr-1);
866 }

References libMesh::DofObject::_idx_buf.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofObject::add_system(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::DofObject::end_idx(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::DofObject::get_extra_datum(), libMesh::DofObject::get_extra_integer(), get_info(), libMesh::Elem::get_info(), libMesh::DofObject::has_dofs(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_dofs(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), libMesh::DofMap::old_dof_indices(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::Elem::refine(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_systems(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofObject::set_vg_dof_base(), libMesh::DofObject::start_idx(), libMesh::DofObject::start_idx_ints(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystems(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and libMesh::DofObject::vg_dof_base().

◆ n_var_groups()

unsigned int libMesh::DofObject::n_var_groups ( const unsigned int  s) const
inlineinherited

◆ n_vars() [1/2]

unsigned int libMesh::DofObject::n_vars ( const unsigned int  s) const
inlineinherited
Returns
The number of Variable variables associated with system s for this DofObject

Definition at line 908 of file dof_object.h.

909 {
910  libmesh_assert_less (s, this->n_systems());
911 
912  const unsigned int nvg = this->n_var_groups(s);
913 
914  unsigned int val=0;
915 
916  for (unsigned int vg=0; vg<nvg; vg++)
917  val += this->n_vars(s,vg);
918 
919  return val;
920 }

References libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), and libMesh::DofObject::n_vars().

◆ n_vars() [2/2]

unsigned int libMesh::DofObject::n_vars ( const unsigned int  s,
const unsigned int  vg 
) const
inlineinherited
Returns
The number of Variable variables associated with VariableGroup vg in system s for this DofObject

Definition at line 891 of file dof_object.h.

893 {
894  libmesh_assert_less (s, this->n_systems());
895  libmesh_assert_less (vg, this->n_var_groups(s));
896 
897  const unsigned int start_idx_sys = this->start_idx(s);
898 
899  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
900 
901  return (cast_int<unsigned int>
902  (_idx_buf[start_idx_sys + 2*vg]) >> ncv_magic_exp);
903 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::ncv_magic_exp, and libMesh::DofObject::start_idx().

Referenced by libMesh::DofObject::add_system(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::DofMap::distribute_dofs(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), get_info(), libMesh::Elem::get_info(), libMesh::DofObject::has_dofs(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_dofs(), libMesh::DofObject::n_vars(), libMesh::BuildProjectionList::operator()(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_systems(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::DofObject::system_var_to_vg_var(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNVariableGroups(), DofObjectTest< Node >::testSetNVariableGroupsExtraInts(), libMesh::DofObject::var_to_vg(), and libMesh::DofObject::var_to_vg_and_offset().

◆ norm()

auto libMesh::TypeVector< Real >::norm ( ) const-> decltype(std::norm(Real ()))
inlineinherited
Returns
The magnitude of the vector, i.e. the square-root of the sum of the elements squared.

Definition at line 955 of file type_vector.h.

956 {
957  return std::sqrt(this->norm_sq());
958 }

◆ norm_sq()

auto libMesh::TypeVector< Real >::norm_sq ( ) const-> decltype(std::norm(Real ()))
inlineinherited
Returns
The magnitude of the vector squared, i.e. the sum of the element magnitudes squared.

Definition at line 986 of file type_vector.h.

987 {
988 #if LIBMESH_DIM == 1
989  return (TensorTools::norm_sq(_coords[0]));
990 #endif
991 
992 #if LIBMESH_DIM == 2
993  return (TensorTools::norm_sq(_coords[0]) +
995 #endif
996 
997 #if LIBMESH_DIM == 3
998  return (TensorTools::norm_sq(_coords[0]) +
1001 #endif
1002 }

◆ operator!=()

bool libMesh::TypeVector< Real >::operator!= ( const TypeVector< Real > &  rhs) const
inlineinherited
Returns
!(*this == rhs)

Definition at line 1089 of file type_vector.h.

1090 {
1091  return (!(*this == rhs));
1092 }

◆ operator()() [1/2]

Real & libMesh::TypeVector< Real >::operator() ( const unsigned int  i)
inlineinherited
Returns
A writable reference to the \( i^{th} \) entry of the vector.

Definition at line 591 of file type_vector.h.

592 {
593  libmesh_assert_less (i, LIBMESH_DIM);
594 
595  return _coords[i];
596 }

◆ operator()() [2/2]

const Real & libMesh::TypeVector< Real >::operator() ( const unsigned int  i) const
inlineinherited
Returns
A const reference to the \( i^{th} \) entry of the vector.

Definition at line 580 of file type_vector.h.

581 {
582  libmesh_assert_less (i, LIBMESH_DIM);
583 
584  return _coords[i];
585 }

◆ operator*() [1/2]

boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< Real , Scalar >::supertype > >::type libMesh::TypeVector< Real >::operator* ( const Scalar &  factor) const
inlineinherited

Multiply this vector by a scalar value.

Returns
A copy of the result, this vector is unchanged.

Definition at line 777 of file type_vector.h.

778 {
779  typedef typename CompareTypes<T, Scalar>::supertype SuperType;
780 
781 #if LIBMESH_DIM == 1
782  return TypeVector<SuperType>(_coords[0]*factor);
783 #endif
784 
785 #if LIBMESH_DIM == 2
786  return TypeVector<SuperType>(_coords[0]*factor,
787  _coords[1]*factor);
788 #endif
789 
790 #if LIBMESH_DIM == 3
791  return TypeVector<SuperType>(_coords[0]*factor,
792  _coords[1]*factor,
793  _coords[2]*factor);
794 #endif
795 }

◆ operator*() [2/2]

CompareTypes< Real , T2 >::supertype libMesh::TypeVector< Real >::operator* ( const TypeVector< T2 > &  p) const
inlineinherited
Returns
The dot-product of this vector with another vector.
Note
The complex conjugate is not taken in the complex-valued case.
The vectors may contain different numeric types.

Definition at line 888 of file type_vector.h.

889 {
890 #if LIBMESH_DIM == 1
891  return _coords[0]*p._coords[0];
892 #endif
893 
894 #if LIBMESH_DIM == 2
895  return (_coords[0]*p._coords[0] +
896  _coords[1]*p._coords[1]);
897 #endif
898 
899 #if LIBMESH_DIM == 3
900  return (_coords[0]*p(0) +
901  _coords[1]*p(1) +
902  _coords[2]*p(2));
903 #endif
904 }

◆ operator*=()

const TypeVector< Real > & libMesh::TypeVector< Real >::operator*= ( const Real &  factor)
inlineinherited

Multiply this vector by a scalar value.

Returns
A reference to *this.

Definition at line 814 of file type_vector.h.

815 {
816 #if LIBMESH_DIM == 1
817  _coords[0] *= factor;
818 #endif
819 
820 #if LIBMESH_DIM == 2
821  _coords[0] *= factor;
822  _coords[1] *= factor;
823 #endif
824 
825 #if LIBMESH_DIM == 3
826  _coords[0] *= factor;
827  _coords[1] *= factor;
828  _coords[2] *= factor;
829 #endif
830 
831  return *this;
832 }

◆ operator+()

TypeVector< typename CompareTypes< Real , T2 >::supertype > libMesh::TypeVector< Real >::operator+ ( const TypeVector< T2 > &  p) const
inlineinherited

Add two vectors.

Returns
A copy of the result, this vector is unchanged.

Definition at line 604 of file type_vector.h.

605 {
606  typedef typename CompareTypes<T, T2>::supertype TS;
607 #if LIBMESH_DIM == 1
608  return TypeVector<TS> (_coords[0] + p._coords[0]);
609 #endif
610 
611 #if LIBMESH_DIM == 2
612  return TypeVector<TS> (_coords[0] + p._coords[0],
613  _coords[1] + p._coords[1]);
614 #endif
615 
616 #if LIBMESH_DIM == 3
617  return TypeVector<TS> (_coords[0] + p._coords[0],
618  _coords[1] + p._coords[1],
619  _coords[2] + p._coords[2]);
620 #endif
621 
622 }

◆ operator+=()

const TypeVector< Real > & libMesh::TypeVector< Real >::operator+= ( const TypeVector< T2 > &  p)
inlineinherited

Add to this vector.

Returns
A reference to *this.

Definition at line 629 of file type_vector.h.

630 {
631  this->add (p);
632 
633  return *this;
634 }

◆ operator-() [1/2]

TypeVector< Real > libMesh::TypeVector< Real >::operator- ( ) const
inlineinherited
Returns
The negative of this vector in a separate copy.

Definition at line 749 of file type_vector.h.

750 {
751 
752 #if LIBMESH_DIM == 1
753  return TypeVector(-_coords[0]);
754 #endif
755 
756 #if LIBMESH_DIM == 2
757  return TypeVector(-_coords[0],
758  -_coords[1]);
759 #endif
760 
761 #if LIBMESH_DIM == 3
762  return TypeVector(-_coords[0],
763  -_coords[1],
764  -_coords[2]);
765 #endif
766 
767 }

◆ operator-() [2/2]

TypeVector< typename CompareTypes< Real , T2 >::supertype > libMesh::TypeVector< Real >::operator- ( const TypeVector< T2 > &  p) const
inlineinherited

Subtract from this vector.

Returns
A copy of the result, this vector is unchanged.

Definition at line 690 of file type_vector.h.

691 {
692  typedef typename CompareTypes<T, T2>::supertype TS;
693 
694 #if LIBMESH_DIM == 1
695  return TypeVector<TS>(_coords[0] - p._coords[0]);
696 #endif
697 
698 #if LIBMESH_DIM == 2
699  return TypeVector<TS>(_coords[0] - p._coords[0],
700  _coords[1] - p._coords[1]);
701 #endif
702 
703 #if LIBMESH_DIM == 3
704  return TypeVector<TS>(_coords[0] - p._coords[0],
705  _coords[1] - p._coords[1],
706  _coords[2] - p._coords[2]);
707 #endif
708 
709 }

◆ operator-=()

const TypeVector< Real > & libMesh::TypeVector< Real >::operator-= ( const TypeVector< T2 > &  p)
inlineinherited

Subtract from this vector.

Returns
A reference to *this.

Definition at line 716 of file type_vector.h.

717 {
718  this->subtract (p);
719 
720  return *this;
721 }

◆ operator/()

boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< Real , Scalar >::supertype > >::type libMesh::TypeVector< Real >::operator/ ( const Scalar &  factor) const
inlineinherited

Divide each entry of this vector by scalar value.

Returns
A copy of the result, this vector is unchanged.

Definition at line 842 of file type_vector.h.

843 {
844  libmesh_assert_not_equal_to (factor, static_cast<T>(0.));
845 
846  typedef typename CompareTypes<T, Scalar>::supertype TS;
847 
848 #if LIBMESH_DIM == 1
849  return TypeVector<TS>(_coords[0]/factor);
850 #endif
851 
852 #if LIBMESH_DIM == 2
853  return TypeVector<TS>(_coords[0]/factor,
854  _coords[1]/factor);
855 #endif
856 
857 #if LIBMESH_DIM == 3
858  return TypeVector<TS>(_coords[0]/factor,
859  _coords[1]/factor,
860  _coords[2]/factor);
861 #endif
862 
863 }

◆ operator/=()

const TypeVector< Real > & libMesh::TypeVector< Real >::operator/= ( const Real &  factor)
inlineinherited

Divide each entry of this vector by scalar value.

Returns
A reference to *this.

Definition at line 871 of file type_vector.h.

872 {
873  libmesh_assert_not_equal_to (factor, static_cast<T>(0.));
874 
875  for (unsigned int i=0; i<LIBMESH_DIM; i++)
876  _coords[i] /= factor;
877 
878  return *this;
879 }

◆ operator<() [1/2]

bool libMesh::TypeVector< Complex >::operator< ( const TypeVector< Complex > &  rhs) const
inherited

Definition at line 140 of file type_vector.C.

141 {
142  for (unsigned int i=0; i<LIBMESH_DIM; i++)
143  {
144  if ((*this)(i).real() < rhs(i).real())
145  return true;
146  if ((*this)(i).real() > rhs(i).real())
147  return false;
148  if ((*this)(i).imag() < rhs(i).imag())
149  return true;
150  if ((*this)(i).imag() > rhs(i).imag())
151  return false;
152  }
153  return false;
154 }

◆ operator<() [2/2]

bool libMesh::TypeVector< Real >::operator< ( const TypeVector< Real > &  rhs) const
inherited
Returns
true if this vector is "less" than rhs.

Useful for sorting. Also used for choosing some arbitrary basis function orientations.

Definition at line 82 of file type_vector.C.

83 {
84  for (unsigned int i=0; i<LIBMESH_DIM; i++)
85  {
86  if ((*this)(i) < rhs(i))
87  return true;
88  if ((*this)(i) > rhs(i))
89  return false;
90  }
91  return false;
92 }

◆ operator<=() [1/2]

bool libMesh::TypeVector< Complex >::operator<= ( const TypeVector< Complex > &  rhs) const
inherited

Definition at line 159 of file type_vector.C.

160 {
161  for (unsigned int i=0; i<LIBMESH_DIM; i++)
162  {
163  if ((*this)(i).real() < rhs(i).real())
164  return true;
165  if ((*this)(i).real() > rhs(i).real())
166  return false;
167  if ((*this)(i).imag() < rhs(i).imag())
168  return true;
169  if ((*this)(i).imag() > rhs(i).imag())
170  return false;
171  }
172  return true;
173 }

◆ operator<=() [2/2]

bool libMesh::TypeVector< Real >::operator<= ( const TypeVector< Real > &  rhs) const
inherited
Returns
true if this vector is <= to rhs.

Useful for sorting. Also used for choosing some arbitrary constraint equation directions.

Definition at line 96 of file type_vector.C.

97 {
98  for (unsigned int i=0; i<LIBMESH_DIM; i++)
99  {
100  if ((*this)(i) < rhs(i))
101  return true;
102  if ((*this)(i) > rhs(i))
103  return false;
104  }
105  return true;
106 }

◆ operator=()

Node & libMesh::Node::operator= ( const Point p)
inline

Assign to a node from a point.

Definition at line 297 of file node.h.

298 {
299  (*this)(0) = p(0);
300 #if LIBMESH_DIM > 1
301  (*this)(1) = p(1);
302 #endif
303 #if LIBMESH_DIM > 2
304  (*this)(2) = p(2);
305 #endif
306 
307  return *this;
308 }

◆ operator==() [1/2]

bool libMesh::Node::operator== ( const Node rhs) const
Returns
true if this node equals rhs, false otherwise.

Definition at line 37 of file node.C.

38 {
39  // Explicitly calling the operator== defined in Point
40  return this->Point::operator==(rhs);
41 }

References libMesh::TypeVector< Real >::operator==().

◆ operator==() [2/2]

bool libMesh::TypeVector< Real >::operator== ( const TypeVector< Real > &  rhs) const
inlineinherited
Returns
true if this(i)==rhs(i) for each component of the vector.
Note
For floating point types T, the function absolute_fuzzy_equals() may be a more appropriate choice.

Definition at line 1067 of file type_vector.h.

1068 {
1069 #if LIBMESH_DIM == 1
1070  return (_coords[0] == rhs._coords[0]);
1071 #endif
1072 
1073 #if LIBMESH_DIM == 2
1074  return (_coords[0] == rhs._coords[0] &&
1075  _coords[1] == rhs._coords[1]);
1076 #endif
1077 
1078 #if LIBMESH_DIM == 3
1079  return (_coords[0] == rhs._coords[0] &&
1080  _coords[1] == rhs._coords[1] &&
1081  _coords[2] == rhs._coords[2]);
1082 #endif
1083 }

◆ operator>() [1/2]

bool libMesh::TypeVector< Complex >::operator> ( const TypeVector< Complex > &  rhs) const
inherited

Definition at line 178 of file type_vector.C.

179 {
180  for (unsigned int i=0; i<LIBMESH_DIM; i++)
181  {
182  if ((*this)(i).real() > rhs(i).real())
183  return true;
184  if ((*this)(i).real() < rhs(i).real())
185  return false;
186  if ((*this)(i).imag() > rhs(i).imag())
187  return true;
188  if ((*this)(i).imag() < rhs(i).imag())
189  return false;
190  }
191  return false;
192 }

◆ operator>() [2/2]

bool libMesh::TypeVector< Real >::operator> ( const TypeVector< Real > &  rhs) const
inherited
Returns
true if this vector is "greater" than rhs.

Useful for sorting. Also used for choosing some arbitrary basis function orientations.

Definition at line 111 of file type_vector.C.

112 {
113  for (unsigned int i=0; i<LIBMESH_DIM; i++)
114  {
115  if ((*this)(i) > rhs(i))
116  return true;
117  if ((*this)(i) < rhs(i))
118  return false;
119  }
120  return false;
121 }

◆ operator>=() [1/2]

bool libMesh::TypeVector< Complex >::operator>= ( const TypeVector< Complex > &  rhs) const
inherited

Definition at line 197 of file type_vector.C.

198 {
199  for (unsigned int i=0; i<LIBMESH_DIM; i++)
200  {
201  if ((*this)(i).real() > rhs(i).real())
202  return true;
203  if ((*this)(i).real() < rhs(i).real())
204  return false;
205  if ((*this)(i).imag() > rhs(i).imag())
206  return true;
207  if ((*this)(i).imag() < rhs(i).imag())
208  return false;
209  }
210  return true;
211 }

◆ operator>=() [2/2]

bool libMesh::TypeVector< Real >::operator>= ( const TypeVector< Real > &  rhs) const
inherited
Returns
true if this vector is >= rhs.

Useful for sorting. Also used for choosing some arbitrary constraint equation directions.

Definition at line 125 of file type_vector.C.

126 {
127  for (unsigned int i=0; i<LIBMESH_DIM; i++)
128  {
129  if ((*this)(i) > rhs(i))
130  return true;
131  if ((*this)(i) < rhs(i))
132  return false;
133  }
134  return true;
135 }

◆ pack_indexing()

void libMesh::DofObject::pack_indexing ( std::back_insert_iterator< std::vector< largest_id_type >>  target) const
inherited

A method for creating packed data from our index buffer - basically a copy with prepended size with our current implementation.

Definition at line 636 of file dof_object.C.

637 {
638 #ifdef LIBMESH_ENABLE_AMR
639  // We might need to pack old_dof_object too
640  *target++ = (old_dof_object == nullptr) ? 0 : 1;
641 #endif
642 
643  *target++ = _idx_buf.size();
644  std::copy(_idx_buf.begin(), _idx_buf.end(), target);
645 
646 #ifdef LIBMESH_ENABLE_AMR
647  if (old_dof_object)
648  old_dof_object->pack_indexing(target);
649 #endif
650 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::old_dof_object, and libMesh::DofObject::pack_indexing().

Referenced by libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), and libMesh::DofObject::pack_indexing().

◆ packed_indexing_size()

unsigned int libMesh::DofObject::packed_indexing_size ( ) const
inherited

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

Definition at line 554 of file dof_object.C.

555 {
556  return
557  cast_int<unsigned int> (
558 #ifdef LIBMESH_ENABLE_AMR
559  ((old_dof_object == nullptr) ? 0 : old_dof_object->packed_indexing_size()) + 2 +
560 #else
561  1 +
562 #endif
563  _idx_buf.size());
564 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::old_dof_object, and libMesh::DofObject::packed_indexing_size().

Referenced by libMesh::Parallel::Packing< const Node * >::packable_size(), libMesh::Parallel::Packing< const Elem * >::packable_size(), libMesh::DofObject::packed_indexing_size(), packed_size(), libMesh::Parallel::Packing< Node * >::unpack(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ packed_size()

unsigned int libMesh::Node::packed_size ( ) const
inline

Definition at line 157 of file node.h.

158  {
159  const unsigned int header_size = 2;
160 
161  // use "(a+b-1)/b" trick to get a/b to round up
162  static const unsigned int idtypes_per_Real =
163  (sizeof(Real) + sizeof(largest_id_type) - 1) / sizeof(largest_id_type);
164 
165  return header_size + LIBMESH_DIM*idtypes_per_Real +
166  this->packed_indexing_size();
167  }

References libMesh::DofObject::packed_indexing_size(), and libMesh::Real.

◆ print()

void libMesh::TypeVector< Real >::print ( std::ostream &  os = libMesh::out) const
inherited

Formatted print, by default to libMesh::out.

Definition at line 37 of file type_vector.C.

38 {
39 #if LIBMESH_DIM == 1
40 
41  os << "x=" << (*this)(0);
42 
43 #endif
44 #if LIBMESH_DIM == 2
45 
46  os << "(x,y)=("
47  << std::setw(8) << (*this)(0) << ", "
48  << std::setw(8) << (*this)(1) << ")";
49 
50 #endif
51 #if LIBMESH_DIM == 3
52 
53  os << "(x,y,z)=("
54  << std::setw(8) << (*this)(0) << ", "
55  << std::setw(8) << (*this)(1) << ", "
56  << std::setw(8) << (*this)(2) << ")";
57 #endif
58 }

◆ print_dof_info()

void libMesh::DofObject::print_dof_info ( ) const
inherited

Print out info for debugging.

Definition at line 664 of file dof_object.C.

665 {
666  libMesh::out << this->id() << " [ ";
667 
668  for (auto s : IntRange<unsigned int>(0, this->n_systems()))
669  {
670  libMesh::out << "s:" << s << " ";
671  for (auto var : IntRange<unsigned int>(0, this->n_vars(s)))
672  {
673  libMesh::out << "v:" << var << " ";
674  for (auto comp : IntRange<unsigned int>(0, this->n_comp(s,var)))
675  {
676  libMesh::out << "c:" << comp << " dof:" << this->dof_number(s,var,comp) << " ";
677  }
678  }
679  }
680 
681  libMesh::out << "]\n";
682 }

References libMesh::DofObject::dof_number(), libMesh::DofObject::id(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), and libMesh::out.

◆ print_info() [1/3]

void libMesh::Node::print_info ( std::ostream &  os = libMesh::out) const

Prints relevant information about the node.

Definition at line 45 of file node.C.

46 {
47  os << this->get_info()
48  << std::endl;
49 }

References get_info().

Referenced by libMesh::operator<<().

◆ print_info() [2/3]

void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

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

Definition at line 87 of file reference_counter.C.

88 {
90  out_stream << ReferenceCounter::get_info();
91 }

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

◆ print_info() [3/3]

void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

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

Definition at line 87 of file reference_counter.C.

88 {
90  out_stream << ReferenceCounter::get_info();
91 }

References libMesh::ReferenceCounter::_enable_print_counter, and libMesh::ReferenceCounter::get_info().

◆ processor_id() [1/3]

processor_id_type & libMesh::DofObject::processor_id ( )
inlineinherited
Returns
The processor that this DofObject belongs to as a writable reference.

Definition at line 837 of file dof_object.h.

838 {
839  return _processor_id;
840 }

References libMesh::DofObject::_processor_id.

◆ processor_id() [2/3]

processor_id_type libMesh::DofObject::processor_id ( ) const
inlineinherited
Returns
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.

Definition at line 829 of file dof_object.h.

830 {
831  return _processor_id;
832 }

References libMesh::DofObject::_processor_id.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::DistributedMesh::add_point(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Patch::build_around_element(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubProjector::construct_projection(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::Elem::Elem(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshFunction::find_element(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::Modification::flatten(), get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::DistributedMesh::insert_elem(), libMesh::DofObject::invalidate_processor_id(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::MeshTools::libmesh_assert_parallel_consistent_new_node_procids(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_parallel_consistent_procids< Node >(), libMesh::MeshTools::libmesh_assert_topology_consistent_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), AugmentSparsityOnInterface::mesh_reinit(), AugmentSparsityOnNodes::operator()(), OverlappingCouplingFunctor::operator()(), AugmentSparsityOnInterface::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SortAndCopy::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectEdges::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectSides::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectInteriors::operator()(), libMesh::DistributedMesh::own_node(), libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::XdrIO::pack_element(), libMesh::LinearPartitioner::partition_range(), libMesh::SFCPartitioner::partition_range(), libMesh::CentroidPartitioner::partition_range(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofObject::processor_id(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Elem::refine(), libMesh::DofMap::scatter_constraints(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), ParsedFEMFunctionTest::setUp(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), DofObjectTest< Node >::testInvalidateProcId(), EquationSystemsTest::testPostInitAddElem(), DofObjectTest< Node >::testSetProcId(), BoundaryInfoTest::testShellFaceConstraints(), DofObjectTest< Node >::testValidProcId(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DTKAdapter::update_variable_values(), libMesh::GmshIO::write_mesh(), and libMesh::Nemesis_IO_Helper::write_sidesets().

◆ processor_id() [3/3]

void libMesh::DofObject::processor_id ( const processor_id_type  pid)
inlineinherited

Sets the processor_id for this DofObject.

Definition at line 845 of file dof_object.h.

846 {
847  this->processor_id() = pid;
848 }

References libMesh::DofObject::processor_id().

◆ relative_fuzzy_equals()

bool libMesh::TypeVector< Real >::relative_fuzzy_equals ( const TypeVector< Real > &  rhs,
Real  tol = TOLERANCE 
) const
inlineinherited
Returns
true if two vectors are equal to within a relative tolerance of tol.

Definition at line 1042 of file type_vector.h.

1043 {
1044 #if LIBMESH_DIM == 1
1045  return this->absolute_fuzzy_equals(rhs, tol *
1046  (std::abs(_coords[0]) + std::abs(rhs._coords[0])));
1047 #endif
1048 
1049 #if LIBMESH_DIM == 2
1050  return this->absolute_fuzzy_equals(rhs, tol *
1051  (std::abs(_coords[0]) + std::abs(rhs._coords[0]) +
1052  std::abs(_coords[1]) + std::abs(rhs._coords[1])));
1053 #endif
1054 
1055 #if LIBMESH_DIM == 3
1056  return this->absolute_fuzzy_equals(rhs, tol *
1057  (std::abs(_coords[0]) + std::abs(rhs._coords[0]) +
1058  std::abs(_coords[1]) + std::abs(rhs._coords[1]) +
1059  std::abs(_coords[2]) + std::abs(rhs._coords[2])));
1060 #endif
1061 }

◆ set_buffer()

void libMesh::DofObject::set_buffer ( const std::vector< dof_id_type > &  buf)
inlineinherited

Definition at line 650 of file dof_object.h.

651  { _idx_buf = buf; }

References libMesh::DofObject::_idx_buf.

Referenced by DofObjectTest< Node >::testJensEftangBug().

◆ set_dof_number()

void libMesh::DofObject::set_dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp,
const dof_id_type  dn 
)
inherited

Sets the global degree of freedom number for variable var, component comp for system s associated with this DofObject.

Definition at line 467 of file dof_object.C.

471 {
472  libmesh_assert_less (s, this->n_systems());
473  libmesh_assert_less (var, this->n_vars(s));
474  libmesh_assert_less (comp, this->n_comp(s,var));
475 
476  const unsigned int
477  vg = this->var_to_vg(s,var),
478 #ifndef NDEBUG
479  ncg = this->n_comp_group(s,vg),
480 #endif
481  vig = this->system_var_to_vg_var(s,vg,var),
482  start_idx_sys = this->start_idx(s);
483 
484  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
485 
486  dof_id_type & base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
487 
488  // We intend to change all dof numbers together or not at all
489  if (comp || vig)
490  libmesh_assert ((dn == invalid_id && base_idx == invalid_id) ||
491  (dn == base_idx + vig*ncg + comp));
492 
493  // only explicitly store the base index for vig==0, comp==0
494  else
495  base_idx = dn;
496 
497  libmesh_assert_equal_to (this->dof_number(s, var, comp), dn);
498 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::dof_number(), libMesh::DofObject::invalid_id, libMesh::libmesh_assert(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), libMesh::DofObject::start_idx(), libMesh::DofObject::system_var_to_vg_var(), and libMesh::DofObject::var_to_vg().

◆ set_extra_datum()

template<typename T >
void libMesh::DofObject::set_extra_datum ( const unsigned int  index,
const T  value 
)
inlineinherited

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.

Definition at line 1042 of file dof_object.h.

1044 {
1045 #ifndef NDEBUG
1046  const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1047 #endif
1048  libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1049  libmesh_assert_less(this->n_pseudo_systems(), _idx_buf.size());
1050 
1051  const unsigned int start_idx_i = this->start_idx_ints();
1052 
1053  libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1054  std::memcpy(&_idx_buf[start_idx_i+index], &value, sizeof(T));
1055 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_pseudo_systems(), libMesh::DofObject::start_idx_ints(), and value.

Referenced by libMesh::DynaIO::read_mesh(), and DofObjectTest< Node >::testAddExtraData().

◆ set_extra_integer()

void libMesh::DofObject::set_extra_integer ( const unsigned int  index,
const dof_id_type  value 
)
inlineinherited

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.

Definition at line 1010 of file dof_object.h.

1012 {
1013  libmesh_assert_less(index, this->n_extra_integers());
1014  libmesh_assert_less(this->n_pseudo_systems(), _idx_buf.size());
1015 
1016  const unsigned int start_idx_i = this->start_idx_ints();
1017 
1018  libmesh_assert_less(start_idx_i+index, _idx_buf.size());
1019  _idx_buf[start_idx_i+index] = value;
1020 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_pseudo_systems(), libMesh::DofObject::start_idx_ints(), and value.

Referenced by libMesh::UnstructuredMesh::create_submesh(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_nodes(), libMesh::Elem::refine(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), DofObjectTest< Node >::testSetNSystemsExtraInts(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

◆ set_id() [1/2]

dof_id_type & libMesh::DofObject::set_id ( )
inlineinherited
Returns
The id for this DofObject as a writable reference.

Definition at line 776 of file dof_object.h.

777 {
778  return _id;
779 }

References libMesh::DofObject::_id.

Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Subdivision::all_subdivision(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_elem(), GetBoundaryPointsTest::build_mesh(), SlitMeshTest::build_mesh(), OverlappingTestBase::build_quad_mesh(), libMesh::UnstructuredMesh::create_submesh(), libMesh::UNVIO::elements_in(), libMesh::MeshTools::Modification::flatten(), libMesh::DofObject::invalidate_id(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::RBDataDeserialization::load_rb_eim_evaluation_data(), Node(), libMesh::DistributedMesh::own_node(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::VTKIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::UCDIO::read_implementation(), libMesh::GmshIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::OFFIO::read_stream(), libMesh::MatlabIO::read_stream(), libMesh::RemoteElem::RemoteElem(), libMesh::ReplicatedMesh::renumber_elem(), libMesh::DistributedMesh::renumber_elem(), libMesh::ReplicatedMesh::renumber_node(), libMesh::DistributedMesh::renumber_node(), libMesh::ReplicatedMesh::renumber_nodes_and_elements(), libMesh::DofObject::set_id(), DofObjectTest< Node >::testInvalidateId(), EquationSystemsTest::testPostInitAddElem(), SystemsTest::testProjectMatrix3D(), DofObjectTest< Node >::testSetId(), DofObjectTest< Node >::testValidId(), libMesh::Parallel::Packing< Node * >::unpack(), and libMesh::Parallel::Packing< Elem * >::unpack().

◆ set_id() [2/2]

void libMesh::DofObject::set_id ( const dof_id_type  dofid)
inlineinherited

Sets the id for this DofObject.

Definition at line 156 of file dof_object.h.

157  { this->set_id() = dofid; }

References libMesh::DofObject::set_id().

◆ set_n_comp()

void libMesh::DofObject::set_n_comp ( const unsigned int  s,
const unsigned int  var,
const unsigned int  ncomp 
)
inherited

Sets the number of components for Variable var of system s associated with this DofObject.

Definition at line 398 of file dof_object.C.

401 {
402  libmesh_assert_less (s, this->n_systems());
403  libmesh_assert_less (var, this->n_vars(s));
404 
405  this->set_n_comp_group(s, this->var_to_vg(s,var), ncomp);
406 }

References libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), libMesh::DofObject::set_n_comp_group(), and libMesh::DofObject::var_to_vg().

◆ set_n_comp_group()

void libMesh::DofObject::set_n_comp_group ( const unsigned int  s,
const unsigned int  vg,
const unsigned int  ncomp 
)
inherited

Sets the number of components for VariableGroup vg of system s associated with this DofObject.

Definition at line 410 of file dof_object.C.

413 {
414  libmesh_assert_less (s, this->n_systems());
415  libmesh_assert_less (vg, this->n_var_groups(s));
416 
417  // Check for trivial return
418  if (ncomp == this->n_comp_group(s,vg)) return;
419 
420 #ifndef NDEBUG
421  if (ncomp >= ncv_magic)
422  {
423  const index_t ncvm = ncv_magic;
424  libmesh_error_msg("ERROR: ncomp must be less than DofObject::ncv_magic!\n" \
425  << "ncomp = " \
426  << ncomp \
427  << ", ncv_magic = " \
428  << ncvm \
429  << "\nrecompile and try again!");
430  }
431 #endif
432 
433  const unsigned int
434  start_idx_sys = this->start_idx(s),
435  n_vars_group = this->n_vars(s,vg),
436  base_offset = start_idx_sys + 2*vg;
437 
438  libmesh_assert_less ((base_offset + 1), _idx_buf.size());
439 
440  // if (ncomp)
441  // libMesh::out << "s,vg,ncomp="
442  // << s << ","
443  // << vg << ","
444  // << ncomp << '\n';
445 
446  // set the number of components, maintaining the number
447  // of variables in the group
448  _idx_buf[base_offset] = ncv_magic*n_vars_group + ncomp;
449 
450  // We use (invalid_id - 1) to signify no
451  // components for this object
452  _idx_buf[base_offset + 1] = (ncomp == 0) ? invalid_id - 1 : invalid_id;
453 
454  // this->debug_buffer();
455  // libMesh::out << "s,vg = " << s << "," << vg << '\n'
456  // << "base_offset=" << base_offset << '\n'
457  // << "this->n_comp(s,vg)=" << this->n_comp(s,vg) << '\n'
458  // << "this->n_comp_group(s,vg)=" << this->n_comp_group(s,vg) << '\n'
459  // << "this->n_vars(s,vg)=" << this->n_vars(s,vg) << '\n'
460  // << "this->n_var_groups(s)=" << this->n_var_groups(s) << '\n';
461 
462  libmesh_assert_equal_to (ncomp, this->n_comp_group(s,vg));
463 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::invalid_id, libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), libMesh::DofObject::ncv_magic, and libMesh::DofObject::start_idx().

Referenced by libMesh::DofMap::reinit(), libMesh::DofObject::set_n_comp(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), and DofObjectTest< Node >::testManualDofCalculation().

◆ set_n_systems()

void libMesh::DofObject::set_n_systems ( const unsigned int  s)
inherited

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.

Definition at line 165 of file dof_object.C.

166 {
167  const unsigned int old_ns = this->n_systems();
168 
169  // Check for trivial return
170  if (ns == old_ns)
171  return;
172 
173  const unsigned int nei = this->n_extra_integers();
174  const dof_id_type header_size = ns + bool(nei);
175  const dof_id_type hdr = nei ? -header_size : header_size;
176  index_buffer_t new_buf(header_size + nei, hdr);
177  if (nei)
178  {
179  const unsigned int start_idx_ints = old_ns ?
180  cast_int<unsigned int>(_idx_buf[old_ns]) :
181  1;
182  libmesh_assert_less(start_idx_ints, _idx_buf.size());
183  std::copy(_idx_buf.begin()+start_idx_ints,
184  _idx_buf.end(),
185  new_buf.begin()+header_size);
186  if (ns)
187  std::fill(new_buf.begin()+1, new_buf.begin()+ns+1, ns+1);
188  }
189 
190  // vector swap trick to force deallocation when shrinking
191  new_buf.swap(_idx_buf);
192 
193 #ifdef DEBUG
194  libmesh_assert_equal_to(nei, this->n_extra_integers());
195 
196  // check that all systems now exist and that they have 0 size
197  libmesh_assert_equal_to (ns, this->n_systems());
198  for (auto s : IntRange<unsigned int>(0, this->n_systems()))
199  {
200  libmesh_assert_equal_to (this->n_vars(s), 0);
201  libmesh_assert_equal_to (this->n_var_groups(s), 0);
202  }
203 #endif
204 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), and libMesh::DofObject::start_idx_ints().

Referenced by libMesh::DofObject::add_system(), libMesh::DofObject::clear_dofs(), libMesh::Elem::refine(), DofObjectTest< Node >::testManualDofCalculation(), DofObjectTest< Node >::testSetNSystems(), DofObjectTest< Node >::testSetNSystemsExtraInts(), DofObjectTest< Node >::testSetNVariableGroups(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

◆ set_n_vars_per_group()

void libMesh::DofObject::set_n_vars_per_group ( const unsigned int  s,
const std::vector< unsigned int > &  nvpg 
)
inherited

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)).

Definition at line 260 of file dof_object.C.

262 {
263  const unsigned int n_sys = this->n_systems();
264 
265  libmesh_assert_less (s, n_sys);
266 
267  // number of variable groups for this system - inferred
268  const unsigned int nvg = cast_int<unsigned int>(nvpg.size());
269 
270  // BSK - note that for compatibility with the previous implementation
271  // calling this method when (nvars == this->n_vars()) requires that
272  // we invalidate the DOF indices and set the number of components to 0.
273  // Note this was a bit of a surprise to me - there was no quick return in
274  // the old method, which caused removal and readdition of the DOF indices
275  // even in the case of (nvars == this->n_vars()), resulting in n_comp(s,v)
276  // implicitly becoming 0 regardless of any previous value.
277  // quick return?
278  if (nvg == this->n_var_groups(s))
279  {
280  for (unsigned int vg=0; vg<nvg; vg++)
281  {
282  this->set_n_comp_group(s,vg,0);
283  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
284  }
285  return;
286  }
287 
288  const bool hei = this->has_extra_integers();
289 
290  // since there is ample opportunity to screw up other systems, let us
291  // cache their current sizes and later assert that they are unchanged.
292 #ifdef DEBUG
293  const unsigned int nei = this->n_extra_integers();
294 
295  DofObject::index_buffer_t old_system_sizes, old_extra_integers;
296  old_system_sizes.reserve(n_sys);
297  old_extra_integers.reserve(nei);
298 
299  for (unsigned int s_ctr=0; s_ctr<n_sys; s_ctr++)
300  old_system_sizes.push_back(this->n_var_groups(s_ctr));
301 
302  for (unsigned int ei=0; ei != nei; ++ei)
303  old_extra_integers.push_back(this->get_extra_integer(ei));
304 #endif
305 
306  // remove current indices if we have some
307  if (this->n_var_groups(s) != 0)
308  {
309  const unsigned int old_nvg_s = this->n_var_groups(s);
310 
311  DofObject::index_buffer_t::iterator
312  it = _idx_buf.begin(),
313  end = _idx_buf.begin();
314 
315  std::advance(it, this->start_idx(s));
316  std::advance(end, this->end_idx(s));
317  _idx_buf.erase(it,end);
318 
319  for (unsigned int ctr=(s+1); ctr<n_sys; ctr++)
320  _idx_buf[ctr] -= 2*old_nvg_s;
321 
322  if (hei)
323  _idx_buf[n_sys] -= 2*old_nvg_s;
324  }
325 
326  // better not have any now!
327  libmesh_assert_equal_to (this->n_var_groups(s), 0);
328 
329  // Make sure we didn't screw up any of our sizes!
330 #ifdef DEBUG
331  for (auto s_ctr : IntRange<unsigned int>(0, this->n_systems()))
332  if (s_ctr != s)
333  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
334 
335  libmesh_assert_equal_to (nei, this->n_extra_integers());
336 
337  for (unsigned int ei=0; ei != nei; ++ei)
338  libmesh_assert_equal_to(old_extra_integers[ei], this->get_extra_integer(ei));
339 #endif
340 
341  // OK, if the user requested 0 that is what we have
342  if (nvg == 0)
343  return;
344 
345  {
346  // array to hold new indices
347  DofObject::index_buffer_t var_idxs(2*nvg);
348  for (unsigned int vg=0; vg<nvg; vg++)
349  {
350  var_idxs[2*vg ] = ncv_magic*nvpg[vg] + 0;
351  var_idxs[2*vg + 1] = invalid_id - 1;
352  }
353 
354  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
355  std::advance(it, this->end_idx(s));
356  _idx_buf.insert(it, var_idxs.begin(), var_idxs.end());
357 
358  for (unsigned int ctr=(s+1); ctr<n_sys; ctr++)
359  _idx_buf[ctr] += 2*nvg;
360 
361  if (hei)
362  _idx_buf[n_sys] += 2*nvg;
363 
364  // resize _idx_buf to fit so no memory is wasted.
366  }
367 
368  libmesh_assert_equal_to (nvg, this->n_var_groups(s));
369 
370 #ifdef DEBUG
371 
372  libmesh_assert_equal_to (this->n_var_groups(s), nvpg.size());
373 
374  for (auto vg : IntRange<unsigned int>(0, this->n_var_groups(s)))
375  {
376  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
377  libmesh_assert_equal_to (this->n_comp_group(s,vg), 0);
378  }
379 
380  for (auto v : IntRange<unsigned int>(0, this->n_vars(s)))
381  libmesh_assert_equal_to (this->n_comp(s,v), 0);
382 
383  // again, all other system sizes should be unchanged!
384  for (auto s_ctr : IntRange<unsigned int>(0, this->n_systems()))
385  if (s_ctr != s)
386  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
387 
388  // Extra integers count and values should also be unchanged!
389  libmesh_assert_equal_to (nei, this->n_extra_integers());
390 
391  for (unsigned int ei=0; ei != nei; ++ei)
392  libmesh_assert_equal_to(old_extra_integers[ei], this->get_extra_integer(ei));
393 #endif
394 }

References libMesh::DofObject::_idx_buf, end, libMesh::DofObject::end_idx(), libMesh::DofObject::get_extra_integer(), libMesh::DofObject::has_extra_integers(), libMesh::DofObject::invalid_id, libMesh::DofObject::n_comp(), libMesh::DofObject::n_comp_group(), libMesh::DofObject::n_extra_integers(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::n_vars(), libMesh::DofObject::ncv_magic, libMesh::DofObject::set_n_comp_group(), and libMesh::DofObject::start_idx().

Referenced by DofObjectTest< Node >::testManualDofCalculation(), DofObjectTest< Node >::testSetNVariableGroups(), and DofObjectTest< Node >::testSetNVariableGroupsExtraInts().

◆ set_old_dof_object()

void libMesh::DofObject::set_old_dof_object ( )
inherited

Sets the old_dof_object to a copy of this.

Definition at line 150 of file dof_object.C.

151 {
152  this->clear_old_dof_object();
153 
155 
156  // Make a new DofObject, assign a copy of \p this.
157  // Make sure the copy ctor for DofObject works!!
158  this->old_dof_object = new DofObject(*this);
159 }

References libMesh::DofObject::clear_old_dof_object(), libMesh::DofObject::DofObject(), libMesh::libmesh_assert(), and libMesh::DofObject::old_dof_object.

◆ set_unique_id()

unique_id_type & libMesh::DofObject::set_unique_id ( )
inlineinherited

◆ set_valence()

void libMesh::Node::set_valence ( unsigned int  val)
inline

Sets the number of nodes connected with this node.

Definition at line 354 of file node.h.

355 {
356  _valence = cast_int<valence_idx_t>(val);
357 }

References _valence.

◆ set_vg_dof_base()

void libMesh::DofObject::set_vg_dof_base ( const unsigned int  s,
const unsigned int  vg,
const dof_id_type  db 
)
inlineinherited

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

Definition at line 1209 of file dof_object.h.

1212 {
1213  libmesh_assert_less (s, this->n_systems());
1214  libmesh_assert_less (vg, this->n_var_groups(s));
1215 
1216  const unsigned int
1217  start_idx_sys = this->start_idx(s);
1218 
1219  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1220 
1221  _idx_buf[start_idx_sys + 2*vg + 1] = db;
1222 
1223  libmesh_assert_equal_to (this->vg_dof_base(s,vg), db);
1224 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), libMesh::DofObject::start_idx(), and libMesh::DofObject::vg_dof_base().

Referenced by libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofObject::invalidate_dofs(), libMesh::DofMap::reinit(), libMesh::DofMap::set_nonlocal_dof_objects(), and DofObjectTest< Node >::testManualDofCalculation().

◆ size()

auto libMesh::TypeVector< Real >::size ( ) const-> decltype(std::norm(Real ()))
inlineinherited
Returns
The magnitude of the vector, i.e. the square-root of the sum of the elements squared.

Definition at line 944 of file type_vector.h.

945 {
946  libmesh_deprecated();
947  return this->norm();
948 }

◆ size_sq()

auto libMesh::TypeVector< Real >::size_sq ( ) const-> decltype(std::norm(Real ()))
inlineinherited
Returns
The magnitude of the vector squared, i.e. the sum of the element magnitudes squared.

Definition at line 975 of file type_vector.h.

976 {
977  libmesh_deprecated();
978  return this->norm_sq();
979 }

◆ slice() [1/2]

Real & libMesh::TypeVector< Real >::slice ( const unsigned int  i)
inlineinherited

Definition at line 180 of file type_vector.h.

180 { return (*this)(i); }

◆ slice() [2/2]

const Real & libMesh::TypeVector< Real >::slice ( const unsigned int  i) const
inlineinherited

Definition at line 174 of file type_vector.h.

174 { return (*this)(i); }

◆ start_idx()

unsigned int libMesh::DofObject::start_idx ( const unsigned int  s) const
inlineprivateinherited

◆ start_idx_ints()

unsigned int libMesh::DofObject::start_idx_ints ( ) const
inlineprivateinherited

The starting index for an extra_integers pseudosystem.

Definition at line 1185 of file dof_object.h.

1186 {
1188 
1189  unsigned int n_sys = this->n_systems();
1190 
1191  libmesh_assert_less(this->n_systems(), _idx_buf.size());
1192  return n_sys ? cast_int<unsigned int>(_idx_buf[this->n_systems()]) :
1193  (n_sys+1);
1194 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::has_extra_integers(), libMesh::libmesh_assert(), and libMesh::DofObject::n_systems().

Referenced by libMesh::DofObject::get_extra_datum(), libMesh::DofObject::get_extra_integer(), libMesh::DofObject::n_extra_integers(), libMesh::DofObject::set_extra_datum(), libMesh::DofObject::set_extra_integer(), and libMesh::DofObject::set_n_systems().

◆ subtract()

void libMesh::TypeVector< Real >::subtract ( const TypeVector< T2 > &  p)
inlineinherited

Subtract from this vector without creating a temporary.

Definition at line 728 of file type_vector.h.

729 {
730  for (unsigned int i=0; i<LIBMESH_DIM; i++)
731  _coords[i] -= p._coords[i];
732 }

◆ subtract_scaled()

void libMesh::TypeVector< Real >::subtract_scaled ( const TypeVector< T2 > &  p,
const Real &  factor 
)
inlineinherited

Subtract a scaled value from this vector without creating a temporary.

Definition at line 739 of file type_vector.h.

740 {
741  for (unsigned int i=0; i<LIBMESH_DIM; i++)
742  _coords[i] -= factor*p(i);
743 }

◆ system_var_to_vg_var()

unsigned int libMesh::DofObject::system_var_to_vg_var ( const unsigned int  s,
const unsigned int  vg,
const unsigned int  var 
) const
inlineprivateinherited

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

Definition at line 1271 of file dof_object.h.

1274 {
1275  unsigned int accumulated_sum=0;
1276 
1277  for (unsigned int vgc=0; vgc<vg; vgc++)
1278  accumulated_sum += this->n_vars(s,vgc);
1279 
1280  libmesh_assert_less_equal (accumulated_sum, var);
1281 
1282  return (var - accumulated_sum);
1283 }

References libMesh::DofObject::n_vars().

Referenced by libMesh::DofObject::set_dof_number().

◆ unique_id()

unique_id_type libMesh::DofObject::unique_id ( ) const
inlineinherited

◆ unit()

TypeVector< Real > libMesh::TypeVector< Real >::unit ( ) const
inlineinherited
Returns
A unit vector in the direction of *this.

Definition at line 1158 of file type_vector.h.

1159 {
1160 
1161  auto && length = norm();
1162 
1163  libmesh_assert_not_equal_to (length, static_cast<Real>(0.));
1164 
1165 #if LIBMESH_DIM == 1
1166  return TypeVector<T>(_coords[0]/length);
1167 #endif
1168 
1169 #if LIBMESH_DIM == 2
1170  return TypeVector<T>(_coords[0]/length,
1171  _coords[1]/length);
1172 #endif
1173 
1174 #if LIBMESH_DIM == 3
1175  return TypeVector<T>(_coords[0]/length,
1176  _coords[1]/length,
1177  _coords[2]/length);
1178 #endif
1179 
1180 }

◆ unpack_indexing()

void libMesh::DofObject::unpack_indexing ( std::vector< largest_id_type >::const_iterator  begin)
inherited

A method for creating our index buffer from packed data - basically with our current implementation we investigate the size term and then copy.

Definition at line 589 of file dof_object.C.

590 {
591  _idx_buf.clear();
592 
593 #ifdef LIBMESH_ENABLE_AMR
594  this->clear_old_dof_object();
595  const bool has_old_dof_object = cast_int<bool>(*begin++);
596 #endif
597 
598  const largest_id_type size = *begin++;
599  _idx_buf.reserve(size);
600  std::copy(begin, begin+size, back_inserter(_idx_buf));
601 
602  // Check as best we can for internal consistency now
603  libmesh_assert(_idx_buf.empty() ||
605  cast_int<dof_id_signed_type>(_idx_buf.size())));
606 #ifdef DEBUG
607  if (!_idx_buf.empty())
608  {
609  const int hdr = cast_int<int>(dof_id_signed_type(_idx_buf[0]));
610  const unsigned int ns = hdr >= 0 ? hdr : (-hdr-1);
611  for (unsigned int i=1; i < ns; ++i)
612  {
613  libmesh_assert_greater_equal (_idx_buf[i], _idx_buf[i-1]);
614  libmesh_assert_equal_to ((_idx_buf[i] - _idx_buf[i-1])%2, 0);
615  libmesh_assert_less_equal (_idx_buf[i], _idx_buf.size());
616  }
617  if (hdr < 0 && ns > 0)
618  {
619  libmesh_assert_greater_equal(_idx_buf[ns], _idx_buf[ns-1]);
620  libmesh_assert_less_equal(_idx_buf[ns], _idx_buf.size());
621  }
622  }
623 #endif
624 
625 #ifdef LIBMESH_ENABLE_AMR
626  if (has_old_dof_object)
627  {
628  this->old_dof_object = new DofObject();
629  this->old_dof_object->unpack_indexing(begin+size);
630  }
631 #endif
632 }

References libMesh::DofObject::_idx_buf, std::abs(), libMesh::DofObject::clear_old_dof_object(), libMesh::DofObject::DofObject(), libMesh::libmesh_assert(), libMesh::DofObject::old_dof_object, and libMesh::DofObject::unpack_indexing().

Referenced by libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::DofObject::unpack_indexing().

◆ unpackable_indexing_size()

unsigned int libMesh::DofObject::unpackable_indexing_size ( std::vector< largest_id_type >::const_iterator  begin)
staticinherited

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

Definition at line 569 of file dof_object.C.

570 {
571 #ifdef LIBMESH_ENABLE_AMR
572  const bool has_old_dof_object = cast_int<bool>(*begin++);
573 
574  static const int dof_header_size = 2;
575 #else
576  static const bool has_old_dof_object = false;
577  static const int dof_header_size = 1;
578 #endif
579 
580  const largest_id_type this_indexing_size = *begin++;
581 
582  return cast_int<unsigned int>
583  (dof_header_size + this_indexing_size +
584  (has_old_dof_object ?
585  unpackable_indexing_size(begin+this_indexing_size) : 0));
586 }

Referenced by libMesh::Parallel::Packing< const Elem * >::packed_size(), libMesh::Parallel::Packing< const Node * >::packed_size(), and libMesh::Parallel::Packing< Node * >::unpack().

◆ valence()

unsigned int libMesh::Node::valence ( ) const
inline
Returns
The number of nodes connected with this node. Currently, this value is invalid (zero) except for subdivision meshes.

Definition at line 176 of file node.h.

177  {
178 #ifdef LIBMESH_ENABLE_NODE_VALENCE
179  return _valence;
180 #else
181  libmesh_not_implemented();
182  return libMesh::invalid_uint;
183 #endif
184  }

References _valence, and libMesh::invalid_uint.

Referenced by libMesh::Tri3Subdivision::get_ordered_valence().

◆ valid_id()

bool libMesh::DofObject::valid_id ( ) const
inlineinherited

◆ valid_processor_id()

bool libMesh::DofObject::valid_processor_id ( ) const
inlineinherited
Returns
true if this DofObject has a valid id set, false otherwise.

Definition at line 853 of file dof_object.h.

854 {
856 }

References libMesh::DofObject::_processor_id, and libMesh::DofObject::invalid_processor_id.

Referenced by DofObjectTest< Node >::testInvalidateProcId(), and DofObjectTest< Node >::testValidProcId().

◆ valid_unique_id()

bool libMesh::DofObject::valid_unique_id ( ) const
inlineinherited

◆ var_to_vg()

unsigned int libMesh::DofObject::var_to_vg ( const unsigned int  s,
const unsigned int  var 
) const
inlineprivateinherited

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

Definition at line 1253 of file dof_object.h.

1255 {
1256  const unsigned int
1257  nvg = this->n_var_groups(s);
1258 
1259  for (unsigned int vg=0, vg_end=0; vg<nvg; vg++)
1260  {
1261  vg_end += this->n_vars(s,vg);
1262  if (var < vg_end) return vg;
1263  }
1264 
1265  libmesh_error_msg("Error: could not map variable " << var << " to variable group.");
1266 }

References libMesh::DofObject::n_var_groups(), and libMesh::DofObject::n_vars().

Referenced by libMesh::DofObject::n_comp(), libMesh::DofObject::set_dof_number(), and libMesh::DofObject::set_n_comp().

◆ var_to_vg_and_offset()

std::pair< unsigned int, unsigned int > libMesh::DofObject::var_to_vg_and_offset ( const unsigned int  s,
const unsigned int  var 
) const
inlineinherited
Returns
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

Definition at line 1112 of file dof_object.h.

1114 {
1115  std::pair<unsigned int, unsigned int> returnval(0,0);
1116 
1117  unsigned int & vg = returnval.first;
1118  unsigned int & offset = returnval.second;
1119 
1120  unsigned int vg_start = 0;
1121  for (; ; vg++)
1122  {
1123  libmesh_assert_less(vg, this->n_var_groups(s));
1124 
1125  const unsigned int vg_end = vg_start + this->n_vars(s,vg);
1126  if (var < vg_end)
1127  {
1128  offset = var - vg_start;
1129  return returnval;
1130  }
1131  vg_start = vg_end;
1132  }
1133 }

References libMesh::DofObject::n_var_groups(), and libMesh::DofObject::n_vars().

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::DofObject::dof_number(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), and libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs().

◆ vg_dof_base()

dof_id_type libMesh::DofObject::vg_dof_base ( const unsigned int  s,
const unsigned int  vg 
) const
inlineinherited

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

Definition at line 1229 of file dof_object.h.

1231 {
1232  libmesh_assert_less (s, this->n_systems());
1233  libmesh_assert_less (vg, this->n_var_groups(s));
1234 
1235  const unsigned int
1236  start_idx_sys = this->start_idx(s);
1237 
1238  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1239 
1240  // #ifdef DEBUG
1241  // std::cout << " [ ";
1242  // for (auto i : _idx_buf)
1243  // std::cout << i << " ";
1244  // std::cout << "]\n";
1245  // #endif
1246 
1247  return _idx_buf[start_idx_sys + 2*vg + 1];
1248 }

References libMesh::DofObject::_idx_buf, libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), and libMesh::DofObject::start_idx().

Referenced by libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::reinit(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::DofObject::set_vg_dof_base(), and DofObjectTest< Node >::testManualDofCalculation().

◆ write_unformatted()

void libMesh::TypeVector< Real >::write_unformatted ( std::ostream &  out,
const bool  newline = true 
) const
inherited

Unformatted print to the stream out.

Simply prints the elements of the vector separated by spaces. Also prints a newline by default, however, this behavior can be controlled with the newline parameter.

Definition at line 65 of file type_vector.C.

67 {
68  libmesh_assert (os);
69 
70  os << std::setiosflags(std::ios::showpoint)
71  << (*this)(0) << " "
72  << (*this)(1) << " "
73  << (*this)(2) << " ";
74 
75  if (newline)
76  os << '\n';
77 }

◆ zero()

void libMesh::TypeVector< Real >::zero ( )
inlineinherited

Set all entries of the vector to 0.

Definition at line 964 of file type_vector.h.

965 {
966  for (unsigned int i=0; i<LIBMESH_DIM; i++)
967  _coords[i] = 0.;
968 }

Friends And Related Function Documentation

◆ Elem

friend class Elem
friend

Definition at line 204 of file node.h.

◆ MeshRefinement

friend class MeshRefinement
friend

This class need access to the node key information, but no one else should be able to mess with it.

Definition at line 203 of file node.h.

Member Data Documentation

◆ _coords

Real libMesh::TypeVector< Real >::_coords[LIBMESH_DIM]
protectedinherited

The coordinates of the TypeVector.

Definition at line 445 of file type_vector.h.

◆ _counts [1/2]

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

◆ _counts [2/2]

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

◆ _enable_print_counter [1/2]

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

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

Definition at line 141 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

◆ _enable_print_counter [2/2]

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

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

Definition at line 141 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info(), and libMesh::ReferenceCounter::print_info().

◆ _id

dof_id_type libMesh::DofObject::_id
privateinherited

◆ _idx_buf

index_buffer_t libMesh::DofObject::_idx_buf
privateinherited

◆ _mutex [1/2]

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 135 of file reference_counter.h.

◆ _mutex [2/2]

Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 135 of file reference_counter.h.

◆ _n_objects [1/2]

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

The number of objects.

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

Definition at line 130 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

◆ _n_objects [2/2]

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

The number of objects.

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

Definition at line 130 of file reference_counter.h.

Referenced by libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter(), and libMesh::ReferenceCounter::~ReferenceCounter().

◆ _processor_id

processor_id_type libMesh::DofObject::_processor_id
privateinherited

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??

Definition at line 527 of file dof_object.h.

Referenced by libMesh::DofObject::operator=(), libMesh::DofObject::processor_id(), and libMesh::DofObject::valid_processor_id().

◆ _unique_id

unique_id_type libMesh::DofObject::_unique_id
privateinherited

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

Definition at line 510 of file dof_object.h.

Referenced by libMesh::DofObject::operator=(), libMesh::DofObject::set_unique_id(), libMesh::DofObject::unique_id(), and libMesh::DofObject::valid_unique_id().

◆ _valence

valence_idx_t libMesh::Node::_valence
private

The number of nodes connected with this node.

Currently, this value is invalid (zero) except for subdivision meshes.

Definition at line 217 of file node.h.

Referenced by set_valence(), and valence().

◆ invalid_id

const dof_id_type libMesh::DofObject::invalid_id = static_cast<dof_id_type>(-1)
staticinherited

An invalid id to distinguish an uninitialized DofObject.

Definition at line 421 of file dof_object.h.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), active(), libMesh::DofObject::add_extra_integers(), libMesh::TopologyMap::add_node(), libMesh::MeshRefinement::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Elem::bracketing_nodes(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::TopologyMap::find(), libMesh::DofMap::gather_constraints(), libMesh::ReplicatedMesh::insert_node(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::invalidate_id(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), Node(), libMesh::Elem::node_id(), libMesh::DofMap::old_dof_indices(), libMesh::DistributedMesh::own_node(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::XdrIO::pack_element(), libMesh::SFCPartitioner::partition_range(), libMesh::Elem::point(), libMesh::System::read_legacy_data(), libMesh::DynaIO::read_mesh(), libMesh::System::read_parallel_data(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::DofMap::SCALAR_dof_indices(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Parallel::sync_node_data_by_element_id_once(), ExtraIntegersTest::test_and_set_initial_data(), DofObjectTest< Node >::testAddExtraData(), DofObjectTest< Node >::testAddSystemExtraInts(), NodalNeighborsTest::testEdge2(), NodalNeighborsTest::testEdge3(), NodalNeighborsTest::testEdge4(), DofObjectTest< Node >::testSetNSystemsExtraInts(), DofObjectTest< Node >::testSetNVariableGroupsExtraInts(), DofObjectTest< Node >::testValidId(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DofObject::valid_id(), and libMesh::System::write_parallel_data().

◆ invalid_processor_id

const processor_id_type libMesh::DofObject::invalid_processor_id = static_cast<processor_id_type>(-1)
staticinherited

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

Definition at line 432 of file dof_object.h.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshCommunication::allgather(), choose_processor_id(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubProjector::construct_projection(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::Elem::Elem(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::MeshCommunication::find_global_indices(), libMesh::DistributedMesh::insert_elem(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::insert_id(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::insert_ids(), libMesh::DofObject::invalidate_processor_id(), libMesh::MeshTools::libmesh_assert_consistent_distributed(), libMesh::MeshTools::libmesh_assert_consistent_distributed_nodes(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::MeshCommunication::make_new_node_proc_ids_parallel_consistent(), libMesh::DistributedMesh::n_active_elem(), libMesh::MeshBase::n_unpartitioned_elem(), libMesh::MeshBase::n_unpartitioned_nodes(), libMesh::SparsityPattern::Build::operator()(), libMesh::Partitioner::processor_pairs_to_interface_nodes(), libMesh::DistributedMesh::renumber_dof_objects(), OverlappingFunctorTest::run_coupling_functor_test(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::send_and_insert_dof_values(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_dofobject_data_by_xyz(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), DofObjectTest< Node >::testValidProcId(), libMesh::MeshTools::total_weight(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DofObject::valid_processor_id(), and libMesh::CheckpointIO::write().

◆ invalid_unique_id

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

◆ ncv_magic

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

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

Definition at line 624 of file dof_object.h.

Referenced by libMesh::DofObject::n_comp_group(), libMesh::DofObject::set_n_comp_group(), and libMesh::DofObject::set_n_vars_per_group().

◆ ncv_magic_exp

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

Definition at line 625 of file dof_object.h.

Referenced by libMesh::DofObject::n_vars().

◆ old_dof_object

DofObject* libMesh::DofObject::old_dof_object
inherited

The documentation for this class was generated from the following files:
libMesh::DofObject::valid_id
bool valid_id() const
Definition: dof_object.h:809
libMesh::dof_id_type
uint8_t dof_id_type
Definition: id_types.h:67
libMesh::DofObject::end_idx
unsigned int end_idx(const unsigned int s) const
The ending index for system s.
Definition: dof_object.h:1172
libMesh::invalid_uint
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:249
libMesh::DofObject::_processor_id
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:527
libMesh::DofObject::n_systems
unsigned int n_systems() const
Definition: dof_object.h:861
libMesh::DofObject::old_dof_object
DofObject * old_dof_object
This object on the last mesh.
Definition: dof_object.h:81
libMesh::DofObject::unpack_indexing
void unpack_indexing(std::vector< largest_id_type >::const_iterator begin)
A method for creating our index buffer from packed data - basically with our current implementation w...
Definition: dof_object.C:589
libMesh::DofObject::unpackable_indexing_size
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:569
libMesh::DofObject::ncv_magic
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:624
libMesh::DofObject::start_idx
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:1161
libMesh::DofObject::set_id
dof_id_type & set_id()
Definition: dof_object.h:776
libMesh::DofObject::var_to_vg
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:1253
libMesh::TypeVector< Real >::add
void add(const TypeVector< T2 > &)
Add to this vector without creating a temporary.
Definition: type_vector.h:641
libMesh::DofObject::start_idx_ints
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.
Definition: dof_object.h:1185
libMesh::DofObject::_idx_buf
index_buffer_t _idx_buf
Definition: dof_object.h:613
libMesh::ReferenceCountedObject< Node >::ReferenceCountedObject
ReferenceCountedObject()
Constructor.
Definition: reference_counted_object.h:74
end
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end.
Definition: variant_filter_iterator.h:343
libMesh::ReferenceCounter::_counts
static Counts _counts
Actually holds the data.
Definition: reference_counter.h:122
std::sqrt
MetaPhysicL::DualNumber< T, D > sqrt(const MetaPhysicL::DualNumber< T, D > &in)
libMesh::DofObject::set_n_comp_group
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:410
libMesh::DofObject::n_var_groups
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:881
libMesh::ReferenceCounter::_n_objects
static Threads::atomic< unsigned int > _n_objects
The number of objects.
Definition: reference_counter.h:130
libMesh::DofObject::set_vg_dof_base
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:1209
libMesh::DofObject::valid_unique_id
bool valid_unique_id() const
Definition: dof_object.h:817
libMesh::DofObject::ncv_magic_exp
static const index_t ncv_magic_exp
Definition: dof_object.h:625
libMesh::largest_id_type
uint64_t largest_id_type
Definition: id_types.h:148
libMesh::TypeVector< Real >::operator==
bool operator==(const TypeVector< Real > &rhs) const
Definition: type_vector.h:1067
libMesh::ReferenceCounter::get_info
static std::string get_info()
Gets a string containing the reference information.
Definition: reference_counter.C:47
libMesh::DofObject::processor_id
processor_id_type processor_id() const
Definition: dof_object.h:829
libMesh::DofObject::system_var_to_vg_var
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:1271
libMesh::DofObject::packed_indexing_size
unsigned int packed_indexing_size() const
If we pack our indices into an buffer for communications, how many ints do we need?
Definition: dof_object.C:554
libMesh::DofObject::dof_number
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:956
libMesh::libmesh_assert
libmesh_assert(ctx)
libMesh::DofObject::invalid_unique_id
static const unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition: dof_object.h:426
libMesh::DofObject::n_extra_integers
unsigned int n_extra_integers() const
Returns how many extra integers are associated to the DofObject.
Definition: dof_object.h:1082
std::abs
MetaPhysicL::DualNumber< T, D > abs(const MetaPhysicL::DualNumber< T, D > &in)
libMesh::TypeVector< Real >::norm_sq
auto norm_sq() const -> decltype(std::norm(Real()))
Definition: type_vector.h:986
libMesh::DofObject::clear_old_dof_object
void clear_old_dof_object()
Sets the old_dof_object to nullptr.
Definition: dof_object.C:142
libMesh::DofObject::n_comp
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:926
libMesh::Threads::spin_mtx
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
libMesh::libmesh_ignore
void libmesh_ignore(const Args &...)
Definition: libmesh_common.h:526
libMesh::TypeVector< Real >::_coords
Real _coords[LIBMESH_DIM]
The coordinates of the TypeVector.
Definition: type_vector.h:445
libMesh::DofObject::invalid_id
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:421
libMesh::dof_id_signed_type
int8_t dof_id_signed_type
Definition: id_types.h:68
libMesh::DofObject::var_to_vg_and_offset
std::pair< unsigned int, unsigned int > var_to_vg_and_offset(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:1112
libMesh::MeshTools::Generation::Private::idx
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)
A useful inline function which replaces the macros used previously.
Definition: mesh_generation.C:72
libMesh::Node::_valence
valence_idx_t _valence
The number of nodes connected with this node.
Definition: node.h:217
libMesh::DofObject::set_n_systems
void set_n_systems(const unsigned int s)
Sets the number of systems for this DofObject.
Definition: dof_object.C:165
libMesh::DofObject::has_extra_integers
bool has_extra_integers() const
Returns whether extra integers are associated to the DofObject.
Definition: dof_object.h:1100
libMesh::DofObject::pack_indexing
void pack_indexing(std::back_insert_iterator< std::vector< largest_id_type >> target) const
A method for creating packed data from our index buffer - basically a copy with prepended size with o...
Definition: dof_object.C:636
libMesh::DofObject::n_vars
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:891
libMesh::TypeVector< Real >::TypeVector
TypeVector()
Empty constructor.
Definition: type_vector.h:457
libMesh::TensorTools::norm_sq
T norm_sq(std::complex< T > a)
Definition: tensor_tools.h:85
libMesh::DofObject::get_extra_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 obta...
Definition: dof_object.h:1026
value
static const bool value
Definition: xdr_io.C:56
libMesh::DofObject::id
dof_id_type id() const
Definition: dof_object.h:767
libMesh::DofObject::_id
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:516
libMesh::DofObject::invalid_processor_id
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:432
libMesh::on_command_line
bool on_command_line(std::string arg)
Definition: libmesh.C:898
libMesh::Node::get_info
std::string get_info() const
Prints relevant information about the node to a string.
Definition: node.C:53
libMesh::DofObject::index_t
dof_id_type index_t
DoF index information.
Definition: dof_object.h:611
libMesh::DofObject::invalidate_processor_id
void invalidate_processor_id()
Sets the processor id to invalid_processor_id.
Definition: dof_object.h:719
libMesh::DofObject::n_comp_group
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:939
libMesh::Node::Node
Node(const Real x=0, const Real y=0, const Real z=0, const dof_id_type id=invalid_id)
Constructor.
Definition: node.h:238
libMesh::DofObject::_unique_id
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:510
libMesh::DofObject::invalidate_dofs
void invalidate_dofs(const unsigned int sys_num=libMesh::invalid_uint)
Sets all degree of freedom numbers to invalid_id.
Definition: dof_object.h:690
libMesh::TypeVector< Real >::subtract
void subtract(const TypeVector< T2 > &)
Subtract from this vector without creating a temporary.
Definition: type_vector.h:728
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Definition: libmesh_common.h:121
libMesh::ReferenceCounter::_enable_print_counter
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called.
Definition: reference_counter.h:141
libMesh::DofObject::index_buffer_t
std::vector< index_t > index_buffer_t
Definition: dof_object.h:612
libMesh::TypeVector< Real >::norm
auto norm() const -> decltype(std::norm(Real()))
Definition: type_vector.h:955
libMesh::out
OStreamProxy out
libMesh::Point::Point
Point(const Real x=0., const Real y=0., const Real z=0.)
Constructor.
Definition: point.h:46
libMesh::DofObject::vg_dof_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 di...
Definition: dof_object.h:1229
std::imag
boost::multiprecision::float128 imag(const boost::multiprecision::float128)
Definition: float128_shims.h:83
libMesh::DofObject::DofObject
DofObject()
Constructor.
Definition: dof_object.h:660
libMesh::DofObject::invalidate_id
void invalidate_id()
Sets the id to invalid_id.
Definition: dof_object.h:711
libMesh::Quality::name
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:42
libMesh::DofObject::n_pseudo_systems
unsigned int n_pseudo_systems() const
Definition: dof_object.h:871
libMesh::TypeVector< Real >::absolute_fuzzy_equals
bool absolute_fuzzy_equals(const TypeVector< Real > &rhs, Real tol=TOLERANCE) const
Definition: type_vector.h:1017
std::real
boost::multiprecision::float128 real(const boost::multiprecision::float128 in)
Definition: float128_shims.h:77