Node Class Reference

#include <node.h>

Inheritance diagram for Node:

List of all members.

Classes

struct  PackedNode

Public Member Functions

 Node (const Real x, const Real y, const Real z, const unsigned int id=invalid_id)
 Node (const Node &n)
 Node (const Point &p, const unsigned int id=invalid_id)
virtual ~Node ()
Nodeoperator= (const Point &p)
bool active () const
virtual bool operator== (const DofObject &rhs) const
template<typename T2 >
void assign (const TypeVector< T2 > &)
operator() (const unsigned int i) const
T & operator() (const unsigned int i)
template<typename T2 >
TypeVector< typename
CompareTypes< T, T2 >
::supertype > 
operator+ (const TypeVector< T2 > &) const
template<typename T2 >
const TypeVector< T > & operator+= (const TypeVector< T2 > &)
template<typename T2 >
void add (const TypeVector< T2 > &)
template<typename T2 >
void add_scaled (const TypeVector< T2 > &, const T)
template<typename T2 >
TypeVector< typename
CompareTypes< T, T2 >
::supertype > 
operator- (const TypeVector< T2 > &) const
TypeVector< T > operator- () const
template<typename T2 >
const TypeVector< T > & operator-= (const TypeVector< T2 > &)
template<typename T2 >
void subtract (const TypeVector< T2 > &)
template<typename T2 >
void subtract_scaled (const TypeVector< T2 > &, const T)
template<typename Scalar >
boostcopy::enable_if_c
< ScalarTraits< Scalar >
::value, TypeVector< typename
CompareTypes< T, Scalar >
::supertype > >::type 
operator* (const Scalar) const
template<typename T2 >
CompareTypes< T, T2 >::supertype operator* (const TypeVector< T2 > &) const
const TypeVector< T > & operator*= (const T)
template<typename Scalar >
boostcopy::enable_if_c
< ScalarTraits< Scalar >
::value, TypeVector< typename
CompareTypes< T, Scalar >
::supertype > >::type 
operator/ (const Scalar) const
const TypeVector< T > & operator/= (const T)
template<typename T2 >
TypeVector< typename
CompareTypes< T, T2 >
::supertype > 
cross (const TypeVector< T2 > &) const
TypeVector< T > unit () const
Real size () const
Real size_sq () const
void zero ()
bool relative_fuzzy_equals (const TypeVector< T > &rhs, Real tol=TOLERANCE) const
bool absolute_fuzzy_equals (const TypeVector< T > &rhs, Real tol=TOLERANCE) const
bool operator== (const TypeVector< T > &rhs) const
bool operator!= (const TypeVector< T > &rhs) const
template<>
bool operator!= (const TypeVector< Real > &rhs) const
bool operator< (const TypeVector< T > &rhs) const
template<>
bool operator< (const TypeVector< Complex > &rhs) const
bool operator> (const TypeVector< T > &rhs) const
template<>
bool operator> (const TypeVector< Complex > &rhs) const
void print (std::ostream &os) const
void write_unformatted (std::ostream &out, const bool newline=true) const
void clear_old_dof_object ()
void set_old_dof_object ()
void clear_dofs ()
void invalidate_dofs (const unsigned int sys_num=libMesh::invalid_uint)
void invalidate_id ()
void invalidate_processor_id ()
void invalidate ()
unsigned int n_dofs (const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
unsigned int id () const
unsigned int & set_id ()
void set_id (const unsigned int id)
bool valid_id () const
unsigned short int processor_id () const
unsigned short int & processor_id ()
void processor_id (const unsigned int id)
bool valid_processor_id () const
unsigned int n_systems () const
void set_n_systems (const unsigned int s)
void add_system ()
unsigned int n_vars (const unsigned int s) const
void set_n_vars (const unsigned int s, const unsigned int nvars)
unsigned int n_comp (const unsigned int s, const unsigned int var) const
void set_n_comp (const unsigned int s, const unsigned int var, const unsigned int ncomp)
unsigned int 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 unsigned int dn)
bool has_dofs (const unsigned int s=libMesh::invalid_uint) const

Static Public Member Functions

static AutoPtr< Nodebuild (const Node &n)
static AutoPtr< Nodebuild (const Point &p, const unsigned int id)
static AutoPtr< Nodebuild (const Real x, const Real y, const Real z, const unsigned int id)
static std::string get_info ()
static void print_info ()
static unsigned int n_objects ()
static std::string get_info ()
static void print_info ()
static unsigned int n_objects ()

Public Attributes

DofObjectold_dof_object

Static Public Attributes

static const unsigned int invalid_id = libMesh::invalid_uint
static const unsigned short int invalid_processor_id = static_cast<unsigned short int>(-1)

Protected Types

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

Protected Member Functions

void increment_constructor_count (const std::string &name)
void increment_destructor_count (const std::string &name)
void increment_constructor_count (const std::string &name)
void increment_destructor_count (const std::string &name)

Protected Attributes

_coords [LIBMESH_DIM]

Static Protected Attributes

static Counts _counts
static Threads::atomic
< unsigned int > 
_n_objects
static Threads::spin_mutex _mutex
static Counts _counts
static Threads::atomic
< unsigned int > 
_n_objects
static Threads::spin_mutex _mutex

Friends

class MeshRefinement
class Elem
class Node
std::ostream & operator<< (std::ostream &os, const TypeVector< T > &t)


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
Version:
Revision
3391

Definition at line 51 of file node.h.


Member Typedef Documentation

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > ReferenceCounter::Counts [protected, inherited]

Data structure to log the information. The log is identified by the class name.

Definition at line 105 of file reference_counter.h.

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > ReferenceCounter::Counts [protected, inherited]

Data structure to log the information. The log is identified by the class name.

Definition at line 105 of file reference_counter.h.


Constructor & Destructor Documentation

Node::Node ( const Real  x,
const Real  y,
const Real  z,
const unsigned int  id = invalid_id 
) [inline]

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

References DofObject::set_id().

Referenced by build(), and Node::PackedNode::build_node().

00194                                    :
00195   Point(x,y,z)
00196 {
00197   this->set_id() = id;
00198 }

Node::Node ( const Node n  )  [inline]

Copy-constructor.

Definition at line 203 of file node.h.

00203                          :
00204   Point(n),
00205   DofObject(n),
00206   ReferenceCountedObject<Node>()
00207 {
00208 }

Node::Node ( const Point p,
const unsigned int  id = invalid_id 
) [inline, explicit]

Copy-constructor from a Point. Optionally assigned the id.

Definition at line 213 of file node.h.

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

00214                                    :
00215   Point(p)
00216 {
00217   // optionally assign the id.  We have
00218   // to do it like this otherwise
00219   // Node n = Point p would erase
00220   // the id!
00221   if (id != invalid_id)
00222     this->set_id() = id;
00223 }

Node::~Node (  )  [inline, virtual]

Destructor.

Definition at line 228 of file node.h.

00229 {
00230 }


Member Function Documentation

template<typename T >
bool TypeVector< T >::absolute_fuzzy_equals ( const TypeVector< T > &  rhs,
Real  tol = TOLERANCE 
) const [inline, inherited]

Returns:
true iff two vectors occupy approximately the same physical location in space, to within an absolute tolerance of tol.

Definition at line 755 of file type_vector.h.

References TypeVector< T >::_coords.

Referenced by LocationMap< T >::find(), and TypeVector< T >::relative_fuzzy_equals().

00756 {
00757 #if LIBMESH_DIM == 1
00758   return (std::abs(_coords[0] - rhs._coords[0])
00759           <= tol);
00760 #endif
00761 
00762 #if LIBMESH_DIM == 2
00763   return (std::abs(_coords[0] - rhs._coords[0]) +
00764           std::abs(_coords[1] - rhs._coords[1])
00765           <= tol);
00766 #endif
00767 
00768 #if LIBMESH_DIM == 3
00769   return (std::abs(_coords[0] - rhs._coords[0]) +
00770           std::abs(_coords[1] - rhs._coords[1]) +
00771           std::abs(_coords[2] - rhs._coords[2])
00772           <= tol);
00773 #endif
00774 }

bool Node::active (  )  const [inline]

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

Definition at line 279 of file node.h.

References DofObject::invalid_id.

00280 {
00281   return (this->id() != Node::invalid_id);
00282 }

template<typename T >
template<typename T2 >
void TypeVector< T >::add ( const TypeVector< T2 > &  p  )  [inline, inherited]

Add to this vector without creating a temporary.

Definition at line 426 of file type_vector.h.

References TypeVector< T >::_coords.

Referenced by Elem::centroid(), InfFE< Dim, T_radial, T_map >::inverse_map(), FE< Dim, T >::inverse_map(), LaplaceMeshSmoother::smooth(), and MeshTools::Modification::smooth().

00427 {
00428 #if LIBMESH_DIM == 1
00429   _coords[0] += p._coords[0];
00430 #endif
00431   
00432 #if LIBMESH_DIM == 2
00433   _coords[0] += p._coords[0];
00434   _coords[1] += p._coords[1];
00435 #endif
00436   
00437 #if LIBMESH_DIM == 3
00438   _coords[0] += p._coords[0];
00439   _coords[1] += p._coords[1];
00440   _coords[2] += p._coords[2];
00441 #endif
00442 
00443 }

template<typename T >
template<typename T2 >
void TypeVector< T >::add_scaled ( const TypeVector< T2 > &  p,
const T  factor 
) [inline, inherited]

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

Definition at line 450 of file type_vector.h.

References TypeVector< T >::_coords.

Referenced by HPCoarsenTest::add_projection(), KellyErrorEstimator::boundary_side_integration(), System::calculate_norm(), Elem::coarsen(), FEBase::coarsened_dof_values(), FEMContext::fixed_interior_gradient(), FEMContext::fixed_side_gradient(), MeshFunction::gradient(), FEMContext::interior_gradient(), KellyErrorEstimator::internal_side_integration(), InfFE< Dim, T_radial, T_map >::inverse_map(), FE< Dim, T >::map(), FE< Dim, T >::map_eta(), FE< Dim, T >::map_xi(), FE< Dim, T >::map_zeta(), PatchRecoveryErrorEstimator::EstimateError::operator()(), HPCoarsenTest::select_refinement(), FEMContext::side_gradient(), and MeshTools::Modification::smooth().

00451 {
00452 #if LIBMESH_DIM == 1
00453   _coords[0] += factor*p(0);
00454 #endif
00455   
00456 #if LIBMESH_DIM == 2
00457   _coords[0] += factor*p(0);
00458   _coords[1] += factor*p(1);
00459 #endif
00460   
00461 #if LIBMESH_DIM == 3
00462   _coords[0] += factor*p(0);
00463   _coords[1] += factor*p(1);
00464   _coords[2] += factor*p(2);
00465 #endif
00466 
00467 }

void DofObject::add_system (  )  [inherited]

Adds an additional system to the DofObject

Definition at line 188 of file dof_object.C.

References DofObject::_dof_ids, DofObject::_n_systems, DofObject::_n_v_comp, and DofObject::n_systems().

00189 {
00190   if (this->n_systems() > 0)
00191     {
00192       // Copy the old systems to temporary storage
00193       unsigned char **old_n_v_comp = new unsigned char* [this->n_systems()];
00194       unsigned int  **old_dof_ids  = new unsigned int*  [this->n_systems()]; 
00195       
00196       for (unsigned int s=0; s<this->n_systems(); s++)
00197         {
00198           old_n_v_comp[s] = _n_v_comp[s];
00199           old_dof_ids[s]  = _dof_ids[s];
00200         }
00201       
00202       // Delete old storage
00203       libmesh_assert (_n_v_comp != NULL); delete [] _n_v_comp; _n_v_comp = NULL;
00204       libmesh_assert (_dof_ids  != NULL); delete [] _dof_ids;  _dof_ids  = NULL;
00205   
00206       // Allocate space for new system
00207       _n_v_comp= new unsigned char* [this->n_systems()+1];
00208       _dof_ids = new unsigned int*  [this->n_systems()+1];
00209       
00210       // Copy the other systems
00211       for (unsigned int s=0; s<this->n_systems(); s++)
00212         {
00213           _n_v_comp[s] = old_n_v_comp[s];
00214           _dof_ids[s]  = old_dof_ids[s];
00215         }
00216                
00217       // Delete temporary storage
00218       libmesh_assert (old_n_v_comp != NULL); delete [] old_n_v_comp; old_n_v_comp = NULL;
00219       libmesh_assert (old_dof_ids  != NULL); delete [] old_dof_ids;  old_dof_ids  = NULL;
00220     }
00221   else
00222     {
00223       libmesh_assert (_n_v_comp == NULL);
00224       libmesh_assert (_dof_ids  == NULL);
00225       
00226       // Allocate space for new system
00227       _n_v_comp = new unsigned char* [this->n_systems()+1];
00228       _dof_ids  = new unsigned int*  [this->n_systems()+1];      
00229     }
00230   
00231   // Initialize the new system
00232   _n_v_comp[this->n_systems()] = NULL;
00233   _dof_ids[this->n_systems()]  = NULL;
00234   
00235   // Done. Don't forget to increment the number of systems!
00236   _n_systems++;
00237 }

template<typename T >
template<typename T2 >
void TypeVector< T >::assign ( const TypeVector< T2 > &  p  )  [inline, inherited]

Assign to a vector without creating a temporary.

Definition at line 335 of file type_vector.h.

References TypeVector< T >::_coords.

00336 {
00337   for (unsigned int i=0; i<LIBMESH_DIM; i++)
00338     _coords[i] = p._coords[i];
00339 }

AutoPtr< Node > Node::build ( const Real  x,
const Real  y,
const Real  z,
const unsigned int  id 
) [inline, static]

Builds a Node from specified points and returns an AutoPtr<Node> to the newly-created object. Optionally assigned the id.

Definition at line 267 of file node.h.

References Node().

00271 {
00272   AutoPtr<Node> ap(new Node(x,y,z,id));
00273   return ap;
00274 }

AutoPtr< Node > Node::build ( const Point p,
const unsigned int  id 
) [inline, static]

Builds a Node from Point p and returns an AutoPtr<Node> to the newly-created object. Optionally assignes the id.

Definition at line 256 of file node.h.

References Node().

00258 {
00259   
00260   AutoPtr<Node> ap(new Node(p,id));
00261   return ap;
00262 }

AutoPtr< Node > Node::build ( const Node n  )  [inline, static]

Builds a Node and returns an AutoPtr<Node> to the newly-created object. The id is copied from n.id()

Definition at line 247 of file node.h.

References Node().

Referenced by SerialMesh::add_point(), and ParallelMesh::add_point().

00248 {
00249   AutoPtr<Node> ap(new Node(n));
00250   return ap;
00251 }

void DofObject::clear_dofs (  )  [inline, inherited]

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

Definition at line 388 of file dof_object.h.

References DofObject::_dof_ids, DofObject::_n_systems, DofObject::_n_v_comp, and DofObject::n_systems().

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

00389 {
00390   // Only clear if there is data
00391   if (this->n_systems() != 0)
00392     {
00393       libmesh_assert (_n_v_comp != NULL);
00394       libmesh_assert (_dof_ids  != NULL);
00395       
00396       for (unsigned int s=0; s<this->n_systems(); s++)
00397         {
00398           if (_dof_ids[s] != NULL) // This has only been allocated if 
00399             {                      // variables were declared
00400               delete [] _dof_ids[s]; _dof_ids[s] = NULL;
00401             }
00402           
00403           if (_n_v_comp[s] != NULL) // it is possible the number of variables is 0,
00404             {                       // but this was allocated (_n_v_comp[s][0] == 0)
00405               delete [] _n_v_comp[s]; _n_v_comp[s] = NULL;
00406             }
00407         }
00408       
00409       delete [] _n_v_comp; _n_v_comp = NULL;
00410       delete [] _dof_ids;  _dof_ids  = NULL;
00411     }
00412   
00413   // Make sure we cleaned up
00414   // (or there was nothing there)
00415   libmesh_assert (_n_v_comp == NULL);
00416   libmesh_assert (_dof_ids  == NULL);
00417   
00418   // No systems now.
00419   _n_systems = 0;
00420 }

void DofObject::clear_old_dof_object (  )  [inherited]

Sets the old_dof_object to NULL

Definition at line 120 of file dof_object.C.

References DofObject::old_dof_object.

Referenced by DofObject::set_old_dof_object(), and DofObject::~DofObject().

00121 {
00122   // If we have been called before...
00123   // prevent a memory leak
00124   if (old_dof_object != NULL)
00125     {
00126       delete this->old_dof_object;
00127       this->old_dof_object = NULL;
00128     }  
00129 }

template<typename T >
template<typename T2 >
TypeVector< typename CompareTypes< T, T2 >::supertype > TypeVector< T >::cross ( const TypeVector< T2 > &  p  )  const [inline, inherited]

Cross 2 vectors together, i.e. cross-product.

Definition at line 696 of file type_vector.h.

References TypeVector< T >::_coords.

Referenced by FEBase::compute_face_map(), FEXYZ< Dim >::compute_face_values(), Plane::create_from_three_points(), Tri3::volume(), Quad4::volume(), Tet4::volume(), Pyramid5::volume(), Prism6::volume(), and Hex8::volume().

00697 {
00698   typedef typename CompareTypes<T, T2>::supertype TS;
00699   libmesh_assert (LIBMESH_DIM == 3);
00700 
00701   // |     i          j          k    |
00702   // |(*this)(0) (*this)(1) (*this)(2)|
00703   // |   p(0)       p(1)       p(2)   |
00704 
00705   return TypeVector<TS>( _coords[1]*p._coords[2] - _coords[2]*p._coords[1],
00706                         -_coords[0]*p._coords[2] + _coords[2]*p._coords[0],
00707                          _coords[0]*p._coords[1] - _coords[1]*p._coords[0]);
00708 }

unsigned int DofObject::dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp 
) const [inline, inherited]

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

Definition at line 564 of file dof_object.h.

References DofObject::_dof_ids, DofObject::invalid_id, DofObject::n_comp(), DofObject::n_systems(), and DofObject::n_vars().

Referenced by DofMap::constrain_p_dofs(), DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), DofMap::dof_indices(), DofObject::DofObject(), DofMap::old_dof_indices(), DofMap::reinit(), HPCoarsenTest::select_refinement(), DofObject::set_dof_number(), DofMap::set_nonlocal_dof_objects(), VTKIO::solution_to_vtk(), and System::zero_variable().

00567 {
00568   libmesh_assert (s < this->n_systems());
00569   libmesh_assert (var  < this->n_vars(s));
00570   libmesh_assert (_dof_ids != NULL);
00571   libmesh_assert (_dof_ids[s] != NULL);  
00572   libmesh_assert (comp < this->n_comp(s,var));
00573   
00574   if (_dof_ids[s][var] == invalid_id)
00575     return invalid_id;
00576   else
00577     return (_dof_ids[s][var] + comp);
00578 }

std::string ReferenceCounter::get_info (  )  [static, inherited]

Gets a string containing the reference information.

Definition at line 45 of file reference_counter.C.

References ReferenceCounter::_counts, and QuadratureRules::name().

Referenced by ReferenceCounter::print_info().

00046 {
00047 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
00048 
00049   std::ostringstream out;
00050   
00051   out << '\n'
00052       << " ---------------------------------------------------------------------------- \n"
00053       << "| Reference count information                                                |\n"
00054       << " ---------------------------------------------------------------------------- \n";
00055   
00056   for (Counts::iterator it = _counts.begin();
00057        it != _counts.end(); ++it)
00058     {
00059       const std::string name(it->first);
00060       const unsigned int creations    = it->second.first;
00061       const unsigned int destructions = it->second.second;
00062 
00063       out << "| " << name << " reference count information:\n"
00064           << "|  Creations:    " << creations    << '\n'
00065           << "|  Destructions: " << destructions << '\n';
00066     }
00067   
00068   out << " ---------------------------------------------------------------------------- \n";
00069 
00070   return out.str();
00071 
00072 #else
00073 
00074   return "";
00075   
00076 #endif
00077 }

std::string ReferenceCounter::get_info (  )  [static, inherited]

Gets a string containing the reference information.

Definition at line 45 of file reference_counter.C.

References ReferenceCounter::_counts, and QuadratureRules::name().

Referenced by ReferenceCounter::print_info().

00046 {
00047 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
00048 
00049   std::ostringstream out;
00050   
00051   out << '\n'
00052       << " ---------------------------------------------------------------------------- \n"
00053       << "| Reference count information                                                |\n"
00054       << " ---------------------------------------------------------------------------- \n";
00055   
00056   for (Counts::iterator it = _counts.begin();
00057        it != _counts.end(); ++it)
00058     {
00059       const std::string name(it->first);
00060       const unsigned int creations    = it->second.first;
00061       const unsigned int destructions = it->second.second;
00062 
00063       out << "| " << name << " reference count information:\n"
00064           << "|  Creations:    " << creations    << '\n'
00065           << "|  Destructions: " << destructions << '\n';
00066     }
00067   
00068   out << " ---------------------------------------------------------------------------- \n";
00069 
00070   return out.str();
00071 
00072 #else
00073 
00074   return "";
00075   
00076 #endif
00077 }

bool DofObject::has_dofs ( const unsigned int  s = libMesh::invalid_uint  )  const [inline, inherited]

Returns:
true if any system has variables which have been assigned, false otherwise

Definition at line 583 of file dof_object.h.

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

Referenced by DofMap::reinit().

00584 {
00585   if (sys == libMesh::invalid_uint)
00586     {
00587       for (unsigned int s=0; s<this->n_systems(); s++)
00588         if (this->n_vars(s))
00589           return true;
00590     }
00591   
00592   else
00593     {
00594       libmesh_assert (sys < this->n_systems());
00595 
00596       if (this->n_vars(sys))
00597         return true;
00598     }
00599   
00600   return false;
00601 }

unsigned int DofObject::id (  )  const [inline, inherited]

Returns:
the id for this DofObject

Definition at line 449 of file dof_object.h.

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

Referenced by SFCPartitioner::_do_partition(), SerialMesh::add_elem(), ParallelMesh::add_elem(), SerialMesh::add_node(), ParallelMesh::add_node(), ParallelMesh::add_point(), UnstructuredMesh::all_first_order(), UnstructuredMesh::all_second_order(), FEMSystem::assembly(), MeshData::assign(), ParmetisPartitioner::assign_partitioning(), MeshTools::Generation::build_delaunay_square(), ParmetisPartitioner::build_graph(), InfElemBuilder::build_inf_elem(), VTKIO::cells_to_vtk(), clough_compute_coefs(), FEBase::compute_single_point_map(), UnstructuredMesh::copy_nodes_and_elements(), MeshRefinement::create_parent_error_vector(), SerialMesh::delete_elem(), ParallelMesh::delete_elem(), SerialMesh::delete_node(), ParallelMesh::delete_node(), MeshCommunication::delete_remote_elements(), MeshData::elem_to_foreign_id(), JumpErrorEstimator::estimate_error(), ExactErrorEstimator::estimate_error(), UnstructuredMesh::find_neighbors(), MeshTools::find_nodal_neighbors(), MeshRefinement::flag_elements_by_elem_fraction(), MeshRefinement::flag_elements_by_error_fraction(), MeshRefinement::flag_elements_by_error_tolerance(), MeshRefinement::flag_elements_by_mean_stddev(), TetGenMeshInterface::get_node_index(), hermite_compute_coefs(), LaplaceMeshSmoother::init(), ParmetisPartitioner::initialize(), ExodusII_IO_Helper::initialize(), TreeNode< N >::insert(), SerialMesh::insert_elem(), ParallelMesh::insert_elem(), ParallelMesh::insert_node(), FE< Dim, T >::inverse_map(), Elem::is_ancestor_of(), MeshTools::libmesh_assert_valid_elem_ids(), MeshTools::libmesh_assert_valid_node_procids(), MeshTools::libmesh_assert_valid_refinement_flags(), Elem::node(), MeshData::node_to_foreign_id(), VTKIO::nodes_to_vtk(), PatchRecoveryErrorEstimator::EstimateError::operator()(), XdrIO::pack_element(), ErrorVector::plot_error(), Nemesis_IO::read(), ExodusII_IO::read(), ParallelMesh::renumber_elem(), ParallelMesh::renumber_node(), ParallelMesh::renumber_nodes_and_elements(), HPCoarsenTest::select_refinement(), Partitioner::set_node_processor_ids(), DofMap::set_nonlocal_dof_objects(), Partitioner::set_parent_processor_ids(), FE< Dim, T >::shape(), FE< Dim, T >::shape_deriv(), FE< Dim, T >::shape_second_deriv(), LaplaceMeshSmoother::smooth(), MeshTools::Modification::smooth(), BoundaryInfo::sync(), Parallel::sync_dofobject_data_by_id(), Parallel::sync_element_data_by_parent_id(), GMVIO::write_ascii_new_impl(), GMVIO::write_ascii_old_impl(), ExodusII_IO_Helper::write_elements(), LegacyXdrIO::write_mesh(), GmshIO::write_mesh(), and XdrIO::write_serialized_connectivity().

00450 {
00451   libmesh_assert (this->valid_id());
00452   return _id;
00453 }

void ReferenceCounter::increment_constructor_count ( const std::string &  name  )  [inline, protected, inherited]

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

Definition at line 149 of file reference_counter.h.

References ReferenceCounter::_counts, and Threads::spin_mtx.

Referenced by ReferenceCountedObject< SparseMatrix< T > >::ReferenceCountedObject().

00150 {
00151   Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
00152   std::pair<unsigned int, unsigned int>& p = _counts[name];
00153 
00154   p.first++;
00155 }

void ReferenceCounter::increment_constructor_count ( const std::string &  name  )  [inline, protected, inherited]

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

Definition at line 149 of file reference_counter.h.

References ReferenceCounter::_counts, and Threads::spin_mtx.

Referenced by ReferenceCountedObject< SparseMatrix< T > >::ReferenceCountedObject().

00150 {
00151   Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
00152   std::pair<unsigned int, unsigned int>& p = _counts[name];
00153 
00154   p.first++;
00155 }

void ReferenceCounter::increment_destructor_count ( const std::string &  name  )  [inline, protected, inherited]

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

Definition at line 167 of file reference_counter.h.

References ReferenceCounter::_counts, and Threads::spin_mtx.

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

00168 {
00169   Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
00170   std::pair<unsigned int, unsigned int>& p = _counts[name];
00171 
00172   p.second++;
00173 }

void ReferenceCounter::increment_destructor_count ( const std::string &  name  )  [inline, protected, inherited]

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

Definition at line 167 of file reference_counter.h.

References ReferenceCounter::_counts, and Threads::spin_mtx.

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

00168 {
00169   Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
00170   std::pair<unsigned int, unsigned int>& p = _counts[name];
00171 
00172   p.second++;
00173 }

void DofObject::invalidate (  )  [inline, inherited]

Invalidates all the indices for this DofObject

Definition at line 378 of file dof_object.h.

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

Referenced by DofObject::DofObject().

00379 {
00380   this->invalidate_dofs ();
00381   this->invalidate_id ();
00382   this->invalidate_processor_id ();
00383 }

void DofObject::invalidate_dofs ( const unsigned int  sys_num = libMesh::invalid_uint  )  [inline, inherited]

Sets all degree of freedom numbers to invalid_id

Definition at line 342 of file dof_object.h.

References DofObject::invalid_id, DofObject::n_comp(), DofObject::n_systems(), DofObject::n_vars(), and DofObject::set_dof_number().

Referenced by DofObject::invalidate().

00343 {
00344   // If the user does not specify the system number...
00345   if (sys_num >= this->n_systems()) 
00346     {
00347       for (unsigned int s=0; s<this->n_systems(); s++)
00348         for (unsigned int v=0; v<this->n_vars(s); v++)
00349           if (this->n_comp(s,v))
00350             this->set_dof_number(s,v,0,invalid_id);
00351     }
00352   // ...otherwise invalidate the dofs for all systems
00353   else
00354     for (unsigned int v=0; v<n_vars(sys_num); v++)
00355       if (this->n_comp(sys_num,v))
00356         this->set_dof_number(sys_num,v,0,invalid_id);
00357 }

void DofObject::invalidate_id (  )  [inline, inherited]

Sets the id to invalid_id

Definition at line 362 of file dof_object.h.

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

Referenced by DofObject::invalidate().

00363 {
00364   this->set_id (invalid_id);
00365 }

void DofObject::invalidate_processor_id (  )  [inline, inherited]

unsigned int DofObject::n_comp ( const unsigned int  s,
const unsigned int  var 
) const [inline, 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 dof's associated with one node. Another example is the MONOMIALs, where only the elements hold the dof's, but for the different spatial directions, and orders, see FE.

Definition at line 538 of file dof_object.h.

References DofObject::_dof_ids, DofObject::_n_v_comp, DofObject::n_systems(), and DofObject::n_vars().

Referenced by DofMap::constrain_p_dofs(), DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), DofMap::dof_indices(), DofObject::dof_number(), DofObject::DofObject(), DofObject::invalidate_dofs(), DofObject::n_dofs(), DofMap::old_dof_indices(), DofMap::reinit(), DofObject::set_dof_number(), DofObject::set_n_comp(), DofMap::set_nonlocal_dof_objects(), and System::zero_variable().

00540 {
00541   libmesh_assert (s < this->n_systems());
00542   libmesh_assert (_dof_ids != NULL);
00543   libmesh_assert (_dof_ids[s] != NULL);
00544   libmesh_assert (_n_v_comp != NULL);
00545   libmesh_assert (_n_v_comp[s] != NULL);
00546 
00547 # ifdef DEBUG
00548   // Does this ever happen?  I doubt it... 3/7/2003 (BSK)
00549   if (var >= this->n_vars(s))
00550     {
00551       std::cout << "s=" << s << ", var=" << var << std::endl
00552                 << "this->n_vars(s)=" << this->n_vars(s) << std::endl
00553                 << "this->n_systems()=" << this->n_systems() << std::endl;
00554       libmesh_error();
00555     }
00556 # endif
00557   
00558   return static_cast<unsigned int>(_n_v_comp[s][var+1]);
00559 }

unsigned int DofObject::n_dofs ( const unsigned int  s,
const unsigned int  var = libMesh::invalid_uint 
) const [inline, 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 425 of file dof_object.h.

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

00427 {
00428   libmesh_assert (s < this->n_systems());
00429   
00430   unsigned int num = 0;
00431 
00432   // Count all variables
00433   if (var == libMesh::invalid_uint)
00434     for (unsigned int v=0; v<this->n_vars(s); v++)
00435       num += this->n_comp(s,v);
00436   
00437   // Only count specified variable
00438   else
00439     {
00440       num = this->n_comp(s,var);
00441     }
00442 
00443   return num;
00444 }

static unsigned int ReferenceCounter::n_objects (  )  [inline, static, inherited]

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

Definition at line 76 of file reference_counter.h.

References ReferenceCounter::_n_objects.

00077   { return _n_objects; }

static unsigned int ReferenceCounter::n_objects (  )  [inline, static, inherited]

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

Definition at line 76 of file reference_counter.h.

References ReferenceCounter::_n_objects.

00077   { return _n_objects; }

unsigned int DofObject::n_vars ( const unsigned int  s  )  const [inline, inherited]

Returns:
the number of variables associated with system s for this DofObject

Definition at line 525 of file dof_object.h.

References DofObject::_n_v_comp, and DofObject::n_systems().

Referenced by DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), DofObject::dof_number(), DofObject::DofObject(), DofObject::has_dofs(), DofObject::invalidate_dofs(), DofObject::n_comp(), DofObject::n_dofs(), DofObject::set_dof_number(), DofObject::set_n_comp(), DofObject::set_n_vars(), and DofMap::set_nonlocal_dof_objects().

00526 {
00527   libmesh_assert (s < this->n_systems());
00528   libmesh_assert (_n_v_comp != NULL);
00529   if (_n_v_comp[s] == NULL)
00530     return 0;
00531   return static_cast<unsigned int>(_n_v_comp[s][0]);
00532 }

template<>
bool TypeVector< Real >::operator!= ( const TypeVector< Real > &  rhs  )  const [inline, inherited]

Definition at line 827 of file type_vector.h.

00828 {
00829   return (!(*this == rhs));
00830 }

template<typename T >
bool TypeVector< T >::operator!= ( const TypeVector< T > &  rhs  )  const [inherited]

Returns:
true iff two vectors do not occupy approximately the same physical location in space.

template<typename T >
T & TypeVector< T >::operator() ( const unsigned int  i  )  [inline, inherited]

Return a writeable reference to the $ i^{th} $ element of the vector.

Definition at line 363 of file type_vector.h.

References TypeVector< T >::_coords.

00364 {
00365 #if LIBMESH_DIM < 3
00366 
00367   if (i >= LIBMESH_DIM)
00368     {
00369 //       std::cerr << "ERROR:  You are assigning to a vector component" << std::endl
00370 //              << "that is out of range for the compiled LIBMESH_DIM!"      << std::endl
00371 //              << " LIBMESH_DIM=" << LIBMESH_DIM << " , i=" << i
00372 //              << std::endl;
00373       libmesh_error();
00374     }
00375   
00376 #endif
00377   
00378   libmesh_assert (i<LIBMESH_DIM);
00379   
00380   return _coords[i];
00381 }

template<typename T >
T TypeVector< T >::operator() ( const unsigned int  i  )  const [inline, inherited]

Return the $ i^{th} $ element of the vector.

Definition at line 345 of file type_vector.h.

References TypeVector< T >::_coords.

00346 {
00347   libmesh_assert (i<3);
00348 
00349 #if LIBMESH_DIM < 3
00350   
00351   if (i > (LIBMESH_DIM-1))
00352     return 0.;
00353   
00354 #endif
00355   
00356   return _coords[i];
00357 }

template<typename T >
template<typename T2 >
CompareTypes< T, T2 >::supertype TypeVector< T >::operator* ( const TypeVector< T2 > &  p  )  const [inline, inherited]

Multiply 2 vectors together, i.e. dot-product. The vectors may be of different types.

Definition at line 673 of file type_vector.h.

References TypeVector< T >::_coords.

00674 {
00675 #if LIBMESH_DIM == 1
00676   return _coords[0]*p._coords[0];
00677 #endif
00678   
00679 #if LIBMESH_DIM == 2
00680   return (_coords[0]*p._coords[0] +
00681           _coords[1]*p._coords[1]);
00682 #endif
00683   
00684 #if LIBMESH_DIM == 3
00685   return (_coords[0]*p(0) +
00686           _coords[1]*p(1) +
00687           _coords[2]*p(2));
00688 #endif
00689 }

template<typename T >
template<typename Scalar >
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< T, Scalar >::supertype > >::type TypeVector< T >::operator* ( const Scalar  factor  )  const [inline, inherited]

Multiply a vector by a number, i.e. scale.

Definition at line 562 of file type_vector.h.

References TypeVector< T >::_coords.

00563 {
00564   typedef typename CompareTypes<T, Scalar>::supertype TS;
00565 
00566 #if LIBMESH_DIM == 1
00567   return TypeVector<TS>(_coords[0]*factor);
00568 #endif
00569   
00570 #if LIBMESH_DIM == 2 
00571   return TypeVector<TS>(_coords[0]*factor,
00572                         _coords[1]*factor);
00573 #endif
00574   
00575 #if LIBMESH_DIM == 3
00576   return TypeVector<TS>(_coords[0]*factor,
00577                         _coords[1]*factor, 
00578                         _coords[2]*factor);
00579 #endif  
00580 }

template<typename T >
const TypeVector< T > & TypeVector< T >::operator*= ( const T  factor  )  [inline, inherited]

Multiply this vector by a number, i.e. scale.

Definition at line 599 of file type_vector.h.

References TypeVector< T >::_coords.

00600 {
00601 #if LIBMESH_DIM == 1
00602   _coords[0] *= factor;
00603 #endif
00604   
00605 #if LIBMESH_DIM == 2
00606   _coords[0] *= factor;
00607   _coords[1] *= factor;
00608 #endif
00609   
00610 #if LIBMESH_DIM == 3
00611   _coords[0] *= factor;
00612   _coords[1] *= factor;
00613   _coords[2] *= factor;
00614 #endif
00615 
00616   return *this;
00617 }

template<typename T >
template<typename T2 >
TypeVector< typename CompareTypes< T, T2 >::supertype > TypeVector< T >::operator+ ( const TypeVector< T2 > &  p  )  const [inline, inherited]

Add two vectors.

Definition at line 389 of file type_vector.h.

References TypeVector< T >::_coords.

00390 {
00391   typedef typename CompareTypes<T, T2>::supertype TS;
00392 #if LIBMESH_DIM == 1
00393   return TypeVector<TS> (_coords[0] + p._coords[0]);
00394 #endif
00395 
00396 #if LIBMESH_DIM == 2 
00397   return TypeVector<TS> (_coords[0] + p._coords[0],
00398                          _coords[1] + p._coords[1]);
00399 #endif
00400 
00401 #if LIBMESH_DIM == 3
00402   return TypeVector<TS> (_coords[0] + p._coords[0],
00403                          _coords[1] + p._coords[1],
00404                          _coords[2] + p._coords[2]);
00405 #endif
00406                
00407 }

template<typename T >
template<typename T2 >
const TypeVector< T > & TypeVector< T >::operator+= ( const TypeVector< T2 > &  p  )  [inline, inherited]

Add to this vector.

Definition at line 414 of file type_vector.h.

00415 {
00416   this->add (p);
00417 
00418   return *this;
00419 }

template<typename T >
TypeVector< T > TypeVector< T >::operator- (  )  const [inline, inherited]

Return the opposite of a vector

Definition at line 534 of file type_vector.h.

References TypeVector< T >::_coords, and TypeVector< T >::TypeVector.

00535 {
00536   
00537 #if LIBMESH_DIM == 1
00538   return TypeVector(-_coords[0]);
00539 #endif
00540 
00541 #if LIBMESH_DIM == 2 
00542   return TypeVector(-_coords[0],
00543                     -_coords[1]);
00544 #endif
00545 
00546 #if LIBMESH_DIM == 3
00547   return TypeVector(-_coords[0],
00548                     -_coords[1], 
00549                     -_coords[2]);
00550 #endif
00551   
00552 }

template<typename T >
template<typename T2 >
TypeVector< typename CompareTypes< T, T2 >::supertype > TypeVector< T >::operator- ( const TypeVector< T2 > &  p  )  const [inline, inherited]

Subtract two vectors.

Definition at line 475 of file type_vector.h.

References TypeVector< T >::_coords.

00476 {
00477   typedef typename CompareTypes<T, T2>::supertype TS;
00478 
00479 #if LIBMESH_DIM == 1
00480   return TypeVector<TS>(_coords[0] - p._coords[0]);
00481 #endif
00482 
00483 #if LIBMESH_DIM == 2 
00484   return TypeVector<TS>(_coords[0] - p._coords[0],
00485                         _coords[1] - p._coords[1]);
00486 #endif
00487 
00488 #if LIBMESH_DIM == 3
00489   return TypeVector<TS>(_coords[0] - p._coords[0],
00490                         _coords[1] - p._coords[1],
00491                         _coords[2] - p._coords[2]);
00492 #endif
00493 
00494 }

template<typename T >
template<typename T2 >
const TypeVector< T > & TypeVector< T >::operator-= ( const TypeVector< T2 > &  p  )  [inline, inherited]

Subtract from this vector.

Definition at line 501 of file type_vector.h.

References TypeVector< T >::subtract().

00502 {
00503   this->subtract (p);
00504 
00505   return *this;
00506 }

template<typename T >
template<typename Scalar >
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeVector< typename CompareTypes< T, Scalar >::supertype > >::type TypeVector< T >::operator/ ( const Scalar  factor  )  const [inline, inherited]

Divide a vector by a number, i.e. scale.

Definition at line 627 of file type_vector.h.

References TypeVector< T >::_coords.

00628 {
00629   libmesh_assert (factor != static_cast<T>(0.));
00630 
00631   typedef typename CompareTypes<T, Scalar>::supertype TS;
00632   
00633 #if LIBMESH_DIM == 1
00634   return TypeVector<TS>(_coords[0]/factor);
00635 #endif
00636   
00637 #if LIBMESH_DIM == 2 
00638   return TypeVector<TS>(_coords[0]/factor,
00639                         _coords[1]/factor);
00640 #endif
00641   
00642 #if LIBMESH_DIM == 3
00643   return TypeVector<TS>(_coords[0]/factor,
00644                         _coords[1]/factor, 
00645                         _coords[2]/factor);
00646 #endif
00647   
00648 }

template<typename T >
const TypeVector< T > & TypeVector< T >::operator/= ( const T  factor  )  [inline, inherited]

Divide this vector by a number, i.e. scale.

Definition at line 656 of file type_vector.h.

References TypeVector< T >::_coords.

00657 {
00658   libmesh_assert (factor != static_cast<T>(0.));
00659   
00660   for (unsigned int i=0; i<LIBMESH_DIM; i++)
00661     _coords[i] /= factor;
00662 
00663   return *this;
00664 }

template<>
bool TypeVector< Complex >::operator< ( const TypeVector< Complex > &  rhs  )  const [inline, inherited]

Definition at line 141 of file type_vector.C.

00142 {
00143   for (unsigned int i=0; i<LIBMESH_DIM; i++)
00144     {
00145       if ((*this)(i).real() < rhs(i).real())
00146         return true;
00147       if ((*this)(i).real() > rhs(i).real())
00148         return false;
00149       if ((*this)(i).imag() < rhs(i).imag())
00150         return true;
00151       if ((*this)(i).imag() > rhs(i).imag())
00152         return false;
00153     }
00154   return false;
00155 }

template<typename T >
bool TypeVector< T >::operator< ( const TypeVector< T > &  rhs  )  const [inline, inherited]

Returns:
true if this vector is "less" than another. Useful for sorting. Also used for choosing some arbitrary basis function orientations

Definition at line 110 of file type_vector.C.

00111 {
00112   for (unsigned int i=0; i<LIBMESH_DIM; i++)
00113     {
00114       if ((*this)(i) < rhs(i))
00115         return true;
00116       if ((*this)(i) > rhs(i))
00117         return false;
00118     }
00119   return false;
00120 }

Node & Node::operator= ( const Point p  )  [inline]

Assign to a node from a point

Definition at line 235 of file node.h.

00236 {
00237   (*this)(0) = p(0);
00238   (*this)(1) = p(1);
00239   (*this)(2) = p(2);
00240 
00241   return *this;
00242 }

template<typename T >
bool TypeVector< T >::operator== ( const TypeVector< T > &  rhs  )  const [inline, inherited]

Returns:
true iff two vectors occupy approximately the same physical location in space, to within an absolute tolerance of TOLERANCE.

Definition at line 805 of file type_vector.h.

References TypeVector< T >::_coords.

00806 {
00807 #if LIBMESH_DIM == 1
00808   return (_coords[0] == rhs._coords[0]);
00809 #endif
00810 
00811 #if LIBMESH_DIM == 2
00812   return (_coords[0] == rhs._coords[0] &&
00813           _coords[1] == rhs._coords[1]);
00814 #endif
00815 
00816 #if LIBMESH_DIM == 3
00817   return (_coords[0] == rhs._coords[0] &&
00818           _coords[1] == rhs._coords[1] &&
00819           _coords[2] == rhs._coords[2]);
00820 #endif
00821 }

bool Node::operator== ( const DofObject rhs  )  const [virtual]

Returns:
true if this node equals rhs, false otherwise. Note that rhs is a DofObject, so it is possible that rhs is not a Node. If rhs is not a Node, then we return false of course.

Reimplemented from DofObject.

Definition at line 34 of file node.C.

00035 {
00036   // Cast rhs to a Node*
00037   const Node* rhs_node = dynamic_cast<const Node*>(&rhs);
00038 
00039   // If we can't cast to a Node* then rhs must be an Elem
00040   if(rhs_node == NULL)
00041     return false;
00042 
00043   // Explicitly calling the operator== defined in Point
00044   return this->Point::operator==(*rhs_node);
00045 }

template<>
bool TypeVector< Complex >::operator> ( const TypeVector< Complex > &  rhs  )  const [inline, inherited]

Definition at line 160 of file type_vector.C.

00161 {
00162   for (unsigned int i=0; i<LIBMESH_DIM; i++)
00163     {
00164       if ((*this)(i).real() > rhs(i).real())
00165         return true;
00166       if ((*this)(i).real() < rhs(i).real())
00167         return false;
00168       if ((*this)(i).imag() > rhs(i).imag())
00169         return true;
00170       if ((*this)(i).imag() < rhs(i).imag())
00171         return false;
00172     }
00173   return false;
00174 }

template<typename T >
bool TypeVector< T >::operator> ( const TypeVector< T > &  rhs  )  const [inline, inherited]

Returns:
true if this vector is "greater" than another. Useful for sorting. Also used for choosing some arbitrary basis function orientations

Definition at line 125 of file type_vector.C.

00126 {
00127   for (unsigned int i=0; i<LIBMESH_DIM; i++)
00128     {
00129       if ((*this)(i) > rhs(i))
00130         return true;
00131       if ((*this)(i) < rhs(i))
00132         return false;
00133     }
00134   return false;
00135 }

template<typename T >
void TypeVector< T >::print ( std::ostream &  os  )  const [inline, inherited]

Formatted print to std::cout.

Definition at line 63 of file type_vector.C.

00064 {
00065 #if LIBMESH_DIM == 1
00066   
00067   os << "x=" << (*this)(0) << '\n';
00068   
00069 #endif
00070 #if LIBMESH_DIM == 2
00071   
00072   os << "(x,y)=("
00073      << std::setw(8) << (*this)(0) << ", "
00074      << std::setw(8) << (*this)(1) << ")"
00075      << '\n';
00076 
00077 #endif
00078 #if LIBMESH_DIM == 3
00079   
00080   os <<  "(x,y,z)=("
00081      << std::setw(8) << (*this)(0) << ", "
00082      << std::setw(8) << (*this)(1) << ", "
00083      << std::setw(8) << (*this)(2) << ")"
00084      << '\n';
00085 #endif
00086 }

void ReferenceCounter::print_info (  )  [static, inherited]

Prints the reference information to std::cout.

Definition at line 83 of file reference_counter.C.

References ReferenceCounter::get_info().

00084 {
00085 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
00086   
00087   std::cout << ReferenceCounter::get_info();
00088   
00089 #endif
00090 }

void ReferenceCounter::print_info (  )  [static, inherited]

Prints the reference information to std::cout.

Definition at line 83 of file reference_counter.C.

References ReferenceCounter::get_info().

00084 {
00085 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
00086   
00087   std::cout << ReferenceCounter::get_info();
00088   
00089 #endif
00090 }

void DofObject::processor_id ( const unsigned int  id  )  [inline, inherited]

Sets the processor_id for this DofObject.

Definition at line 489 of file dof_object.h.

References DofObject::processor_id().

00490 {
00491 #ifdef DEBUG
00492   
00493   if (id != static_cast<unsigned int>(static_cast<unsigned short int>(id)))
00494     {
00495       std::cerr << "ERROR: id too large for unsigned short int!" << std::endl
00496                 << "Recompile with DofObject::_processor_id larger!" << std::endl;
00497       
00498       libmesh_error();
00499     }
00500 
00501 #endif
00502   
00503   this->processor_id() = id;
00504 }

unsigned short int & DofObject::processor_id (  )  [inline, inherited]

Returns:
the processor that this element belongs to as a writeable reference.

Definition at line 481 of file dof_object.h.

References DofObject::_processor_id.

00482 {
00483   return _processor_id;
00484 }

unsigned short int DofObject::processor_id (  )  const [inline, inherited]

Returns:
the processor that this element belongs to. To conserve space this is stored as a short integer.

Definition at line 473 of file dof_object.h.

References DofObject::_processor_id.

Referenced by MetisPartitioner::_do_partition(), LinearPartitioner::_do_partition(), CentroidPartitioner::_do_partition(), ParallelMesh::add_elem(), Patch::add_local_face_neighbors(), Patch::add_local_point_neighbors(), DofMap::add_neighbors_to_send_list(), ParallelMesh::add_node(), SerialMesh::add_point(), ParallelMesh::add_point(), UnstructuredMesh::all_first_order(), UnstructuredMesh::all_second_order(), MeshTools::Modification::all_tri(), ParmetisPartitioner::assign_partitioning(), Patch::build_around_element(), InfElemBuilder::build_inf_elem(), UnstructuredMesh::copy_nodes_and_elements(), MeshTools::correct_node_proc_ids(), UnstructuredMesh::create_submesh(), DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), Elem::Elem(), UnstructuredMesh::find_neighbors(), MeshTools::Modification::flatten(), DofObject::invalidate_processor_id(), Elem::is_ancestor_of(), MeshTools::libmesh_assert_valid_elem_ids(), MeshRefinement::make_coarsening_compatible(), XdrIO::pack_element(), Partitioner::partition_unpartitioned_elements(), DofObject::processor_id(), Nemesis_IO::read(), XdrIO::read_serialized_connectivity(), MeshData::read_xdr(), Elem::refine(), Partitioner::set_node_processor_ids(), DofMap::set_nonlocal_dof_objects(), Partitioner::set_parent_processor_ids(), BoundaryInfo::sync(), Parallel::sync_dofobject_data_by_id(), Parallel::sync_element_data_by_parent_id(), GmshIO::write_mesh(), and XdrIO::write_serialized_connectivity().

00474 {
00475   return _processor_id;
00476 }

template<typename T >
bool TypeVector< T >::relative_fuzzy_equals ( const TypeVector< T > &  rhs,
Real  tol = TOLERANCE 
) const [inline, inherited]

Returns:
true iff two vectors occupy approximately the same physical location in space, to within a relative tolerance of tol.

Definition at line 780 of file type_vector.h.

References TypeVector< T >::_coords, and TypeVector< T >::absolute_fuzzy_equals().

Referenced by Quad9::has_affine_map(), Quad8::has_affine_map(), Quad4::has_affine_map(), Prism6::has_affine_map(), Prism18::has_affine_map(), Prism15::has_affine_map(), Hex8::has_affine_map(), Hex27::has_affine_map(), and Hex20::has_affine_map().

00781 {
00782 #if LIBMESH_DIM == 1
00783   return this->absolute_fuzzy_equals(rhs, tol *
00784                                      (std::abs(_coords[0]) + std::abs(rhs._coords[0])));
00785 #endif
00786 
00787 #if LIBMESH_DIM == 2
00788   return this->absolute_fuzzy_equals(rhs, tol * 
00789                                      (std::abs(_coords[0]) + std::abs(rhs._coords[0]) +
00790                                       std::abs(_coords[1]) + std::abs(rhs._coords[1])));
00791 #endif
00792 
00793 #if LIBMESH_DIM == 3
00794   return this->absolute_fuzzy_equals(rhs, tol *
00795                                      (std::abs(_coords[0]) + std::abs(rhs._coords[0]) +
00796                                       std::abs(_coords[1]) + std::abs(rhs._coords[1]) +
00797                                       std::abs(_coords[2]) + std::abs(rhs._coords[2])));
00798 #endif
00799 }

void DofObject::set_dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp,
const unsigned int  dn 
) [inherited]

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

Definition at line 338 of file dof_object.C.

References DofObject::_dof_ids, DofObject::dof_number(), DofObject::invalid_id, DofObject::n_comp(), DofObject::n_systems(), and DofObject::n_vars().

Referenced by DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), DofObject::invalidate_dofs(), DofMap::reinit(), and DofMap::set_nonlocal_dof_objects().

00342 {
00343   libmesh_assert (s < this->n_systems());
00344   libmesh_assert (var  < this->n_vars(s));
00345   libmesh_assert (_dof_ids != NULL);
00346   libmesh_assert (_dof_ids[s] != NULL);
00347   libmesh_assert (comp < this->n_comp(s,var));
00348   
00349   //We intend to change all dof numbers together or not at all
00350   if (comp)
00351     libmesh_assert ((dn == invalid_id && _dof_ids[s][var] == invalid_id) || 
00352                     (dn == _dof_ids[s][var] + comp));
00353   else
00354     _dof_ids[s][var] = dn;
00355 
00356 
00357   libmesh_assert(this->dof_number(s, var, comp) == dn);
00358 }

void DofObject::set_id ( const unsigned int  id  )  [inline, inherited]

Sets the id for this DofObject

Definition at line 143 of file dof_object.h.

References DofObject::set_id().

Referenced by DofObject::set_id().

00144   { this->set_id() = id; }

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

References DofObject::_dof_ids, DofObject::_n_v_comp, DofObject::invalid_id, DofObject::n_comp(), DofObject::n_systems(), and DofObject::n_vars().

Referenced by DofMap::reinit(), and DofMap::set_nonlocal_dof_objects().

00301 {
00302   libmesh_assert (s < this->n_systems());
00303   libmesh_assert (var < this->n_vars(s));
00304   libmesh_assert (_dof_ids != NULL);
00305   libmesh_assert (_dof_ids[s] != NULL);
00306   
00307   // Check for trivial return
00308   if (ncomp == this->n_comp(s,var)) return;
00309 
00310 #ifdef DEBUG
00311 
00312   if (ncomp != static_cast<unsigned int>(static_cast<unsigned char>(ncomp)))
00313     {
00314       std::cerr << "Unsigned char not big enough to hold ncomp!" << std::endl
00315                 << "Recompile with _n_v_comp set to a bigger type!"
00316                 << std::endl;
00317       
00318       libmesh_error();
00319     }
00320   
00321 #endif
00322 
00323   // We use (invalid_id - 1) to signify no
00324   // components for this object
00325   if (ncomp == 0)
00326     {
00327       _dof_ids[s][var] = (invalid_id - 1);
00328     }
00329   
00330   libmesh_assert (_n_v_comp    != NULL);
00331   libmesh_assert (_n_v_comp[s] != NULL);
00332     
00333   _n_v_comp[s][var+1]  = static_cast<unsigned char>(ncomp);
00334 }

void DofObject::set_n_systems ( const unsigned int  s  )  [inherited]

Sets the number of systems for this DofObject

Definition at line 148 of file dof_object.C.

References DofObject::_dof_ids, DofObject::_n_systems, DofObject::_n_v_comp, DofObject::clear_dofs(), and DofObject::n_systems().

Referenced by Elem::refine().

00149 {
00150   // Check for trivial return
00151   if (ns == this->n_systems()) return;
00152  
00153 #ifdef DEBUG
00154 
00155   if (ns != static_cast<unsigned int>(static_cast<unsigned char>(ns)))
00156     {
00157       std::cerr << "Unsigned char not big enough to hold ns!" << std::endl
00158                 << "Recompile with _n_systems set to a bigger type!"
00159                 << std::endl;
00160       
00161       libmesh_error();
00162     }
00163                                         
00164 #endif
00165 
00166 
00167   // Clear any existing data.  This is safe to call
00168   // even if we don't have any data.
00169   this->clear_dofs();
00170 
00171   // Set the new number of systems
00172   _n_systems = static_cast<unsigned char>(ns);
00173   
00174   // Allocate storage for the systems
00175   _n_v_comp = new unsigned char* [this->n_systems()];
00176   _dof_ids  = new unsigned int*  [this->n_systems()];
00177 
00178   // No variables have been declared yet.
00179   for (unsigned int s=0; s<this->n_systems(); s++)
00180     {
00181       _n_v_comp[s] = NULL;
00182       _dof_ids[s]  = NULL;
00183     }
00184 }

void DofObject::set_n_vars ( const unsigned int  s,
const unsigned int  nvars 
) [inherited]

Sets number of variables associated with system s for this DofObject

Definition at line 241 of file dof_object.C.

References DofObject::_dof_ids, DofObject::_n_v_comp, DofObject::invalid_id, DofObject::n_systems(), and DofObject::n_vars().

00243 {
00244   libmesh_assert (s < this->n_systems());
00245   libmesh_assert (_n_v_comp != NULL);
00246   libmesh_assert (_dof_ids  != NULL);
00247 
00248 #ifdef DEBUG
00249 
00250   if (nvars != static_cast<unsigned int>(static_cast<unsigned char>(nvars)))
00251     {
00252       std::cerr << "Unsigned char not big enough to hold nvar!" << std::endl
00253                 << "Recompile with _n_vars set to a bigger type!"
00254                 << std::endl;
00255       
00256       libmesh_error();
00257     }
00258                                         
00259 #endif
00260 
00261   
00262   
00263   // If we already have memory allocated clear it.
00264   if (this->n_vars(s) != 0)
00265     {
00266       libmesh_assert (_n_v_comp[s] != NULL); delete [] _n_v_comp[s]; _n_v_comp[s] = NULL;
00267       libmesh_assert (_dof_ids[s]  != NULL); delete [] _dof_ids[s];  _dof_ids[s]  = NULL;
00268     }
00269 
00270   // Reset the number of variables in the system  
00271   if (nvars > 0)
00272     {
00273       libmesh_assert (_n_v_comp[s] == NULL);
00274       libmesh_assert (_dof_ids[s]  == NULL);
00275       
00276       _n_v_comp[s] = new unsigned char [nvars+1];
00277       _dof_ids[s]  = new unsigned int  [nvars];
00278       
00279       _n_v_comp[s][0] = static_cast<unsigned char>(nvars);
00280 
00281       libmesh_assert (nvars == this->n_vars(s));
00282       
00283       for (unsigned int v=0; v<this->n_vars(s); v++)
00284         {
00285           _n_v_comp[s][v+1] = 0;
00286           _dof_ids[s][v]    = invalid_id - 1;
00287         }
00288     }
00289   else // (nvars == 0)
00290     {
00291       libmesh_assert (_n_v_comp[s] == NULL);
00292       libmesh_assert (_dof_ids[s]  == NULL);
00293     }
00294 }

void DofObject::set_old_dof_object (  )  [inherited]

Sets the old_dof_object to a copy of this

Definition at line 133 of file dof_object.C.

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

Referenced by DofMap::reinit().

00134 {
00135   this->clear_old_dof_object();
00136 
00137   libmesh_assert (this->old_dof_object == NULL);
00138   
00139   // Make a new DofObject, assign a copy of \p this.
00140   // Make sure the copy ctor for DofObject works!!
00141   this->old_dof_object = new DofObject(*this);
00142 }

template<typename T >
Real TypeVector< T >::size (  )  const [inline, inherited]

template<typename T >
Real TypeVector< T >::size_sq (  )  const [inline, inherited]

Returns the magnitude of the vector squared, i.e. the sum of the element magnitudes squared.

Definition at line 733 of file type_vector.h.

References TypeVector< T >::_coords, and libmesh_norm().

Referenced by ExactSolution::_compute_error(), System::calculate_norm(), ExactErrorEstimator::find_squared_element_error(), HPCoarsenTest::select_refinement(), TypeVector< T >::size(), Sphere::Sphere(), and Edge3::volume().

00734 {
00735 #if LIBMESH_DIM == 1
00736   return (libmesh_norm(_coords[0]));
00737 #endif
00738   
00739 #if LIBMESH_DIM == 2
00740   return (libmesh_norm(_coords[0]) +
00741           libmesh_norm(_coords[1]));
00742 #endif
00743   
00744 #if LIBMESH_DIM == 3
00745   return (libmesh_norm(_coords[0]) +
00746           libmesh_norm(_coords[1]) + 
00747           libmesh_norm(_coords[2]));
00748 #endif
00749 }

template<typename T >
template<typename T2 >
void TypeVector< T >::subtract ( const TypeVector< T2 > &  p  )  [inline, inherited]

Subtract from this vector without creating a temporary.

Definition at line 513 of file type_vector.h.

References TypeVector< T >::_coords.

Referenced by TypeVector< T >::operator-=().

00514 {
00515   for (unsigned int i=0; i<LIBMESH_DIM; i++)
00516     _coords[i] -= p._coords[i];
00517 }

template<typename T >
template<typename T2 >
void TypeVector< T >::subtract_scaled ( const TypeVector< T2 > &  p,
const T  factor 
) [inline, inherited]

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

Definition at line 524 of file type_vector.h.

References TypeVector< T >::_coords.

Referenced by HPCoarsenTest::select_refinement().

00525 {
00526   for (unsigned int i=0; i<LIBMESH_DIM; i++)
00527     _coords[i] -= factor*p(i);
00528 }

template<typename T >
TypeVector< T > TypeVector< T >::unit (  )  const [inline, inherited]

Think of a vector as a dim dimensional vector. This will return a unit vector aligned in that direction.

Definition at line 36 of file type_vector.C.

References TypeVector< T >::_coords, and TypeVector< T >::size().

Referenced by FEBase::compute_face_map(), FEXYZ< Dim >::compute_face_values(), Plane::create_from_point_normal(), Plane::create_from_three_points(), MeshTools::Modification::distort(), and Sphere::unit_normal().

00037 {
00038 
00039   const Real length = size();
00040   
00041   libmesh_assert (length != static_cast<Real>(0.));
00042   
00043 #if LIBMESH_DIM == 1
00044   return TypeVector<T>(_coords[0]/length);
00045 #endif
00046   
00047 #if LIBMESH_DIM == 2 
00048   return TypeVector<T>(_coords[0]/length,
00049                        _coords[1]/length);
00050 #endif
00051   
00052 #if LIBMESH_DIM == 3
00053   return TypeVector<T>(_coords[0]/length,
00054                        _coords[1]/length, 
00055                        _coords[2]/length);
00056 #endif
00057   
00058 }

bool DofObject::valid_id (  )  const [inline, inherited]

Returns:
true if this DofObject has a valid id set, false otherwise.

Definition at line 466 of file dof_object.h.

References DofObject::_id, and DofObject::invalid_id.

Referenced by SerialMesh::add_elem(), ParallelMesh::add_elem(), SerialMesh::add_node(), ParallelMesh::add_node(), DofObject::id(), and Elem::libmesh_assert_valid_node_pointers().

00467 {
00468   return (DofObject::invalid_id != _id);
00469 }

bool DofObject::valid_processor_id (  )  const [inline, inherited]

Returns:
true if this DofObject has a valid id set, false otherwise.

Definition at line 509 of file dof_object.h.

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

00510 {
00511   return (DofObject::invalid_processor_id != _processor_id);
00512 }

template<typename T >
void TypeVector< T >::write_unformatted ( std::ostream &  out,
const bool  newline = true 
) const [inline, inherited]

Unformatted print to the stream out. Simply prints the elements of the vector separated by spaces. Optionally prints a newline, which it does by default.

Definition at line 93 of file type_vector.C.

Referenced by InfElemBuilder::build_inf_elem(), TecplotIO::write_ascii(), and DivaIO::write_stream().

00095 {
00096   libmesh_assert (out);
00097 
00098   out << std::setiosflags(std::ios::showpoint)
00099       << (*this)(0) << " "
00100       << (*this)(1) << " "
00101       << (*this)(2) << " ";
00102 
00103   if (newline)
00104     out << '\n';      
00105 }

template<typename T >
void TypeVector< T >::zero (  )  [inline, inherited]

Zero the vector in any dimension.

Definition at line 723 of file type_vector.h.

References TypeVector< T >::_coords.

00724 {
00725   for (unsigned int i=0; i<LIBMESH_DIM; i++)
00726     _coords[i] = 0.;
00727 }


Friends And Related Function Documentation

friend class Elem [friend]

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

friend class Node [friend, inherited]

Returns:
a key associated with this point. Useful for sorting. Make the derived class a friend

Definition at line 81 of file point.h.

template<typename T >
std::ostream& operator<< ( std::ostream &  os,
const TypeVector< T > &  t 
) [friend, inherited]

Formatted print as above but allows you to do Point p(1,2,3); std::cout << p << std::endl;

Definition at line 268 of file type_vector.h.

00269   {
00270     t.print(os);
00271     return os;
00272   }


Member Data Documentation

Threads::spin_mutex ReferenceCounter::_mutex [static, protected, inherited]

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 123 of file reference_counter.h.

Threads::spin_mutex ReferenceCounter::_mutex [static, protected, inherited]

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 123 of file reference_counter.h.

Threads::atomic< unsigned int > ReferenceCounter::_n_objects [static, protected, inherited]

The number of objects. Print the reference count information when the number returns to 0.

Definition at line 118 of file reference_counter.h.

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

Threads::atomic< unsigned int > ReferenceCounter::_n_objects [static, protected, inherited]

The number of objects. Print the reference count information when the number returns to 0.

Definition at line 118 of file reference_counter.h.

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

This object on the last mesh. Useful for projecting solutions from one mesh to another.

Definition at line 81 of file dof_object.h.

Referenced by DofObject::clear_old_dof_object(), DofMap::old_dof_indices(), DofMap::reinit(), and DofObject::set_old_dof_object().


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

Site Created By: libMesh Developers
Last modified: November 25 2009 03:44:40.

Hosted By:
SourceForge.net Logo