libMesh
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | 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.
 
typedef unsigned int index_type
 Helper typedef for generic index programming.
 

Public Member Functions

 Node (const Real x=0, const Real y=0, const Real z=0, const dof_id_type id=invalid_id)
 Constructor.
 
 Node (const Node &n)
 "Copy"-constructor: deliberately slices the source Node and only copies its' Point information, since copying anything else would likely be a bug.
 
 Node (const Node &n)=delete
 
 Node (const Point &p, const dof_id_type id=invalid_id)
 Copy-constructor from a Point.
 
template<typename T , typename = typename std::enable_if<ScalarTraits<T>::value,void>::type>
 Node (const T x)
 Disambiguate constructing from non-Real scalars.
 
 ~Node ()
 Destructor.
 
Node & operator= (const Point &p)
 Assign to a node from a point.
 
bool active () const
 
bool operator== (const Node &rhs) const
 
void print_info (std::ostream &os=libMesh::out) const
 Prints relevant information about the node.
 
std::string get_info () const
 Prints relevant information about the node to a string.
 
unsigned int packed_size () const
 
unsigned int valence () const
 
void set_valence (unsigned int val)
 Sets the number of nodes connected with this node.
 
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.
 
LIBMESH_DEVICE_INLINE void assign (const TypeVector< T2 > &)
 Assign to this vector without creating a temporary.
 
const Real & operator() (const unsigned int i) const
 
Real & operator() (const unsigned int i)
 
LIBMESH_DEVICE_INLINE const Real & slice (const unsigned int i) const
 
LIBMESH_DEVICE_INLINE Real & slice (const unsigned int i)
 
TypeVector< typename CompareTypes< Real, T2 >::supertype > operator+ (const TypeVector< T2 > &) const
 Add two vectors.
 
LIBMESH_DEVICE_INLINE TypeVector< typename CompareTypes< Real, T2 >::supertype > operator+ (const TypeVector< T2 > &p) const
 
const TypeVector< Real > & operator+= (const TypeVector< T2 > &)
 Add to this vector.
 
LIBMESH_DEVICE_INLINE const TypeVector< Real > & operator+= (const TypeVector< T2 > &p)
 
void add (const TypeVector< T2 > &)
 Add to this vector without creating a temporary.
 
LIBMESH_DEVICE_INLINE void add (const TypeVector< T2 > &p)
 
LIBMESH_DEVICE_INLINE void add_scaled (const TypeVector< T2 > &, const Real &)
 Add a scaled value to this vector without creating a temporary.
 
TypeVector< typename CompareTypes< Real, T2 >::supertype > operator- (const TypeVector< T2 > &) const
 Subtract from this vector.
 
TypeVector< Real > operator- () const
 
LIBMESH_DEVICE_INLINE TypeVector< typename CompareTypes< Real, T2 >::supertype > operator- (const TypeVector< T2 > &p) const
 
const TypeVector< Real > & operator-= (const TypeVector< T2 > &)
 Subtract from this vector.
 
LIBMESH_DEVICE_INLINE const TypeVector< Real > & operator-= (const TypeVector< T2 > &p)
 
void subtract (const TypeVector< T2 > &)
 Subtract from this vector without creating a temporary.
 
LIBMESH_DEVICE_INLINE void subtract (const TypeVector< T2 > &p)
 
LIBMESH_DEVICE_INLINE void subtract_scaled (const TypeVector< T2 > &, const Real &)
 Subtract a scaled value from this vector without creating a temporary.
 
std::enable_if< ScalarTraits< Scalar >::value, TypeVector< typenameCompareTypes< Real, Scalar >::supertype > >::type operator* (const Scalar &) const
 Multiply this vector by a scalar value.
 
CompareTypes< Real, T2 >::supertype operator* (const TypeVector< T2 > &) const
 
LIBMESH_DEVICE_INLINE std::enable_if< ScalarTraits< Scalar >::value, TypeVector< typenameCompareTypes< Real, Scalar >::supertype > >::type operator* (const Scalar &factor) const
 
LIBMESH_DEVICE_INLINE CompareTypes< Real, T2 >::supertype operator* (const TypeVector< T2 > &p) const
 
const TypeVector< Real > & operator*= (const Real &)
 Multiply this vector by a scalar value.
 
std::enable_if< ScalarTraits< Scalar >::value, TypeVector< typenameCompareTypes< Real, Scalar >::supertype > >::type operator/ (const Scalar &) const
 Divide each entry of this vector by scalar value.
 
LIBMESH_DEVICE_INLINE std::enable_if< ScalarTraits< Scalar >::value, TypeVector< typenameCompareTypes< Real, Scalar >::supertype > >::type operator/ (const Scalar &factor) const
 
const TypeVector< Real > & operator/= (const Real &)
 Divide each entry of this vector by scalar value.
 
LIBMESH_DEVICE_INLINE CompareTypes< Real, T2 >::supertype contract (const TypeVector< T2 > &) const
 
TypeVector< typename CompareTypes< Real, T2 >::supertype > cross (const TypeVector< T2 > &v) const
 
LIBMESH_DEVICE_INLINE TypeVector< typename CompareTypes< Real, T2 >::supertype > cross (const TypeVector< T2 > &p) const
 
LIBMESH_DEVICE_INLINE TypeVector< Real > unit () const
 
auto norm () const
 
auto norm () const
 
auto norm () const
 
auto norm () const
 
auto norm () const
 
auto norm_sq () const
 
LIBMESH_DEVICE_INLINE auto l1_norm () const
 
auto l1_norm () const
 
auto l1_norm () const
 
LIBMESH_DEVICE_INLINE bool is_zero () const
 
LIBMESH_DEVICE_INLINE void zero ()
 Set all entries of the vector to 0.
 
bool relative_fuzzy_equals (const TypeVector< Real > &rhs, Real tol=TOLERANCE) const
 
bool absolute_fuzzy_equals (const TypeVector< Real > &rhs, Real tol=TOLERANCE) const
 
LIBMESH_DEVICE_INLINE bool operator== (const TypeVector< Real > &rhs) const
 
LIBMESH_DEVICE_INLINE 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.
 
void write_unformatted (std::ostream &out_stream, const bool newline=true) const
 Unformatted print to the stream out.
 
DofObject * get_old_dof_object ()
 Pointer accessor for previously public old_dof_object.
 
const DofObject * get_old_dof_object () const
 
DofObject & get_old_dof_object_ref ()
 As above, but do not use in situations where the old_dof_object may be nullptr, since this function asserts that the old_dof_object is valid before returning a reference to it.
 
const DofObject & get_old_dof_object_ref () const
 
void clear_old_dof_object ()
 Sets the old_dof_object to nullptr.
 
void set_old_dof_object ()
 Sets the old_dof_object to a copy of this.
 
void clear_dofs ()
 Clear the DofMap data structures holding degree of freedom data.
 
void invalidate_dofs (const unsigned int sys_num=libMesh::invalid_uint)
 Sets all degree of freedom numbers to invalid_id.
 
void invalidate_id ()
 Sets the id to invalid_id.
 
void invalidate_processor_id ()
 Sets the processor id to invalid_processor_id.
 
void invalidate ()
 Invalidates all the indices for this DofObject.
 
