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

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

#include <node.h>

Inheritance diagram for libMesh::Node:
[legend]

Public Types

typedef Real value_type
 Helper typedef for C++98 generic programming. More...
 

Public Member Functions

 Node (const Real x=0, const Real y=0, const Real z=0, const dof_id_type id=invalid_id)
 Constructor. More...
 
 Node (const Node &n)
 Copy-constructor. More...
 
 Node (const Point &p, const dof_id_type id=invalid_id)
 Copy-constructor from a Point. More...
 
 ~Node ()
 Destructor. More...
 
Nodeoperator= (const Point &p)
 Assign to a node from a point. More...
 
bool active () const
 
bool operator== (const Node &rhs) const
 
void print_info (std::ostream &os=libMesh::out) const
 Prints relevant information about the node. More...
 
std::string get_info () const
 Prints relevant information about the node to a string. More...
 
unsigned int packed_size () const
 
unsigned int valence () const
 
void set_valence (unsigned int val)
 Sets the number of nodes connected with this node. More...
 
void assign (const TypeVector< T2 > &)
 Assign to this vector without creating a temporary. More...
 
const Realoperator() (const unsigned int i) const
 
Realoperator() (const unsigned int i)
 
const Realslice (const unsigned int i) const
 
Realslice (const unsigned int i)
 
TypeVector< typename CompareTypes< Real, T2 >::supertype > operator+ (const TypeVector< T2 > &) const
 Add two vectors. More...
 
const TypeVector< Real > & operator+= (const TypeVector< T2 > &)
 Add to this vector. More...
 
void add (const TypeVector< T2 > &)
 Add to this vector without creating a temporary. More...
 
void add_scaled (const TypeVector< T2 > &, const Real)
 Add a scaled value to this vector without creating a temporary. More...
 
TypeVector< typename CompareTypes< Real, T2 >::supertype > operator- (const TypeVector< T2 > &) const
 Subtract from this vector. More...
 
TypeVector< Realoperator- () const
 
const TypeVector< Real > & operator-= (const TypeVector< T2 > &)
 Subtract from this vector. More...
 
void subtract (const TypeVector< T2 > &)
 Subtract from this vector without creating a temporary. More...
 
void subtract_scaled (const TypeVector< T2 > &, const Real)
 Subtract a scaled value from this vector without creating a temporary. More...
 
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< Real, Scalar >::supertype > >::type operator* (const Scalar) const
 Multiply this vector by a scalar value. More...
 
CompareTypes< Real, T2 >::supertype operator* (const TypeVector< T2 > &) const
 
const TypeVector< Real > & operator*= (const Real)
 Multiply this vector by a scalar value. More...
 
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< Real, Scalar >::supertype > >::type operator/ (const Scalar) const
 Divide each entry of this vector by scalar value. More...
 
const TypeVector< Real > & operator/= (const Real)
 Divide each entry of this vector by scalar value. More...
 
CompareTypes< Real, T2 >::supertype contract (const TypeVector< T2 > &) const
 
TypeVector< typename CompareTypes< Real, T2 >::supertype > cross (const TypeVector< T2 > &v) const
 
TypeVector< Realunit () const
 
Real size () const
 
Real norm () const
 
Real size_sq () const
 
Real norm_sq () const
 
void zero ()
 Set all entries of the vector to 0. More...
 
bool relative_fuzzy_equals (const TypeVector< Real > &rhs, Real tol=TOLERANCE) const
 
bool absolute_fuzzy_equals (const TypeVector< Real > &rhs, Real tol=TOLERANCE) const
 
bool operator== (const TypeVector< Real > &rhs) const
 
bool operator!= (const TypeVector< Real > &rhs) const
 
bool operator< (const TypeVector< Real > &rhs) const
 
bool operator<= (const TypeVector< Real > &rhs) const
 
bool operator> (const TypeVector< Real > &rhs) const
 
bool operator>= (const TypeVector< Real > &rhs) const
 
void print (std::ostream &os=libMesh::out) const
 Formatted print, by default to libMesh::out. More...
 
void write_unformatted (std::ostream &out, const bool newline=true) const
 Unformatted print to the stream out. More...
 
void clear_old_dof_object ()
 Sets the old_dof_object to libmesh_nullptr. More...
 
void set_old_dof_object ()
 Sets the old_dof_object to a copy of this. More...
 
void clear_dofs ()
 Clear the DofMap data structures and return to a pristine state. More...
 
void invalidate_dofs (const unsigned int sys_num=libMesh::invalid_uint)
 Sets all degree of freedom numbers to invalid_id. More...
 
void invalidate_id ()
 Sets the id to invalid_id. More...
 
void invalidate_processor_id ()
 Sets the processor id to invalid_processor_id. More...
 
void invalidate ()
 Invalidates all the indices for this DofObject. More...
 
unsigned int n_dofs (const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
 
dof_id_type id () const
 
dof_id_typeset_id ()
 
void set_id (const dof_id_type dofid)
 Sets the id for this DofObject. More...
 
unique_id_type unique_id () const
 
unique_id_typeset_unique_id ()
 
bool valid_id () const
 
bool valid_unique_id () const
 
processor_id_type processor_id () const
 
processor_id_typeprocessor_id ()
 
void processor_id (const processor_id_type pid)
 Sets the processor_id for this DofObject. More...
 
bool valid_processor_id () const
 
unsigned int n_systems () const
 
void set_n_systems (const unsigned int s)
 Sets the number of systems for this DofObject. More...
 
void add_system ()
 Adds an additional system to the DofObject. More...
 
unsigned int n_var_groups (const unsigned int s) const
 
unsigned int n_vars (const unsigned int s, const unsigned int vg) const
 
unsigned int n_vars (const unsigned int s) const
 
void set_n_vars_per_group (const unsigned int s, const std::vector< unsigned int > &nvpg)
 Sets number of variables in each group associated with system s for this DofObject. More...
 
unsigned int n_comp (const unsigned int s, const unsigned int var) const
 
unsigned int n_comp_group (const unsigned int s, const unsigned int vg) const
 
void set_n_comp (const unsigned int s, const unsigned int var, const unsigned int ncomp)
 Sets the number of components for Variable var of system s associated with this DofObject. More...
 
void set_n_comp_group (const unsigned int s, const unsigned int vg, const unsigned int ncomp)
 Sets the number of components for VariableGroup vg of system s associated with this DofObject. More...
 
dof_id_type dof_number (const unsigned int s, const unsigned int var, const unsigned int comp) const
 
void set_dof_number (const unsigned int s, const unsigned int var, const unsigned int comp, const dof_id_type dn)
 Sets the global degree of freedom number for variable var, component comp for system s associated with this DofObject. More...
 
bool has_dofs (const unsigned int s=libMesh::invalid_uint) const
 
void set_vg_dof_base (const unsigned int s, const unsigned int vg, const dof_id_type db)
 VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base. More...
 
dof_id_type vg_dof_base (const unsigned int s, const unsigned int vg) const
 VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for direct access to the base. More...
 
unsigned int packed_indexing_size () const
 If we pack our indices into an buffer for communications, how many ints do we need? More...
 
void unpack_indexing (std::vector< largest_id_type >::const_iterator begin)
 A method for creating our index buffer from packed data - basically with our current implementation we investigate the size term and then copy. More...
 
void pack_indexing (std::back_insert_iterator< std::vector< largest_id_type >> target) const
 A method for creating packed data from our index buffer - basically a copy with prepended size with our current implementation. More...
 
void debug_buffer () const
 Print our buffer for debugging. More...
 
void print_dof_info () const
 Print out info for debugging. More...
 
void set_buffer (const std::vector< dof_id_type > &buf)
 

Static Public Member Functions

static UniquePtr< Nodebuild (const Node &n)
 
static UniquePtr< Nodebuild (const Point &p, const dof_id_type id)
 
static UniquePtr< Nodebuild (const Real x, const Real y, const Real z, const dof_id_type id)
 
static unsigned int unpackable_indexing_size (std::vector< largest_id_type >::const_iterator begin)
 If we have indices packed into an buffer for communications, how much of that buffer applies to this dof object? More...
 
static std::string get_info ()
 Gets a string containing the reference information. More...
 
static void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void disable_print_counter_info ()
 
static std::string get_info ()
 Gets a string containing the reference information. More...
 
static void print_info (std::ostream &out=libMesh::out)
 Prints the reference information, by default to libMesh::out. More...
 
static unsigned int n_objects ()
 Prints the number of outstanding (created, but not yet destroyed) objects. More...
 
static void enable_print_counter_info ()
 Methods to enable/disable the reference counter output from print_info() More...
 
static void disable_print_counter_info ()
 

Public Attributes

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

Static Public Attributes

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

Protected Types

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

Protected Member Functions

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

Protected Attributes

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

Static Protected Attributes

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

Private Types

typedef unsigned char valence_idx_t
 Type used to store node valence. More...
 

Private Attributes

valence_idx_t _valence
 The number of nodes connected with this node. More...
 

Friends

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

Detailed Description

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

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

Author
Benjamin S. Kirk
Date
2003 A geometric point in (x,y,z) space associated with a DOF.

Definition at line 52 of file node.h.

Member Typedef Documentation

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.

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.

typedef unsigned char libMesh::Node::valence_idx_t
private

Type used to store node valence.

Definition at line 194 of file node.h.

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

Helper typedef for C++98 generic programming.

Definition at line 107 of file type_vector.h.

Constructor & Destructor Documentation

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

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

References _valence, libMesh::DofObject::DofObject(), libMesh::DofObject::invalid_id, libMesh::Point::Point(), libMesh::DofObject::set_id(), and ~Node().

Referenced by build().

225  :
226  Point(x,y,z)
227 #ifdef LIBMESH_ENABLE_NODE_VALENCE
228  ,
229  _valence(0)
230 #endif
231 {
232  this->set_id() = dofid;
233 }
234 
235 
236 
237 #ifdef LIBMESH_ENABLE_DEPRECATED
238 inline
239 Node::Node (const Node & n) :
240  Point(n),
241  DofObject(n),
243 #ifdef LIBMESH_ENABLE_NODE_VALENCE
244  ,
245  _valence(n._valence)
246 #endif
247 {
248  libmesh_deprecated();
249 }
250 #endif
251 
252 
253 
254 inline
255 Node::Node (const Point & p,
256  const dof_id_type dofid) :
257  Point(p)
258 #ifdef LIBMESH_ENABLE_NODE_VALENCE
259  ,
260  _valence(0)
261 #endif
262 {
263  // optionally assign the id. We have
264  // to do it like this otherwise
265  // Node n = Point p would erase
266  // the id!
267  if (dofid != invalid_id)
268  this->set_id() = dofid;
269 }
270 
271 
272 
273 inline
274 Node::~Node ()
275 {
276 }
valence_idx_t _valence
The number of nodes connected with this node.
Definition: node.h:201
dof_id_type & set_id()
Definition: dof_object.h:641
Node(const Real x=0, const Real y=0, const Real z=0, const dof_id_type id=invalid_id)
Constructor.
Definition: node.h:222
DofObject()
Constructor.
Definition: dof_object.h:522
Point(const Real x=0., const Real y=0., const Real z=0.)
Constructor.
Definition: point.h:46
PetscErrorCode Vec x
uint8_t dof_id_type
Definition: id_types.h:64
libMesh::Node::Node ( const Node n)

Copy-constructor.

Deprecated:
  • anyone copying a Node would almost certainly be better off copying the much cheaper Point or taking a reference to the Node.
libMesh::Node::Node ( const Point p,
const dof_id_type  id = invalid_id 
)
explicit

Copy-constructor from a Point.

Optionally assigned the id.

libMesh::Node::~Node ( )

Destructor.

Referenced by Node().

Member Function Documentation

bool libMesh::TypeVector< Real >::absolute_fuzzy_equals ( const TypeVector< Real > &  rhs,
Real  tol = TOLERANCE 
) const
inherited
Returns
true if two vectors are equal to within an absolute tolerance of tol.
bool libMesh::Node::active ( ) const
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 328 of file node.h.

References libMesh::DofObject::invalid_id.

329 {
330  return (this->id() != Node::invalid_id);
331 }
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:324
void libMesh::TypeVector< Real >::add ( const TypeVector< T2 > &  )
inherited

Add to this vector without creating a temporary.

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

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

void libMesh::DofObject::add_system ( )
inherited

Adds an additional system to the DofObject.

Definition at line 195 of file dof_object.C.

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

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

196 {
197  // quick return?
198  if (this->n_systems() == 0)
199  {
200  this->set_n_systems(1);
201  return;
202  }
203 
204  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
205 
206  std::advance(it, this->n_systems());
207 
208  // this inserts the current vector size at the position for the new system - creating the
209  // entry we need for the new system indicating there are 0 variables.
210  _idx_buf.insert(it, cast_int<dof_id_type>(_idx_buf.size()));
211 
212  // cache this value before we screw it up!
213  const unsigned int ns_orig = this->n_systems();
214 
215  // increment the number of systems and the offsets for each of
216  // the systems including the new one we just added.
217  for (unsigned int i=0; i<ns_orig+1; i++)
218  _idx_buf[i]++;
219 
220  libmesh_assert_equal_to (this->n_systems(), (ns_orig+1));
221  libmesh_assert_equal_to (this->n_vars(ns_orig), 0);
222  libmesh_assert_equal_to (this->n_var_groups(ns_orig), 0);
223 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
void set_n_systems(const unsigned int s)
Sets the number of systems for this DofObject.
Definition: dof_object.C:165
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
void libMesh::TypeVector< Real >::assign ( const TypeVector< T2 > &  )
inherited

Assign to this vector without creating a temporary.

UniquePtr< Node > libMesh::Node::build ( const Node n)
static
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 298 of file node.h.

References Node().

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

299 {
300  libmesh_deprecated();
301  return UniquePtr<Node>(new Node(n));
302 }
Node(const Real x=0, const Real y=0, const Real z=0, const dof_id_type id=invalid_id)
Constructor.
Definition: node.h:222
UniquePtr< Node > libMesh::Node::build ( const Point p,
const dof_id_type  id 
)
static
Returns
A Node copied from p with id == and wrapped in a smart pointer.

Definition at line 308 of file node.h.

References Node().

310 {
311  return UniquePtr<Node>(new Node(p,id));
312 }
Node(const Real x=0, const Real y=0, const Real z=0, const dof_id_type id=invalid_id)
Constructor.
Definition: node.h:222
UniquePtr< Node > libMesh::Node::build ( const Real  x,
const Real  y,
const Real  z,
const dof_id_type  id 
)
static
Returns
A Node created from the specified (x,y,z) positions with id == and wrapped in a smart pointer.

Definition at line 317 of file node.h.

References Node().

321 {
322  return UniquePtr<Node>(new Node(x,y,z,id));
323 }
Node(const Real x=0, const Real y=0, const Real z=0, const dof_id_type id=invalid_id)
Constructor.
Definition: node.h:222
PetscErrorCode Vec x
void libMesh::DofObject::clear_dofs ( )
inherited

Clear the DofMap data structures and return to a pristine state.

Definition at line 598 of file dof_object.h.

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

Referenced by libMesh::DofObject::set_n_systems(), and libMesh::DofObject::~DofObject().

599 {
600  // vector swap trick to force deallocation
601  index_buffer_t().swap(_idx_buf);
602 
603  libmesh_assert_equal_to (this->n_systems(), 0);
604  libmesh_assert (_idx_buf.empty());
605 }
libmesh_assert(j)
std::vector< index_t > index_buffer_t
Definition: dof_object.h:484
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
void libMesh::DofObject::clear_old_dof_object ( )
inherited

Sets the old_dof_object to libmesh_nullptr.

Definition at line 142 of file dof_object.C.

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

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

143 {
144  delete this->old_dof_object;
146 }
const class libmesh_nullptr_t libmesh_nullptr
DofObject * old_dof_object
This object on the last mesh.
Definition: dof_object.h:79
CompareTypes<Real , T2>::supertype libMesh::TypeVector< Real >::contract ( const TypeVector< T2 > &  ) const
inherited
Returns
The result of TypeVector::operator*().
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.
void libMesh::DofObject::debug_buffer ( ) const
inherited

Print our buffer for debugging.

Definition at line 550 of file dof_object.C.

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

551 {
552  libMesh::out << " [ ";
553  for (std::size_t i=0; i<_idx_buf.size(); i++)
554  libMesh::out << _idx_buf[i] << " ";
555  libMesh::out << "]\n";
556 }
OStreamProxy out
index_buffer_t _idx_buf
Definition: dof_object.h:485
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 107 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

108 {
109  _enable_print_counter = false;
110  return;
111 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 107 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

108 {
109  _enable_print_counter = false;
110  return;
111 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
dof_id_type libMesh::DofObject::dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp 
) const
inherited
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 810 of file dof_object.h.

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

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::allgather_recursive_constraints(), assemble_shell(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::dof_indices(), libMesh::DofObject::DofObject(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), fill_dirichlet_bc(), get_info(), libMesh::Elem::get_info(), libMesh::DofMap::local_variable_indices(), main(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::HPCoarsenTest::select_refinement(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_id(), libMesh::DofMap::set_nonlocal_dof_objects(), ParsedFEMFunctionTest::setUp(), DofObjectTest< Node >::testJensEftangBug(), DofObjectTest< Node >::testManualDofCalculation(), libMesh::BoundaryVolumeSolutionTransfer::transfer_boundary_volume(), libMesh::BoundaryVolumeSolutionTransfer::transfer_volume_boundary(), and libMesh::DTKAdapter::update_variable_values().

813 {
814  libmesh_assert_less (s, this->n_systems());
815  libmesh_assert_less (var, this->n_vars(s));
816  libmesh_assert_less (comp, this->n_comp(s,var));
817 
818  const unsigned int
819  vg = this->var_to_vg(s,var),
820  start_idx_sys = this->start_idx(s);
821 
822  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
823 
824  const dof_id_type
825  base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
826 
827  // if the first component is invalid, they
828  // are all invalid
829  if (base_idx == invalid_id)
830  return invalid_id;
831 
832  // otherwise the index is the first component
833  // index augmented by the component number
834  else
835  {
836  const unsigned int
837  ncg = this->n_comp_group(s,vg),
838  vig = this->system_var_to_vg_var(s,vg,var);
839 
840  // std::cout << "base_idx, var, vg, vig, ncg, comp="
841  // << base_idx << " "
842  // << var << " "
843  // << vg << " "
844  // << vig << " "
845  // << ncg << " "
846  // << comp << '\n';
847 
848  return cast_int<dof_id_type>(base_idx + vig*ncg + comp);
849  }
850 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:793
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int system_var_to_vg_var(const unsigned int s, const unsigned int vg, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:965
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:324
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:878
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:946
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:780
unsigned int n_systems() const
Definition: dof_object.h:726
uint8_t dof_id_type
Definition: id_types.h:64
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 101 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

102 {
103  _enable_print_counter = true;
104  return;
105 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 101 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

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

102 {
103  _enable_print_counter = true;
104  return;
105 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

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

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

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (Counts::iterator it = _counts.begin();
59  it != _counts.end(); ++it)
60  {
61  const std::string name(it->first);
62  const unsigned int creations = it->second.first;
63  const unsigned int destructions = it->second.second;
64 
65  oss << "| " << name << " reference count information:\n"
66  << "| Creations: " << creations << '\n'
67  << "| Destructions: " << destructions << '\n';
68  }
69 
70  oss << " ---------------------------------------------------------------------------- \n";
71 
72  return oss.str();
73 
74 #else
75 
76  return "";
77 
78 #endif
79 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
static Counts _counts
Actually holds the data.
std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

Definition at line 47 of file reference_counter.C.

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

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

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (Counts::iterator it = _counts.begin();
59  it != _counts.end(); ++it)
60  {
61  const std::string name(it->first);
62  const unsigned int creations = it->second.first;
63  const unsigned int destructions = it->second.second;
64 
65  oss << "| " << name << " reference count information:\n"
66  << "| Creations: " << creations << '\n'
67  << "| Destructions: " << destructions << '\n';
68  }
69 
70  oss << " ---------------------------------------------------------------------------- \n";
71 
72  return oss.str();
73 
74 #else
75 
76  return "";
77 
78 #endif
79 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
static Counts _counts
Actually holds the data.
std::string libMesh::Node::get_info ( ) const

Prints relevant information about the node to a string.

Definition at line 53 of file node.C.

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

Referenced by print_info().

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 (unsigned int s=0; s != this->n_systems(); ++s)
69  for (unsigned int v=0; v != this->n_vars(s); ++v)
70  for (unsigned int c=0; c != this->n_comp(s,v); ++c)
71  oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";
72 
73  return oss.str();
74 }
bool valid_id() const
Definition: dof_object.h:674
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:810
Point(const Real x=0., const Real y=0., const Real z=0.)
Constructor.
Definition: point.h:46
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:780
dof_id_type id() const
Definition: dof_object.h:632
unsigned int n_systems() const
Definition: dof_object.h:726
processor_id_type processor_id() const
Definition: dof_object.h:694
bool libMesh::DofObject::has_dofs ( const unsigned int  s = libMesh::invalid_uint) const
inherited
Returns
true if any system has variables which have been assigned, false otherwise.

Definition at line 855 of file dof_object.h.

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

Referenced by libMesh::DofMap::old_dof_indices(), libMesh::DofMap::reinit(), and libMesh::DofObject::set_id().

856 {
857  if (sys == libMesh::invalid_uint)
858  {
859  for (unsigned int s=0; s<this->n_systems(); s++)
860  if (this->n_vars(s))
861  return true;
862  }
863 
864  else
865  {
866  libmesh_assert_less (sys, this->n_systems());
867 
868  if (this->n_vars(sys))
869  return true;
870  }
871 
872  return false;
873 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:184
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
ImplicitSystem & sys
unsigned int n_systems() const
Definition: dof_object.h:726
dof_id_type libMesh::DofObject::id ( ) const
inherited
Returns
The id for this DofObject

Definition at line 632 of file dof_object.h.

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

Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::BoundaryInfo::_find_id_maps(), add_cube_convex_hull_to_mesh(), libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::TopologyMap::add_node(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::DistributedMesh::add_point(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), assemble_ellipticdg(), libMesh::ParmetisPartitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEMap::compute_single_point_map(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::UnstructuredMesh::create_submesh(), libMesh::ReplicatedMesh::delete_elem(), libMesh::DistributedMesh::delete_elem(), libMesh::ReplicatedMesh::delete_node(), libMesh::DistributedMesh::delete_node(), libMesh::MeshBase::detect_interior_parents(), libMesh::DTKAdapter::DTKAdapter(), libMesh::UNVIO::elements_out(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshTools::Modification::flatten(), get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::ParmetisPartitioner::initialize(), libMesh::TreeNode< N >::insert(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), libMesh::FE< Dim, T >::inverse_map(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), main(), libMesh::MeshRefinement::make_coarsening_compatible(), LinearElasticityWithContact::move_mesh(), libMesh::Elem::node_id(), libMesh::VTKIO::nodes_to_vtk(), libMesh::CompareElemIdsByLevel::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::BoundaryInfo::operator=(), libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::MetisPartitioner::partition_range(), libMesh::SFCPartitioner::partition_range(), libMesh::DofObject::print_dof_info(), libMesh::DistributedMesh::query_elem_ptr(), libMesh::DistributedMesh::query_node_ptr(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read_elements(), libMesh::DistributedMesh::renumber_elem(), libMesh::DistributedMesh::renumber_node(), libMesh::DistributedMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::MeshTools::Modification::smooth(), libMesh::ReplicatedMesh::stitching_helper(), 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(), MixedDimensionMeshTest::testPointLocatorTree(), DofObjectTest< Node >::testSetId(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::CheckpointIO::write_connectivity(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::CheckpointIO::write_nodes(), libMesh::CheckpointIO::write_remote_elem(), and libMesh::XdrIO::write_serialized_connectivity().

633 {
634  libmesh_assert (this->valid_id());
635  return _id;
636 }
bool valid_id() const
Definition: dof_object.h:674
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:419
libmesh_assert(j)
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
protectedinherited

Increments the construction counter.

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

Definition at line 185 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

186 {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189 
190  p.first++;
191 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
protectedinherited

Increments the construction counter.

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

Definition at line 185 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::ReferenceCountedObject().

186 {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189 
190  p.first++;
191 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
protectedinherited

Increments the destruction counter.

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

Definition at line 198 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

199 {
200  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
201  std::pair<unsigned int, unsigned int> & p = _counts[name];
202 
203  p.second++;
204 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
protectedinherited

Increments the destruction counter.

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

Definition at line 198 of file reference_counter.h.

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

Referenced by libMesh::ReferenceCounter::n_objects(), and libMesh::ReferenceCountedObject< RBParametrized >::~ReferenceCountedObject().

199 {
200  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
201  std::pair<unsigned int, unsigned int> & p = _counts[name];
202 
203  p.second++;
204 }
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
Definition: elem_quality.C:39
spin_mutex spin_mtx
A convenient spin mutex object which can be used for obtaining locks.
Definition: threads.C:29
static Counts _counts
Actually holds the data.
void libMesh::DofObject::invalidate ( )
inherited

Invalidates all the indices for this DofObject.

Definition at line 588 of file dof_object.h.

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

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

589 {
590  this->invalidate_dofs ();
591  this->invalidate_id ();
592  this->invalidate_processor_id ();
593 }
void invalidate_id()
Sets the id to invalid_id.
Definition: dof_object.h:572
void invalidate_processor_id()
Sets the processor id to invalid_processor_id.
Definition: dof_object.h:580
void invalidate_dofs(const unsigned int sys_num=libMesh::invalid_uint)
Sets all degree of freedom numbers to invalid_id.
Definition: dof_object.h:552
void libMesh::DofObject::invalidate_dofs ( const unsigned int  sys_num = libMesh::invalid_uint)
inherited

Sets all degree of freedom numbers to invalid_id.

Definition at line 552 of file dof_object.h.

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

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

553 {
554  // If the user does not specify the system number...
555  if (sys_num >= this->n_systems())
556  {
557  for (unsigned int s=0; s<this->n_systems(); s++)
558  for (unsigned int vg=0; vg<this->n_var_groups(s); vg++)
559  if (this->n_comp_group(s,vg))
560  this->set_vg_dof_base(s,vg,invalid_id);
561  }
562  // ...otherwise invalidate the dofs for all systems
563  else
564  for (unsigned int vg=0; vg<this->n_var_groups(sys_num); vg++)
565  if (this->n_comp_group(sys_num,vg))
566  this->set_vg_dof_base(sys_num,vg,invalid_id);
567 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:793
void set_vg_dof_base(const unsigned int s, const unsigned int vg, const dof_id_type db)
VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for di...
Definition: dof_object.h:902
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:324
unsigned int n_systems() const
Definition: dof_object.h:726
void libMesh::DofObject::invalidate_id ( )
inherited

Sets the id to invalid_id.

Definition at line 572 of file dof_object.h.

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

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

573 {
574  this->set_id (invalid_id);
575 }
dof_id_type & set_id()
Definition: dof_object.h:641
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:324
void libMesh::DofObject::invalidate_processor_id ( )
inherited

Sets the processor id to invalid_processor_id.

Definition at line 580 of file dof_object.h.

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

Referenced by libMesh::DofObject::invalidate(), libMesh::Partitioner::set_parent_processor_ids(), and DofObjectTest< Node >::testInvalidateProcId().

581 {
583 }
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:335
processor_id_type processor_id() const
Definition: dof_object.h:694
unsigned int libMesh::DofObject::n_comp ( const unsigned int  s,
const unsigned int  var 
) const
inherited
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 780 of file dof_object.h.

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

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::OldSolutionValue< Output, point_output >::eval_at_node(), get_info(), libMesh::Elem::get_info(), libMesh::DofMap::local_variable_indices(), main(), libMesh::DofObject::n_dofs(), libMesh::DofMap::old_dof_indices(), libMesh::BuildProjectionList::operator()(), libMesh::DofObject::operator=(), libMesh::DofObject::print_dof_info(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_id(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

782 {
783  libmesh_assert_less (s, this->n_systems());
784  libmesh_assert_less (var, this->n_vars(s));
785 
786  return this->n_comp_group(s,this->var_to_vg(s,var));
787 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:793
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:946
unsigned int n_systems() const
Definition: dof_object.h:726
unsigned int libMesh::DofObject::n_comp_group ( const unsigned int  s,
const unsigned int  vg 
) const
inherited
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 793 of file dof_object.h.

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::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofObject::dof_number(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::n_comp(), libMesh::DofMap::reinit(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_id(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

795 {
796  libmesh_assert_less (s, this->n_systems());
797  libmesh_assert_less (vg, this->n_var_groups(s));
798 
799  const unsigned int
800  start_idx_sys = this->start_idx(s);
801 
802  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
803 
804  return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
805 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:878
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
static const index_t ncv_magic
Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv a...
Definition: dof_object.h:496
unsigned int libMesh::DofObject::n_dofs ( const unsigned int  s,
const unsigned int  var = libMesh::invalid_uint 
) const
inherited
Returns
The number of degrees of freedom associated with system s for this object. Optionally only counts degrees of freedom for variable number var

Definition at line 610 of file dof_object.h.

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

612 {
613  libmesh_assert_less (s, this->n_systems());
614 
615  unsigned int num = 0;
616 
617  // Count all variables
618  if (var == libMesh::invalid_uint)
619  for (unsigned int v=0; v<this->n_vars(s); v++)
620  num += this->n_comp(s,v);
621 
622  // Only count specified variable
623  else
624  num = this->n_comp(s,var);
625 
626  return num;
627 }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:184
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:780
unsigned int n_systems() const
Definition: dof_object.h:726
static unsigned int libMesh::ReferenceCounter::n_objects ( )
staticinherited
static unsigned int libMesh::ReferenceCounter::n_objects ( )
staticinherited
unsigned int libMesh::DofObject::n_systems ( ) const
inherited
unsigned int libMesh::DofObject::n_var_groups ( const unsigned int  s) const
inherited
unsigned int libMesh::DofObject::n_vars ( const unsigned int  s,
const unsigned int  vg 
) const
inherited
Returns
The number of Variable variables associated with VariableGroup vg in system s for this DofObject

Definition at line 745 of file dof_object.h.

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

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

747 {
748  libmesh_assert_less (s, this->n_systems());
749  libmesh_assert_less (vg, this->n_var_groups(s));
750 
751  const unsigned int start_idx_sys = this->start_idx(s);
752 
753  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
754 
755  return (cast_int<unsigned int>
756  (_idx_buf[start_idx_sys + 2*vg]) >> ncv_magic_exp);
757 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:878
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
static const index_t ncv_magic_exp
Definition: dof_object.h:497
unsigned int libMesh::DofObject::n_vars ( const unsigned int  s) const
inherited
Returns
The number of Variable variables associated with system s for this DofObject

Definition at line 762 of file dof_object.h.

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

763 {
764  libmesh_assert_less (s, this->n_systems());
765 
766  const unsigned int nvg = this->n_var_groups(s);
767 
768  unsigned int val=0;
769 
770  for (unsigned int vg=0; vg<nvg; vg++)
771  val += this->n_vars(s,vg);
772 
773  return val;
774 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
unsigned int n_systems() const
Definition: dof_object.h:726
Real libMesh::TypeVector< Real >::norm ( ) const
inherited
Returns
The magnitude of the vector, i.e. the square-root of the sum of the elements squared.
Real libMesh::TypeVector< Real >::norm_sq ( ) const
inherited
Returns
The magnitude of the vector squared, i.e. the sum of the element magnitudes squared.
bool libMesh::TypeVector< Real >::operator!= ( const TypeVector< Real > &  rhs) const
inherited
Returns
!(*this == rhs)
const Real & libMesh::TypeVector< Real >::operator() ( const unsigned int  i) const
inherited
Returns
A const reference to the $ i^{th} $ entry of the vector.
Real & libMesh::TypeVector< Real >::operator() ( const unsigned int  i)
inherited
Returns
A writable reference to the $ i^{th} $ entry of the vector.
boostcopy::enable_if_c< ScalarTraits<Scalar>::value, TypeVector<typename CompareTypes<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.
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.
const TypeVector<Real >& libMesh::TypeVector< Real >::operator*= ( const Real  )
inherited

Multiply this vector by a scalar value.

Returns
A reference to *this.
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.
const TypeVector<Real >& libMesh::TypeVector< Real >::operator+= ( const TypeVector< T2 > &  )
inherited

Add to this vector.

Returns
A reference to *this.
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.
TypeVector<Real > libMesh::TypeVector< Real >::operator- ( ) const
inherited
Returns
The negative of this vector in a separate copy.
const TypeVector<Real >& libMesh::TypeVector< Real >::operator-= ( const TypeVector< T2 > &  )
inherited

Subtract from this vector.

Returns
A reference to *this.
boostcopy::enable_if_c< ScalarTraits<Scalar>::value, TypeVector<typename CompareTypes<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.
const TypeVector<Real >& libMesh::TypeVector< Real >::operator/= ( const Real  )
inherited

Divide each entry of this vector by scalar value.

Returns
A reference to *this.
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.

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.

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

Assign to a node from a point.

Definition at line 281 of file node.h.

282 {
283  (*this)(0) = p(0);
284 #if LIBMESH_DIM > 1
285  (*this)(1) = p(1);
286 #endif
287 #if LIBMESH_DIM > 2
288  (*this)(2) = p(2);
289 #endif
290 
291  return *this;
292 }
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.

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

38 {
39  // Explicitly calling the operator== defined in Point
40  return this->Point::operator==(rhs);
41 }
bool operator==(const TypeVector< Real > &rhs) const
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.

Referenced by operator==().

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.

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.

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

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

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

533 {
534 #ifdef LIBMESH_ENABLE_AMR
535  // We might need to pack old_dof_object too
536  *target++ = (old_dof_object == libmesh_nullptr) ? 0 : 1;
537 #endif
538 
539  *target++ = _idx_buf.size();
540  std::copy(_idx_buf.begin(), _idx_buf.end(), target);
541 
542 #ifdef LIBMESH_ENABLE_AMR
543  if (old_dof_object)
544  old_dof_object->pack_indexing(target);
545 #endif
546 }
const class libmesh_nullptr_t libmesh_nullptr
void pack_indexing(std::back_insert_iterator< std::vector< largest_id_type >> target) const
A method for creating packed data from our index buffer - basically a copy with prepended size with o...
Definition: dof_object.C:532
DofObject * old_dof_object
This object on the last mesh.
Definition: dof_object.h:79
index_buffer_t _idx_buf
Definition: dof_object.h:485
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 457 of file dof_object.C.

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

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

458 {
459  return
460  cast_int<unsigned int> (
461 #ifdef LIBMESH_ENABLE_AMR
462  ((old_dof_object == libmesh_nullptr) ? 0 : old_dof_object->packed_indexing_size()) + 2 +
463 #else
464  1 +
465 #endif
466  _idx_buf.size());
467 }
const class libmesh_nullptr_t libmesh_nullptr
DofObject * old_dof_object
This object on the last mesh.
Definition: dof_object.h:79
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int libMesh::Node::packed_size ( ) const

Definition at line 147 of file node.h.

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

148  {
149  const unsigned int header_size = 2;
150 
151  // use "(a+b-1)/b" trick to get a/b to round up
152  static const unsigned int idtypes_per_Real =
153  (sizeof(Real) + sizeof(largest_id_type) - 1) / sizeof(largest_id_type);
154 
155  return header_size + LIBMESH_DIM*idtypes_per_Real +
156  this->packed_indexing_size();
157  }
uint64_t largest_id_type
Definition: id_types.h:139
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:457
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void libMesh::TypeVector< Real >::print ( std::ostream &  os = libMesh::out) const
inherited

Formatted print, by default to libMesh::out.

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

Print out info for debugging.

Definition at line 560 of file dof_object.C.

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

561 {
562  libMesh::out << this->id() << " [ ";
563 
564  for (unsigned int s=0; s<this->n_systems(); s++)
565  {
566  libMesh::out << "s:" << s << " ";
567  for (unsigned int var=0; var<this->n_vars(s); var++)
568  {
569  libMesh::out << "v:" << var << " ";
570  for (unsigned int comp=0; comp<this->n_comp(s,var); comp++)
571  {
572  libMesh::out << "c:" << comp << " dof:" << this->dof_number(s,var,comp) << " ";
573  }
574  }
575  }
576 
577  libMesh::out << "]\n";
578 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:810
OStreamProxy out
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:780
dof_id_type id() const
Definition: dof_object.h:632
unsigned int n_systems() const
Definition: dof_object.h:726
void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

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

Definition at line 88 of file reference_counter.C.

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

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

89 {
91  out_stream << ReferenceCounter::get_info();
92 }
static std::string get_info()
Gets a string containing the reference information.
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out)
staticinherited

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

Definition at line 88 of file reference_counter.C.

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

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

89 {
91  out_stream << ReferenceCounter::get_info();
92 }
static std::string get_info()
Gets a string containing the reference information.
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
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.

References get_info().

Referenced by libMesh::operator<<().

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
processor_id_type libMesh::DofObject::processor_id ( ) const
inherited
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 694 of file dof_object.h.

References libMesh::DofObject::_processor_id.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::BoundaryInfo::add_elements(), libMesh::Patch::add_local_face_neighbors(), libMesh::Patch::add_local_point_neighbors(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DistributedMesh::add_node(), libMesh::MeshRefinement::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::DistributedMesh::add_point(), libMesh::RBConstruction::add_scaled_matrix_and_vector(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Patch::build_around_element(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::Nemesis_IO_Helper::compute_num_global_nodesets(), libMesh::Nemesis_IO_Helper::compute_num_global_sidesets(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::UnstructuredMesh::create_submesh(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::Elem::Elem(), libMesh::MeshFunction::find_element(), libMesh::MeshFunction::find_elements(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::Modification::flatten(), get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::DistributedMesh::insert_elem(), libMesh::DofObject::invalidate_processor_id(), libMesh::Elem::is_semilocal(), libMesh::RBEIMEvaluation::legacy_write_out_interpolation_points_elem(), 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_p_levels_parallel_consistent(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::GhostPointNeighbors::operator()(), libMesh::SiblingCoupling::operator()(), AugmentSparsityOnInterface::operator()(), libMesh::PointNeighborCoupling::operator()(), libMesh::DefaultCoupling::operator()(), libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::XdrIO::pack_element(), libMesh::LinearPartitioner::partition_range(), libMesh::MetisPartitioner::partition_range(), libMesh::SFCPartitioner::partition_range(), libMesh::MappedSubdomainPartitioner::partition_range(), libMesh::CentroidPartitioner::partition_range(), libMesh::Partitioner::partition_unpartitioned_elements(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), libMesh::DofObject::processor_id(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Elem::refine(), BoundaryMeshTest::sanityCheck(), libMesh::DofMap::scatter_constraints(), libMesh::MeshCommunication::send_coarse_ghosts(), libMesh::DofObject::set_id(), 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(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), DofObjectTest< Node >::testInvalidateProcId(), EquationSystemsTest::testPostInitAddElem(), DofObjectTest< Node >::testSetProcId(), BoundaryInfoTest::testShellFaceConstraints(), DofObjectTest< Node >::testValidProcId(), libMesh::MeshRefinement::uniformly_coarsen(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DTKAdapter::update_variable_values(), libMesh::CheckpointIO::write_connectivity(), libMesh::GmshIO::write_mesh(), libMesh::CheckpointIO::write_nodes(), and libMesh::Nemesis_IO_Helper::write_sidesets().

695 {
696  return _processor_id;
697 }
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:430
processor_id_type & libMesh::DofObject::processor_id ( )
inherited
Returns
The processor that this DofObject belongs to as a writable reference.

Definition at line 702 of file dof_object.h.

References libMesh::DofObject::_processor_id.

703 {
704  return _processor_id;
705 }
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:430
void libMesh::DofObject::processor_id ( const processor_id_type  pid)
inherited

Sets the processor_id for this DofObject.

Definition at line 710 of file dof_object.h.

References libMesh::DofObject::processor_id().

711 {
712  this->processor_id() = pid;
713 }
processor_id_type processor_id() const
Definition: dof_object.h:694
bool libMesh::TypeVector< Real >::relative_fuzzy_equals ( const TypeVector< Real > &  rhs,
Real  tol = TOLERANCE 
) const
inherited
Returns
true if two vectors are equal to within a relative tolerance of tol.
void libMesh::DofObject::set_buffer ( const std::vector< dof_id_type > &  buf)
inherited

Definition at line 512 of file dof_object.h.

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

513  { _idx_buf = buf; }
index_buffer_t _idx_buf
Definition: dof_object.h:485
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 414 of file dof_object.C.

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

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

418 {
419  libmesh_assert_less (s, this->n_systems());
420  libmesh_assert_less (var, this->n_vars(s));
421  libmesh_assert_less (comp, this->n_comp(s,var));
422 
423  const unsigned int
424  vg = this->var_to_vg(s,var),
425 #ifndef NDEBUG
426  ncg = this->n_comp_group(s,vg),
427 #endif
428  vig = this->system_var_to_vg_var(s,vg,var),
429  start_idx_sys = this->start_idx(s);
430 
431  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
432 
433  dof_id_type & base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
434 
435  // We intend to change all dof numbers together or not at all
436  if (comp || vig)
437  libmesh_assert ((dn == invalid_id && base_idx == invalid_id) ||
438  (dn == base_idx + vig*ncg + comp));
439 
440  // only explicitly store the base index for vig==0, comp==0
441  else
442  base_idx = dn;
443 
444  // #ifdef DEBUG
445  // libMesh::out << " [ ";
446  // for (std::size_t i=0; i<_idx_buf.size(); i++)
447  // libMesh::out << _idx_buf[i] << " ";
448  // libMesh::out << "]\n";
449  // #endif
450 
451  libmesh_assert_equal_to (this->dof_number(s, var, comp), dn);
452 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:793
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
Definition: dof_object.h:810
unsigned int system_var_to_vg_var(const unsigned int s, const unsigned int vg, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:965
libmesh_assert(j)
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:324
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:878
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:946
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:780
unsigned int n_systems() const
Definition: dof_object.h:726
uint8_t dof_id_type
Definition: id_types.h:64
dof_id_type & libMesh::DofObject::set_id ( )
inherited
Returns
The id for this DofObject as a writable reference.

Definition at line 641 of file dof_object.h.

References libMesh::DofObject::_id.

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

642 {
643  return _id;
644 }
dof_id_type _id
The id of the DofObject.
Definition: dof_object.h:419
void libMesh::DofObject::set_id ( const dof_id_type  dofid)
inherited
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 345 of file dof_object.C.

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

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

348 {
349  libmesh_assert_less (s, this->n_systems());
350  libmesh_assert_less (var, this->n_vars(s));
351 
352  this->set_n_comp_group(s, this->var_to_vg(s,var), ncomp);
353 }
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
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:357
unsigned int var_to_vg(const unsigned int s, const unsigned int var) const
Utility function - for variable var in system s, figure out what variable group it lives in...
Definition: dof_object.h:946
unsigned int n_systems() const
Definition: dof_object.h:726
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 357 of file dof_object.C.

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

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

360 {
361  libmesh_assert_less (s, this->n_systems());
362  libmesh_assert_less (vg, this->n_var_groups(s));
363 
364  // Check for trivial return
365  if (ncomp == this->n_comp_group(s,vg)) return;
366 
367 #ifndef NDEBUG
368  if (ncomp >= ncv_magic)
369  {
370  const index_t ncvm = ncv_magic;
371  libmesh_error_msg("ERROR: ncomp must be less than DofObject::ncv_magic!\n" \
372  << "ncomp = " \
373  << ncomp \
374  << ", ncv_magic = " \
375  << ncvm \
376  << "\nrecompile and try again!");
377  }
378 #endif
379 
380  const unsigned int
381  start_idx_sys = this->start_idx(s),
382  n_vars_group = this->n_vars(s,vg),
383  base_offset = start_idx_sys + 2*vg;
384 
385  libmesh_assert_less ((base_offset + 1), _idx_buf.size());
386 
387  // if (ncomp)
388  // libMesh::out << "s,vg,ncomp="
389  // << s << ","
390  // << vg << ","
391  // << ncomp << '\n';
392 
393  // set the number of components, maintaining the number
394  // of variables in the group
395  _idx_buf[base_offset] = ncv_magic*n_vars_group + ncomp;
396 
397  // We use (invalid_id - 1) to signify no
398  // components for this object
399  _idx_buf[base_offset + 1] = (ncomp == 0) ? invalid_id - 1 : invalid_id;
400 
401  // this->debug_buffer();
402  // libMesh::out << "s,vg = " << s << "," << vg << '\n'
403  // << "base_offset=" << base_offset << '\n'
404  // << "this->n_comp(s,vg)=" << this->n_comp(s,vg) << '\n'
405  // << "this->n_comp_group(s,vg)=" << this->n_comp_group(s,vg) << '\n'
406  // << "this->n_vars(s,vg)=" << this->n_vars(s,vg) << '\n'
407  // << "this->n_var_groups(s)=" << this->n_var_groups(s) << '\n';
408 
409  libmesh_assert_equal_to (ncomp, this->n_comp_group(s,vg));
410 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:793
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
dof_id_type index_t
DoF index information.
Definition: dof_object.h:483
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:324
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:878
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
static const index_t ncv_magic
Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv a...
Definition: dof_object.h:496
void libMesh::DofObject::set_n_systems ( const unsigned int  s)
inherited

Sets the number of systems for this DofObject.

Definition at line 165 of file dof_object.C.

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

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

166 {
167  // Check for trivial return
168  if (ns == this->n_systems())
169  return;
170 
171  // Clear any existing data. This is safe to call
172  // even if we don't have any data.
173  this->clear_dofs();
174 
175  // Set the new number of systems
176  _idx_buf.resize(ns, ns);
177  _idx_buf[0] = ns;
178 
179 
180 #ifdef DEBUG
181 
182  // check that all systems now exist and that they have 0 size
183  libmesh_assert_equal_to (ns, this->n_systems());
184  for (unsigned int s=0; s<this->n_systems(); s++)
185  {
186  libmesh_assert_equal_to (this->n_vars(s), 0);
187  libmesh_assert_equal_to (this->n_var_groups(s), 0);
188  }
189 
190 #endif
191 }
void clear_dofs()
Clear the DofMap data structures and return to a pristine state.
Definition: dof_object.h:598
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
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 227 of file dof_object.C.

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

Referenced by libMesh::DofObject::set_id(), DofObjectTest< Node >::testManualDofCalculation(), and DofObjectTest< Node >::testSetNVariableGroups().

229 {
230 
231  libmesh_assert_less (s, this->n_systems());
232 
233  // number of variable groups for this system - inferred
234  const unsigned int nvg = cast_int<unsigned int>(nvpg.size());
235 
236  // BSK - note that for compatibility with the previous implementation
237  // calling this method when (nvars == this->n_vars()) requires that
238  // we invalidate the DOF indices and set the number of components to 0.
239  // Note this was a bit of a surprise to me - there was no quick return in
240  // the old method, which caused removal and readdition of the DOF indices
241  // even in the case of (nvars == this->n_vars()), resulting in n_comp(s,v)
242  // implicitly becoming 0 regardless of any previous value.
243  // quick return?
244  if (nvg == this->n_var_groups(s))
245  {
246  for (unsigned int vg=0; vg<nvg; vg++)
247  {
248  this->set_n_comp_group(s,vg,0);
249  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
250  }
251  return;
252  }
253 
254  // since there is ample opportunity to screw up other systems, let us
255  // cache their current sizes and later assert that they are unchanged.
256 #ifdef DEBUG
257  DofObject::index_buffer_t old_system_sizes;
258  old_system_sizes.reserve(this->n_systems());
259 
260  for (unsigned int s_ctr=0; s_ctr<this->n_systems(); s_ctr++)
261  old_system_sizes.push_back(this->n_var_groups(s_ctr));
262 #endif
263 
264  // remove current indices if we have some
265  if (this->n_var_groups(s) != 0)
266  {
267  const unsigned int old_nvg_s = this->n_var_groups(s);
268 
269  DofObject::index_buffer_t::iterator
270  it = _idx_buf.begin(),
271  end = _idx_buf.begin();
272 
273  std::advance(it, this->start_idx(s));
274  std::advance(end, this->end_idx(s));
275  _idx_buf.erase(it,end);
276 
277  for (unsigned int ctr=(s+1); ctr<this->n_systems(); ctr++)
278  _idx_buf[ctr] -= 2*old_nvg_s;
279  }
280 
281  // better not have any now!
282  libmesh_assert_equal_to (this->n_var_groups(s), 0);
283 
284  // Make sure we didn't screw up any of our sizes!
285 #ifdef DEBUG
286  for (unsigned int s_ctr=0; s_ctr<this->n_systems(); s_ctr++)
287  if (s_ctr != s)
288  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
289 #endif
290 
291  // OK, if the user requested 0 that is what we have
292  if (nvg == 0)
293  return;
294 
295  {
296  // array to hold new indices
297  DofObject::index_buffer_t var_idxs(2*nvg);
298  for (unsigned int vg=0; vg<nvg; vg++)
299  {
300  var_idxs[2*vg ] = ncv_magic*nvpg[vg] + 0;
301  var_idxs[2*vg + 1] = invalid_id - 1;
302  }
303 
304  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
305  std::advance(it, this->end_idx(s));
306  _idx_buf.insert(it, var_idxs.begin(), var_idxs.end());
307 
308  for (unsigned int ctr=(s+1); ctr<this->n_systems(); ctr++)
309  _idx_buf[ctr] += 2*nvg;
310 
311  // resize _idx_buf to fit so no memory is wasted.
313  }
314 
315  libmesh_assert_equal_to (nvg, this->n_var_groups(s));
316 
317 #ifdef DEBUG
318 
319  // libMesh::out << " [ ";
320  // for (std::size_t i=0; i<_idx_buf.size(); i++)
321  // libMesh::out << _idx_buf[i] << " ";
322  // libMesh::out << "]\n";
323 
324  libmesh_assert_equal_to (this->n_var_groups(s), nvpg.size());
325 
326  for (unsigned int vg=0; vg<this->n_var_groups(s); vg++)
327  {
328  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
329  libmesh_assert_equal_to (this->n_comp_group(s,vg), 0);
330  }
331 
332  for (unsigned int v=0; v<this->n_vars(s); v++)
333  libmesh_assert_equal_to (this->n_comp(s,v), 0);
334 
335  // again, all other system sizes should be unchanged!
336  for (unsigned int s_ctr=0; s_ctr<this->n_systems(); s_ctr++)
337  if (s_ctr != s)
338  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
339 
340 #endif
341 }
unsigned int n_comp_group(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:793
unsigned int n_vars(const unsigned int s, const unsigned int vg) const
Definition: dof_object.h:745
IterBase * end
Also have a polymorphic pointer to the end object, this prevents iterating past the end...
unsigned int end_idx(const unsigned int s) const
The ending index for system s.
Definition: dof_object.h:889
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
Definition: dof_object.h:324
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:878
std::vector< index_t > index_buffer_t
Definition: dof_object.h:484
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:357
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_comp(const unsigned int s, const unsigned int var) const
Definition: dof_object.h:780
unsigned int n_systems() const
Definition: dof_object.h:726
static const index_t ncv_magic
Above we introduced the chimera ncv, which is a hybrid of the form ncv = ncv_magic*nv + nc where nv a...
Definition: dof_object.h:496
void libMesh::DofObject::set_old_dof_object ( )
inherited

Sets the old_dof_object to a copy of this.

Definition at line 150 of file dof_object.C.

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

Referenced by libMesh::DofMap::reinit().

151 {
152  this->clear_old_dof_object();
153 
155 
156  // Make a new DofObject, assign a copy of \p this.
157  // Make sure the copy ctor for DofObject works!!
158  this->old_dof_object = new DofObject(*this);
159 }
libmesh_assert(j)
DofObject()
Constructor.
Definition: dof_object.h:522
void clear_old_dof_object()
Sets the old_dof_object to libmesh_nullptr.
Definition: dof_object.C:142
DofObject * old_dof_object
This object on the last mesh.
Definition: dof_object.h:79
unique_id_type & libMesh::DofObject::set_unique_id ( )
inherited
void libMesh::Node::set_valence ( unsigned int  val)

Sets the number of nodes connected with this node.

Definition at line 338 of file node.h.

References _valence.

Referenced by valence().

339 {
340  _valence = cast_int<valence_idx_t>(val);
341 }
valence_idx_t _valence
The number of nodes connected with this node.
Definition: node.h:201
void libMesh::DofObject::set_vg_dof_base ( const unsigned int  s,
const unsigned int  vg,
const dof_id_type  db 
)
inherited

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

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

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

905 {
906  libmesh_assert_less (s, this->n_systems());
907  libmesh_assert_less (vg, this->n_var_groups(s));
908 
909  const unsigned int
910  start_idx_sys = this->start_idx(s);
911 
912  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
913 
914  _idx_buf[start_idx_sys + 2*vg + 1] = db;
915 
916  libmesh_assert_equal_to (this->vg_dof_base(s,vg), db);
917 }
dof_id_type vg_dof_base(const unsigned int s, const unsigned int vg) const
VariableGroup DoF indices are indexed as id = base + var_in_vg*ncomp + comp This method allows for di...
Definition: dof_object.h:922
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:878
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
Real libMesh::TypeVector< Real >::size ( ) const
inherited
Returns
The magnitude of the vector, i.e. the square-root of the sum of the elements squared.
Deprecated:
Use the norm() function instead.
Real libMesh::TypeVector< Real >::size_sq ( ) const
inherited
Returns
The magnitude of the vector squared, i.e. the sum of the element magnitudes squared.
Deprecated:
Use the norm_sq() function instead.
const Real & libMesh::TypeVector< Real >::slice ( const unsigned int  i) const
inherited

Definition at line 140 of file type_vector.h.

References libMesh::TypeVector< T >::operator()().

140 { return (*this)(i); }
Real & libMesh::TypeVector< Real >::slice ( const unsigned int  i)
inherited
void libMesh::TypeVector< Real >::subtract ( const TypeVector< T2 > &  )
inherited

Subtract from this vector without creating a temporary.

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

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

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

Definition at line 649 of file dof_object.h.

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

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::UnstructuredMesh::create_submesh(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), libMesh::MeshTools::libmesh_assert_valid_unique_ids(), libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::XdrIO::pack_element(), SlitMeshRefinedSystemTest::testRestart(), libMesh::CheckpointIO::write_connectivity(), and libMesh::CheckpointIO::write_nodes().

650 {
651 #ifdef LIBMESH_ENABLE_UNIQUE_ID
653  return _unique_id;
654 #else
655  return invalid_unique_id;
656 #endif
657 }
bool valid_unique_id() const
Definition: dof_object.h:682
libmesh_assert(j)
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:413
static const unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition: dof_object.h:329
TypeVector<Real > libMesh::TypeVector< Real >::unit ( ) const
inherited
Returns
A unit vector in the direction of *this.
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 494 of file dof_object.C.

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

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

495 {
496  _idx_buf.clear();
497 
498 #ifdef LIBMESH_ENABLE_AMR
499  this->clear_old_dof_object();
500  const bool has_old_dof_object = cast_int<bool>(*begin++);
501 #endif
502 
503  const largest_id_type size = *begin++;
504  _idx_buf.reserve(size);
505  std::copy(begin, begin+size, back_inserter(_idx_buf));
506 
507  // Check as best we can for internal consistency now
508  libmesh_assert(_idx_buf.empty() ||
509  (_idx_buf[0] <= _idx_buf.size()));
510 #ifdef DEBUG
511  if (!_idx_buf.empty())
512  for (unsigned int i=1; i < _idx_buf[0]; ++i)
513  {
514  libmesh_assert_greater_equal (_idx_buf[i], _idx_buf[i-1]);
515  libmesh_assert_equal_to ((_idx_buf[i] - _idx_buf[i-1])%2, 0);
516  libmesh_assert_less_equal (_idx_buf[i], _idx_buf.size());
517  }
518 #endif
519 
520 #ifdef LIBMESH_ENABLE_AMR
521  if (has_old_dof_object)
522  {
523  this->old_dof_object = new DofObject();
524  this->old_dof_object->unpack_indexing(begin+size);
525  }
526 #endif
527 }
uint64_t largest_id_type
Definition: id_types.h:139
libmesh_assert(j)
DofObject()
Constructor.
Definition: dof_object.h:522
void clear_old_dof_object()
Sets the old_dof_object to libmesh_nullptr.
Definition: dof_object.C:142
DofObject * old_dof_object
This object on the last mesh.
Definition: dof_object.h:79
void unpack_indexing(std::vector< largest_id_type >::const_iterator begin)
A method for creating our index buffer from packed data - basically with our current implementation w...
Definition: dof_object.C:494
index_buffer_t _idx_buf
Definition: dof_object.h:485
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 473 of file dof_object.C.

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

474 {
475 #ifdef LIBMESH_ENABLE_AMR
476  const bool has_old_dof_object = cast_int<bool>(*begin++);
477 
478  static const int dof_header_size = 2;
479 #else
480  static const bool has_old_dof_object = false;
481  static const int dof_header_size = 1;
482 #endif
483 
484  const largest_id_type this_indexing_size = *begin++;
485 
486  return cast_int<unsigned int>
487  (dof_header_size + this_indexing_size +
488  (has_old_dof_object ?
489  unpackable_indexing_size(begin+this_indexing_size) : 0));
490 }
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:473
uint64_t largest_id_type
Definition: id_types.h:139
unsigned int libMesh::Node::valence ( ) const
Returns
The number of nodes connected with this node. Currently, this value is invalid (zero) except for subdivision meshes.

Definition at line 166 of file node.h.

References _valence, libMesh::invalid_uint, and set_valence().

167  {
168 #ifdef LIBMESH_ENABLE_NODE_VALENCE
169  return _valence;
170 #else
171  libmesh_not_implemented();
172  return libMesh::invalid_uint;
173 #endif
174  }
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value.
Definition: libmesh.h:184
valence_idx_t _valence
The number of nodes connected with this node.
Definition: node.h:201
bool libMesh::DofObject::valid_id ( ) const
inherited
bool libMesh::DofObject::valid_processor_id ( ) const
inherited
Returns
true if this DofObject has a valid id set, false otherwise.

Definition at line 718 of file dof_object.h.

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

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

719 {
721 }
static const processor_id_type invalid_processor_id
An invalid processor_id to distinguish DoFs that have not been assigned to a processor.
Definition: dof_object.h:335
processor_id_type _processor_id
The processor_id of the DofObject.
Definition: dof_object.h:430
bool libMesh::DofObject::valid_unique_id ( ) const
inherited
Returns
true if this DofObject has a valid unique_id set, false otherwise.

Definition at line 682 of file dof_object.h.

References libMesh::DofObject::_unique_id, and libMesh::DofObject::invalid_unique_id.

Referenced by libMesh::ReplicatedMesh::add_elem(), libMesh::DistributedMesh::add_elem(), libMesh::ReplicatedMesh::add_node(), libMesh::DistributedMesh::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::Elem::get_info(), libMesh::ReplicatedMesh::insert_elem(), libMesh::DistributedMesh::insert_elem(), libMesh::ReplicatedMesh::insert_node(), libMesh::Parallel::Packing< const Node * >::pack(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::DofObject::set_id(), and libMesh::DofObject::unique_id().

683 {
684 #ifdef LIBMESH_ENABLE_UNIQUE_ID
686 #else
687  return false;
688 #endif
689 }
unique_id_type _unique_id
A globally unique id, guaranteed not to change as the mesh is repartitioned or adapted.
Definition: dof_object.h:413
static const unique_id_type invalid_unique_id
An invalid unique_id to distinguish an uninitialized DofObject.
Definition: dof_object.h:329
dof_id_type libMesh::DofObject::vg_dof_base ( const unsigned int  s,
const unsigned int  vg 
) const
inherited

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

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

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

924 {
925  libmesh_assert_less (s, this->n_systems());
926  libmesh_assert_less (vg, this->n_var_groups(s));
927 
928  const unsigned int
929  start_idx_sys = this->start_idx(s);
930 
931  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
932 
933  // #ifdef DEBUG
934  // std::cout << " [ ";
935  // for (std:size_t i=0; i<_idx_buf.size(); i++)
936  // std::cout << _idx_buf[i] << " ";
937  // std::cout << "]\n";
938  // #endif
939 
940  return _idx_buf[start_idx_sys + 2*vg + 1];
941 }
unsigned int n_var_groups(const unsigned int s) const
Definition: dof_object.h:735
unsigned int start_idx(const unsigned int s) const
The starting index for system s.
Definition: dof_object.h:878
index_buffer_t _idx_buf
Definition: dof_object.h:485
unsigned int n_systems() const
Definition: dof_object.h:726
void libMesh::TypeVector< Real >::write_unformatted ( std::ostream &  out,
const bool  newline = true 
) const
inherited

Unformatted print to the stream out.

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

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

Set all entries of the vector to 0.

Friends And Related Function Documentation

friend class Elem
friend

Definition at line 188 of file node.h.

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

Member Data Documentation

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

The coordinates of the TypeVector.

Definition at line 406 of file type_vector.h.

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited
ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited
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().

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

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.

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.

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

The number of objects.

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

Definition at line 132 of file reference_counter.h.

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

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

The number of objects.

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

Definition at line 132 of file reference_counter.h.

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

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

Referenced by Node(), set_valence(), and valence().

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

An invalid id to distinguish an uninitialized DofObject.

Definition at line 324 of file dof_object.h.

Referenced by libMesh::DofMap::_dof_indices(), active(), libMesh::TopologyMap::add_node(), libMesh::MeshRefinement::add_node(), libMesh::ReplicatedMesh::add_point(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::Elem::bracketing_nodes(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::RBEIMConstruction::enrich_RB_space(), libMesh::TopologyMap::find(), libMesh::ReplicatedMesh::insert_node(), libMesh::DofObject::invalidate_dofs(), libMesh::DofObject::invalidate_id(), libMesh::MeshTools::libmesh_assert_valid_neighbors(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), Node(), libMesh::Elem::node_id(), libMesh::DofMap::old_dof_indices(), libMesh::Parallel::Packing< const Elem * >::pack(), libMesh::XdrIO::pack_element(), libMesh::Elem::point(), libMesh::XdrIO::polynomial_level_file_name(), libMesh::MeshBase::query_elem(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::ReplicatedMesh::reserve_elem(), libMesh::DistributedMesh::reserve_elem(), libMesh::DofMap::SCALAR_dof_indices(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_comp_group(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), NodalNeighborsTest::testEdge2(), NodalNeighborsTest::testEdge3(), NodalNeighborsTest::testEdge4(), DofObjectTest< Node >::testValidId(), libMesh::Parallel::Packing< Elem * >::unpack(), and libMesh::DofObject::valid_id().

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

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

Definition at line 335 of file dof_object.h.

Referenced by libMesh::BoundaryInfo::_find_id_maps(), libMesh::DistributedMesh::add_elem(), libMesh::DistributedMesh::add_node(), libMesh::MeshCommunication::allgather(), libMesh::MeshTools::create_bounding_box(), libMesh::MeshTools::create_nodal_bounding_box(), libMesh::DistributedMesh::delete_elem(), libMesh::DistributedMesh::delete_node(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::Elem::Elem(), libMesh::MeshCommunication::find_global_indices(), libMesh::MeshCommunication::gather(), libMesh::DistributedMesh::insert_elem(), libMesh::DofObject::invalidate_processor_id(), libMesh::DistributedMesh::libmesh_assert_valid_parallel_object_ids(), 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::MeshBase::query_elem(), libMesh::CheckpointIO::read_connectivity(), libMesh::DistributedMesh::renumber_dof_objects(), libMesh::ReplicatedMesh::reserve_elem(), libMesh::DistributedMesh::reserve_elem(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_dofobject_data_by_xyz(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id(), DofObjectTest< Node >::testValidProcId(), libMesh::MeshTools::total_weight(), libMesh::Parallel::Packing< Node * >::unpack(), libMesh::Parallel::Packing< Elem * >::unpack(), libMesh::DofObject::valid_processor_id(), libMesh::CheckpointIO::write(), and libMesh::CheckpointIO::write_connectivity().

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

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