unsigned int n_dofs (const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
 
dof_id_type id () const
 
dof_id_type & set_id ()
 
void set_id (const dof_id_type dofid)
 Sets the id for this DofObject.
 
unique_id_type unique_id () const
 
void set_unique_id (unique_id_type new_id)
 Sets the unique_id for this DofObject.
 
bool valid_id () const
 
bool valid_unique_id () const
 
processor_id_type processor_id () const
 
processor_id_type & processor_id ()
 
void processor_id (const processor_id_type pid)
 Sets the processor_id for this DofObject.
 
bool valid_processor_id () const
 
unsigned int n_systems () const
 
unsigned int n_pseudo_systems () const
 
void set_n_systems (const unsigned int s)
 Sets the number of systems for this DofObject.
 
void set_extra_integer (const unsigned int index, const dof_id_type value)
 Sets the value on this object of the extra integer associated with index, which should have been obtained via a call to MeshBase::add_elem_integer or MeshBase::add_node_integer.
 
dof_id_type get_extra_integer (const unsigned int index) const
 Gets the value on this object of the extra integer associated with index, which should have been obtained via a call to MeshBase::add_elem_integer or MeshBase::add_node_integer.
 
template<typename T >
void set_extra_datum (const unsigned int index, const T value)
 Sets the value on this object of the extra datum associated with index, which should have been obtained via a call to MeshBase::add_elem_datum or MeshBase::add_node_datum using the same type T.
 
template<typename T >
T get_extra_datum (const unsigned int index) const
 Gets the value on this object of the extra datum associated with index, which should have been obtained via a call to MeshBase::add_elem_datum or MeshBase::add_node_datum using the same type T.
 
void add_system ()
 Adds an additional system to the DofObject.
 
unsigned int n_var_groups (const unsigned int s) const
 
unsigned int n_vars (const unsigned int s, const unsigned int vg) const
 
unsigned int n_vars (const unsigned int s) const
 
void set_n_vars_per_group (const unsigned int s, const std::vector< unsigned int > &nvpg)
 Sets number of variables in each group associated with system s for this DofObject.
 
unsigned int n_comp (const unsigned int s, const unsigned int var) const
 
unsigned int n_comp_group (const unsigned int s, const unsigned int vg) const
 
void set_n_comp (const unsigned int s, const unsigned int var, const unsigned int ncomp)
 Sets the number of components for Variable var of system s associated with this DofObject.
 
void set_n_comp_group (const unsigned int s, const unsigned int vg, const unsigned int ncomp)
 Sets the number of components for VariableGroup vg of system s associated with this DofObject.
 
dof_id_type dof_number (const unsigned int s, const unsigned int var, const unsigned int comp) const
 
dof_id_type dof_number (const unsigned int s, const unsigned int vg, const unsigned int vig, const unsigned int comp, const unsigned int n_comp) const
 
std::pair< unsigned int, unsigned int > var_to_vg_and_offset (const unsigned int s, const unsigned int var) const
 
void set_dof_number (const unsigned int s, const unsigned int var, const unsigned int comp, const dof_id_type dn)
 Sets the global degree of freedom number for variable var, component comp for system s associated with this DofObject.
 
bool has_dofs (const unsigned int s=libMesh::invalid_uint) const
 
void set_vg_dof_base (const unsigned int s, const unsigned int vg, const dof_id_type db)
 VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base.
 
dof_id_type vg_dof_base (const unsigned int s, const unsigned int vg) const
 VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base.
 
void add_extra_integers (const unsigned int n_integers)
 Assigns a set of extra integers to this DofObject.
 
void add_extra_integers (const unsigned int n_integers, const std::vector< dof_id_type > &default_values)
 Assigns a set of extra integers to this DofObject.
 
unsigned int n_extra_integers () const
 Returns how many extra integers are associated to the DofObject.
 
bool has_extra_integers () const
 Returns whether extra integers are associated to the DofObject.
 
unsigned int packed_indexing_size () const
 If we pack our indices into an buffer for communications, how many ints do we need?
 
void unpack_indexing (std::vector< largest_id_type >::const_iterator begin)
 A method for creating our index buffer from packed data - basically with our current implementation we investigate the size term and then copy.
 
void pack_indexing (std::back_insert_iterator< std::vector< largest_id_type > > target) const
 A method for creating packed data from our index buffer - basically a copy with prepended size with our current implementation.
 
void debug_buffer () const
 Print our buffer for debugging.
 
void print_dof_info () const
 Print out info for debugging.
 
void set_buffer (const std::vector< dof_id_type > &buf)
 

Static Public Member Functions

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

Static Public Attributes

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

Protected Types

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

Protected Member Functions

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

Protected Attributes

Real _coords [LIBMESH_DIM]
 The coordinates of the TypeVector.
 
std::unique_ptr< DofObject > old_dof_object
 This object on the last mesh.
 

Static Protected Attributes

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

Private Types

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

Private Member Functions

std::unique_ptr< DofObject > construct (const DofObject *other=nullptr)
 Convenient factory function that calls either the (deep) copy constructor or the default constructor depending on the input arg.
 
unsigned int var_to_vg (const unsigned int s, const unsigned int var) const
 Utility function - for variable var in system s, figure out what variable group it lives in.
 
unsigned int system_var_to_vg_var (const unsigned int s, const unsigned int vg, const unsigned int var) const
 Utility function - for variable var in system s, figure out what variable group it lives in.
 
unsigned int start_idx (const unsigned int s) const
 The starting index for system s.
 
unsigned int end_idx (const unsigned int s) const
 The ending index for system s.
 
unsigned int start_idx_ints () const
 The starting index for an extra_integers pseudosystem.
 
unsigned int end_idx_ints () const
 The ending index for an extra_integers pseudosystem.
 

Private Attributes

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

Static Private Attributes

static constexpr index_t ncv_magic_exp = sizeof(index_t)*3
 Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv are the number of identical variables of a given type, and nc is the number of components for this set of variables.
 
static constexpr index_t ncv_magic = index_t(1) << ncv_magic_exp
 

Friends

class MeshRefinement
 This class need access to the node key information, but no one else should be able to mess with it.
 
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 119 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 119 of file reference_counter.h.

◆ index_buffer_t

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

Definition at line 670 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 669 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 123 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 212 of file node.h.

◆ value_type

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

Helper typedef for C++98 generic programming.

Definition at line 118 of file type_vector.h.

Constructor & Destructor Documentation

◆ Node() [1/5]

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 240 of file node.h.

243 :
244 Point(x,y,z)
245#ifdef LIBMESH_ENABLE_NODE_VALENCE
246 ,
247 _valence(0)
248#endif
249{
250 this->set_id() = dofid;
251}
252
253
254#ifdef LIBMESH_ENABLE_DEPRECATED
255inline
256Node::Node (const Node & n) :
257 Point(n),
258 DofObject(), // Deliberately slicing!
260#ifdef LIBMESH_ENABLE_NODE_VALENCE
261 ,
262 _valence(0)
263#endif
264{
265 libmesh_deprecated(); // Cast to Point first!
266}
267#endif // LIBMESH_ENABLE_DEPRECATED
268
269
270
271inline
272Node::Node (const Point & p,
273 const dof_id_type dofid) :
274 Point(p)
275#ifdef LIBMESH_ENABLE_NODE_VALENCE
276 ,
277 _valence(0)
278#endif
279{
280 // optionally assign the id. We have
281 // to do it like this otherwise
282 // Node n = Point p would erase
283 // the id!
284 if (dofid != invalid_id)
285 this->set_id() = dofid;
286}
287
288
289
290inline
291Node::~Node ()
292{
293}
DofObject()
Constructor.
Definition dof_object.h:732
dof_id_type & set_id()
Definition dof_object.h:841
valence_idx_t _valence
The number of nodes connected with this node.
Definition node.h:219
friend class Node
Make the derived class a friend.
Definition point.h:96
LIBMESH_DEVICE_INLINE Point(const Real x=0., const Real y=0., const Real z=0.)
Constructor.
Definition point.h:49

References libMesh::DofObject::set_id().

◆ Node() [2/5]

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

"Copy"-constructor: deliberately slices the source Node and only copies its' Point information, since copying anything else would likely be a bug.

Deprecated:
  • the constructor from Point is what we really want.

◆ Node() [3/5]

libMesh::Node::Node ( const Node &  n)
delete

◆ Node() [4/5]

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

Copy-constructor from a Point.

Optionally assigned the id.

◆ Node() [5/5]

template<typename T , typename = typename std::enable_if<ScalarTraits<T>::value,void>::type>
libMesh::Node::Node ( const T  x)
inlineexplicit

Disambiguate constructing from non-Real scalars.

Definition at line 94 of file node.h.

94 :
95 Point (x,0,0)
96 { this->set_id() = invalid_id; }
static constexpr dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition dof_object.h:473

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 347 of file type_vector.h.

1044{
1045 return libMesh::absolute_fuzzy_equals(*this, rhs, tol);
1046}
bool absolute_fuzzy_equals(const T &var1, const T2 &var2, const Real tol=TOLERANCE *TOLERANCE)
Function to check whether two variables are equal within an absolute tolerance.

◆ 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 345 of file node.h.

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

References libMesh::DofObject::invalid_id.

◆ add() [1/2]

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

Add to this vector without creating a temporary.

◆ add() [2/2]

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

Definition at line 619 of file type_vector.h.

620{
621#if LIBMESH_DIM == 1
622 _coords[0] += p._coords[0];
623#endif
624
625#if LIBMESH_DIM == 2
626 _coords[0] += p._coords[0];
627 _coords[1] += p._coords[1];
628#endif
629
630#if LIBMESH_DIM == 3
631 _coords[0] += p._coords[0];
632 _coords[1] += p._coords[1];
633 _coords[2] += p._coords[2];
634#endif
635
636}
Real _coords[LIBMESH_DIM]
The coordinates of the TypeVector.

◆ add_extra_integers() [1/2]

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.

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

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

Definition at line 482 of file dof_object.C.

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

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

Referenced by libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_elem(), libMesh::DofObject::add_extra_integers(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::create_submesh(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_elem(), DofObjectTest< DerivedClass >::testAddExtraData(), DofObjectTest< DerivedClass >::testAddSystemExtraInts(), DofObjectTest< DerivedClass >::testSetNSystemsExtraInts(), and DofObjectTest< DerivedClass >::testSetNVariableGroupsExtraInts().

◆ add_extra_integers() [2/2]

void libMesh::DofObject::add_extra_integers ( const unsigned int  n_integers,
const std::vector< dof_id_type > &  default_values 
)
inherited

Assigns a set of extra integers to this DofObject.

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

Any newly-added values will be copied from default_values.

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

Definition at line 534 of file dof_object.C.

536{
537 libmesh_assert_equal_to(n_integers, default_values.size());
538
539 const unsigned int n_old_integers = this->n_extra_integers();
540 this->add_extra_integers(n_integers);
541 if (n_integers > n_old_integers)
542 {
543 const unsigned int n_more_integers = n_integers - n_old_integers;
544 std::copy(default_values.begin()+n_old_integers,
545 default_values.end(),
546 _idx_buf.end()-n_more_integers);
547 }
548}
void add_extra_integers(const unsigned int n_integers)
Assigns a set of extra integers to this DofObject.
Definition dof_object.C:482

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

◆ add_scaled()

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

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

Definition at line 201 of file type_vector.h.

644{
645#if LIBMESH_DIM == 1
646 _coords[0] += factor*p(0);
647#endif
648
649#if LIBMESH_DIM == 2
650 _coords[0] += factor*p(0);
651 _coords[1] += factor*p(1);
652#endif
653
654#if LIBMESH_DIM == 3
655 _coords[0] += factor*p(0);
656 _coords[1] += factor*p(1);
657 _coords[2] += factor*p(2);
658#endif
659
660}

◆ add_system()

void libMesh::DofObject::add_system ( )
inherited

Adds an additional system to the DofObject.

Definition at line 187 of file dof_object.C.

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

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

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

◆ assign()

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

Assign to this vector without creating a temporary.

Definition at line 146 of file type_vector.h.

549{
550 for (unsigned int i=0; i<LIBMESH_DIM; i++)
551 _coords[i] = p._coords[i];
552}

◆ 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.
Deprecated:
  • anyone copying a Node would almost certainly be better off copying the much cheaper Point or taking a reference to the Node.

Definition at line 315 of file node.h.

316{
317 libmesh_deprecated();
318 return std::make_unique<Node>(n);
319}

Referenced by libMesh::DistributedMesh::add_point(), libMesh::ReplicatedMesh::add_point(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_elem(), SideVertexAverageNormalTest::construct_elem(), VolumeTest::construct_elem(), libMesh::ReferenceElem::ideal_target(), libMesh::XdrIO::read_serialized_connectivity(), and SideVertexAverageNormalTest::testC0Polyhedron().

◆ 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 325 of file node.h.

327{
328 return std::make_unique<Node>(p,id);
329}

◆ 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 334 of file node.h.

338{
339 return std::make_unique<Node>(x,y,z,id);
340}

◆ 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}
static constexpr 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:484
bool on_command_line(std::string arg)
Definition libmesh.C:934

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

Referenced by libMesh::MeshTools::correct_node_proc_ids(), and libMesh::Partitioner::set_node_processor_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 803 of file dof_object.h.

804{
805 this->set_n_systems(0);
806}

References libMesh::DofObject::set_n_systems().

◆ clear_old_dof_object()

void libMesh::DofObject::clear_old_dof_object ( )
inherited

Sets the old_dof_object to nullptr.

Definition at line 120 of file dof_object.C.

121{
122 this->old_dof_object.reset(nullptr);
123}
std::unique_ptr< DofObject > old_dof_object
This object on the last mesh.
Definition dof_object.h:88

References libMesh::DofObject::old_dof_object.

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

◆ construct()

std::unique_ptr< DofObject > libMesh::DofObject::construct ( const DofObject *  other = nullptr)
inlineprivateinherited

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

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

Definition at line 746 of file dof_object.h.

747{
748 return other
749 ? std::unique_ptr<DofObject>(new DofObject(*other))
750 : std::unique_ptr<DofObject>(new DofObject());
751}

References libMesh::DofObject::DofObject().

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

◆ contract()

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

Definition at line 291 of file type_vector.h.

890{
891 return (*this)*(p);
892}

◆ cross() [1/2]

LIBMESH_DEVICE_INLINE TypeVector< typename CompareTypes< Real , T2 >::supertype > libMesh::TypeVector< Real >::cross ( const TypeVector< T2 > &  p) const
inherited

Definition at line 900 of file type_vector.h.

901{
902 typedef typename CompareTypes<T, T2>::supertype TS;
903 libmesh_assert_equal_to (LIBMESH_DIM, 3);
904
905 // | i j k |
906 // |(*this)(0) (*this)(1) (*this)(2)|
907 // | p(0) p(1) p(2) |
908
909#if LIBMESH_DIM == 3
910 return TypeVector<TS>( _coords[1]*p._coords[2] - _coords[2]*p._coords[1],
911 -_coords[0]*p._coords[2] + _coords[2]*p._coords[0],
912 _coords[0]*p._coords[1] - _coords[1]*p._coords[0]);
913#else
915 return TypeVector<TS>(0);
916#endif
917}
void libmesh_ignore(const Args &...)

◆ cross() [2/2]

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.

◆ debug_buffer()

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

Print our buffer for debugging.

Definition at line 652 of file dof_object.C.

653{
654 libMesh::out << " [ ";
655 for (const auto & idx : _idx_buf)
656 libMesh::out << idx << " ";
657 libMesh::out << "]\n";
658}
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.
The libMesh namespace provides an interface to certain functionality in the library.
OStreamProxy out

References libMesh::DofObject::_idx_buf, and libMesh::out.

◆ disable_print_counter_info() [1/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 100 of file reference_counter.C.

101{
102 _enable_print_counter = false;
103 return;
104}
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called.

References libMesh::ReferenceCounter::_enable_print_counter.

◆ disable_print_counter_info() [2/2]

void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 100 of file reference_counter.C.

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

References libMesh::ReferenceCounter::_enable_print_counter.

◆ 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 1022 of file dof_object.h.

1025{
1026 libmesh_assert_less (s, this->n_systems());
1027 libmesh_assert_less (var, this->n_vars(s));
1028 libmesh_assert_less (comp, this->n_comp(s,var));
1029
1030 const std::pair<unsigned int, unsigned int>
1031 vg_vig = this->var_to_vg_and_offset(s,var);
1032
1033 const unsigned int
1034 n_comp = this->n_comp_group(s,vg_vig.first);
1035
1036 return this->dof_number(s, vg_vig.first, vg_vig.second,
1037 comp, n_comp);
1038}
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition dof_object.h:992
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
std::pair< unsigned int, unsigned int > var_to_vg_and_offset(const unsigned int s, const unsigned int var) const

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

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::DofMap::allgather_recursive_constraints(), assemble_advection_diffusion(), assemble_matrix_and_rhs(), assemble_shell(), centroid_l2_error(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), GhostDofConstraint::constrain(), libMesh::VariationalSmootherConstraint::constrain_node_to_line(), libMesh::VariationalSmootherConstraint::constrain_node_to_plane(), libMesh::DofMap::constrain_p_dofs(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::Nemesis_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::Nemesis_IO::copy_nodal_solution(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::dof_indices(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_mixed_derivatives(), libMesh::OldSolutionValue< Output, point_output >::eval_mixed_derivatives(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), fill_dirichlet_bc(), libMesh::VariationalSmootherConstraint::fix_node(), libMesh::Elem::get_info(), get_info(), AssemblyPointLoadX::get_nodal_rhs_values(), AssemblyPointLoadY::get_nodal_rhs_values(), AssemblyPointLoadZ::get_nodal_rhs_values(), libMesh::DofMap::local_variable_indices(), main(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectInteriors::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::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::DofMap::process_mesh_constraint_rows(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::HPCoarsenTest::select_refinement(), libMesh::DofObject::set_dof_number(), libMesh::PetscPreconditioner< T >::set_hypre_ads_data(), libMesh::PetscPreconditioner< T >::set_hypre_ams_data(), libMesh::DofMap::set_nonlocal_dof_objects(), ParsedFEMFunctionTest::setUp(), DofMapTest::testGhostConstraintSendList(), DofObjectTest< DerivedClass >::testJensEftangBug(), DofObjectTest< DerivedClass >::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 1043 of file dof_object.h.

1048{
1049 libmesh_assert_less (s, this->n_systems());
1050 libmesh_assert_less (vg, this->n_var_groups(s));
1051 libmesh_assert_less (vig, this->n_vars(s,vg));
1052
1053 const unsigned int
1054 start_idx_sys = this->start_idx(s);
1055
1056 libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1057
1058 const dof_id_type
1059 base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
1060
1061 // if the first component is invalid, they
1062 // are all invalid
1063 if (base_idx == invalid_id)
1064 return invalid_id;
1065
1066 // otherwise the index is the first component
1067 // index augmented by the component number
1068 else
1069 return cast_int<dof_id_type>(base_idx + vig*n_comp + comp);
1070}
unsigned int start_idx(const unsigned int s) const
The starting index for system s.

References libMesh::DofObject::_idx_buf, libMesh::DofObject::invalid_id, libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), 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().

Enabled by default.

Definition at line 94 of file reference_counter.C.

95{
97 return;
98}

References libMesh::ReferenceCounter::_enable_print_counter.

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

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

Enabled by default.

Definition at line 94 of file reference_counter.C.

95{
97 return;
98}

References libMesh::ReferenceCounter::_enable_print_counter.

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

◆ end_idx()

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

The ending index for system s.

Definition at line 1250 of file dof_object.h.

1251{
1252 libmesh_assert_less (s, this->n_systems());
1253 libmesh_assert_less (s, _idx_buf.size());
1254
1255 return ((s+1) == this->n_pseudo_systems()) ?
1256 cast_int<unsigned int>(_idx_buf.size()) :
1257 cast_int<unsigned int>(_idx_buf[s+1]);
1258}
void ErrorVector unsigned int
unsigned int n_pseudo_systems() const
Definition dof_object.h:937
Tnew cast_int(Told oldvar)

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 1277 of file dof_object.h.

1278{
1280
1281 return cast_int<unsigned int>(_idx_buf.size());
1282}
libmesh_assert(ctx)

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 1136 of file dof_object.h.

1137{
1138#ifndef NDEBUG
1139 const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1140#endif
1141 libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1142 libmesh_assert_less(this->n_systems(), _idx_buf.size());
1143
1144 const unsigned int start_idx_i = this->start_idx_ints();
1145
1146 libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1147 T returnval;
1148 std::memcpy(&returnval, &_idx_buf[start_idx_i+index], sizeof(T));
1149 return returnval;
1150}
unsigned int start_idx_ints() const
The starting index for an extra_integers pseudosystem.

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

Referenced by libMesh::MeshTools::Modification::all_rbb(), libMesh::Elem::get_info(), libMesh::VTKIO::nodes_to_vtk(), libMesh::rational_fe_shape(), libMesh::rational_fe_shape_deriv(), libMesh::rational_fe_shape_second_deriv(), libMesh::rational_fe_weighted_shapes(), libMesh::rational_fe_weighted_shapes_derivs(), libMesh::ExodusII_IO::read(), and DofObjectTest< DerivedClass >::testAddExtraData().

◆ get_extra_integer()

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

◆ 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 & [name, cd] : _counts)
59 oss << "| " << name << " reference count information:\n"
60 << "| Creations: " << cd.first << '\n'
61 << "| Destructions: " << cd.second << '\n';
62
63 oss << " ---------------------------------------------------------------------------- \n";
64
65 return oss.str();
66
67#else
68
69 return "";
70
71#endif
72}
static Counts _counts
Actually holds the data.
std::string name(const ElemQuality q)
This function returns a string containing some name for q.

References libMesh::ReferenceCounter::_counts.

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 & [name, cd] : _counts)
59 oss << "| " << name << " reference count information:\n"
60 << "| Creations: " << cd.first << '\n'
61 << "| Destructions: " << cd.second << '\n';
62
63 oss << " ---------------------------------------------------------------------------- \n";
64
65 return oss.str();
66
67#else
68
69 return "";
70
71#endif
72}

References libMesh::ReferenceCounter::_counts.

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 : make_range(this->n_systems()))
69 for (auto v : make_range(this->n_vars(s)))
70 for (auto c : make_range(this->n_comp(s,v)))
71 oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";
72
73 return oss.str();
74}
bool valid_id() const
Definition dof_object.h:875
processor_id_type processor_id() const
Definition dof_object.h:895
dof_id_type id() const
Definition dof_object.h:833
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Definition int_range.h:176

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

Referenced by print_info().

◆ get_old_dof_object() [1/2]

DofObject * libMesh::DofObject::get_old_dof_object ( )
inlineinherited

◆ get_old_dof_object() [2/2]

const DofObject * libMesh::DofObject::get_old_dof_object ( ) const
inlineinherited

Definition at line 97 of file dof_object.h.

97{ return old_dof_object.get(); }

References libMesh::DofObject::old_dof_object.

◆ get_old_dof_object_ref() [1/2]

DofObject & libMesh::DofObject::get_old_dof_object_ref ( )
inlineinherited

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

Definition at line 104 of file dof_object.h.

105 {
107 return *old_dof_object;
108 }

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

Referenced by libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::DofMap::old_dof_indices(), and libMesh::DofMap::old_dof_indices().

◆ get_old_dof_object_ref() [2/2]

const DofObject & libMesh::DofObject::get_old_dof_object_ref ( ) const
inlineinherited

Definition at line 110 of file dof_object.h.

111 {
113 return *old_dof_object;
114 }

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

◆ 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 1216 of file dof_object.h.

1217{
1218 if (sys == libMesh::invalid_uint)
1219 {
1220 for (auto s : make_range(this->n_systems()))
1221 if (this->n_vars(s))
1222 return true;
1223 }
1224
1225 else
1226 {
1227 libmesh_assert_less (sys, this->n_systems());
1228
1229 if (this->n_vars(sys))
1230 return true;
1231 }
1232
1233 return false;
1234}
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition libmesh.h:303

References libMesh::invalid_uint, libMesh::make_range(), libMesh::DofObject::n_systems(), and 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 833 of file dof_object.h.

834{
835 return _id;
836}
dof_id_type _id
The id of the DofObject.
Definition dof_object.h:574

References libMesh::DofObject::_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::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::TopologyMap::add_node(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_node(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::ClawSystem::assemble_avg_coupling_matrices(), assemble_ellipticdg(), libMesh::ClawSystem::assemble_jump_coupling_matrix(), assemble_shell(), libMesh::MeshTools::Generation::build_cube(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::EquationSystems::build_parallel_solution_vector(), libMesh::BoundaryInfo::build_side_list_from_node_list(), libMesh::MeshTetInterface::check_hull_integrity(), compute_jacobian(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), compute_residual(), libMesh::InfFE< Dim, T_radial, T_map >::compute_shape_functions(), libMesh::MeshBase::copy_constraint_rows(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::DistributedMesh::delete_elem(), libMesh::ReplicatedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::ReplicatedMesh::delete_node(), libMesh::Elem::disconnected_clone(), libMesh::C0Polyhedron::disconnected_clone(), libMesh::StaticCondensationDofMap::dof_indices(), libMesh::DTKAdapter::DTKAdapter(), libMesh::UNVIO::elements_out(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubFunctor::find_dofs_to_send(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshTools::find_nodal_or_face_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(), libMesh::Elem::get_info(), get_info(), libMesh::MeshBase::get_info(), libMesh::VariationalSmootherConstraint::get_neighbors_for_boundary_constraint(), libMesh::VariationalSmootherConstraint::get_neighbors_for_subdomain_constraint(), libMesh::MeshTetInterface::improve_hull_integrity(), libMesh::ParmetisPartitioner::initialize(), libMesh::TreeNode< N >::insert(), libMesh::TriangulatorInterface::insert_any_extra_boundary_points(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_elem(), libMesh::Poly2TriTriangulator::insert_refinement_points(), EIM_F::interior_assembly(), AssemblyEIM::interior_assembly(), libMesh::MeshTools::Modification::interpolate_surface(), libMesh::FEMap::inverse_map(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_constraint_rows(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::Tri3Subdivision::local_node_number(), main(), MeshPerElemTest< elem_type >::meshes_equal_enough(), LinearElasticityWithContact::move_mesh(), libMesh::MeshTools::n_connected_components(), libMesh::FE< Dim, T >::nodal_soln(), libMesh::Elem::node_id(), libMesh::TriangulatorInterface::nodes_to_segments(), libMesh::VTKIO::nodes_to_vtk(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::CompareDofObjectsByID::operator()(), libMesh::CompareDofObjectsByPIDAndThenID::operator()(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::GhostPointNeighbors::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectVertices::operator()(), libMesh::BoundaryInfo::operator==(), libMesh::DistributedMesh::own_node(), libMesh::DistributedMesh::parallel_max_elem_id(), libMesh::DistributedMesh::parallel_max_node_id(), libMesh::MetisPartitioner::partition_range(), libMesh::DofObject::print_dof_info(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::DistributedMesh::query_elem_ptr(), libMesh::DistributedMesh::query_elem_ptr(), libMesh::query_ghosting_functors(), libMesh::DistributedMesh::query_node_ptr(), libMesh::DistributedMesh::query_node_ptr(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::ExodusII_IO_Helper::read_edge_blocks(), libMesh::EquationSystems::redundant_added_side(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::DistributedMesh::renumber_elem(), libMesh::DistributedMesh::renumber_node(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::C0Polyhedron::retriangulate(), libMesh::DofMap::scatter_constraints(), libMesh::StaticCondensation::set_current_elem(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), FETestBase< order, family, elem_type, build_nx, CaseName >::setUp(), 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(), ElemTest< elem_type >::test_n_refinements(), ElemTest< elem_type >::test_orient_elements(), DefaultCouplingTest::testCoupling(), MixedDimensionMeshTest::testPointLocatorTree(), InfFERadialTest::testRefinement(), DofObjectTest< DerivedClass >::testSetId(), DisjointNeighborTest::testTempJump(), libMesh::Elem::topologically_equal(), libMesh::NetGenMeshInterface::triangulate(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::Poly2TriTriangulator::triangulate_current_points(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::MeshTetInterface::volume_to_surface_mesh(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO_Helper::write_elemsets(), 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)
inlineprotectednoexceptinherited

Increments the construction counter.

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

Definition at line 183 of file reference_counter.h.

184{
185 libmesh_try
186 {
187 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188 std::pair<unsigned int, unsigned int> & p = _counts[name];
189 p.first++;
190 }
191 libmesh_catch (...)
192 {
193 auto stream = libMesh::err.get();
194 stream->exceptions(stream->goodbit); // stream must not throw
195 libMesh::err << "Encountered unrecoverable error while calling "
196 << "ReferenceCounter::increment_constructor_count() "
197 << "for a(n) " << name << " object." << std::endl;
198 std::terminate();
199 }
200}
streamT * get()
Rather than implement every ostream/ios/ios_base function, we'll be lazy and make esoteric uses go th...
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition threads.C:30
OStreamProxy err

References libMesh::err, libMesh::BasicOStreamProxy< charT, traits >::get(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< T >::ReferenceCountedObject(), libMesh::ReferenceCountedObject< T >::ReferenceCountedObject(), and libMesh::ReferenceCountedObject< T >::ReferenceCountedObject().

◆ increment_constructor_count() [2/2]

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

Increments the construction counter.

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

Definition at line 183 of file reference_counter.h.

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

References libMesh::err, libMesh::BasicOStreamProxy< charT, traits >::get(), and libMesh::Threads::spin_mtx.

Referenced by libMesh::ReferenceCountedObject< T >::ReferenceCountedObject(), libMesh::ReferenceCountedObject< T >::ReferenceCountedObject(), and libMesh::ReferenceCountedObject< T >::ReferenceCountedObject().

◆ increment_destructor_count() [1/2]

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

Increments the destruction counter.

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

Definition at line 207 of file reference_counter.h.

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

References libMesh::err, libMesh::BasicOStreamProxy< charT, traits >::get(), and libMesh::Threads::spin_mtx.

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

◆ increment_destructor_count() [2/2]

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

Increments the destruction counter.

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

Definition at line 207 of file reference_counter.h.

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

References libMesh::err, libMesh::BasicOStreamProxy< charT, traits >::get(), and libMesh::Threads::spin_mtx.

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

◆ invalidate()

void libMesh::DofObject::invalidate ( )
inlineinherited

Invalidates all the indices for this DofObject.

Definition at line 793 of file dof_object.h.

794{
795 this->invalidate_dofs ();
796 this->invalidate_id ();
798}
void invalidate_processor_id()
Sets the processor id to invalid_processor_id.
Definition dof_object.h:785
void invalidate_id()
Sets the id to invalid_id.
Definition dof_object.h:777
void invalidate_dofs(const unsigned int sys_num=libMesh::invalid_uint)
Sets all degree of freedom numbers to invalid_id.
Definition dof_object.h:756

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 756 of file dof_object.h.

757{
758 const unsigned int n_sys = this->n_systems();
759 // If the user does not specify the system number...
760 if (sys_num >= n_sys)
761 {
762 for (auto s : make_range(n_sys))
763 for (auto vg : make_range(this->n_var_groups(s)))
764 if (this->n_comp_group(s,vg))
765 this->set_vg_dof_base(s,vg,invalid_id);
766 }
767 // ...otherwise invalidate the dofs for all systems
768 else
769 for (auto vg : make_range(this->n_var_groups(sys_num)))
770 if (this->n_comp_group(sys_num,vg))
771 this->set_vg_dof_base(sys_num,vg,invalid_id);
772}
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...

References libMesh::DofObject::invalid_id, libMesh::make_range(), 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 777 of file dof_object.h.

778{
779 this->set_id (invalid_id);
780}

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

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

◆ invalidate_processor_id()

void libMesh::DofObject::invalidate_processor_id ( )
inlineinherited

◆ is_zero()

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

Definition at line 328 of file type_vector.h.

1017{
1018 for (const auto & val : _coords)
1019 if (val != T(0))
1020 return false;
1021 return true;
1022}

◆ l1_norm() [1/3]

LIBMESH_DEVICE_INLINE auto libMesh::TypeVector< Real >::l1_norm ( ) const
inherited
Returns
The L1 norm of the vector

Definition at line 322 of file type_vector.h.

1032{
1033 using std::abs;
1034 decltype(abs(T())) ret{};
1035 for (const auto i : make_range(libmesh_dim))
1036 ret += abs(_coords[i]);
1037
1038 return ret;
1039}

◆ l1_norm() [2/3]

auto libMesh::TypeVector< bool >::l1_norm ( ) const
inherited

◆ l1_norm() [3/3]

auto libMesh::TypeVector< bool >::l1_norm ( ) const
inherited

Definition at line 203 of file type_vector.C.

204{
205 bool ret{};
206 for (const auto i : make_range(libmesh_dim))
207 ret += _coords[i];
208
209 return ret;
210}

◆ 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 992 of file dof_object.h.

994{
995 libmesh_assert_less (s, this->n_systems());
996 libmesh_assert_less (var, this->n_vars(s));
997
998 return this->n_comp_group(s,this->var_to_vg(s,var));
999}
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.

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

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

◆ 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 1005 of file dof_object.h.

1007{
1008 libmesh_assert_less (s, this->n_systems());
1009 libmesh_assert_less (vg, this->n_var_groups(s));
1010
1011 const unsigned int
1012 start_idx_sys = this->start_idx(s);
1013
1014 libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
1015
1016 return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
1017}
static constexpr index_t ncv_magic
Definition dof_object.h:697

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::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::n_comp(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), 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 directly stored on this object. Optionally only degrees of freedom for variable number var are counted. Does not count degrees of freedom only indirectly associated with this object, such as those stored on an element's nodes when n_dofs() is called on the element itself.

Definition at line 811 of file dof_object.h.

813{
814 libmesh_assert_less (s, this->n_systems());
815
816 unsigned int num = 0;
817
818 // Count all variables
819 if (var == libMesh::invalid_uint)
820 for (auto v : make_range(this->n_vars(s)))
821 num += this->n_comp(s,v);
822
823 // Only count specified variable
824 else
825 num = this->n_comp(s,var);
826
827 return num;
828}

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

Referenced by libMesh::PetscDMWrapper::add_dofs_helper(), and libMesh::EquationSystems::build_parallel_solution_vector().

◆ 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 1160 of file dof_object.h.

1161{
1162 if (_idx_buf.empty())
1163 return 0;
1164
1165 const int hdr = dof_id_signed_type(_idx_buf[0]);
1166 if (hdr >= 0)
1167 return 0;
1168
1169 const unsigned int start_idx_i = this->start_idx_ints();
1170
1171 return _idx_buf.size() - start_idx_i;
1172}

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

Referenced by libMesh::DofObject::add_extra_integers(), libMesh::DofObject::add_extra_integers(), libMesh::MeshTools::Modification::all_tri(), libMesh::Elem::disconnected_clone(), libMesh::C0Polyhedron::disconnected_clone(), libMesh::MeshTools::Modification::flatten(), libMesh::DofObject::get_extra_datum(), libMesh::DofObject::get_extra_integer(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_nodes(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Elem::refine(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::DofObject::set_extra_datum(), libMesh::DofObject::set_extra_integer(), libMesh::DofObject::set_n_systems(), libMesh::DofObject::set_n_vars_per_group(), DofObjectTest< DerivedClass >::testAddExtraData(), DofObjectTest< DerivedClass >::testAddSystemExtraInts(), DofObjectTest< DerivedClass >::testSetNSystemsExtraInts(), and DofObjectTest< DerivedClass >::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 85 of file reference_counter.h.

86 { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects
The number of objects.

References libMesh::ReferenceCounter::_n_objects.

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

◆ 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 85 of file reference_counter.h.

86 { return _n_objects; }

References libMesh::ReferenceCounter::_n_objects.

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

◆ 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 937 of file dof_object.h.

938{
939 const int hdr = _idx_buf.empty() ?
940 0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
941 return std::abs(hdr);
942}

References libMesh::DofObject::_idx_buf.

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 927 of file dof_object.h.

928{
929 const int hdr = _idx_buf.empty() ?
930 0 : cast_int<int>(dof_id_signed_type(_idx_buf[0]));
931 return hdr >= 0 ? hdr : (-hdr-1);
932}

References libMesh::DofObject::_idx_buf.

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofObject::add_system(), libMesh::DofObject::dof_number(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::DofObject::end_idx(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionCoefs< Output, point_output >::eval_old_dofs(), libMesh::DofObject::get_extra_datum(), libMesh::DofObject::get_extra_integer(), libMesh::Elem::get_info(), 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::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< DerivedClass >::testAddSystemExtraInts(), DofObjectTest< DerivedClass >::testSetNSystems(), DofObjectTest< DerivedClass >::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 974 of file dof_object.h.

975{
976 libmesh_assert_less (s, this->n_systems());
977
978 const unsigned int nvg = this->n_var_groups(s);
979
980 unsigned int val=0;
981
982 for (unsigned int vg=0; vg<nvg; vg++)
983 val += this->n_vars(s,vg);
984
985 return val;
986}

References libMesh::DofObject::n_systems(), libMesh::DofObject::n_var_groups(), and 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 957 of file dof_object.h.

959{
960 libmesh_assert_less (s, this->n_systems());
961 libmesh_assert_less (vg, this->n_var_groups(s));
962
963 const unsigned int start_idx_sys = this->start_idx(s);
964
965 libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
966
967 return (cast_int<unsigned int>
968 (_idx_buf[start_idx_sys + 2*vg] >> ncv_magic_exp));
969}
static constexpr index_t ncv_magic_exp
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:696

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::DofMap::allgather_recursive_constraints(), libMesh::DofMap::distribute_dofs(), libMesh::DofObject::DofObject(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_at_node(), libMesh::OldSolutionCoefs< Output, point_output >::eval_mixed_derivatives(), libMesh::OldSolutionValue< Output, point_output >::eval_mixed_derivatives(), libMesh::BuildProjectionList::operator()(), libMesh::DofObject::operator=(), libMesh::DofMap::set_nonlocal_dof_objects(), DofObjectTest< DerivedClass >::testAddSystemExtraInts(), DofObjectTest< DerivedClass >::testSetNVariableGroups(), and DofObjectTest< DerivedClass >::testSetNVariableGroupsExtraInts().

◆ norm() [1/5]

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

Definition at line 310 of file type_vector.h.

924{
925 using std::sqrt;
926
927 // The norm is not differentiable at the origin: the directional
928 // derivative there depends on the direction of approach, so there is no
929 // well-defined gradient, and computing sqrt(norm_sq()) directly would
930 // divide by zero in the derivative terms of AD types. We return a zero
931 // derivative in this case, consistent with the MetaPhysicL convention for
932 // other functions with the same kind of non-differentiable point (e.g.
933 // abs()).
934 if (this->is_zero())
935 return decltype(sqrt(this->norm_sq())){};
936
937 return sqrt(this->norm_sq());
938}
LIBMESH_DEVICE_INLINE bool is_zero() const

◆ norm() [2/5]

auto libMesh::TypeVector< float >::norm ( ) const
inlineinherited

Definition at line 978 of file type_vector.h.

979{
980 using std::sqrt;
981 return sqrt(this->norm_sq());
982}

◆ norm() [3/5]

auto libMesh::TypeVector< double >::norm ( ) const
inlineinherited

Definition at line 986 of file type_vector.h.

987{
988 using std::sqrt;
989 return sqrt(this->norm_sq());
990}

◆ norm() [4/5]

auto libMesh::TypeVector< longdouble >::norm ( ) const
inlineinherited

Definition at line 994 of file type_vector.h.

995{
996 using std::sqrt;
997 return sqrt(this->norm_sq());
998}

◆ norm() [5/5]

auto libMesh::TypeVector< Real >::norm ( ) const
inlineinherited

Definition at line 1006 of file type_vector.h.

1007{
1008 using std::sqrt;
1009 return sqrt(this->norm_sq());
1010}

◆ norm_sq()

LIBMESH_DEVICE_INLINE auto libMesh::TypeVector< Real >::norm_sq ( ) const
inherited
Returns
The magnitude of the vector squared, i.e. the sum of the element magnitudes squared.

Definition at line 316 of file type_vector.h.

955{
956#if LIBMESH_DIM == 1
957 return (TensorTools::norm_sq(_coords[0]));
958#endif
959
960#if LIBMESH_DIM == 2
961 return (TensorTools::norm_sq(_coords[0]) +
962 TensorTools::norm_sq(_coords[1]));
963#endif
964
965#if LIBMESH_DIM == 3
966 return (TensorTools::norm_sq(_coords[0]) +
967 TensorTools::norm_sq(_coords[1]) +
968 TensorTools::norm_sq(_coords[2]));
969#endif
970}

◆ operator!=()

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

Definition at line 364 of file type_vector.h.

1084{
1085 return (!(*this == rhs));
1086}

◆ operator()() [1/2]

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

Definition at line 169 of file type_vector.h.

570{
571 libmesh_assert_less (i, LIBMESH_DIM);
572
573 return _coords[i];
574}

◆ operator()() [2/2]

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

Definition at line 162 of file type_vector.h.

559{
560 libmesh_assert_less (i, LIBMESH_DIM);
561
562 return _coords[i];
563}

◆ operator*() [1/4]

std::enable_if< ScalarTraits< Scalar >::value, TypeVector< typenameCompareTypes< Real , Scalar >::supertype > >::type libMesh::TypeVector< Real >::operator* ( const Scalar &  ) const
inherited

Multiply this vector by a scalar value.

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

◆ operator*() [2/4]

LIBMESH_DEVICE_INLINE std::enable_if< ScalarTraits< Scalar >::value, TypeVector< typenameCompareTypes< Real , Scalar >::supertype > >::type libMesh::TypeVector< Real >::operator* ( const Scalar &  factor) const
inherited

Definition at line 755 of file type_vector.h.

756{
757 typedef typename CompareTypes<T, Scalar>::supertype SuperType;
758
759#if LIBMESH_DIM == 1
760 return TypeVector<SuperType>(_coords[0]*factor);
761#endif
762
763#if LIBMESH_DIM == 2
764 return TypeVector<SuperType>(_coords[0]*factor,
765 _coords[1]*factor);
766#endif
767
768#if LIBMESH_DIM == 3
769 return TypeVector<SuperType>(_coords[0]*factor,
770 _coords[1]*factor,
771 _coords[2]*factor);
772#endif
773}

◆ operator*() [3/4]

CompareTypes< Real , T2 >::supertype libMesh::TypeVector< Real >::operator* ( const TypeVector< T2 > &  ) const
inherited
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.

◆ operator*() [4/4]

LIBMESH_DEVICE_INLINE CompareTypes< Real , T2 >::supertype libMesh::TypeVector< Real >::operator* ( const TypeVector< T2 > &  p) const
inherited

Definition at line 867 of file type_vector.h.

868{
869#if LIBMESH_DIM == 1
870 return _coords[0]*p._coords[0];
871#endif
872
873#if LIBMESH_DIM == 2
874 return (_coords[0]*p._coords[0] +
875 _coords[1]*p._coords[1]);
876#endif
877
878#if LIBMESH_DIM == 3
879 return (_coords[0]*p(0) +
880 _coords[1]*p(1) +
881 _coords[2]*p(2));
882#endif
883}

◆ operator*=()

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

Multiply this vector by a scalar value.

Returns
A reference to *this.

Definition at line 255 of file type_vector.h.

793{
794#if LIBMESH_DIM == 1
795 _coords[0] *= factor;
796#endif
797
798#if LIBMESH_DIM == 2
799 _coords[0] *= factor;
800 _coords[1] *= factor;
801#endif
802
803#if LIBMESH_DIM == 3
804 _coords[0] *= factor;
805 _coords[1] *= factor;
806 _coords[2] *= factor;
807#endif
808
809 return *this;
810}

◆ operator+() [1/2]

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

Add two vectors.

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

◆ operator+() [2/2]

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

Definition at line 582 of file type_vector.h.

583{
584 typedef typename CompareTypes<T, T2>::supertype TS;
585#if LIBMESH_DIM == 1
586 return TypeVector<TS> (_coords[0] + p._coords[0]);
587#endif
588
589#if LIBMESH_DIM == 2
590 return TypeVector<TS> (_coords[0] + p._coords[0],
591 _coords[1] + p._coords[1]);
592#endif
593
594#if LIBMESH_DIM == 3
595 return TypeVector<TS> (_coords[0] + p._coords[0],
596 _coords[1] + p._coords[1],
597 _coords[2] + p._coords[2]);
598#endif
599
600}

◆ operator+=() [1/2]

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

Add to this vector.

Returns
A reference to *this.

◆ operator+=() [2/2]

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

Definition at line 607 of file type_vector.h.

608{
609 this->add (p);
610
611 return *this;
612}
void add(const TypeVector< T2 > &)
Add to this vector without creating a temporary.

◆ operator-() [1/3]

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

Definition at line 237 of file type_vector.h.

728{
729
730#if LIBMESH_DIM == 1
731 return TypeVector(-_coords[0]);
732#endif
733
734#if LIBMESH_DIM == 2
735 return TypeVector(-_coords[0],
736 -_coords[1]);
737#endif
738
739#if LIBMESH_DIM == 3
740 return TypeVector(-_coords[0],
741 -_coords[1],
742 -_coords[2]);
743#endif
744
745}

◆ operator-() [2/3]

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

Subtract from this vector.

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

◆ operator-() [3/3]

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

Definition at line 668 of file type_vector.h.

669{
670 typedef typename CompareTypes<T, T2>::supertype TS;
671
672#if LIBMESH_DIM == 1
673 return TypeVector<TS>(_coords[0] - p._coords[0]);
674#endif
675
676#if LIBMESH_DIM == 2
677 return TypeVector<TS>(_coords[0] - p._coords[0],
678 _coords[1] - p._coords[1]);
679#endif
680
681#if LIBMESH_DIM == 3
682 return TypeVector<TS>(_coords[0] - p._coords[0],
683 _coords[1] - p._coords[1],
684 _coords[2] - p._coords[2]);
685#endif
686
687}

◆ operator-=() [1/2]

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

Subtract from this vector.

Returns
A reference to *this.

◆ operator-=() [2/2]

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

Definition at line 694 of file type_vector.h.

695{
696 this->subtract (p);
697
698 return *this;
699}
void subtract(const TypeVector< T2 > &)
Subtract from this vector without creating a temporary.

◆ operator/() [1/2]

std::enable_if< ScalarTraits< Scalar >::value, TypeVector< typenameCompareTypes< Real , Scalar >::supertype > >::type libMesh::TypeVector< Real >::operator/ ( const Scalar &  ) const
inherited

Divide each entry of this vector by scalar value.

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

◆ operator/() [2/2]

LIBMESH_DEVICE_INLINE std::enable_if< ScalarTraits< Scalar >::value, TypeVector< typenameCompareTypes< Real , Scalar >::supertype > >::type libMesh::TypeVector< Real >::operator/ ( const Scalar &  factor) const
inherited

Definition at line 820 of file type_vector.h.

821{
822 typedef typename CompareTypes<T, Scalar>::supertype TS;
823
824 libmesh_assert_not_equal_to (static_cast<TS>(factor),
825 static_cast<TS>(0.));
826
827#if LIBMESH_DIM == 1
828 return TypeVector<TS>(_coords[0]/factor);
829#endif
830
831#if LIBMESH_DIM == 2
832 return TypeVector<TS>(_coords[0]/factor,
833 _coords[1]/factor);
834#endif
835
836#if LIBMESH_DIM == 3
837 return TypeVector<TS>(_coords[0]/factor,
838 _coords[1]/factor,
839 _coords[2]/factor);
840#endif
841
842}

◆ operator/=()

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

Divide each entry of this vector by scalar value.

Returns
A reference to *this.

Definition at line 273 of file type_vector.h.

851{
852 libmesh_assert_not_equal_to (factor, static_cast<T>(0.));
853
854 for (unsigned int i=0; i<LIBMESH_DIM; i++)
855 _coords[i] /= factor;
856
857 return *this;
858}

◆ operator<() [1/2]

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

Definition at line 124 of file type_vector.C.

125{
126 for (unsigned int i=0; i<LIBMESH_DIM; i++)
127 {
128 if ((*this)(i).real() < rhs(i).real())
129 return true;
130 if ((*this)(i).real() > rhs(i).real())
131 return false;
132 if ((*this)(i).imag() < rhs(i).imag())
133 return true;
134 if ((*this)(i).imag() > rhs(i).imag())
135 return false;
136 }
137 return false;
138}
boost::multiprecision::float128 real(const boost::multiprecision::float128 in)
boost::multiprecision::float128 imag(const boost::multiprecision::float128)

◆ 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 372 of file type_vector.C.

67{
68 for (unsigned int i=0; i<LIBMESH_DIM; i++)
69 {
70 if ((*this)(i) < rhs(i))
71 return true;
72 if ((*this)(i) > rhs(i))
73 return false;
74 }
75 return false;
76}

◆ operator<=() [1/2]

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

Definition at line 143 of file type_vector.C.

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

◆ 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 380 of file type_vector.C.

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

◆ operator=()

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

Assign to a node from a point.

Definition at line 298 of file node.h.

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

◆ 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}
LIBMESH_DEVICE_INLINE bool operator==(const TypeVector< Real > &rhs) const

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

◆ operator==() [2/2]

LIBMESH_DEVICE_INLINE bool libMesh::TypeVector< Real >::operator== ( const TypeVector< Real > &  rhs) const
inherited
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 358 of file type_vector.h.

1062{
1063#if LIBMESH_DIM == 1
1064 return (_coords[0] == rhs._coords[0]);
1065#endif
1066
1067#if LIBMESH_DIM == 2
1068 return (_coords[0] == rhs._coords[0] &&
1069 _coords[1] == rhs._coords[1]);
1070#endif
1071
1072#if LIBMESH_DIM == 3
1073 return (_coords[0] == rhs._coords[0] &&
1074 _coords[1] == rhs._coords[1] &&
1075 _coords[2] == rhs._coords[2]);
1076#endif
1077}

◆ operator>() [1/2]

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

Definition at line 162 of file type_vector.C.

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

◆ 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 388 of file type_vector.C.

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

◆ operator>=() [1/2]

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

Definition at line 181 of file type_vector.C.

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

◆ 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 396 of file type_vector.C.

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

◆ 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 634 of file dof_object.C.

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

References libMesh::DofObject::_idx_buf, and libMesh::DofObject::old_dof_object.

◆ 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 552 of file dof_object.C.

553{
554 return
555 cast_int<unsigned int> (
556#ifdef LIBMESH_ENABLE_AMR
557 ((old_dof_object == nullptr) ? 0 : old_dof_object->packed_indexing_size()) + 2 +
558#else
559 1 +
560#endif
561 _idx_buf.size());
562}
unsigned int packed_indexing_size() const
If we pack our indices into an buffer for communications, how many ints do we need?
Definition dof_object.C:552

References libMesh::DofObject::_idx_buf, and libMesh::DofObject::old_dof_object.

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

◆ packed_size()

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

Definition at line 159 of file node.h.

160 {
161 const unsigned int header_size = 2;
162
163 // use "(a+b-1)/b" trick to get a/b to round up
164 static const unsigned int idtypes_per_Real =
165 (sizeof(Real) + sizeof(largest_id_type) - 1) / sizeof(largest_id_type);
166
167 return header_size + LIBMESH_DIM*idtypes_per_Real +
168 this->packed_indexing_size();
169 }
uint64_t largest_id_type
Definition id_types.h:148
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

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 401 of file type_vector.h.

1235{
1236#if LIBMESH_DIM == 1
1237
1238 os << "x=" << (*this)(0);
1239
1240#endif
1241#if LIBMESH_DIM == 2
1242
1243 os << "(x,y)=("
1244 << std::setw(8) << (*this)(0) << ", "
1245 << std::setw(8) << (*this)(1) << ")";
1246
1247#endif
1248#if LIBMESH_DIM == 3
1249
1250 os << "(x,y,z)=("
1251 << std::setw(8) << (*this)(0) << ", "
1252 << std::setw(8) << (*this)(1) << ", "
1253 << std::setw(8) << (*this)(2) << ")";
1254#endif
1255}

◆ print_dof_info()

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

Print out info for debugging.

Definition at line 662 of file dof_object.C.

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

References libMesh::DofObject::dof_number(), libMesh::DofObject::id(), libMesh::make_range(), libMesh::DofObject::n_comp(), libMesh::DofObject::n_systems(), 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}
std::string get_info() const
Prints relevant information about the node to a string.
Definition node.C:53

References get_info().

Referenced by libMesh::operator<<().

◆ print_info() [2/3]

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

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

Definition at line 81 of file reference_counter.C.

82{
84 out_stream << ReferenceCounter::get_info();
85}
static std::string get_info()
Gets a string containing the reference information.

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

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

◆ print_info() [3/3]

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

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

Definition at line 81 of file reference_counter.C.

82{
84 out_stream << ReferenceCounter::get_info();
85}

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

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

◆ 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 903 of file dof_object.h.

904{
905 return _processor_id;
906}
processor_id_type _processor_id
The processor_id of the DofObject.
Definition dof_object.h:585

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 895 of file dof_object.h.

896{
897 return _processor_id;
898}

References libMesh::DofObject::_processor_id.

Referenced by GhostDofConstraintPartitioner::_do_partition(), NonManifoldTestPartitioner::_do_partition(), libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::MeshRefinement::add_node(), libMesh::DistributedMesh::add_node(), libMesh::DistributedMesh::add_point(), libMesh::ReplicatedMesh::add_point(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Patch::build_around_element(), libMesh::Partitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::BoundaryInfo::build_side_list_from_node_list(), libMesh::MeshFunction::check_found_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::MeshBase::copy_constraint_rows(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::DistributedMesh::delete_elem(), libMesh::MeshCommunication::delete_remote_elements(), 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::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), get_info(), libMesh::Elem::inherit_data_from(), libMesh::RBEIMConstruction::initialize_qp_data(), libMesh::DistributedMesh::insert_elem(), libMesh::MeshTools::Modification::interpolate_surface(), libMesh::DofObject::invalidate_processor_id(), 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(), MeshPerElemTest< elem_type >::meshes_equal_enough(), libMesh::PeriodicBoundaries::neighbor(), libMesh::RBEIMEvaluation::node_distribute_bfs(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SortAndCopy::operator()(), libMesh::CompareDofObjectsByPIDAndThenID::operator()(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::ProjectInteriors::operator()(), AugmentSparsityOnInterface::operator()(), libMesh::GhostPointNeighbors::operator()(), OverlappingCouplingFunctor::operator()(), AugmentSparsityOnNodes::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::DistributedMesh::own_node(), libMesh::XdrIO::pack_element(), libMesh::CentroidPartitioner::partition_range(), libMesh::LinearPartitioner::partition_range(), libMesh::SFCPartitioner::partition_range(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::Polygon::Polygon(), libMesh::Polyhedron::Polyhedron(), libMesh::DofMap::process_mesh_constraint_rows(), libMesh::DofObject::processor_id(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_nodes(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::PetscPreconditioner< T >::set_hypre_ads_data(), libMesh::PetscPreconditioner< T >::set_hypre_ams_data(), libMesh::Partitioner::set_interface_node_processor_ids_BFS(), libMesh::Partitioner::set_interface_node_processor_ids_linear(), libMesh::Partitioner::set_interface_node_processor_ids_petscpartitioner(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), ParsedFEMFunctionTest::setUp(), libMesh::Partitioner::single_partition_range(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id_once(), MeshFunctionTest::test_bad_gradient_var_with_out_of_mesh_value(), MeshFunctionTest::test_bad_hessian_var_with_out_of_mesh_value(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), DofMapTest::testGhostConstraintSendList(), DofObjectTest< DerivedClass >::testInvalidateProcId(), EquationSystemsTest::testPostInitAddElem(), DofObjectTest< DerivedClass >::testSetProcId(), BoundaryInfoTest::testShellFaceConstraints(), DofObjectTest< DerivedClass >::testValidProcId(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::DTKAdapter::update_variable_values(), NonManifoldGhostingFunctorTest::verify_send_list_entries_helper(), libMesh::GmshIO::write_mesh(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), 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 911 of file dof_object.h.

912{
913 this->processor_id() = pid;
914}

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 340 of file type_vector.h.

1053{
1054 return libMesh::relative_fuzzy_equals(*this, rhs, tol);
1055}
bool relative_fuzzy_equals(const T &var1, const T2 &var2, const Real tol=TOLERANCE *TOLERANCE)
Function to check whether two variables are equal within a relative tolerance.

◆ set_buffer()

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

Definition at line 722 of file dof_object.h.

723 { _idx_buf = buf; }

References libMesh::DofObject::_idx_buf.

Referenced by DofObjectTest< DerivedClass >::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 446 of file dof_object.C.

450{
451 libmesh_assert_less (s, this->n_systems());
452 libmesh_assert_less (var, this->n_vars(s));
453 libmesh_assert_less (comp, this->n_comp(s,var));
454
455 const unsigned int
456 vg = this->var_to_vg(s,var),
457#ifndef NDEBUG
458 ncg = this->n_comp_group(s,vg),
459#endif
460 vig = this->system_var_to_vg_var(s,vg,var),
461 start_idx_sys = this->start_idx(s);
462
463 libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
464
465 dof_id_type & base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
466
467 // We intend to change all dof numbers together or not at all
468 if (comp || vig)
469 libmesh_assert ((dn == invalid_id && base_idx == invalid_id) ||
470 (dn == base_idx + vig*ncg + comp));
471
472 // only explicitly store the base index for vig==0, comp==0
473 else
474 base_idx = dn;
475
476 libmesh_assert_equal_to (this->dof_number(s, var, comp), dn);
477}
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.

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(), 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 1116 of file dof_object.h.

1118{
1119#ifndef NDEBUG
1120 const unsigned int n_more_integers = (sizeof(T)-1)/sizeof(dof_id_type);
1121#endif
1122 libmesh_assert_less(index+n_more_integers, this->n_extra_integers());
1123 libmesh_assert_less(this->n_pseudo_systems(), _idx_buf.size());
1124
1125 const unsigned int start_idx_i = this->start_idx_ints();
1126
1127 libmesh_assert_less(start_idx_i+index+n_more_integers, _idx_buf.size());
1128 std::memcpy(&_idx_buf[start_idx_i+index], &value, sizeof(T));
1129}
static const bool value
Definition xdr_io.C:55

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::MeshTools::Modification::all_rbb(), libMesh::ExodusII_IO::read(), libMesh::DynaIO::read_mesh(), RationalMapTest< elem_type >::setUp(), FETestBase< order, family, elem_type, build_nx, CaseName >::setUp(), and DofObjectTest< DerivedClass >::testAddExtraData().

◆ set_extra_integer()

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

◆ set_id() [1/2]

dof_id_type & libMesh::DofObject::set_id ( )
inlineinherited

◆ set_id() [2/2]

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

Sets the id for this DofObject.

Definition at line 192 of file dof_object.h.

193 { 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 377 of file dof_object.C.

380{
381 libmesh_assert_less (s, this->n_systems());
382 libmesh_assert_less (var, this->n_vars(s));
383
384 this->set_n_comp_group(s, this->var_to_vg(s,var), ncomp);
385}
void set_n_comp_group(const unsigned int s, const unsigned int vg, const unsigned int ncomp)
Sets the number of components for VariableGroup vg of system s associated with this DofObject.
Definition dof_object.C:389

References libMesh::DofObject::n_systems(), 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 389 of file dof_object.C.

392{
393 libmesh_assert_less (s, this->n_systems());
394 libmesh_assert_less (vg, this->n_var_groups(s));
395
396 // Check for trivial return
397 if (ncomp == this->n_comp_group(s,vg)) return;
398
399#ifndef NDEBUG
400 if (index_t(ncomp) >= ncv_magic)
401 {
402 const index_t ncvm = ncv_magic;
403 libmesh_error_msg("ERROR: ncomp must be less than DofObject::ncv_magic!\n" \
404 << "ncomp = " \
405 << ncomp \
406 << ", ncv_magic = " \
407 << ncvm \
408 << "\nrecompile and try again!");
409 }
410#endif
411
412 const unsigned int
413 start_idx_sys = this->start_idx(s),
414 n_vars_group = this->n_vars(s,vg),
415 base_offset = start_idx_sys + 2*vg;
416
417 libmesh_assert_less ((base_offset + 1), _idx_buf.size());
418
419 // if (ncomp)
420 // libMesh::out << "s,vg,ncomp="
421 // << s << ","
422 // << vg << ","
423 // << ncomp << '\n';
424
425 // set the number of components, maintaining the number
426 // of variables in the group
427 _idx_buf[base_offset] = ncv_magic*n_vars_group + ncomp;
428
429 // We use (invalid_id - 1) to signify no
430 // components for this object
431 _idx_buf[base_offset + 1] = (ncomp == 0) ? invalid_id - 1 : invalid_id;
432
433 // this->debug_buffer();
434 // libMesh::out << "s,vg = " << s << "," << vg << '\n'
435 // << "base_offset=" << base_offset << '\n'
436 // << "this->n_comp(s,vg)=" << this->n_comp(s,vg) << '\n'
437 // << "this->n_comp_group(s,vg)=" << this->n_comp_group(s,vg) << '\n'
438 // << "this->n_vars(s,vg)=" << this->n_vars(s,vg) << '\n'
439 // << "this->n_var_groups(s)=" << this->n_var_groups(s) << '\n';
440
441 libmesh_assert_equal_to (ncomp, this->n_comp_group(s,vg));
442}
dof_id_type index_t
DoF index information.
Definition dof_object.h:669

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

Referenced by libMesh::DofObject::set_n_comp(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), and DofObjectTest< DerivedClass >::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 142 of file dof_object.C.

143{
144 const unsigned int old_ns = this->n_systems();
145
146 // Check for trivial return
147 if (ns == old_ns)
148 return;
149
150 const unsigned int nei = this->n_extra_integers();
151 const dof_id_type header_size = ns + bool(nei);
152 const dof_id_type hdr = nei ?
153 static_cast<dof_id_type>(-static_cast<std::ptrdiff_t>(header_size))
154 : header_size;
155 index_buffer_t new_buf(header_size + nei, hdr);
156 if (nei)
157 {
158 const unsigned int start_idx_ints = old_ns ?
159 cast_int<unsigned int>(_idx_buf[old_ns]) :
160 1;
161 libmesh_assert_less(start_idx_ints, _idx_buf.size());
162 std::copy(_idx_buf.begin()+start_idx_ints,
163 _idx_buf.end(),
164 new_buf.begin()+header_size);
165 if (ns)
166 std::fill(new_buf.begin()+1, new_buf.begin()+ns+1, ns+1);
167 }
168
169 // vector swap trick to force deallocation when shrinking
170 new_buf.swap(_idx_buf);
171
172#ifdef DEBUG
173 libmesh_assert_equal_to(nei, this->n_extra_integers());
174
175 // check that all systems now exist and that they have 0 size
176 libmesh_assert_equal_to (ns, this->n_systems());
177 for (auto s : make_range(this->n_systems()))
178 {
179 libmesh_assert_equal_to (this->n_vars(s), 0);
180 libmesh_assert_equal_to (this->n_var_groups(s), 0);
181 }
182#endif
183}
std::vector< index_t > index_buffer_t
Definition dof_object.h:670

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

Referenced by libMesh::DofObject::add_system(), libMesh::DofObject::clear_dofs(), libMesh::Elem::refine(), DofObjectTest< DerivedClass >::testManualDofCalculation(), DofObjectTest< DerivedClass >::testSetNSystems(), DofObjectTest< DerivedClass >::testSetNSystemsExtraInts(), DofObjectTest< DerivedClass >::testSetNVariableGroups(), and DofObjectTest< DerivedClass >::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 239 of file dof_object.C.

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

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

Referenced by DofObjectTest< DerivedClass >::testManualDofCalculation(), DofObjectTest< DerivedClass >::testSetNVariableGroups(), and DofObjectTest< DerivedClass >::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 127 of file dof_object.C.

128{
129 this->clear_old_dof_object();
130
132
133 // Make a new DofObject, assign a copy of \p this.
134 // Make sure the copy ctor for DofObject works!!
135 this->old_dof_object = this->construct(this);
136}
std::unique_ptr< DofObject > construct(const DofObject *other=nullptr)
Convenient factory function that calls either the (deep) copy constructor or the default constructor ...
Definition dof_object.h:746
void clear_old_dof_object()
Sets the old_dof_object to nullptr.
Definition dof_object.C:120

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

◆ set_unique_id()

void libMesh::DofObject::set_unique_id ( unique_id_type  new_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 355 of file node.h.

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

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 1287 of file dof_object.h.

1290{
1291 libmesh_assert_less (s, this->n_systems());
1292 libmesh_assert_less (vg, this->n_var_groups(s));
1293
1294 const unsigned int
1295 start_idx_sys = this->start_idx(s);
1296
1297 libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1298
1299 _idx_buf[start_idx_sys + 2*vg + 1] = db;
1300
1301 libmesh_assert_equal_to (this->vg_dof_base(s,vg), db);
1302}
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...

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::set_nonlocal_dof_objects(), and DofObjectTest< DerivedClass >::testManualDofCalculation().

◆ slice() [1/2]

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

Definition at line 171 of file type_vector.h.

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

◆ slice() [2/2]

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

Definition at line 164 of file type_vector.h.

164{ 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 1263 of file dof_object.h.

1264{
1266
1267 unsigned int n_sys = this->n_systems();
1268
1269 libmesh_assert_less(this->n_systems(), _idx_buf.size());
1270 return n_sys ? cast_int<unsigned int>(_idx_buf[this->n_systems()]) :
1271 (n_sys+1);
1272}

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() [1/2]

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

Subtract from this vector without creating a temporary.

◆ subtract() [2/2]

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

Definition at line 706 of file type_vector.h.

707{
708 for (unsigned int i=0; i<LIBMESH_DIM; i++)
709 _coords[i] -= p._coords[i];
710}

◆ subtract_scaled()

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

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

Definition at line 232 of file type_vector.h.

718{
719 for (unsigned int i=0; i<LIBMESH_DIM; i++)
720 _coords[i] -= factor*p(i);
721}

◆ 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 1349 of file dof_object.h.

1352{
1353 unsigned int accumulated_sum=0;
1354
1355 for (unsigned int vgc=0; vgc<vg; vgc++)
1356 accumulated_sum += this->n_vars(s,vgc);
1357
1358 libmesh_assert_less_equal (accumulated_sum, var);
1359
1360 return (var - accumulated_sum);
1361}

References n_vars.

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

◆ unique_id()

unique_id_type libMesh::DofObject::unique_id ( ) const
inlineinherited
Returns
The globally unique_id for this DofObject

Definition at line 849 of file dof_object.h.

850{
851#ifdef LIBMESH_ENABLE_UNIQUE_ID
853 return _unique_id;
854#else
855 return invalid_unique_id;
856#endif
857}
static constexpr unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition dof_object.h:478
bool valid_unique_id() const
Definition dof_object.h:883

References libMesh::DofObject::_unique_id, libMesh::DofObject::invalid_unique_id, libMesh::libmesh_assert(), and libMesh::DofObject::valid_unique_id().

Referenced by libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::MeshTools::Modification::all_tri(), libMesh::Elem::disconnected_clone(), libMesh::C0Polyhedron::disconnected_clone(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_elem(), libMesh::XdrIO::pack_element(), libMesh::ExodusII_IO::read_elemental_variable(), libMesh::CheckpointIO::read_nodes(), MeshInputTest::testExodusSetNodeUniqueIdsFromMaps_implementation(), SlitMeshRefinedSystemTest::testRestart(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), and libMesh::XdrIO::write_serialized_nodes().

◆ unit()

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

Definition at line 304 of file type_vector.h.

1210{
1211
1212 auto && length = norm();
1213
1214 libmesh_assert_not_equal_to (length, static_cast<Real>(0.));
1215
1216#if LIBMESH_DIM == 1
1217 return TypeVector<T>(_coords[0]/length);
1218#endif
1219
1220#if LIBMESH_DIM == 2
1221 return TypeVector<T>(_coords[0]/length,
1222 _coords[1]/length);
1223#endif
1224
1225#if LIBMESH_DIM == 3
1226 return TypeVector<T>(_coords[0]/length,
1227 _coords[1]/length,
1228 _coords[2]/length);
1229#endif
1230
1231}

◆ 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 587 of file dof_object.C.

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

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

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

◆ 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 567 of file dof_object.C.

568{
569#ifdef LIBMESH_ENABLE_AMR
570 const bool has_old_dof_object = cast_int<bool>(*begin++);
571
572 static const int dof_header_size = 2;
573#else
574 static const bool has_old_dof_object = false;
575 static const int dof_header_size = 1;
576#endif
577
578 const largest_id_type this_indexing_size = *begin++;
579
580 return cast_int<unsigned int>
581 (dof_header_size + this_indexing_size +
582 (has_old_dof_object ?
583 unpackable_indexing_size(begin+this_indexing_size) : 0));
584}
static unsigned int unpackable_indexing_size(std::vector< largest_id_type >::const_iterator begin)
If we have indices packed into an buffer for communications, how much of that buffer applies to this ...
Definition dof_object.C:567

References libMesh::DofObject::unpackable_indexing_size().

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

◆ 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 178 of file node.h.

179 {
180#ifdef LIBMESH_ENABLE_NODE_VALENCE
181 return _valence;
182#else
183 libmesh_not_implemented();
185#endif
186 }

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

◆ 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 1331 of file dof_object.h.

1333{
1334 const unsigned int
1335 nvg = this->n_var_groups(s);
1336
1337 for (unsigned int vg=0, vg_end=0; vg<nvg; vg++)
1338 {
1339 vg_end += this->n_vars(s,vg);
1340 if (var < vg_end) return vg;
1341 }
1342
1343 libmesh_error_msg("Error: could not map variable " << var << " to variable group.");
1344}

References libMesh::DofObject::n_var_groups(), and 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 1190 of file dof_object.h.

1192{
1193 std::pair<unsigned int, unsigned int> returnval(0,0);
1194
1195 unsigned int & vg = returnval.first;
1196 unsigned int & offset = returnval.second;
1197
1198 unsigned int vg_start = 0;
1199 for (; ; vg++)
1200 {
1201 libmesh_assert_less(vg, this->n_var_groups(s));
1202
1203 const unsigned int vg_end = vg_start + this->n_vars(s,vg);
1204 if (var < vg_end)
1205 {
1206 offset = var - vg_start;
1207 return returnval;
1208 }
1209 vg_start = vg_end;
1210 }
1211}

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

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::_node_dof_indices(), libMesh::DofObject::dof_number(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), and libMesh::OldSolutionCoefs< 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 1307 of file dof_object.h.

1309{
1310 libmesh_assert_less (s, this->n_systems());
1311 libmesh_assert_less (vg, this->n_var_groups(s));
1312
1313 const unsigned int
1314 start_idx_sys = this->start_idx(s);
1315
1316 libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
1317
1318 // #ifdef DEBUG
1319 // std::cout << " [ ";
1320 // for (auto i : _idx_buf)
1321 // std::cout << i << " ";
1322 // std::cout << "]\n";
1323 // #endif
1324
1325 return _idx_buf[start_idx_sys + 2*vg + 1];
1326}

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::set_nonlocal_dof_objects(), libMesh::DofObject::set_vg_dof_base(), and DofObjectTest< DerivedClass >::testManualDofCalculation().

◆ write_unformatted()

void libMesh::TypeVector< Real >::write_unformatted ( std::ostream &  out_stream,
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 423 of file type_vector.C.

53{
54 os << std::setiosflags(std::ios::showpoint)
55 << (*this)(0) << " "
56 << (*this)(1) << " "
57 << (*this)(2) << " ";
58
59 if (newline)
60 os << '\n';
61}

◆ zero()

LIBMESH_DEVICE_INLINE void libMesh::TypeVector< Real >::zero ( )
inherited

Set all entries of the vector to 0.

Definition at line 334 of file type_vector.h.

945{
946 for (unsigned int i=0; i<LIBMESH_DIM; i++)
947 _coords[i] = 0.;
948}

Friends And Related Symbol Documentation

◆ Elem

friend class Elem
friend

Definition at line 206 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 205 of file node.h.

Member Data Documentation

◆ _coords

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

The coordinates of the TypeVector.

Definition at line 431 of file type_vector.h.

◆ _counts [1/2]

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

Actually holds the data.

Definition at line 124 of file reference_counter.h.

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

◆ _counts [2/2]

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

Actually holds the data.

Definition at line 124 of file reference_counter.h.

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

◆ _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 143 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 143 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 137 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 137 of file reference_counter.h.

◆ _n_objects [1/2]

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

◆ _n_objects [2/2]

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

◆ _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 585 of file dof_object.h.

Referenced by libMesh::DofObject::operator=(), libMesh::DofObject::processor_id(), 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 568 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 219 of file node.h.

Referenced by set_valence(), and valence().

◆ invalid_id

constexpr dof_id_type libMesh::DofObject::invalid_id = static_cast<dof_id_type>(-1)
staticconstexprinherited

An invalid id to distinguish an uninitialized DofObject.

Definition at line 473 of file dof_object.h.

Referenced by libMesh::DofMap::_dof_indices(), active(), libMesh::MeshBase::add_elem_datum(), libMesh::MeshBase::add_elem_integers(), libMesh::DofObject::add_extra_integers(), libMesh::StaticCondensation::add_matrix(), libMesh::TopologyMap::add_node(), libMesh::MeshRefinement::add_node(), libMesh::MeshBase::add_node_datum(), libMesh::MeshBase::add_node_integers(), libMesh::ReplicatedMesh::add_point(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Elem::bracketing_nodes(), ExtraIntegersTest::checkpoint_helper(), libMesh::StaticCondensation::clear(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::DofObject::dof_number(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_interiors(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_nodes(), libMesh::RBEIMConstruction::enrich_eim_approximation_on_sides(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::OldSolutionValue< Output, point_output >::eval_old_dofs(), libMesh::TopologyMap::find(), libMesh::TopologyMap::find(), libMesh::DofMap::gather_constraints(), libMesh::MeshBase::get_elemset_code(), libMesh::Poly2TriTriangulator::insert_refinement_points(), libMesh::Elem::interior_parent(), 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::DistributedMesh::own_node(), libMesh::XdrIO::pack_element(), libMesh::SFCPartitioner::partition_range(), libMesh::Elem::point(), libMesh::ExodusII_IO::read(), libMesh::DynaIO::read_mesh(), libMesh::System::read_parallel_data(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::SimplexRefiner::refine_via_edges(), libMesh::StaticCondensationDofMap::reinit(), 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< DerivedClass >::testAddExtraData(), DofObjectTest< DerivedClass >::testAddSystemExtraInts(), ExtraIntegersTest::testExtraIntegersExodusReading(), InfFERadialTest::testRefinement(), DofObjectTest< DerivedClass >::testSetNSystemsExtraInts(), DofObjectTest< DerivedClass >::testSetNVariableGroupsExtraInts(), MeshTetTest::testTetInterfaceBase(), DofObjectTest< DerivedClass >::testValidId(), MeshSmootherTest::testVariationalSmoother(), WriteElemsetData::testWriteImpl(), libMesh::NetGenMeshInterface::triangulate(), libMesh::Poly2TriTriangulator::triangulate_current_points(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DofObject::valid_id(), libMesh::System::write_parallel_data(), and libMesh::XdrIO::write_serialized_connectivity().

◆ invalid_processor_id

constexpr processor_id_type libMesh::DofObject::invalid_processor_id = static_cast<processor_id_type>(-1)
staticconstexprinherited

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

Definition at line 484 of file dof_object.h.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::MeshRefinement::add_node(), libMesh::DistributedMesh::add_node(), libMesh::MeshCommunication::allgather(), choose_processor_id(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubProjector::construct_projection(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshBase::count_constraint_rows(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), 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::MeshBase::get_info(), libMesh::DistributedMesh::insert_elem(), 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_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::MeshBase::n_unpartitioned_elem(), libMesh::MeshBase::n_unpartitioned_nodes(), libMesh::SparsityPattern::Build::operator()(), libMesh::Partitioner::processor_pairs_to_interface_nodes(), libMesh::Nemesis_IO_Helper::read_var_names_impl(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DistributedMesh::renumber_nodes_and_elements(), 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::LaplaceMeshSmoother::smooth(), 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< DerivedClass >::testValidProcId(), libMesh::MeshTools::total_weight(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::DofObject::valid_processor_id(), and libMesh::CheckpointIO::write().

◆ invalid_unique_id

constexpr unique_id_type libMesh::DofObject::invalid_unique_id = static_cast<unique_id_type>(-1)
staticconstexprinherited

An invalid unique_id to distinguish an uninitialized DofObject.

Definition at line 478 of file dof_object.h.

Referenced by libMesh::DistributedMesh::renumber_dof_objects(), libMesh::DofObject::unique_id(), and libMesh::DofObject::valid_unique_id().

◆ ncv_magic

constexpr index_t libMesh::DofObject::ncv_magic = index_t(1) << ncv_magic_exp
staticconstexprprivateinherited

◆ ncv_magic_exp

constexpr index_t libMesh::DofObject::ncv_magic_exp = sizeof(index_t)*3
staticconstexprprivateinherited

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

I want ncv_magic to be low enough so we can still do some testing with multiphysics and 16-bit DoF indices occasionally, but high enough that we don't fail with only a few hundred components (e.g. a p=6 L2_HIERARCIC Hex has 7^3 and already exceeds 2^8).

Let's make it what our indices can store to the 3/8 power. That leaves 5/8 for n_vars. On a 32-bit build this lets us have n_vars up to 2^20 (good for 1M variables, passing our 100K unit test) and n_comp up to 2^12 (good for 16^3 components, so we can go up to p=15 even on an L2_HIERARCHIC hex).

For a 64-bit build we instead get 2^40 and 2^24, 1T vars and p=30, which should be enough for anybody.

Definition at line 696 of file dof_object.h.

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

◆ old_dof_object

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

The documentation for this class was generated from the following files: