libMesh::Hex20 Class Reference

#include <cell_hex20.h>

Inheritance diagram for libMesh::Hex20:

Public Types

enum  RefinementState {
  COARSEN = 0, DO_NOTHING, REFINE, JUST_REFINED,
  JUST_COARSENED, INACTIVE, COARSEN_INACTIVE, INVALID_REFINEMENTSTATE
}
 
typedef Predicates::multi_predicate Predicate
 

Public Member Functions

 Hex20 (Elem *p=NULL)
 
ElemType type () const
 
unsigned int n_nodes () const
 
unsigned int n_sub_elem () const
 
virtual bool is_vertex (const unsigned int i) const
 
virtual bool is_edge (const unsigned int i) const
 
virtual bool is_face (const unsigned int i) const
 
virtual bool is_node_on_side (const unsigned int n, const unsigned int s) const
 
virtual bool is_node_on_edge (const unsigned int n, const unsigned int e) const
 
virtual bool has_affine_map () const
 
Order default_order () const
 
AutoPtr< Elembuild_side (const unsigned int i, bool proxy) const
 
AutoPtr< Elembuild_edge (const unsigned int i) const
 
virtual void connectivity (const unsigned int sc, const IOPackage iop, std::vector< dof_id_type > &conn) const
 
unsigned int n_second_order_adjacent_vertices (const unsigned int) const
 
unsigned short int second_order_adjacent_vertex (const unsigned int n, const unsigned int v) const
 
virtual std::pair< unsigned
short int, unsigned short int > 
second_order_child_vertex (const unsigned int n) const
 
unsigned int n_sides () const
 
unsigned int n_vertices () const
 
unsigned int n_edges () const
 
unsigned int n_faces () const
 
unsigned int n_children () const
 
virtual bool is_child_on_side (const unsigned int c, const unsigned int s) const
 
virtual bool is_edge_on_side (const unsigned int e, const unsigned int s) const
 
virtual unsigned int opposite_side (const unsigned int s) const
 
virtual unsigned int opposite_node (const unsigned int n, const unsigned int s) const
 
dof_id_type key (const unsigned int s) const
 
AutoPtr< Elemside (const unsigned int i) const
 
Real quality (const ElemQuality q) const
 
std::pair< Real, Realqual_bounds (const ElemQuality q) const
 
unsigned int dim () const
 
bool infinite () const
 
virtual const Pointpoint (const unsigned int i) const
 
virtual Pointpoint (const unsigned int i)
 
virtual dof_id_type node (const unsigned int i) const
 
virtual unsigned int local_node (const dof_id_type i) const
 
unsigned int get_node_index (const Node *node_ptr) const
 
virtual Nodeget_node (const unsigned int i) const
 
virtual Node *& set_node (const unsigned int i)
 
subdomain_id_type subdomain_id () const
 
subdomain_id_typesubdomain_id ()
 
const Elemreference_elem () const
 
bool operator== (const Elem &rhs) const
 
Elemneighbor (const unsigned int i) const
 
const Elemtopological_neighbor (const unsigned int i, const MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb) const
 
Elemtopological_neighbor (const unsigned int i, MeshBase &mesh, const PointLocatorBase &point_locator, const PeriodicBoundaries *pb)
 
bool has_topological_neighbor (const Elem *elem, const MeshBase &mesh, const PointLocatorBase &point_locator, PeriodicBoundaries *pb) const
 
void set_neighbor (const unsigned int i, Elem *n)
 
bool has_neighbor (const Elem *elem) const
 
Elemchild_neighbor (Elem *elem) const
 
const Elemchild_neighbor (const Elem *elem) const
 
bool on_boundary () const
 
bool is_semilocal (const processor_id_type my_pid) const
 
unsigned int which_neighbor_am_i (const Elem *e) const
 
unsigned int which_side_am_i (const Elem *e) const
 
bool contains_vertex_of (const Elem *e) const
 
bool contains_edge_of (const Elem *e) const
 
void find_point_neighbors (const Point &p, std::set< const Elem * > &neighbor_set) const
 
void find_point_neighbors (std::set< const Elem * > &neighbor_set) const
 
void find_edge_neighbors (const Point &p1, const Point &p2, std::set< const Elem * > &neighbor_set) const
 
void find_edge_neighbors (std::set< const Elem * > &neighbor_set) const
 
void make_links_to_me_remote ()
 
void make_links_to_me_local (unsigned int n)
 
virtual bool is_remote () const
 
void write_connectivity (std::ostream &out, const IOPackage iop) const
 
virtual unsigned int n_neighbors () const
 
virtual Point centroid () const
 
virtual Real hmin () const
 
virtual Real hmax () const
 
virtual Real volume () const
 
virtual bool contains_point (const Point &p, Real tol=TOLERANCE) const
 
virtual bool close_to_point (const Point &p, Real tol) const
 
virtual bool is_linear () const
 
void print_info (std::ostream &os=libMesh::out) const
 
std::string get_info () const
 
bool active () const
 
bool ancestor () const
 
bool subactive () const
 
bool has_children () const
 
bool has_ancestor_children () const
 
bool is_ancestor_of (const Elem *descendant) const
 
const Elemparent () const
 
Elemparent ()
 
void set_parent (Elem *p)
 
const Elemtop_parent () const
 
const Eleminterior_parent () const
 
void set_interior_parent (Elem *p)
 
Real length (const unsigned int n1, const unsigned int n2) const
 
unsigned int level () const
 
unsigned int p_level () const
 
Elemchild (const unsigned int i) const
 
unsigned int which_child_am_i (const Elem *e) const
 
virtual bool is_child_on_edge (const unsigned int c, const unsigned int e) const
 
void add_child (Elem *elem)
 
void add_child (Elem *elem, unsigned int c)
 
void replace_child (Elem *elem, unsigned int c)
 
void family_tree (std::vector< const Elem * > &family, const bool reset=true) const
 
void total_family_tree (std::vector< const Elem * > &active_family, const bool reset=true) const
 
void active_family_tree (std::vector< const Elem * > &active_family, const bool reset=true) const
 
void family_tree_by_side (std::vector< const Elem * > &family, const unsigned int side, const bool reset=true) const
 
void active_family_tree_by_side (std::vector< const Elem * > &family, const unsigned int side, const bool reset=true) const
 
void family_tree_by_neighbor (std::vector< const Elem * > &family, const Elem *neighbor, const bool reset=true) const
 
void family_tree_by_subneighbor (std::vector< const Elem * > &family, const Elem *neighbor, const Elem *subneighbor, const bool reset=true) const
 
void active_family_tree_by_neighbor (std::vector< const Elem * > &family, const Elem *neighbor, const bool reset=true) const
 
RefinementState refinement_flag () const
 
void set_refinement_flag (const RefinementState rflag)
 
RefinementState p_refinement_flag () const
 
void set_p_refinement_flag (const RefinementState pflag)
 
unsigned int max_descendant_p_level () const
 
unsigned int min_p_level_by_neighbor (const Elem *neighbor, unsigned int current_min) const
 
unsigned int min_new_p_level_by_neighbor (const Elem *neighbor, unsigned int current_min) const
 
void set_p_level (const unsigned int p)
 
void hack_p_level (const unsigned int p)
 
virtual void refine (MeshRefinement &mesh_refinement)
 
void coarsen ()
 
void contract ()
 
void libmesh_assert_valid_neighbors () const
 
void libmesh_assert_valid_node_pointers () const
 
side_iterator boundary_sides_begin ()
 
side_iterator boundary_sides_end ()
 
virtual Point origin () const
 
unsigned int packed_size () 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
 
dof_id_type id () const
 
dof_id_typeset_id ()
 
void set_id (const dof_id_type dofid)
 
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)
 
bool valid_processor_id () const
 
unsigned int n_systems () const
 
void set_n_systems (const unsigned int s)
 
void add_system ()
 
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)
 
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)
 
void set_n_comp_group (const unsigned int s, const unsigned int vg, const unsigned int ncomp)
 
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)
 
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)
 
dof_id_type vg_dof_base (const unsigned int s, const unsigned int vg) const
 
unsigned int packed_indexing_size () const
 
void unpack_indexing (std::vector< largest_id_type >::const_iterator begin)
 
void pack_indexing (std::back_insert_iterator< std::vector< largest_id_type > > target) const
 
void debug_buffer () const
 
void set_buffer (const std::vector< dof_id_type > &buf)
 

Static Public Member Functions

static void print_info (std::ostream &out=libMesh::out)
 
static void print_info (std::ostream &out=libMesh::out)
 
static std::string get_info ()
 
static std::string get_info ()
 
static ElemType second_order_equivalent_type (const ElemType et, const bool full_ordered=true)
 
static ElemType first_order_equivalent_type (const ElemType et)
 
static AutoPtr< Elembuild (const ElemType type, Elem *p=NULL)
 
static unsigned int n_objects ()
 
static unsigned int n_objects ()
 
static void enable_print_counter_info ()
 
static void enable_print_counter_info ()
 
static void disable_print_counter_info ()
 
static void disable_print_counter_info ()
 
static unsigned int unpackable_indexing_size (std::vector< largest_id_type >::const_iterator begin)
 

Public Attributes

DofObjectold_dof_object
 

Static Public Attributes

static const unsigned int side_nodes_map [6][8]
 
static const unsigned int edge_nodes_map [12][3]
 
static const unsigned int type_to_n_nodes_map [INVALID_ELEM]
 
static const unsigned int type_to_n_sides_map [INVALID_ELEM]
 
static const unsigned int type_to_n_edges_map [INVALID_ELEM]
 
static const dof_id_type invalid_id = static_cast<dof_id_type>(-1)
 
static const unique_id_type invalid_unique_id = static_cast<unique_id_type>(-1)
 
static const processor_id_type invalid_processor_id = static_cast<processor_id_type>(-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

float embedding_matrix (const unsigned int i, const unsigned int j, const unsigned int k) const
 
void nullify_neighbors ()
 
void increment_constructor_count (const std::string &name)
 
void increment_constructor_count (const std::string &name)
 
void increment_destructor_count (const std::string &name)
 
void increment_destructor_count (const std::string &name)
 

Static Protected Member Functions

static dof_id_type compute_key (dof_id_type n0)
 
static dof_id_type compute_key (dof_id_type n0, dof_id_type n1)
 
static dof_id_type compute_key (dof_id_type n0, dof_id_type n1, dof_id_type n2)
 
static dof_id_type compute_key (dof_id_type n0, dof_id_type n1, dof_id_type n2, dof_id_type n3)
 

Protected Attributes

Node_nodelinks_data [20]
 
Elem_elemlinks_data [7+(LIBMESH_DIM >3)]
 
Node ** _nodes
 
Elem ** _elemlinks
 
Elem ** _children
 
unsigned char _rflag
 
unsigned char _pflag
 
unsigned char _p_level
 
subdomain_id_type _sbd_id
 

Static Protected Attributes

static const float _embedding_matrix [8][20][20]
 
static const unsigned short int _second_order_adjacent_vertices [12][2]
 
static const unsigned short int _second_order_vertex_child_number [27]
 
static const unsigned short int _second_order_vertex_child_index [27]
 
static Counts _counts
 
static Counts _counts
 
static Threads::atomic
< unsigned int > 
_n_objects
 
static Threads::atomic
< unsigned int > 
_n_objects
 
static Threads::spin_mutex _mutex
 
static Threads::spin_mutex _mutex
 
static bool _enable_print_counter = true
 
static bool _enable_print_counter = true
 

Detailed Description

The Hex20 is an element in 3D composed of 20 nodes. It is numbered like this:

 HEX20:      7              18             6
             o--------------o--------------o
            /:                            /|
           / :                           / |
          /  :                          /  |
       19/   :                       17/   |
        o    :                        o    |
       /     :                       /     |
      /    15o                      /    14o
     /       :                     /       |
   4/        :    16             5/        |
   o--------------o--------------o         |
   |         :                   |         |
   |         :                   |         |
   |         :              10   |         |
   |        3o..............o....|.........o
   |        .                    |        / 2
   |       .                   13|       /
12 o      .                      o      /
   |     .                       |     /
   |  11o                        |    o
   |   .                         |   / 9
   |  .                          |  /
   | .                           | /
   |.                            |/
   o--------------o--------------o
   0              8              1

Definition at line 71 of file cell_hex20.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 113 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 113 of file reference_counter.h.

Useful iterator typedefs

Definition at line 1069 of file elem.h.

Member Enumeration Documentation

Useful ENUM describing the refinement state of an element.

Enumerator
COARSEN 
DO_NOTHING 
REFINE 
JUST_REFINED 
JUST_COARSENED 
INACTIVE 
COARSEN_INACTIVE 
INVALID_REFINEMENTSTATE 

Definition at line 827 of file elem.h.

827  { COARSEN = 0,
828  DO_NOTHING,
829  REFINE,
830  JUST_REFINED,
832  INACTIVE,

Constructor & Destructor Documentation

libMesh::Hex20::Hex20 ( Elem p = NULL)
inlineexplicit

Constructor. By default this element has no parent.

Definition at line 226 of file cell_hex20.h.

226  :
228 {
229 }

Member Function Documentation

bool libMesh::Elem::active ( ) const
inlineinherited
Returns
true if the element is active (i.e. has no active descendants), false otherwise. Note that it suffices to check the first child only. Always returns true if AMR is disabled.

Definition at line 1587 of file elem.h.

References libMesh::Elem::COARSEN_INACTIVE, libMesh::Elem::INACTIVE, and libMesh::Elem::refinement_flag().

Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::MetisPartitioner::_do_partition(), libMesh::MeshRefinement::_refine_elements(), libMesh::Elem::active_family_tree(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::active_family_tree_by_side(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::HPCoarsenTest::add_projection(), libMesh::Elem::ancestor(), libMesh::Patch::build_around_element(), libMesh::ParmetisPartitioner::build_graph(), libMesh::Elem::coarsen(), libMesh::MeshRefinement::coarsen_elements(), libMesh::FEGenericBase< T >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< T >::compute_proj_constraints(), libMesh::UnstructuredMesh::contract(), libMesh::Elem::contract(), libMesh::DofMap::dof_indices(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::Elem::family_tree(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::find_edge_neighbors(), libMesh::Patch::find_face_neighbors(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::for(), libMesh::Elem::get_info(), libMesh::ErrorVector::is_active_elem(), libMesh::MeshTools::libmesh_assert_valid_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_refinement_tree(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::DofMap::old_dof_indices(), libMesh::PointLocatorList::operator()(), libMesh::Elem::refine(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::MeshRefinement::refine_elements(), libMesh::Elem::subactive(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::MeshRefinement::test_level_one(), libMesh::Parallel::unpack(), libMesh::Elem::PackedElem::unpack(), and libMesh::DivaIO::write_stream().

1588 {
1589 #ifdef LIBMESH_ENABLE_AMR
1590  if ((this->refinement_flag() == INACTIVE) ||
1591  (this->refinement_flag() == COARSEN_INACTIVE))
1592  return false;
1593  else
1594  return true;
1595 #else
1596  return true;
1597 #endif
1598 }
void libMesh::Elem::active_family_tree ( std::vector< const Elem * > &  active_family,
const bool  reset = true 
) const
inherited

Same as the family_tree() member, but only adds the active children. Can be thought of as removing all the inactive elements from the vector created by family_tree, but is implemented more efficiently.

Definition at line 1476 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree(), libMesh::Elem::child(), libMesh::Elem::is_remote(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), and libMesh::Elem::subactive().

Referenced by libMesh::MetisPartitioner::_do_partition(), libMesh::Elem::active_family_tree(), libMesh::ParmetisPartitioner::build_graph(), and libMesh::Partitioner::set_parent_processor_ids().

1478 {
1479  // The "family tree" doesn't include subactive elements
1480  libmesh_assert(!this->subactive());
1481 
1482  // Clear the vector if the flag reset tells us to.
1483  if (reset)
1484  active_family.clear();
1485 
1486  // Add this element to the family tree if it is active
1487  if (this->active())
1488  active_family.push_back(this);
1489 
1490  // Otherwise recurse into the element's children.
1491  // Do not clear the vector any more.
1492  else
1493  for (unsigned int c=0; c<this->n_children(); c++)
1494  if (!this->child(c)->is_remote())
1495  this->child(c)->active_family_tree (active_family, false);
1496 }
void libMesh::Elem::active_family_tree_by_neighbor ( std::vector< const Elem * > &  family,
const Elem neighbor,
const bool  reset = true 
) const
inherited

Same as the active_family_tree() member, but only adds elements which are next to neighbor.

Definition at line 1631 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::child(), libMesh::Elem::has_neighbor(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::Elem::active_family_tree_by_neighbor(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::Elem::find_edge_neighbors(), libMesh::Patch::find_face_neighbors(), libMesh::Elem::find_point_neighbors(), and libMesh::SparsityPattern::Build::operator()().

1634 {
1635  // The "family tree" doesn't include subactive elements
1636  libmesh_assert(!this->subactive());
1637 
1638  // Clear the vector if the flag reset tells us to.
1639  if (reset)
1640  family.clear();
1641 
1642  // This only makes sense if we're already a neighbor
1643  if (this->level() >= neighbor_in->level())
1644  libmesh_assert (this->has_neighbor(neighbor_in));
1645 
1646  // Add an active element to the family tree.
1647  if (this->active())
1648  family.push_back(this);
1649 
1650  // Or recurse into an ancestor element's children.
1651  // Do not clear the vector any more.
1652  else if (!this->active())
1653  for (unsigned int c=0; c<this->n_children(); c++)
1654  {
1655  Elem *current_child = this->child(c);
1656  if (current_child != remote_elem && current_child->has_neighbor(neighbor_in))
1657  current_child->active_family_tree_by_neighbor (family, neighbor_in, false);
1658  }
1659 }
void libMesh::Elem::active_family_tree_by_side ( std::vector< const Elem * > &  family,
const unsigned int  side,
const bool  reset = true 
) const
inherited

Same as the active_family_tree() member, but only adds elements which are next to side.

Definition at line 1526 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_side(), libMesh::Elem::child(), libMesh::Elem::is_child_on_side(), libMesh::Elem::is_remote(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_sides(), and libMesh::Elem::subactive().

Referenced by libMesh::Elem::active_family_tree_by_side(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::ExodusII_IO_Helper::write_sidesets(), and libMesh::Nemesis_IO_Helper::write_sidesets().

1529 {
1530  // The "family tree" doesn't include subactive elements
1531  libmesh_assert(!this->subactive());
1532 
1533  // Clear the vector if the flag reset tells us to.
1534  if (reset)
1535  family.clear();
1536 
1537  libmesh_assert_less (s, this->n_sides());
1538 
1539  // Add an active element to the family tree.
1540  if (this->active())
1541  family.push_back(this);
1542 
1543  // Or recurse into an ancestor element's children.
1544  // Do not clear the vector any more.
1545  else
1546  for (unsigned int c=0; c<this->n_children(); c++)
1547  if (!this->child(c)->is_remote() && this->is_child_on_side(c, s))
1548  this->child(c)->active_family_tree_by_side (family, s, false);
1549 }
void libMesh::Elem::add_child ( Elem elem)
inherited

Adds a child pointer to the array of children of this element. If this is the first child to be added, this method allocates memory in the parent's _children array, otherwise, it just sets the pointer.

Definition at line 1361 of file elem.C.

References libMesh::Elem::_children, libMesh::err, libMesh::Elem::n_children(), libMesh::Elem::parent(), libMesh::remote_elem, and libMesh::Elem::set_child().

Referenced by libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::CheckpointIO::read_connectivity(), libMesh::LegacyXdrIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Parallel::unpack(), and libMesh::Elem::PackedElem::unpack().

1362 {
1363  if(_children == NULL)
1364  {
1365  _children = new Elem*[this->n_children()];
1366 
1367  for (unsigned int c=0; c<this->n_children(); c++)
1368  this->set_child(c, NULL);
1369  }
1370 
1371  for (unsigned int c=0; c<this->n_children(); c++)
1372  {
1373  if(this->_children[c] == NULL || this->_children[c] == remote_elem)
1374  {
1375  libmesh_assert_equal_to (this, elem->parent());
1376  this->set_child(c, elem);
1377  return;
1378  }
1379  }
1380 
1381  libMesh::err << "Error: Tried to add a child to an element with full children array"
1382  << std::endl;
1383  libmesh_error();
1384 }
void libMesh::Elem::add_child ( Elem elem,
unsigned int  c 
)
inherited

Adds a new child pointer to the specified index in the array of children of this element. If this is the first child to be added, this method allocates memory in the parent's _children array, otherwise, it just sets the pointer.

Definition at line 1388 of file elem.C.

References libMesh::Elem::_children, libMesh::Elem::child(), libMesh::Elem::has_children(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::parent(), libMesh::remote_elem, and libMesh::Elem::set_child().

1389 {
1390  if(!this->has_children())
1391  {
1392  _children = new Elem*[this->n_children()];
1393 
1394  for (unsigned int i=0; i<this->n_children(); i++)
1395  this->set_child(i, NULL);
1396  }
1397 
1398  libmesh_assert (this->_children[c] == NULL || this->child(c) == remote_elem);
1399  libmesh_assert (elem == remote_elem || this == elem->parent());
1400 
1401  this->set_child(c, elem);
1402 }
void libMesh::DofObject::add_system ( )
inherited

Adds an additional system to the DofObject

Definition at line 189 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().

190 {
191  // quick return?
192  if (this->n_systems() == 0)
193  {
194  this->set_n_systems(1);
195  return;
196  }
197 
198  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
199 
200  std::advance(it, this->n_systems());
201 
202  // this inserts the current vector size at the position for the new system - creating the
203  // entry we need for the new system indicating there are 0 variables.
204  _idx_buf.insert(it, _idx_buf.size());
205 
206  // cache this value before we screw it up!
207  const unsigned int ns_orig = this->n_systems();
208 
209  // incriment the number of systems and the offsets for each of
210  // the systems including the new one we just added.
211  for (unsigned int i=0; i<ns_orig+1; i++)
212  _idx_buf[i]++;
213 
214  libmesh_assert_equal_to (this->n_systems(), (ns_orig+1));
215  libmesh_assert_equal_to (this->n_vars(ns_orig), 0);
216  libmesh_assert_equal_to (this->n_var_groups(ns_orig), 0);
217 }
bool libMesh::Elem::ancestor ( ) const
inherited
Returns
true if the element is an ancestor (i.e. has an active child or ancestor child), false otherwise. Always returns false if AMR is disabled.

Definition at line 1339 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::ancestor(), libMesh::Elem::child(), and libMesh::Elem::has_children().

Referenced by libMesh::Elem::ancestor(), libMesh::UnstructuredMesh::contract(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::MeshTools::libmesh_assert_valid_refinement_tree(), libMesh::MeshRefinement::make_coarsening_compatible(), and libMesh::Elem::refine().

1340 {
1341 #ifdef LIBMESH_ENABLE_AMR
1342 
1343  if (this->active())
1344  return false;
1345 
1346 if (!this->has_children())
1347  return false;
1348  if (this->child(0)->active())
1349  return true;
1350 
1351  return this->child(0)->ancestor();
1352 #else
1353  return false;
1354 #endif
1355 }
Elem::side_iterator libMesh::Elem::boundary_sides_begin ( )
inherited

Iterator accessor functions

Definition at line 2173 of file elem.C.

References libMesh::Elem::_first_side(), and libMesh::Elem::_last_side().

2174 {
2175  Predicates::BoundarySide<SideIter> bsp;
2176  return side_iterator(this->_first_side(), this->_last_side(), bsp);
2177 }
Elem::side_iterator libMesh::Elem::boundary_sides_end ( )
inherited

Definition at line 2182 of file elem.C.

References libMesh::Elem::_last_side().

2183 {
2184  Predicates::BoundarySide<SideIter> bsp;
2185  return side_iterator(this->_last_side(), this->_last_side(), bsp);
2186 }
AutoPtr< Elem > libMesh::Elem::build ( const ElemType  type,
Elem p = NULL 
)
staticinherited

Build an element of type type. Since this method allocates memory the new Elem is returned in a AutoPtr<>

Definition at line 202 of file elem.C.

References libMeshEnums::EDGE2, libMeshEnums::EDGE3, libMeshEnums::EDGE4, libMesh::err, libMeshEnums::HEX20, libMeshEnums::HEX27, libMeshEnums::HEX8, libMeshEnums::INFEDGE2, libMeshEnums::INFHEX16, libMeshEnums::INFHEX18, libMeshEnums::INFHEX8, libMeshEnums::INFPRISM12, libMeshEnums::INFPRISM6, libMeshEnums::INFQUAD4, libMeshEnums::INFQUAD6, libMeshEnums::PRISM15, libMeshEnums::PRISM18, libMeshEnums::PRISM6, libMeshEnums::PYRAMID14, libMeshEnums::PYRAMID5, libMeshEnums::QUAD4, libMeshEnums::QUAD8, libMeshEnums::QUAD9, libMeshEnums::TET10, libMeshEnums::TET4, libMeshEnums::TRI3, and libMeshEnums::TRI6.

Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::MeshTools::Modification::flatten(), libMesh::ExodusII_IO::read(), libMesh::Nemesis_IO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::AbaqusIO::read_elements(), libMesh::GmshIO::read_mesh(), libMesh::LegacyXdrIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::Elem::refine(), libMesh::Parallel::unpack(), libMesh::Elem::PackedElem::unpack(), and libMesh::GMVIO::write_ascii_old_impl().

204 {
205  Elem* elem = NULL;
206 
207  switch (type)
208  {
209  // 1D elements
210  case EDGE2:
211  {
212  elem = new Edge2(p);
213  break;
214  }
215  case EDGE3:
216  {
217  elem = new Edge3(p);
218  break;
219  }
220  case EDGE4:
221  {
222  elem = new Edge4(p);
223  break;
224  }
225 
226 
227 
228  // 2D elements
229  case TRI3:
230  {
231  elem = new Tri3(p);
232  break;
233  }
234  case TRI6:
235  {
236  elem = new Tri6(p);
237  break;
238  }
239  case QUAD4:
240  {
241  elem = new Quad4(p);
242  break;
243  }
244  case QUAD8:
245  {
246  elem = new Quad8(p);
247  break;
248  }
249  case QUAD9:
250  {
251  elem = new Quad9(p);
252  break;
253  }
254 
255 
256  // 3D elements
257  case TET4:
258  {
259  elem = new Tet4(p);
260  break;
261  }
262  case TET10:
263  {
264  elem = new Tet10(p);
265  break;
266  }
267  case HEX8:
268  {
269  elem = new Hex8(p);
270  break;
271  }
272  case HEX20:
273  {
274  elem = new Hex20(p);
275  break;
276  }
277  case HEX27:
278  {
279  elem = new Hex27(p);
280  break;
281  }
282  case PRISM6:
283  {
284  elem = new Prism6(p);
285  break;
286  }
287  case PRISM15:
288  {
289  elem = new Prism15(p);
290  break;
291  }
292  case PRISM18:
293  {
294  elem = new Prism18(p);
295  break;
296  }
297  case PYRAMID5:
298  {
299  elem = new Pyramid5(p);
300  break;
301  }
302  case PYRAMID14:
303  {
304  elem = new Pyramid14(p);
305  break;
306  }
307 
308 
309 
310 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
311 
312  // 1D infinite elements
313  case INFEDGE2:
314  {
315  elem = new InfEdge2(p);
316  break;
317  }
318 
319 
320  // 2D infinite elements
321  case INFQUAD4:
322  {
323  elem = new InfQuad4(p);
324  break;
325  }
326  case INFQUAD6:
327  {
328  elem = new InfQuad6(p);
329  break;
330  }
331 
332 
333  // 3D infinite elements
334  case INFHEX8:
335  {
336  elem = new InfHex8(p);
337  break;
338  }
339  case INFHEX16:
340  {
341  elem = new InfHex16(p);
342  break;
343  }
344  case INFHEX18:
345  {
346  elem = new InfHex18(p);
347  break;
348  }
349  case INFPRISM6:
350  {
351  elem = new InfPrism6(p);
352  break;
353  }
354  case INFPRISM12:
355  {
356  elem = new InfPrism12(p);
357  break;
358  }
359 
360 #endif
361 
362  default:
363  {
364  libMesh::err << "ERROR: Undefined element type!." << std::endl;
365  libmesh_error();
366  }
367  }
368 
369 
370  AutoPtr<Elem> ap(elem);
371  return ap;
372 }
AutoPtr< Elem > libMesh::Hex20::build_edge ( const unsigned int  i) const
virtual

Builds a EDGE3 built coincident with edge i. The AutoPtr<Elem> handles the memory aspect.

Implements libMesh::Elem.

Definition at line 257 of file cell_hex20.C.

References libMesh::Hex::n_edges().

258 {
259  libmesh_assert_less (i, this->n_edges());
260 
261  AutoPtr<Elem> ap(new SideEdge<Edge3,Hex20>(this,i));
262  return ap;
263 }
AutoPtr< Elem > libMesh::Hex20::build_side ( const unsigned int  i,
bool  proxy 
) const
virtual

Builds a QUAD8 built coincident with face i. The AutoPtr<Elem> handles the memory aspect.

Implements libMesh::Elem.

Definition at line 145 of file cell_hex20.C.

References libMesh::Elem::get_node(), libMesh::Hex::n_sides(), and libMesh::Elem::subdomain_id().

147 {
148  libmesh_assert_less (i, this->n_sides());
149 
150  if (proxy)
151  {
152  AutoPtr<Elem> ap(new Side<Quad8,Hex20>(this,i));
153  return ap;
154  }
155 
156  else
157  {
158  AutoPtr<Elem> face(new Quad8);
159  face->subdomain_id() = this->subdomain_id();
160 
161  // Think of a unit cube: (-1,1) x (-1,1)x (1,1)
162  switch (i)
163  {
164  case 0: // the face at z=0
165  {
166  face->set_node(0) = this->get_node(0);
167  face->set_node(1) = this->get_node(3);
168  face->set_node(2) = this->get_node(2);
169  face->set_node(3) = this->get_node(1);
170  face->set_node(4) = this->get_node(11);
171  face->set_node(5) = this->get_node(10);
172  face->set_node(6) = this->get_node(9);
173  face->set_node(7) = this->get_node(8);
174 
175  return face;
176  }
177  case 1: // the face at y = 0
178  {
179  face->set_node(0) = this->get_node(0);
180  face->set_node(1) = this->get_node(1);
181  face->set_node(2) = this->get_node(5);
182  face->set_node(3) = this->get_node(4);
183  face->set_node(4) = this->get_node(8);
184  face->set_node(5) = this->get_node(13);
185  face->set_node(6) = this->get_node(16);
186  face->set_node(7) = this->get_node(12);
187 
188  return face;
189  }
190  case 2: // the face at x=1
191  {
192  face->set_node(0) = this->get_node(1);
193  face->set_node(1) = this->get_node(2);
194  face->set_node(2) = this->get_node(6);
195  face->set_node(3) = this->get_node(5);
196  face->set_node(4) = this->get_node(9);
197  face->set_node(5) = this->get_node(14);
198  face->set_node(6) = this->get_node(17);
199  face->set_node(7) = this->get_node(13);
200 
201  return face;
202  }
203  case 3: // the face at y=1
204  {
205  face->set_node(0) = this->get_node(2);
206  face->set_node(1) = this->get_node(3);
207  face->set_node(2) = this->get_node(7);
208  face->set_node(3) = this->get_node(6);
209  face->set_node(4) = this->get_node(10);
210  face->set_node(5) = this->get_node(15);
211  face->set_node(6) = this->get_node(18);
212  face->set_node(7) = this->get_node(14);
213 
214  return face;
215  }
216  case 4: // the face at x=0
217  {
218  face->set_node(0) = this->get_node(3);
219  face->set_node(1) = this->get_node(0);
220  face->set_node(2) = this->get_node(4);
221  face->set_node(3) = this->get_node(7);
222  face->set_node(4) = this->get_node(11);
223  face->set_node(5) = this->get_node(12);
224  face->set_node(6) = this->get_node(19);
225  face->set_node(7) = this->get_node(15);
226 
227  return face;
228  }
229  case 5: // the face at z=1
230  {
231  face->set_node(0) = this->get_node(4);
232  face->set_node(1) = this->get_node(5);
233  face->set_node(2) = this->get_node(6);
234  face->set_node(3) = this->get_node(7);
235  face->set_node(4) = this->get_node(16);
236  face->set_node(5) = this->get_node(17);
237  face->set_node(6) = this->get_node(18);
238  face->set_node(7) = this->get_node(19);
239 
240  return face;
241  }
242  default:
243  {
244  libmesh_error();
245  return face;
246  }
247  }
248  }
249 
250  // We'll never get here.
251  libmesh_error();
252  AutoPtr<Elem> ap(NULL); return ap;
253 }
Point libMesh::Elem::centroid ( ) const
virtualinherited
Returns
the centriod of the element. The centroid is computed as the average of all the element vertices. This method is overloadable since some derived elements might want to use shortcuts to compute their centroid.

Definition at line 383 of file elem.C.

References libMesh::TypeVector< T >::add(), and libMesh::Elem::n_vertices().

Referenced by libMesh::SFCPartitioner::_do_partition(), libMesh::MeshCommunication::assign_global_indices(), libMesh::CentroidPartitioner::compute_centroids(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::LocationMap< T >::point_of(), libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::Prism6::volume(), and libMesh::Hex8::volume().

384 {
385  Point cp;
386 
387  for (unsigned int n=0; n<this->n_vertices(); n++)
388  cp.add (this->point(n));
389 
390  return (cp /= static_cast<Real>(this->n_vertices()));
391 }
Elem * libMesh::Elem::child ( const unsigned int  i) const
inlineinherited
Returns
a pointer to the $ i^{th} $ child for this element. Do not call if this element has no children, i.e. is active.

Definition at line 1805 of file elem.h.

References libMesh::Elem::_children, and libMesh::libmesh_assert().

Referenced by libMesh::Elem::active_family_tree(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::active_family_tree_by_side(), libMesh::Elem::add_child(), libMesh::HPCoarsenTest::add_projection(), libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::ancestor(), libMesh::Elem::coarsen(), libMesh::FEGenericBase< T >::coarsened_dof_values(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::Elem::family_tree(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::for(), libMesh::Elem::has_ancestor_children(), libMesh::MeshTools::libmesh_assert_no_links_to_elem(), libMesh::MeshTools::libmesh_assert_valid_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_refinement_tree(), libMesh::MeshTools::libmesh_assert_valid_remote_elems(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::Elem::refine(), libMesh::Elem::replace_child(), libMesh::Elem::set_p_level(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::MeshTools::Modification::smooth(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Elem::total_family_tree(), libMesh::Parallel::unpack(), libMesh::Elem::PackedElem::unpack(), libMesh::Elem::which_child_am_i(), and libMesh::XdrIO::write_serialized_connectivity().

1806 {
1809 
1810  return _children[i];
1811 }
Elem * libMesh::Elem::child_neighbor ( Elem elem) const
inlineinherited

If the element elem in question is a neighbor of a child of this element, this returns a pointer to that child. Otherwise it returns NULL.

Definition at line 1478 of file elem.h.

References libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor(), and libMesh::Elem::parent().

1479 {
1480  for (unsigned int n=0; n<elem->n_neighbors(); n++)
1481  if (elem->neighbor(n) &&
1482  elem->neighbor(n)->parent() == this)
1483  return elem->neighbor(n);
1484 
1485  return NULL;
1486 }
const Elem * libMesh::Elem::child_neighbor ( const Elem elem) const
inlineinherited

If the element elem in question is a neighbor of a child of this element, this returns a pointer to that child. Otherwise it returns NULL.

Definition at line 1491 of file elem.h.

References libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor(), and libMesh::Elem::parent().

1492 {
1493  for (unsigned int n=0; n<elem->n_neighbors(); n++)
1494  if (elem->neighbor(n) &&
1495  elem->neighbor(n)->parent() == this)
1496  return elem->neighbor(n);
1497 
1498  return NULL;
1499 }
void libMesh::DofObject::clear_dofs ( )
inlineinherited

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

Definition at line 577 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().

578 {
579  // vector swap trick to force deallocation
580  index_buffer_t().swap(_idx_buf);
581 
582  libmesh_assert_equal_to (this->n_systems(), 0);
583  libmesh_assert (_idx_buf.empty());
584 }
void libMesh::DofObject::clear_old_dof_object ( )
inherited

Sets the old_dof_object to NULL

Definition at line 131 of file dof_object.C.

References libMesh::DofObject::old_dof_object.

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

132 {
133  // If we have been called before...
134  // prevent a memory leak
135  if (old_dof_object != NULL)
136  {
137  delete this->old_dof_object;
138  this->old_dof_object = NULL;
139  }
140 }
bool libMesh::Elem::close_to_point ( const Point p,
Real  tol 
) const
virtualinherited
Returns
true if this element is "close" to the point p, where "close" is determined by the tolerance tol.

Definition at line 1763 of file elem.C.

References libMesh::Elem::point_test().

1764 {
1765  // This test uses the user's passed-in tolerance for the
1766  // bounding box test as well, thereby allowing the routine to
1767  // find points which are not only "in" the element, but also
1768  // "nearby" to within some tolerance.
1769  return this->point_test(p, tol, tol);
1770 }
void libMesh::Elem::coarsen ( )
inherited

Coarsen the element. This is not virtual since it is the same for all element types.

Definition at line 149 of file elem_refinement.C.

References libMesh::Elem::active(), libMesh::TypeVector< T >::add_scaled(), libMesh::Elem::child(), libMesh::Elem::COARSEN, libMesh::Elem::COARSEN_INACTIVE, libMesh::Elem::embedding_matrix(), libMesh::Elem::get_node(), libMesh::Elem::INACTIVE, libMesh::Elem::JUST_COARSENED, libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_nodes(), libMesh::Elem::p_level(), libMesh::Elem::point(), libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::Elem::set_p_level(), and libMesh::Elem::set_refinement_flag().

Referenced by libMesh::MeshRefinement::_coarsen_elements().

150 {
151  libmesh_assert_equal_to (this->refinement_flag(), Elem::COARSEN_INACTIVE);
152  libmesh_assert (!this->active());
153 
154  // We no longer delete children until MeshRefinement::contract()
155  // delete [] _children;
156  // _children = NULL;
157 
158  unsigned int parent_p_level = 0;
159 
160  // re-compute hanging node nodal locations
161  for (unsigned int c=0; c<this->n_children(); c++)
162  {
163  Elem *mychild = this->child(c);
164  if (mychild == remote_elem)
165  continue;
166  for (unsigned int nc=0; nc<mychild->n_nodes(); nc++)
167  {
168  Point new_pos;
169  bool calculated_new_pos = false;
170 
171  for (unsigned int n=0; n<this->n_nodes(); n++)
172  {
173  // The value from the embedding matrix
174  const float em_val = this->embedding_matrix(c,nc,n);
175 
176  // The node location is somewhere between existing vertices
177  if ((em_val != 0.) && (em_val != 1.))
178  {
179  new_pos.add_scaled (this->point(n), em_val);
180  calculated_new_pos = true;
181  }
182  }
183 
184  if(calculated_new_pos)
185  {
186  //Move the existing node back into it's original location
187  for(unsigned int i=0; i<LIBMESH_DIM; i++)
188  {
189  Point & child_node = *(mychild->get_node(nc));
190  child_node(i)=new_pos(i);
191  }
192  }
193  }
194  }
195 
196  for (unsigned int c=0; c<this->n_children(); c++)
197  {
198  Elem *mychild = this->child(c);
199  if (mychild == remote_elem)
200  continue;
201  libmesh_assert_equal_to (mychild->refinement_flag(), Elem::COARSEN);
202  mychild->set_refinement_flag(Elem::INACTIVE);
203  if (mychild->p_level() > parent_p_level)
204  parent_p_level = mychild->p_level();
205  }
206 
208  this->set_p_level(parent_p_level);
209 
210  libmesh_assert (this->active());
211 }
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1 
)
inlinestaticprotectedinherited

Compute a key from the specified nodes.

Definition at line 1950 of file elem.h.

References libMesh::Utility::hashword2(), and swap().

1952 {
1953  // Order the two so that n0 < n1
1954  if (n0 > n1) std::swap (n0, n1);
1955 
1956  return Utility::hashword2(n0, n1);
1957 }
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1,
dof_id_type  n2 
)
inlinestaticprotectedinherited

Compute a key from the specified nodes.

Definition at line 1962 of file elem.h.

References libMesh::Utility::hashword(), libMesh::libmesh_assert(), and swap().

1965 {
1966  // Order the numbers such that n0 < n1 < n2.
1967  // We'll do it in 3 steps like this:
1968  //
1969  // n0 n1 n2
1970  // min(n0,n1) max(n0,n1) n2
1971  // min(n0,n1) min(n2,max(n0,n1) max(n2,max(n0,n1)
1972  // |\ /| |
1973  // | \ / | |
1974  // | / | |
1975  // | / \| |
1976  // gb min= min max gb max
1977 
1978  // Step 1
1979  if (n0 > n1) std::swap (n0, n1);
1980 
1981  // Step 2
1982  if (n1 > n2) std::swap (n1, n2);
1983 
1984  // Step 3
1985  if (n0 > n1) std::swap (n0, n1);
1986 
1987  libmesh_assert ((n0 < n1) && (n1 < n2));
1988 
1989  dof_id_type array[3] = {n0, n1, n2};
1990  return Utility::hashword(array, 3);
1991 }
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1,
dof_id_type  n2,
dof_id_type  n3 
)
inlinestaticprotectedinherited

Compute a key from the specified nodes.

Definition at line 1996 of file elem.h.

References libMesh::Utility::hashword(), libMesh::libmesh_assert(), and swap().

2000 {
2001  // Sort first
2002  // Step 1
2003  if (n0 > n1) std::swap (n0, n1);
2004 
2005  // Step 2
2006  if (n2 > n3) std::swap (n2, n3);
2007 
2008  // Step 3
2009  if (n0 > n2) std::swap (n0, n2);
2010 
2011  // Step 4
2012  if (n1 > n3) std::swap (n1, n3);
2013 
2014  // Finally sort step 5
2015  if (n1 > n2) std::swap (n1, n2);
2016 
2017  libmesh_assert ((n0 < n1) && (n1 < n2) && (n2 < n3));
2018 
2019  dof_id_type array[4] = {n0, n1, n2, n3};
2020  return Utility::hashword(array, 4);
2021 }
void libMesh::Hex20::connectivity ( const unsigned int  sc,
const IOPackage  iop,
std::vector< dof_id_type > &  conn 
) const
virtual

Returns the connectivity for this element in a specific format, which is specified by the IOPackage tag. This method supercedes the tecplot_connectivity(...) and vtk_connectivity(...) routines.

Implements libMesh::Elem.

Definition at line 267 of file cell_hex20.C.

References libMesh::Elem::_nodes, libMeshEnums::INVALID_IO_PACKAGE, libMesh::libmesh_assert(), n_sub_elem(), libMesh::Elem::node(), libMeshEnums::TECPLOT, and libMeshEnums::VTK.

270 {
272  libmesh_assert_less (sc, this->n_sub_elem());
273  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);
274 
275 
276  switch (iop)
277  {
278  case TECPLOT:
279  {
280  switch (sc)
281  {
282  case 0:
283  conn.resize(8);
284  conn[0] = this->node(0)+1;
285  conn[1] = this->node(1)+1;
286  conn[2] = this->node(2)+1;
287  conn[3] = this->node(3)+1;
288  conn[4] = this->node(4)+1;
289  conn[5] = this->node(5)+1;
290  conn[6] = this->node(6)+1;
291  conn[7] = this->node(7)+1;
292 
293  return;
294 
295  default:
296  libmesh_error();
297  }
298  }
299 
300  case VTK:
301  {
302  switch (sc)
303  {
304  case 0:
305  conn.resize(20);
306  conn[0] = this->node(0);
307  conn[1] = this->node(1);
308  conn[2] = this->node(2);
309  conn[3] = this->node(3);
310  conn[4] = this->node(4);
311  conn[5] = this->node(5);
312  conn[6] = this->node(6);
313  conn[7] = this->node(7);
314  conn[8] = this->node(8);
315  conn[9] = this->node(9);
316  conn[10] = this->node(10);
317  conn[11] = this->node(11);
318  conn[12] = this->node(16);
319  conn[13] = this->node(17);
320  conn[14] = this->node(18);
321  conn[15] = this->node(19);
322  conn[16] = this->node(12);
323  conn[17] = this->node(13);
324  conn[18] = this->node(14);
325  conn[19] = this->node(15);
326  return;
327 
328  default:
329  libmesh_error();
330  }
331  }
332 
333  default:
334  libmesh_error();
335  }
336 
337  libmesh_error();
338 }
bool libMesh::Elem::contains_edge_of ( const Elem e) const
inherited

This function returns true iff an edge of e is contained in this element. (Internally, this is done by checking whether at least two vertices of e are contained in this element).

Definition at line 571 of file elem.C.

References libMesh::Elem::contains_point(), libMesh::Elem::n_vertices(), and libMesh::Elem::point().

Referenced by libMesh::Elem::find_edge_neighbors().

572 {
573  unsigned int num_contained_edges = 0;
574 
575  // Our vertices are the first numbered nodes
576  for (unsigned int n = 0; n != e->n_vertices(); ++n)
577  {
578  if (this->contains_point(e->point(n)))
579  {
580  num_contained_edges++;
581  if(num_contained_edges>=2)
582  {
583  return true;
584  }
585  }
586  }
587  return false;
588 }
bool libMesh::Elem::contains_point ( const Point p,
Real  tol = TOLERANCE 
) const
virtualinherited
Returns
true if the point p is contained in this element, false otherwise.

For linear elements, performs an initial tight bounding box check (as an optimization step) and (if that passes) then uses the user-defined tolerance "tol" in a call to inverse_map() to actually test if the point is in the element. For quadratic elements, the bounding box optimization is skipped, and only the inverse_map() steps are performed.

Note that this routine should not be used to determine if a point is merely "nearby" an element to within some tolerance. For that, use Elem::close_to_point() instead.

Reimplemented in libMesh::InfHex8, libMesh::InfPrism6, and libMesh::InfQuad4.

Definition at line 1738 of file elem.C.

References libMesh::err, libMesh::Elem::point_test(), and libMesh::TOLERANCE.

Referenced by libMesh::Elem::contains_edge_of(), libMesh::Elem::contains_vertex_of(), libMesh::Elem::find_edge_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), and libMesh::HPSingularity::select_refinement().

1739 {
1740  // We currently allow the user to enlarge the bounding box by
1741  // providing a tol > TOLERANCE (so this routine is identical to
1742  // Elem::close_to_point()), but print a warning so that the
1743  // user can eventually switch his code over to calling close_to_point()
1744  // instead, which is intended to be used for this purpose.
1745  if ( tol > TOLERANCE )
1746  {
1747  libmesh_do_once(libMesh::err
1748  << "WARNING: Resizing bounding box to match user-specified tolerance!\n"
1749  << "In the future, calls to Elem::contains_point() with tol > TOLERANCE\n"
1750  << "will be more optimized, but should not be used\n"
1751  << "to search for points 'close to' elements!\n"
1752  << "Instead, use Elem::close_to_point() for this purpose.\n"
1753  << std::endl;);
1754  return this->point_test(p, tol, tol);
1755  }
1756  else
1757  return this->point_test(p, TOLERANCE, tol);
1758 }
bool libMesh::Elem::contains_vertex_of ( const Elem e) const
inherited

This function returns true iff a vertex of e is contained in this element

Definition at line 560 of file elem.C.

References libMesh::Elem::contains_point(), libMesh::Elem::n_vertices(), and libMesh::Elem::point().

Referenced by libMesh::Elem::find_point_neighbors().

561 {
562  // Our vertices are the first numbered nodes
563  for (unsigned int n = 0; n != e->n_vertices(); ++n)
564  if (this->contains_point(e->point(n)))
565  return true;
566  return false;
567 }
void libMesh::Elem::contract ( )
inherited

Contract an active element, i.e. remove pointers to any subactive children. This should only be called via MeshRefinement::contract, which will also remove subactive children from the mesh

Definition at line 215 of file elem_refinement.C.

References libMesh::Elem::_children, libMesh::Elem::active(), libMesh::Elem::DO_NOTHING, libMesh::Elem::JUST_COARSENED, libMesh::libmesh_assert(), libMesh::Elem::refinement_flag(), and libMesh::Elem::set_refinement_flag().

Referenced by libMesh::UnstructuredMesh::contract().

216 {
217  // Subactive elements get deleted entirely, not contracted
218  libmesh_assert (this->active());
219 
220  // Active contracted elements no longer can have children
221  if (_children)
222  {
223  delete [] _children;
224  _children = NULL;
225  }
226  if (this->refinement_flag() == Elem::JUST_COARSENED)
228 }
void libMesh::DofObject::debug_buffer ( ) const
inherited

Print our buffer for debugging.

Definition at line 543 of file dof_object.C.

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

544 {
545  libMesh::out << " [ ";
546  for (unsigned int i=0; i<_idx_buf.size(); i++)
547  libMesh::out << _idx_buf[i] << " ";
548  libMesh::out << "]\n";
549 }
Order libMesh::Hex20::default_order ( ) const
inlinevirtual
Returns
SECOND

Implements libMesh::Elem.

Definition at line 134 of file cell_hex20.h.

References libMeshEnums::SECOND.

134 { return SECOND; }
unsigned int libMesh::Cell::dim ( ) const
inlinevirtualinherited
Returns
3, the dimensionality of the object.

Implements libMesh::Elem.

Definition at line 60 of file cell.h.

60 { return 3; }
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 106 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

107 {
108  _enable_print_counter = false;
109  return;
110 }
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

Definition at line 106 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

107 {
108  _enable_print_counter = false;
109  return;
110 }
dof_id_type libMesh::DofObject::dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp 
) const
inlineinherited
Returns
the global degree of freedom number for variable var, component comp for system s associated with this DofObject

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

Definition at line 789 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::add_neighbors_to_send_list(), libMesh::FEGenericBase< T >::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::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::old_dof_indices(), libMesh::DofObject::operator=(), libMesh::HPCoarsenTest::select_refinement(), libMesh::DofObject::set_dof_number(), libMesh::DofMap::set_nonlocal_dof_objects(), and libMesh::System::zero_variable().

792 {
793  libmesh_assert_less (s, this->n_systems());
794  libmesh_assert_less (var, this->n_vars(s));
795  libmesh_assert_less (comp, this->n_comp(s,var));
796 
797  const unsigned int
798  vg = this->var_to_vg(s,var),
799  start_idx_sys = this->start_idx(s);
800 
801  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
802 
803  const dof_id_type
804  base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
805 
806  // if the first component is invalid, they
807  // are all invalid
808  if (base_idx == invalid_id)
809  return invalid_id;
810 
811  // otherwise the index is the first component
812  // index augemented by the component number
813  else
814  {
815  const unsigned int
816  ncg = this->n_comp_group(s,vg),
817  vig = this->system_var_to_vg_var(s,vg,var);
818 
819  // std::cout << "base_idx, var, vg, vig, ncg, comp="
820  // << base_idx << " "
821  // << var << " "
822  // << vg << " "
823  // << vig << " "
824  // << ncg << " "
825  // << comp << '\n';
826 
827  return libmesh_cast_int<dof_id_type>(base_idx + vig*ncg + comp);
828  }
829 }
float libMesh::Hex20::embedding_matrix ( const unsigned int  i,
const unsigned int  j,
const unsigned int  k 
) const
inlineprotectedvirtual

Matrix used to create the elements children.

Implements libMesh::Elem.

Definition at line 206 of file cell_hex20.h.

References _embedding_matrix.

209  { return _embedding_matrix[i][j][k]; }
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

101 {
102  _enable_print_counter = true;
103  return;
104 }
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

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

Definition at line 100 of file reference_counter.C.

References libMesh::ReferenceCounter::_enable_print_counter.

101 {
102  _enable_print_counter = true;
103  return;
104 }
void libMesh::Elem::family_tree ( std::vector< const Elem * > &  family,
const bool  reset = true 
) const
inherited

Fills the vector family with the children of this element, recursively. So, calling this method on a twice-refined element will give you the element itself, its direct children, and their children, etc... When the optional parameter reset is true then the vector will be cleared before the element and its descendants are added.

The family tree only includes ancestor and active elements; for subactive elements as well, use total_family_tree.

Definition at line 1433 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child(), libMesh::Elem::family_tree(), libMesh::Elem::is_remote(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), and libMesh::Elem::subactive().

Referenced by libMesh::Elem::family_tree().

1435 {
1436  // The "family tree" doesn't include subactive elements
1437  libmesh_assert(!this->subactive());
1438 
1439  // Clear the vector if the flag reset tells us to.
1440  if (reset)
1441  family.clear();
1442 
1443  // Add this element to the family tree.
1444  family.push_back(this);
1445 
1446  // Recurse into the elements children, if it has them.
1447  // Do not clear the vector any more.
1448  if (!this->active())
1449  for (unsigned int c=0; c<this->n_children(); c++)
1450  if (!this->child(c)->is_remote())
1451  this->child(c)->family_tree (family, false);
1452 }
void libMesh::Elem::family_tree_by_neighbor ( std::vector< const Elem * > &  family,
const Elem neighbor,
const bool  reset = true 
) const
inherited

Same as the family_tree() member, but only adds elements which are next to neighbor.

Definition at line 1553 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::has_neighbor(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::Elem::family_tree_by_neighbor(), and libMesh::Elem::make_links_to_me_remote().

1556 {
1557  // The "family tree" doesn't include subactive elements
1558  libmesh_assert(!this->subactive());
1559 
1560  // Clear the vector if the flag reset tells us to.
1561  if (reset)
1562  family.clear();
1563 
1564  // This only makes sense if we're already a neighbor
1565  libmesh_assert (this->has_neighbor(neighbor_in));
1566 
1567  // Add this element to the family tree.
1568  family.push_back(this);
1569 
1570  // Recurse into the elements children, if it's not active.
1571  // Do not clear the vector any more.
1572  if (!this->active())
1573  for (unsigned int c=0; c<this->n_children(); c++)
1574  {
1575  Elem *current_child = this->child(c);
1576  if (current_child != remote_elem && current_child->has_neighbor(neighbor_in))
1577  current_child->family_tree_by_neighbor (family, neighbor_in, false);
1578  }
1579 }
void libMesh::Elem::family_tree_by_side ( std::vector< const Elem * > &  family,
const unsigned int  side,
const bool  reset = true 
) const
inherited

Same as the family_tree() member, but only adds elements which are next to side.

Definition at line 1500 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::is_child_on_side(), libMesh::Elem::is_remote(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_sides(), and libMesh::Elem::subactive().

Referenced by libMesh::Elem::family_tree_by_side(), libMesh::Elem::make_links_to_me_local(), and libMesh::Elem::PackedElem::unpack().

1503 {
1504  // The "family tree" doesn't include subactive elements
1505  libmesh_assert(!this->subactive());
1506 
1507  // Clear the vector if the flag reset tells us to.
1508  if (reset)
1509  family.clear();
1510 
1511  libmesh_assert_less (s, this->n_sides());
1512 
1513  // Add this element to the family tree.
1514  family.push_back(this);
1515 
1516  // Recurse into the elements children, if it has them.
1517  // Do not clear the vector any more.
1518  if (!this->active())
1519  for (unsigned int c=0; c<this->n_children(); c++)
1520  if (!this->child(c)->is_remote() && this->is_child_on_side(c, s))
1521  this->child(c)->family_tree_by_side (family, s, false);
1522 }
void libMesh::Elem::family_tree_by_subneighbor ( std::vector< const Elem * > &  family,
const Elem neighbor,
const Elem subneighbor,
const bool  reset = true 
) const
inherited

Same as the family_tree() member, but only adds elements which are next to subneighbor. Only applicable when this->has_neighbor(neighbor) and neighbor->is_ancestor(subneighbor)

Definition at line 1583 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::has_neighbor(), libMesh::Elem::is_ancestor_of(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor(), libMesh::Elem::parent(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::Elem::family_tree_by_subneighbor(), and libMesh::Elem::make_links_to_me_remote().

1587 {
1588  // The "family tree" doesn't include subactive elements
1589  libmesh_assert(!this->subactive());
1590 
1591  // Clear the vector if the flag reset tells us to.
1592  if (reset)
1593  family.clear();
1594 
1595  // To simplifly this function we need an existing neighbor
1596  libmesh_assert (neighbor_in);
1597  libmesh_assert_not_equal_to (neighbor_in, remote_elem);
1598  libmesh_assert (this->has_neighbor(neighbor_in));
1599 
1600  // This only makes sense if subneighbor descends from neighbor
1601  libmesh_assert (subneighbor);
1602  libmesh_assert_not_equal_to (subneighbor, remote_elem);
1603  libmesh_assert (neighbor_in->is_ancestor_of(subneighbor));
1604 
1605  // Add this element to the family tree if applicable.
1606  if (neighbor_in == subneighbor)
1607  family.push_back(this);
1608 
1609  // Recurse into the elements children, if it's not active.
1610  // Do not clear the vector any more.
1611  if (!this->active())
1612  for (unsigned int c=0; c != this->n_children(); ++c)
1613  {
1614  Elem *current_child = this->child(c);
1615  if (current_child != remote_elem)
1616  for (unsigned int s=0; s != current_child->n_sides(); ++s)
1617  {
1618  Elem *child_neigh = current_child->neighbor(s);
1619  if (child_neigh &&
1620  (child_neigh == neighbor_in ||
1621  (child_neigh->parent() == neighbor_in &&
1622  child_neigh->is_ancestor_of(subneighbor))))
1623  current_child->family_tree_by_subneighbor (family, child_neigh,
1624  subneighbor, false);
1625  }
1626  }
1627 }
void libMesh::Elem::find_edge_neighbors ( const Point p1,
const Point p2,
std::set< const Elem * > &  neighbor_set 
) const
inherited

This function finds all active elements which touch the current active element along the specified edge defined by the two points p1 and p2

Definition at line 745 of file elem.C.

References libMesh::Elem::contains_point(), end, libMesh::Elem::find_point_neighbors(), and libMesh::libmesh_assert().

748 {
749  // Simple but perhaps suboptimal code: find elements containing the
750  // first point, then winnow this set down by removing elements which
751  // don't also contain the second point
752 
753  libmesh_assert(this->contains_point(p2));
754  this->find_point_neighbors(p1, neighbor_set);
755 
756  std::set<const Elem*>::iterator it = neighbor_set.begin();
757  const std::set<const Elem*>::iterator end = neighbor_set.end();
758 
759  while(it != end) {
760  std::set<const Elem*>::iterator current = it++;
761 
762  const Elem* elem = *current;
763  // This won't invalidate iterator it, because it is already
764  // pointing to the next element
765  if (!elem->contains_point(p2))
766  neighbor_set.erase(current);
767  }
768 }
void libMesh::Elem::find_edge_neighbors ( std::set< const Elem * > &  neighbor_set) const
inherited

This function finds all active elements which touch the current active element along any edge (more precisely, at at least two points).

Definition at line 772 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::contains_edge_of(), end, libMesh::Elem::n_sides(), libMesh::Elem::neighbor(), and libMesh::remote_elem.

773 {
774  neighbor_set.clear();
775  neighbor_set.insert(this);
776 
777  std::set<const Elem *> untested_set, next_untested_set;
778  untested_set.insert(this);
779 
780  while (!untested_set.empty())
781  {
782  // Loop over all the elements in the patch that haven't already
783  // been tested
784  std::set<const Elem*>::const_iterator it = untested_set.begin();
785  const std::set<const Elem*>::const_iterator end = untested_set.end();
786 
787  for (; it != end; ++it)
788  {
789  const Elem* elem = *it;
790 
791  for (unsigned int s=0; s<elem->n_sides(); s++)
792  {
793  const Elem* current_neighbor = elem->neighbor(s);
794  if (current_neighbor &&
795  current_neighbor != remote_elem) // we have a real neighbor on this side
796  {
797  if (current_neighbor->active()) // ... if it is active
798  {
799  if (this->contains_edge_of(current_neighbor) // ... and touches us
800  || current_neighbor->contains_edge_of(this))
801  {
802  // Make sure we'll test it
803  if (!neighbor_set.count(current_neighbor))
804  next_untested_set.insert (current_neighbor);
805 
806  // And add it
807  neighbor_set.insert (current_neighbor);
808  }
809  }
810 #ifdef LIBMESH_ENABLE_AMR
811  else // ... the neighbor is *not* active,
812  { // ... so add *all* neighboring
813  // active children
814  std::vector<const Elem*> active_neighbor_children;
815 
816  current_neighbor->active_family_tree_by_neighbor
817  (active_neighbor_children, elem);
818 
819  std::vector<const Elem*>::const_iterator
820  child_it = active_neighbor_children.begin();
821  const std::vector<const Elem*>::const_iterator
822  child_end = active_neighbor_children.end();
823  for (; child_it != child_end; ++child_it)
824  {
825  const Elem *current_child = *child_it;
826  if (this->contains_edge_of(*child_it) ||
827  (*child_it)->contains_edge_of(this))
828  {
829  // Make sure we'll test it
830  if (!neighbor_set.count(current_child))
831  next_untested_set.insert (current_child);
832 
833  neighbor_set.insert (current_child);
834  }
835  }
836  }
837 #endif // #ifdef LIBMESH_ENABLE_AMR
838  }
839  }
840  }
841  untested_set.swap(next_untested_set);
842  next_untested_set.clear();
843  }
844 }
void libMesh::Elem::find_point_neighbors ( const Point p,
std::set< const Elem * > &  neighbor_set 
) const
inherited

This function finds all elements (including this one) which touch the current active element at the specified point, which should be a point in the current element.

Definition at line 592 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::contains_point(), end, libMesh::libmesh_assert(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor(), and libMesh::remote_elem.

Referenced by libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::Elem::find_edge_neighbors(), libMesh::Patch::find_point_neighbors(), libMesh::MeshFunction::gradient(), libMesh::MeshFunction::hessian(), libMesh::Elem::is_semilocal(), and libMesh::MeshFunction::operator()().

594 {
595  libmesh_assert(this->contains_point(p));
596 
597  neighbor_set.clear();
598  neighbor_set.insert(this);
599 
600  std::set<const Elem *> untested_set, next_untested_set;
601  untested_set.insert(this);
602 
603  while (!untested_set.empty())
604  {
605  // Loop over all the elements in the patch that haven't already
606  // been tested
607  std::set<const Elem*>::const_iterator it = untested_set.begin();
608  const std::set<const Elem*>::const_iterator end = untested_set.end();
609 
610  for (; it != end; ++it)
611  {
612  const Elem* elem = *it;
613 
614  for (unsigned int s=0; s<elem->n_sides(); s++)
615  {
616  const Elem* current_neighbor = elem->neighbor(s);
617  if (current_neighbor &&
618  current_neighbor != remote_elem) // we have a real neighbor on this side
619  {
620  if (current_neighbor->active()) // ... if it is active
621  {
622  if (current_neighbor->contains_point(p)) // ... and touches p
623  {
624  // Make sure we'll test it
625  if (!neighbor_set.count(current_neighbor))
626  next_untested_set.insert (current_neighbor);
627 
628  // And add it
629  neighbor_set.insert (current_neighbor);
630  }
631  }
632 #ifdef LIBMESH_ENABLE_AMR
633  else // ... the neighbor is *not* active,
634  { // ... so add *all* neighboring
635  // active children that touch p
636  std::vector<const Elem*> active_neighbor_children;
637 
638  current_neighbor->active_family_tree_by_neighbor
639  (active_neighbor_children, elem);
640 
641  std::vector<const Elem*>::const_iterator
642  child_it = active_neighbor_children.begin();
643  const std::vector<const Elem*>::const_iterator
644  child_end = active_neighbor_children.end();
645  for (; child_it != child_end; ++child_it)
646  {
647  const Elem *current_child = *child_it;
648  if (current_child->contains_point(p))
649  {
650  // Make sure we'll test it
651  if (!neighbor_set.count(current_child))
652  next_untested_set.insert (current_child);
653 
654  neighbor_set.insert (current_child);
655  }
656  }
657  }
658 #endif // #ifdef LIBMESH_ENABLE_AMR
659  }
660  }
661  }
662  untested_set.swap(next_untested_set);
663  next_untested_set.clear();
664  }
665 }
void libMesh::Elem::find_point_neighbors ( std::set< const Elem * > &  neighbor_set) const
inherited

This function finds all elements (including this one) which touch the current element at any point

Definition at line 669 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::contains_vertex_of(), end, libMesh::Elem::n_sides(), libMesh::Elem::neighbor(), and libMesh::remote_elem.

670 {
671  neighbor_set.clear();
672  neighbor_set.insert(this);
673 
674  std::set<const Elem *> untested_set, next_untested_set;
675  untested_set.insert(this);
676 
677  while (!untested_set.empty())
678  {
679  // Loop over all the elements in the patch that haven't already
680  // been tested
681  std::set<const Elem*>::const_iterator it = untested_set.begin();
682  const std::set<const Elem*>::const_iterator end = untested_set.end();
683 
684  for (; it != end; ++it)
685  {
686  const Elem* elem = *it;
687 
688  for (unsigned int s=0; s<elem->n_sides(); s++)
689  {
690  const Elem* current_neighbor = elem->neighbor(s);
691  if (current_neighbor &&
692  current_neighbor != remote_elem) // we have a real neighbor on this side
693  {
694  if (current_neighbor->active()) // ... if it is active
695  {
696  if (this->contains_vertex_of(current_neighbor) // ... and touches us
697  || current_neighbor->contains_vertex_of(this))
698  {
699  // Make sure we'll test it
700  if (!neighbor_set.count(current_neighbor))
701  next_untested_set.insert (current_neighbor);
702 
703  // And add it
704  neighbor_set.insert (current_neighbor);
705  }
706  }
707 #ifdef LIBMESH_ENABLE_AMR
708  else // ... the neighbor is *not* active,
709  { // ... so add *all* neighboring
710  // active children
711  std::vector<const Elem*> active_neighbor_children;
712 
713  current_neighbor->active_family_tree_by_neighbor
714  (active_neighbor_children, elem);
715 
716  std::vector<const Elem*>::const_iterator
717  child_it = active_neighbor_children.begin();
718  const std::vector<const Elem*>::const_iterator
719  child_end = active_neighbor_children.end();
720  for (; child_it != child_end; ++child_it)
721  {
722  const Elem *current_child = *child_it;
723  if (this->contains_vertex_of(current_child) ||
724  (current_child)->contains_vertex_of(this))
725  {
726  // Make sure we'll test it
727  if (!neighbor_set.count(current_child))
728  next_untested_set.insert (current_child);
729 
730  neighbor_set.insert (current_child);
731  }
732  }
733  }
734 #endif // #ifdef LIBMESH_ENABLE_AMR
735  }
736  }
737  }
738  untested_set.swap(next_untested_set);
739  next_untested_set.clear();
740  }
741 }
ElemType libMesh::Elem::first_order_equivalent_type ( const ElemType  et)
staticinherited
Returns
the element type of the associated first-order element, e.g. when this is a TET10, then TET4 is returned. Returns INVALID_ELEM for first order or other elements that should not or cannot be converted into lower order equivalents.

Definition at line 2007 of file elem.C.

References libMeshEnums::EDGE2, libMeshEnums::EDGE3, libMeshEnums::EDGE4, libMeshEnums::HEX20, libMeshEnums::HEX27, libMeshEnums::HEX8, libMeshEnums::INFHEX16, libMeshEnums::INFHEX18, libMeshEnums::INFHEX8, libMeshEnums::INFPRISM12, libMeshEnums::INFPRISM6, libMeshEnums::INFQUAD4, libMeshEnums::INFQUAD6, libMeshEnums::INVALID_ELEM, libMeshEnums::PRISM15, libMeshEnums::PRISM18, libMeshEnums::PRISM6, libMeshEnums::PYRAMID14, libMeshEnums::PYRAMID5, libMeshEnums::QUAD4, libMeshEnums::QUAD8, libMeshEnums::QUAD9, libMeshEnums::TET10, libMeshEnums::TET4, libMeshEnums::TRI3, and libMeshEnums::TRI6.

Referenced by libMesh::UnstructuredMesh::all_first_order(), and libMesh::GMVIO::write_ascii_old_impl().

2008 {
2009  switch (et)
2010  {
2011  case EDGE2:
2012  case EDGE3:
2013  case EDGE4:
2014  return EDGE2;
2015  case TRI3:
2016  case TRI6:
2017  return TRI3;
2018  case QUAD4:
2019  case QUAD8:
2020  case QUAD9:
2021  return QUAD4;
2022  case TET4:
2023  case TET10:
2024  return TET4;
2025  case HEX8:
2026  case HEX27:
2027  case HEX20:
2028  return HEX8;
2029  case PRISM6:
2030  case PRISM15:
2031  case PRISM18:
2032  return PRISM6;
2033  case PYRAMID5:
2034  case PYRAMID14:
2035  return PYRAMID5;
2036 
2037 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2038 
2039  case INFQUAD4:
2040  case INFQUAD6:
2041  return INFQUAD4;
2042  case INFHEX8:
2043  case INFHEX16:
2044  case INFHEX18:
2045  return INFHEX8;
2046  case INFPRISM6:
2047  case INFPRISM12:
2048  return INFPRISM6;
2049 
2050 #endif
2051 
2052  default:
2053  // unknown element
2054  return INVALID_ELEM;
2055  }
2056 }
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 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 libMesh::Elem::get_info ( ) const
inherited

Prints relevant information about the element to a string.

Definition at line 1886 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::ancestor(), libMesh::Elem::dim(), libMesh::DofObject::dof_number(), libMesh::Utility::enum_to_string(), libMesh::Elem::get_node(), libMesh::Elem::has_children(), libMesh::Elem::hmax(), libMesh::Elem::hmin(), libMesh::DofObject::id(), libMesh::Elem::infinite(), libMesh::Elem::level(), libMesh::DofObject::n_comp(), libMesh::Elem::n_nodes(), libMesh::Elem::n_sides(), libMesh::DofObject::n_systems(), libMesh::DofObject::n_vars(), libMesh::Elem::neighbor(), libMesh::Elem::origin(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::parent(), libMesh::DofObject::processor_id(), libMesh::Elem::refinement_flag(), libMesh::Elem::subactive(), libMesh::Elem::type(), libMesh::DofObject::valid_id(), and libMesh::Elem::volume().

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

1887 {
1888  std::ostringstream oss;
1889 
1890  oss << " Elem Information" << '\n'
1891  << " id()=";
1892 
1893  if (this->valid_id())
1894  oss << this->id();
1895  else
1896  oss << "invalid";
1897 
1898  oss << ", processor_id()=" << this->processor_id() << '\n';
1899 
1900  oss << " type()=" << Utility::enum_to_string(this->type()) << '\n'
1901  << " dim()=" << this->dim() << '\n'
1902  << " n_nodes()=" << this->n_nodes() << '\n';
1903 
1904  for (unsigned int n=0; n != this->n_nodes(); ++n)
1905  oss << " " << n << *this->get_node(n);
1906 
1907  oss << " n_sides()=" << this->n_sides() << '\n';
1908 
1909  for (unsigned int s=0; s != this->n_sides(); ++s)
1910  {
1911  oss << " neighbor(" << s << ")=";
1912  if (this->neighbor(s))
1913  oss << this->neighbor(s)->id() << '\n';
1914  else
1915  oss << "NULL\n";
1916  }
1917 
1918  oss << " hmin()=" << this->hmin()
1919  << ", hmax()=" << this->hmax() << '\n'
1920  << " volume()=" << this->volume() << '\n'
1921  << " active()=" << this->active()
1922  << ", ancestor()=" << this->ancestor()
1923  << ", subactive()=" << this->subactive()
1924  << ", has_children()=" << this->has_children() << '\n'
1925  << " parent()=";
1926  if (this->parent())
1927  oss << this->parent()->id() << '\n';
1928  else
1929  oss << "NULL\n";
1930  oss << " level()=" << this->level()
1931  << ", p_level()=" << this->p_level() << '\n'
1932 #ifdef LIBMESH_ENABLE_AMR
1933  << " refinement_flag()=" << Utility::enum_to_string(this->refinement_flag()) << '\n'
1934  << " p_refinement_flag()=" << Utility::enum_to_string(this->p_refinement_flag()) << '\n'
1935 #endif
1936 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
1937  << " infinite()=" << this->infinite() << '\n';
1938  if (this->infinite())
1939  oss << " origin()=" << this->origin() << '\n'
1940 #endif
1941  ;
1942 
1943  oss << " DoFs=";
1944  for (unsigned int s=0; s != this->n_systems(); ++s)
1945  for (unsigned int v=0; v != this->n_vars(s); ++v)
1946  for (unsigned int c=0; c != this->n_comp(s,v); ++c)
1947  oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";
1948 
1949 
1950  return oss.str();
1951 }
Node * libMesh::Elem::get_node ( const unsigned int  i) const
inlinevirtualinherited
Returns
the pointer to local Node i.

Reimplemented in libMesh::RemoteElem.

Definition at line 1397 of file elem.h.

References libMesh::Elem::_nodes, libMesh::libmesh_assert(), and libMesh::Elem::n_nodes().

Referenced by libMesh::DofMap::add_neighbors_to_send_list(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::Prism6::build_side(), libMesh::Pyramid5::build_side(), libMesh::InfQuad4::build_side(), libMesh::Quad4::build_side(), libMesh::InfQuad6::build_side(), libMesh::Tri3::build_side(), libMesh::InfHex8::build_side(), libMesh::Hex8::build_side(), libMesh::InfPrism6::build_side(), libMesh::InfPrism12::build_side(), libMesh::Quad9::build_side(), libMesh::Quad8::build_side(), libMesh::Tri6::build_side(), libMesh::Tet4::build_side(), libMesh::InfHex18::build_side(), libMesh::InfHex16::build_side(), libMesh::Tet10::build_side(), build_side(), libMesh::Prism15::build_side(), libMesh::Edge::build_side(), libMesh::Pyramid14::build_side(), libMesh::Hex27::build_side(), libMesh::Prism18::build_side(), libMesh::EquationSystems::build_solution_vector(), libMesh::MeshTools::Modification::change_boundary_id(), libMesh::Elem::coarsen(), libMesh::FEGenericBase< T >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::dof_indices(), libMesh::UNVIO::element_out(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), libMesh::RemoteElem::get_node(), libMesh::MeshTools::libmesh_assert_connected_nodes(), libMesh::MeshTools::libmesh_assert_old_dof_objects(), libMesh::Elem::libmesh_assert_valid_node_pointers(), libMesh::MeshTools::libmesh_assert_valid_procids< Node >(), libMesh::DofMap::old_dof_indices(), libMesh::Tri::quality(), libMesh::Elem::refine(), libMesh::DofMap::reinit(), libMesh::SerialMesh::renumber_nodes_and_elements(), libMesh::HPCoarsenTest::select_refinement(), libMesh::Partitioner::set_node_processor_ids(), libMesh::Tet::side(), libMesh::Prism::side(), libMesh::Pyramid::side(), libMesh::Hex::side(), libMesh::Tri::side(), libMesh::InfHex::side(), libMesh::InfPrism::side(), libMesh::Quad::side(), libMesh::InfQuad::side(), libMesh::Edge::side(), libMesh::MeshTools::Modification::smooth(), libMesh::SerialMesh::stitching_helper(), libMesh::BoundaryInfo::sync(), libMesh::Tri3::volume(), libMesh::Pyramid5::volume(), libMesh::Tet4::volume(), and libMesh::GnuPlotIO::write_solution().

1398 {
1399  libmesh_assert_less (i, this->n_nodes());
1400  libmesh_assert(_nodes[i]);
1401 
1402  return _nodes[i];
1403 }
unsigned int libMesh::Elem::get_node_index ( const Node node_ptr) const
inlineinherited
Returns
the local index for the Node pointer node_ptr, or invalid_id if node_ptr is not a local node.

Definition at line 1408 of file elem.h.

References libMesh::Elem::_nodes, libMesh::invalid_uint, and libMesh::Elem::n_nodes().

1409 {
1410  for (unsigned int n=0; n != this->n_nodes(); ++n)
1411  if (this->_nodes[n] == node_ptr)
1412  return n;
1413 
1414  return libMesh::invalid_uint;
1415 }
void libMesh::Elem::hack_p_level ( const unsigned int  p)
inlineinherited

Sets the value of the p refinement level for the element without altering the p level of its ancestors

Definition at line 1931 of file elem.h.

References libMesh::Elem::_p_level.

Referenced by libMesh::CheckpointIO::read_connectivity(), and libMesh::XdrIO::read_serialized_connectivity().

1932 {
1933  _p_level = libmesh_cast_int<unsigned char>(p);
1934 }
bool libMesh::Hex20::has_affine_map ( ) const
virtual
Returns
true iff the element map is definitely affine (i.e. the same at every quadrature point) within numerical tolerances

Reimplemented from libMesh::Elem.

Definition at line 107 of file cell_hex20.C.

References libMesh::Elem::point(), and libMesh::TypeVector< T >::relative_fuzzy_equals().

108 {
109  // Make sure x-edge endpoints are affine
110  Point v = this->point(1) - this->point(0);
111  if (!v.relative_fuzzy_equals(this->point(2) - this->point(3)) ||
112  !v.relative_fuzzy_equals(this->point(5) - this->point(4)) ||
113  !v.relative_fuzzy_equals(this->point(6) - this->point(7)))
114  return false;
115  // Make sure x-edges are straight
116  v /= 2;
117  if (!v.relative_fuzzy_equals(this->point(8) - this->point(0)) ||
118  !v.relative_fuzzy_equals(this->point(10) - this->point(3)) ||
119  !v.relative_fuzzy_equals(this->point(16) - this->point(4)) ||
120  !v.relative_fuzzy_equals(this->point(18) - this->point(7)))
121  return false;
122  // Make sure xz-faces are identical parallelograms
123  v = this->point(4) - this->point(0);
124  if (!v.relative_fuzzy_equals(this->point(7) - this->point(3)))
125  return false;
126  v /= 2;
127  if (!v.relative_fuzzy_equals(this->point(12) - this->point(0)) ||
128  !v.relative_fuzzy_equals(this->point(13) - this->point(1)) ||
129  !v.relative_fuzzy_equals(this->point(14) - this->point(2)) ||
130  !v.relative_fuzzy_equals(this->point(15) - this->point(3)))
131  return false;
132  // Make sure y-edges are straight
133  v = (this->point(3) - this->point(0))/2;
134  if (!v.relative_fuzzy_equals(this->point(11) - this->point(0)) ||
135  !v.relative_fuzzy_equals(this->point(9) - this->point(1)) ||
136  !v.relative_fuzzy_equals(this->point(17) - this->point(5)) ||
137  !v.relative_fuzzy_equals(this->point(19) - this->point(4)))
138  return false;
139  // If all the above checks out, the map is affine
140  return true;
141 }
bool libMesh::Elem::has_ancestor_children ( ) const
inlineinherited
Returns
true if the element has any descendants other than its immediate children, false otherwise. Always returns false if AMR is disabled.

Definition at line 1639 of file elem.h.

References libMesh::Elem::_children, libMesh::Elem::child(), libMesh::Elem::has_children(), and libMesh::Elem::n_children().

1640 {
1641 #ifdef LIBMESH_ENABLE_AMR
1642  if (_children == NULL)
1643  return false;
1644  else
1645  for (unsigned int c=0; c != this->n_children(); c++)
1646  if (this->child(c)->has_children())
1647  return true;
1648 #endif
1649  return false;
1650 }
bool libMesh::DofObject::has_dofs ( const unsigned int  s = libMesh::invalid_uint) const
inlineinherited
Returns
true if any system has variables which have been assigned, false otherwise

Definition at line 834 of file dof_object.h.

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

Referenced by libMesh::MeshTools::libmesh_assert_old_dof_objects(), libMesh::DofMap::reinit(), and libMesh::Parallel::unpack().

835 {
836  if (sys == libMesh::invalid_uint)
837  {
838  for (unsigned int s=0; s<this->n_systems(); s++)
839  if (this->n_vars(s))
840  return true;
841  }
842 
843  else
844  {
845  libmesh_assert_less (sys, this->n_systems());
846 
847  if (this->n_vars(sys))
848  return true;
849  }
850 
851  return false;
852 }
bool libMesh::Elem::has_neighbor ( const Elem elem) const
inlineinherited
Returns
true if the element elem in question is a neighbor of this element, false otherwise.

Definition at line 1466 of file elem.h.

References libMesh::Elem::n_neighbors(), and libMesh::Elem::neighbor().

Referenced by libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::has_topological_neighbor(), libMesh::MeshRefinement::has_topological_neighbor(), libMesh::Elem::make_links_to_me_remote(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), and libMesh::Elem::on_boundary().

1467 {
1468  for (unsigned int n=0; n<this->n_neighbors(); n++)
1469  if (this->neighbor(n) == elem)
1470  return true;
1471 
1472  return false;
1473 }
bool libMesh::Elem::has_topological_neighbor ( const Elem elem,
const MeshBase mesh,
const PointLocatorBase point_locator,
PeriodicBoundaries pb 
) const
inherited
Returns
true if the element elem in question is a neighbor or topological neighbor of this element, false otherwise.

Definition at line 923 of file elem.C.

References libMesh::Elem::has_neighbor(), libMesh::Elem::n_neighbors(), and libMesh::Elem::topological_neighbor().

Referenced by libMesh::MeshRefinement::has_topological_neighbor().

927 {
928  // First see if this is a normal "interior" neighbor
929  if (has_neighbor(elem))
930  return true;
931 
932  for (unsigned int n=0; n<this->n_neighbors(); n++)
933  if (this->topological_neighbor(n, mesh, point_locator, pb))
934  return true;
935 
936  return false;
937 }
Real libMesh::Elem::hmax ( ) const
virtualinherited
Returns
the maximum vertex separation for the element.

Definition at line 412 of file elem.C.

References std::max(), libMesh::Elem::n_vertices(), libMesh::Elem::point(), libMesh::Real, and libMesh::TypeVector< T >::size_sq().

Referenced by libMesh::DiscontinuityMeasure::boundary_side_integration(), libMesh::KellyErrorEstimator::boundary_side_integration(), libMesh::Elem::get_info(), libMesh::LaplacianErrorEstimator::internal_side_integration(), libMesh::DiscontinuityMeasure::internal_side_integration(), libMesh::KellyErrorEstimator::internal_side_integration(), and libMesh::Elem::point_test().

413 {
414  Real h_max=0;
415 
416  for (unsigned int n_outer=0; n_outer<this->n_vertices(); n_outer++)
417  for (unsigned int n_inner=n_outer+1; n_inner<this->n_vertices(); n_inner++)
418  {
419  const Point diff = (this->point(n_outer) - this->point(n_inner));
420 
421  h_max = std::max(h_max,diff.size_sq());
422  }
423 
424  return std::sqrt(h_max);
425 }
Real libMesh::Elem::hmin ( ) const
virtualinherited
Returns
the minimum vertex separation for the element.

Definition at line 395 of file elem.C.

References std::max(), std::min(), libMesh::Elem::n_vertices(), libMesh::Elem::point(), libMesh::Real, and libMesh::TypeVector< T >::size_sq().

Referenced by libMesh::FEGenericBase< T >::compute_periodic_constraints(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::FEMSystem::numerical_jacobian(), and libMesh::Elem::refine().

396 {
398 
399  for (unsigned int n_outer=0; n_outer<this->n_vertices(); n_outer++)
400  for (unsigned int n_inner=n_outer+1; n_inner<this->n_vertices(); n_inner++)
401  {
402  const Point diff = (this->point(n_outer) - this->point(n_inner));
403 
404  h_min = std::min(h_min,diff.size_sq());
405  }
406 
407  return std::sqrt(h_min);
408 }
dof_id_type libMesh::DofObject::id ( ) const
inlineinherited
Returns
the id for this DofObject

Definition at line 611 of file dof_object.h.

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

Referenced by libMesh::MetisPartitioner::_do_partition(), libMesh::SFCPartitioner::_do_partition(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::SerialMesh::add_elem(), libMesh::ParallelMesh::add_elem(), libMesh::SerialMesh::add_node(), libMesh::ParallelMesh::add_node(), libMesh::ParallelMesh::add_point(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::MeshData::assign(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::MeshTools::Generation::build_delaunay_square(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::ParmetisPartitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::VTKIO::cells_to_vtk(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::FEGenericBase< T >::compute_periodic_constraints(), libMesh::FEMap::compute_single_point_map(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::SerialMesh::delete_elem(), libMesh::ParallelMesh::delete_elem(), libMesh::SerialMesh::delete_node(), libMesh::ParallelMesh::delete_node(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::MeshData::elem_to_foreign_id(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::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::MeshRefinement::flag_elements_by_mean_stddev(), libMesh::MeshTools::Modification::flatten(), libMesh::for(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::EquationSystems::get_solution(), libMesh::LaplaceMeshSmoother::init(), libMesh::ParmetisPartitioner::initialize(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::ExodusII_IO_Helper::initialize_discontinuous(), libMesh::TreeNode< N >::insert(), libMesh::SerialMesh::insert_elem(), libMesh::ParallelMesh::insert_elem(), libMesh::SerialMesh::insert_node(), libMesh::FE< Dim, T >::inverse_map(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_procids< Node >(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::Elem::node(), libMesh::MeshData::node_to_foreign_id(), libMesh::VTKIO::nodes_to_vtk(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::BoundaryInfo::operator=(), libMesh::Parallel::pack(), libMesh::Node::PackedNode::pack(), libMesh::Elem::PackedElem::pack(), libMesh::ErrorVector::plot_error(), libMesh::ParallelMesh::query_elem(), libMesh::ParallelMesh::query_node_ptr(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::AbaqusIO::read_elements(), libMesh::ParallelMesh::renumber_elem(), libMesh::ParallelMesh::renumber_node(), libMesh::ParallelMesh::renumber_nodes_and_elements(), libMesh::DofMap::scatter_constraints(), libMesh::HPCoarsenTest::select_refinement(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::MeshTools::Modification::smooth(), libMesh::SerialMesh::stitching_helper(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Elem::topological_neighbor(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::Node::PackedNode::unpack(), libMesh::Parallel::unpack(), libMesh::Elem::PackedElem::unpack(), libMesh::GMVIO::write_ascii_new_impl(), libMesh::GMVIO::write_ascii_old_impl(), libMesh::CheckpointIO::write_connectivity(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::ExodusII_IO_Helper::write_elements_discontinuous(), libMesh::GmshIO::write_mesh(), libMesh::LegacyXdrIO::write_mesh(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::CheckpointIO::write_nodes(), and libMesh::XdrIO::write_serialized_connectivity().

612 {
613  libmesh_assert (this->valid_id());
614  return _id;
615 }
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectedinherited

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

Definition at line 163 of file reference_counter.h.

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

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

164 {
165  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
166  std::pair<unsigned int, unsigned int>& p = _counts[name];
167 
168  p.first++;
169 }
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectedinherited

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

Definition at line 163 of file reference_counter.h.

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

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

164 {
165  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
166  std::pair<unsigned int, unsigned int>& p = _counts[name];
167 
168  p.first++;
169 }
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectedinherited

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

Definition at line 176 of file reference_counter.h.

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

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

177 {
178  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
179  std::pair<unsigned int, unsigned int>& p = _counts[name];
180 
181  p.second++;
182 }
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectedinherited

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

Definition at line 176 of file reference_counter.h.

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

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

177 {
178  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
179  std::pair<unsigned int, unsigned int>& p = _counts[name];
180 
181  p.second++;
182 }
bool libMesh::Cell::infinite ( ) const
inlinevirtualinherited
Returns
4
false. All classes derived from Cell are finite elements.

Implements libMesh::Elem.

Definition at line 74 of file cell.h.

74 { return false; }
const Elem * libMesh::Elem::interior_parent ( ) const
inlineinherited

In some cases it is desireable to extract the boundary (or a subset thereof) of a D-dimensional mesh as a (D-1)-dimensional manifold. In this case we may want to know the 'parent' element from which the manifold elements were extracted. We can easily do that for the level-0 manifold elements by storing the D-dimensional parent. This method provides access to that element.

Definition at line 1718 of file elem.h.

References libMesh::Elem::_elemlinks, libMesh::Elem::dim(), libMesh::libmesh_assert(), and libMesh::Elem::n_sides().

1719 {
1720  // interior parents make no sense for full-dimensional elements.
1721  libmesh_assert_less (this->dim(), LIBMESH_DIM);
1722 
1723  // // and they [USED TO BE] only good for level-0 elements
1724  // if (this->level() != 0)
1725  // return this->parent()->interior_parent();
1726 
1727  // We store the interior_parent pointer after both the parent
1728  // neighbor and neighbor pointers
1729  Elem *interior_p = _elemlinks[1+this->n_sides()];
1730 
1731  // If we have an interior_parent, it had better be the
1732  // one-higher-dimensional interior element we are looking for.
1733  libmesh_assert (!interior_p ||
1734  interior_p->dim() == (this->dim()+1));
1735 
1736  return interior_p;
1737 }
void libMesh::DofObject::invalidate ( )
inlineinherited

Invalidates all the indices for this DofObject

Definition at line 567 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().

568 {
569  this->invalidate_dofs ();
570  this->invalidate_id ();
571  this->invalidate_processor_id ();
572 }
void libMesh::DofObject::invalidate_dofs ( const unsigned int  sys_num = libMesh::invalid_uint)
inlineinherited

Sets all degree of freedom numbers to invalid_id

Definition at line 531 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().

532 {
533  // If the user does not specify the system number...
534  if (sys_num >= this->n_systems())
535  {
536  for (unsigned int s=0; s<this->n_systems(); s++)
537  for (unsigned int vg=0; vg<this->n_var_groups(s); vg++)
538  if (this->n_comp_group(s,vg))
539  this->set_vg_dof_base(s,vg,invalid_id);
540  }
541  // ...otherwise invalidate the dofs for all systems
542  else
543  for (unsigned int vg=0; vg<this->n_var_groups(sys_num); vg++)
544  if (this->n_comp_group(sys_num,vg))
545  this->set_vg_dof_base(sys_num,vg,invalid_id);
546 }
void libMesh::DofObject::invalidate_id ( )
inlineinherited

Sets the id to invalid_id

Definition at line 551 of file dof_object.h.

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

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

552 {
553  this->set_id (invalid_id);
554 }
void libMesh::DofObject::invalidate_processor_id ( )
inlineinherited
bool libMesh::Elem::is_ancestor_of ( const Elem descendant) const
inlineinherited
Returns
true if descendant is a child of this, or a child of a child of this, etc. Always returns false if AMR is disabled.

Definition at line 1655 of file elem.h.

References libMesh::Elem::parent().

Referenced by libMesh::Elem::family_tree_by_subneighbor().

1660 {
1661 #ifdef LIBMESH_ENABLE_AMR
1662  const Elem *e = descendant;
1663  while (e)
1664  {
1665  if (this == e)
1666  return true;
1667  e = e->parent();
1668  }
1669 #endif
1670  return false;
1671 }
bool libMesh::Elem::is_child_on_edge ( const unsigned int  c,
const unsigned int  e 
) const
virtualinherited
Returns
true iff the specified child is on the specified edge

Definition at line 1417 of file elem.C.

References libMesh::Elem::build_edge(), libMesh::Elem::n_children(), and libMesh::Elem::n_edges().

Referenced by libMesh::FEGenericBase< T >::coarsened_dof_values(), libMesh::BoundaryInfo::edge_boundary_ids(), and libMesh::BoundaryInfo::n_edge_boundary_ids().

1419 {
1420  libmesh_assert_less (c, this->n_children());
1421  libmesh_assert_less (e, this->n_edges());
1422 
1423  AutoPtr<Elem> my_edge = this->build_edge(e);
1424  AutoPtr<Elem> child_edge = this->build_edge(e);
1425 
1426  // We're assuming that an overlapping child edge has the same
1427  // number and orientation as its parent
1428  return (child_edge->node(0) == my_edge->node(0) ||
1429  child_edge->node(1) == my_edge->node(1));
1430 }
bool libMesh::Hex::is_child_on_side ( const unsigned int  c,
const unsigned int  s 
) const
virtualinherited
Returns
true iff the specified child is on the specified side

Implements libMesh::Elem.

Definition at line 185 of file cell_hex.C.

References libMesh::Hex::n_children(), libMesh::Hex::n_sides(), and libMesh::Hex8::side_nodes_map.

187 {
188  libmesh_assert_less (c, this->n_children());
189  libmesh_assert_less (s, this->n_sides());
190 
191  // This array maps the Hex8 node numbering to the Hex8 child
192  // numbering. I.e.
193  // node 6 touches child 7, and
194  // node 7 touches child 6, etc.
195  const unsigned int node_child_map[8] = { 0, 1, 3, 2, 4, 5, 7, 6 };
196 
197  for (unsigned int i = 0; i != 4; ++i)
198  if (node_child_map[Hex8::side_nodes_map[s][i]] == c)
199  return true;
200 
201  return false;
202 }
bool libMesh::Hex20::is_edge ( const unsigned int  i) const
virtual
Returns
true iff the specified (local) node number is an edge.

Implements libMesh::Elem.

Definition at line 73 of file cell_hex20.C.

74 {
75  if (i > 7)
76  return true;
77  return false;
78 }
bool libMesh::Hex::is_edge_on_side ( const unsigned int  e,
const unsigned int  s 
) const
virtualinherited

Implements libMesh::Elem.

Definition at line 206 of file cell_hex.C.

References libMesh::Hex8::edge_nodes_map, libMesh::Elem::is_node_on_side(), libMesh::Hex::n_edges(), and libMesh::Hex::n_sides().

208 {
209  libmesh_assert_less (e, this->n_edges());
210  libmesh_assert_less (s, this->n_sides());
211 
212  return (is_node_on_side(Hex8::edge_nodes_map[e][0],s) &&
214 }
bool libMesh::Hex20::is_face ( const unsigned int  i) const
virtual
Returns
true iff the specified (local) node number is a face.

Implements libMesh::Elem.

Definition at line 80 of file cell_hex20.C.

81 {
82  return false;
83 }
virtual bool libMesh::Elem::is_linear ( ) const
inlinevirtualinherited
Returns
true iff the Lagrange shape functions on this element are linear

Reimplemented in libMesh::NodeElem, libMesh::Tet4, libMesh::Tri3, and libMesh::Edge2.

Definition at line 649 of file elem.h.

Referenced by libMesh::FEMap::init_reference_to_physical_map().

649 { return false; }
bool libMesh::Hex20::is_node_on_edge ( const unsigned int  n,
const unsigned int  e 
) const
virtual

Implements libMesh::Elem.

Definition at line 95 of file cell_hex20.C.

References edge_nodes_map, and libMesh::Hex::n_edges().

97 {
98  libmesh_assert_less (e, n_edges());
99  for (unsigned int i = 0; i != 3; ++i)
100  if (edge_nodes_map[e][i] == n)
101  return true;
102  return false;
103 }
bool libMesh::Hex20::is_node_on_side ( const unsigned int  n,
const unsigned int  s 
) const
virtual

Implements libMesh::Elem.

Definition at line 85 of file cell_hex20.C.

References libMesh::Hex::n_sides(), and side_nodes_map.

87 {
88  libmesh_assert_less (s, n_sides());
89  for (unsigned int i = 0; i != 8; ++i)
90  if (side_nodes_map[s][i] == n)
91  return true;
92  return false;
93 }
virtual bool libMesh::Elem::is_remote ( ) const
inlinevirtualinherited

Returns true if this element is remote, false otherwise. A remote element (see RemoteElem) is a syntactic convenience – it is a placeholder for an element which exists on some other processor. Local elements are required to have valid neighbors, and these ghost elements may have remote neighbors for data structure consistency. The use of remote elements helps assure that any element we may access has a NULL neighbor if and only if it lies on the physical boundary of the domain.

Reimplemented in libMesh::RemoteElem.

Definition at line 357 of file elem.h.

Referenced by libMesh::Elem::active_family_tree(), libMesh::Elem::active_family_tree_by_side(), libMesh::Elem::family_tree(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::make_links_to_me_local(), libMesh::Partitioner::set_parent_processor_ids(), and libMesh::Elem::total_family_tree().

358  { return false; }
bool libMesh::Elem::is_semilocal ( const processor_id_type  my_pid) const
inherited
Returns
true if this element is semilocal to the calling processor, which must specify its rank.

Definition at line 539 of file elem.C.

References end, libMesh::Elem::find_point_neighbors(), and libMesh::DofObject::processor_id().

Referenced by libMesh::Patch::add_semilocal_face_neighbors(), and libMesh::Patch::add_semilocal_point_neighbors().

540 {
541  std::set<const Elem *> point_neighbors;
542 
543  this->find_point_neighbors(point_neighbors);
544 
545  std::set<const Elem*>::const_iterator it = point_neighbors.begin();
546  const std::set<const Elem*>::const_iterator end = point_neighbors.end();
547 
548  for (; it != end; ++it)
549  {
550  const Elem* elem = *it;
551  if (elem->processor_id() == my_pid)
552  return true;
553  }
554 
555  return false;
556 }
bool libMesh::Hex20::is_vertex ( const unsigned int  i) const
virtual
Returns
true iff the specified (local) node number is a vertex.

Implements libMesh::Elem.

Definition at line 66 of file cell_hex20.C.

67 {
68  if (i < 8)
69  return true;
70  return false;
71 }
dof_id_type libMesh::Hex::key ( const unsigned int  s) const
virtualinherited
Returns
an id associated with the s side of this element. The id is not necessariy unique, but should be close. This is particularly useful in the MeshBase::find_neighbors() routine.

Implements libMesh::Elem.

Reimplemented in libMesh::Hex27.

Definition at line 35 of file cell_hex.C.

References libMesh::Elem::compute_key(), libMesh::Hex::n_sides(), and libMesh::Elem::node().

36 {
37  libmesh_assert_less (s, this->n_sides());
38 
39  // Think of a unit cube: (-1,1) x (-1,1)x (-1,1)
40  switch (s)
41  {
42  case 0: // the face at z = -1
43 
44  return
45  this->compute_key (this->node(0),
46  this->node(3),
47  this->node(2),
48  this->node(1));
49 
50  case 1: // the face at y = -1
51 
52  return
53  this->compute_key (this->node(0),
54  this->node(1),
55  this->node(5),
56  this->node(4));
57 
58  case 2: // the face at x = 1
59 
60  return
61  this->compute_key (this->node(1),
62  this->node(2),
63  this->node(6),
64  this->node(5));
65 
66  case 3: // the face at y = 1
67 
68  return
69  this->compute_key (this->node(2),
70  this->node(3),
71  this->node(7),
72  this->node(6));
73 
74  case 4: // the face at x = -1
75 
76  return
77  this->compute_key (this->node(3),
78  this->node(0),
79  this->node(4),
80  this->node(7));
81 
82  case 5: // the face at z = 1
83 
84  return
85  this->compute_key (this->node(4),
86  this->node(5),
87  this->node(6),
88  this->node(7));
89  }
90 
91  // We'll never get here.
92  libmesh_error();
93  return 0;
94 }
Real libMesh::Elem::length ( const unsigned int  n1,
const unsigned int  n2 
) const
inherited
Returns
the magnitude of the distance between nodes n1 and n2. Useful for computing the lengths of the sides of elements.

Definition at line 429 of file elem.C.

References libMesh::Elem::n_vertices(), and libMesh::Elem::point().

Referenced by libMesh::Hex::quality(), libMesh::InfHex::quality(), and libMesh::Quad::quality().

431 {
432  libmesh_assert_less ( n1, this->n_vertices() );
433  libmesh_assert_less ( n2, this->n_vertices() );
434 
435  return (this->point(n1) - this->point(n2)).size();
436 }
unsigned int libMesh::Elem::level ( ) const
inlineinherited
Returns
the refinement level of the current element. If the element's parent is NULL then by convention it is at level 0, otherwise it is simply at one level greater than its parent.

Definition at line 1757 of file elem.h.

References libMesh::Elem::dim(), libMesh::Elem::level(), and libMesh::Elem::parent().

Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::BoundaryInfo::add_edge(), libMesh::BoundaryInfo::add_side(), libMesh::UnstructuredMesh::all_second_order(), libMesh::BoundaryInfo::boundary_id(), libMesh::BoundaryInfo::boundary_ids(), libMesh::JumpErrorEstimator::coarse_n_flux_faces_increment(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEGenericBase< T >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< T >::compute_proj_constraints(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshRefinement::flag_elements_by_mean_stddev(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), libMesh::Elem::get_info(), libMesh::BoundaryInfo::has_boundary_id(), libMesh::Elem::level(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::BoundaryInfo::n_boundary_ids(), libMesh::BoundaryInfo::n_edge_boundary_ids(), libMesh::Elem::nullify_neighbors(), libMesh::Parallel::pack(), libMesh::Elem::PackedElem::pack(), libMesh::Parallel::packable_size(), libMesh::BoundaryInfo::remove_edge(), libMesh::BoundaryInfo::remove_side(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::MeshRefinement::test_level_one(), libMesh::Elem::top_parent(), libMesh::Elem::topological_neighbor(), libMesh::Parallel::unpack(), libMesh::Elem::PackedElem::unpack(), libMesh::Elem::which_neighbor_am_i(), and libMesh::LegacyXdrIO::write_mesh().

1758 {
1759 #ifdef LIBMESH_ENABLE_AMR
1760 
1761  // if I don't have a parent I was
1762  // created directly from file
1763  // or by the user, so I am a
1764  // level-0 element
1765  if (this->parent() == NULL)
1766  return 0;
1767 
1768  // if the parent and this element are of different
1769  // dimensionality we are at the same level as
1770  // the parent (e.g. we are the 2D side of a
1771  // 3D element)
1772  if (this->dim() != this->parent()->dim())
1773  return this->parent()->level();
1774 
1775  // otherwise we are at a level one
1776  // higher than our parent
1777  return (this->parent()->level() + 1);
1778 
1779 #else
1780 
1781  // Without AMR all elements are
1782  // at level 0.
1783  return 0;
1784 
1785 #endif
1786 }
void libMesh::Elem::libmesh_assert_valid_neighbors ( ) const
inherited

This function checks for consistent neighbor links at this element.

Definition at line 956 of file elem.C.

References libMesh::Elem::dim(), libMesh::libmesh_assert(), libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor(), libMesh::Elem::parent(), libMesh::remote_elem, libMesh::Elem::subactive(), and libMesh::Elem::which_neighbor_am_i().

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

957 {
958  for (unsigned int s=0; s<this->n_neighbors(); s++)
959  {
960  const Elem *neigh = this->neighbor(s);
961 
962  // Any element might have a remote neighbor; checking
963  // to make sure that's not inaccurate is tough.
964  if (neigh == remote_elem)
965  continue;
966 
967  if (neigh)
968  {
969  // Only subactive elements have subactive neighbors
970  libmesh_assert (this->subactive() || !neigh->subactive());
971 
972  const Elem *elem = this;
973 
974  // If we're subactive but our neighbor isn't, its
975  // return neighbor link will be to our first active
976  // ancestor OR to our inactive ancestor of the same
977  // level as neigh,
978  if (this->subactive() && !neigh->subactive())
979  {
980  for (elem = this; !elem->active();
981  elem = elem->parent())
982  libmesh_assert(elem);
983  }
984  else
985  {
986  unsigned int rev = neigh->which_neighbor_am_i(elem);
987  libmesh_assert_less (rev, neigh->n_neighbors());
988 
989  if (this->subactive() && !neigh->subactive())
990  {
991  while (neigh->neighbor(rev) != elem)
992  {
993  libmesh_assert(elem->parent());
994  elem = elem->parent();
995  }
996  }
997  else
998  {
999  Elem *nn = neigh->neighbor(rev);
1000  libmesh_assert(nn);
1001 
1002  for (; elem != nn; elem = elem->parent())
1003  libmesh_assert(elem);
1004  }
1005  }
1006  }
1007  // If we don't have a neighbor and we're not subactive, our
1008  // ancestors shouldn't have any neighbors in this same
1009  // direction.
1010  else if (!this->subactive())
1011  {
1012  const Elem *my_parent = this->parent();
1013  if (my_parent &&
1014  // A parent with a different dimension isn't really one of
1015  // our ancestors, it means we're on a boundary mesh and this
1016  // is an interior mesh element for which we're on a side.
1017  // Nothing to test for in that case.
1018  (my_parent->dim() == this->dim()))
1019  libmesh_assert (!my_parent->neighbor(s));
1020  }
1021  }
1022 }
void libMesh::Elem::libmesh_assert_valid_node_pointers ( ) const
inherited

This function checks for a valid id and for pointers to nodes with valid ids at this element.

Definition at line 944 of file elem.C.

References libMesh::Elem::get_node(), libMesh::libmesh_assert(), libMesh::Elem::n_nodes(), and libMesh::DofObject::valid_id().

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

945 {
946  libmesh_assert(this->valid_id());
947  for (unsigned int n=0; n != this->n_nodes(); ++n)
948  {
949  libmesh_assert(this->get_node(n));
950  libmesh_assert(this->get_node(n)->valid_id());
951  }
952 }
unsigned int libMesh::Elem::local_node ( const dof_id_type  i) const
inlinevirtualinherited
Returns
the local id number of global Node id i, or invalid_uint if Node id i is not local.

Definition at line 1385 of file elem.h.

References libMesh::invalid_uint, libMesh::Elem::n_nodes(), and libMesh::Elem::node().

Referenced by libMesh::SerialMesh::stitching_helper().

1386 {
1387  for (unsigned int n=0; n != this->n_nodes(); ++n)
1388  if (this->node(n) == i)
1389  return n;
1390 
1391  return libMesh::invalid_uint;
1392 }
void libMesh::Elem::make_links_to_me_local ( unsigned int  n)
inherited

Resets the appropriate neighbor pointers of our nth neighbor (and its descendants, if appropriate) to point to this Elem instead of to the global remote_elem. Used by the library when a formerly remote element is being added to the local processor.

Definition at line 1028 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::family_tree_by_side(), libMesh::Elem::is_remote(), libMesh::Elem::JUST_REFINED, libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor(), libMesh::Elem::parent(), libMesh::Elem::refinement_flag(), libMesh::remote_elem, libMesh::Elem::set_neighbor(), libMesh::Elem::side(), and libMesh::Elem::subactive().

Referenced by libMesh::Parallel::unpack().

1029 {
1030  Elem *neigh = this->neighbor(n);
1031 
1032  // Don't bother calling this function unless it's necessary
1033  libmesh_assert(neigh);
1034  libmesh_assert(!neigh->is_remote());
1035 
1036  // We never have neighbors more refined than us
1037  libmesh_assert_less_equal (neigh->level(), this->level());
1038 
1039  // We never have subactive neighbors of non subactive elements
1040  libmesh_assert(!neigh->subactive() || this->subactive());
1041 
1042  // If we have a neighbor less refined than us then it must not
1043  // have any more refined active descendants we could have
1044  // pointed to instead.
1045  libmesh_assert(neigh->level() == this->level() ||
1046  neigh->active());
1047 
1048  // If neigh is at our level, then its family might have
1049  // remote_elem neighbor links which need to point to us
1050  // instead, but if not, then we're done.
1051  if (neigh->level() != this->level())
1052  return;
1053 
1054  // If neigh is subactive then we're not updating its neighbor links
1055  // FIXME - this needs to change when we start using subactive
1056  // elements for more than just the two-phase
1057  // restriction/prolongation projections.
1058  if (neigh->subactive())
1059  return;
1060 
1061  // What side of neigh are we on? We can't use the usual Elem
1062  // method because we're in the middle of restoring topology
1063  const AutoPtr<Elem> my_side = this->side(n);
1064  unsigned int nn = 0;
1065  for (; nn != neigh->n_sides(); ++nn)
1066  {
1067  const AutoPtr<Elem> neigh_side = neigh->side(nn);
1068  if (*my_side == *neigh_side)
1069  break;
1070  }
1071 
1072  // we had better be on *some* side of neigh
1073  libmesh_assert_less (nn, neigh->n_sides());
1074 
1075  // Find any elements that ought to point to elem
1076  std::vector<const Elem*> neigh_family;
1077 #ifdef LIBMESH_ENABLE_AMR
1078  if (this->active())
1079  neigh->family_tree_by_side(neigh_family, nn);
1080  else
1081 #endif
1082  neigh_family.push_back(neigh);
1083 
1084  // And point them to elem
1085  for (unsigned int i = 0; i != neigh_family.size(); ++i)
1086  {
1087  Elem* neigh_family_member = const_cast<Elem*>(neigh_family[i]);
1088 
1089  // Ideally, the neighbor link ought to either be correct
1090  // already or ought to be to remote_elem.
1091  //
1092  // However, if we're redistributing a newly created elem,
1093  // after an AMR step but before find_neighbors has fixed up
1094  // neighbor links, we might have an out of date neighbor
1095  // link to elem's parent instead.
1096 #ifdef LIBMESH_ENABLE_AMR
1097  libmesh_assert((neigh_family_member->neighbor(nn) == this) ||
1098  (neigh_family_member->neighbor(nn) == remote_elem)
1099  || ((this->refinement_flag() == JUST_REFINED) &&
1100  (this->parent() != NULL) &&
1101  (neigh_family_member->neighbor(nn) == this->parent())));
1102 #else
1103  libmesh_assert((neigh_family_member->neighbor(nn) == this) ||
1104  (neigh_family_member->neighbor(nn) == remote_elem));
1105 #endif
1106 
1107  neigh_family_member->set_neighbor(nn, this);
1108  }
1109 }
void libMesh::Elem::make_links_to_me_remote ( )
inherited

Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's appropriate pointers to point to the global remote_elem instead of this. Used by the library before a remote element is deleted on the local processor.

Definition at line 1112 of file elem.C.

References libMesh::Elem::child(), libMesh::Elem::dim(), libMesh::Elem::family_tree_by_neighbor(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::has_children(), libMesh::Elem::has_neighbor(), libMesh::Elem::level(), libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_neighbors(), libMesh::Elem::n_sides(), libMesh::Elem::neighbor(), libMesh::Elem::parent(), libMesh::remote_elem, libMesh::Elem::set_child(), libMesh::Elem::set_neighbor(), libMesh::Elem::subactive(), libMesh::Elem::which_child_am_i(), and libMesh::Elem::which_neighbor_am_i().

Referenced by libMesh::MeshCommunication::delete_remote_elements().

1113 {
1114  libmesh_assert_not_equal_to (this, remote_elem);
1115 
1116  // We need to have handled any children first
1117 #if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG)
1118  if (this->has_children())
1119  for (unsigned int c = 0; c != this->n_children(); ++c)
1120  {
1121  Elem *current_child = this->child(c);
1122  libmesh_assert_equal_to (current_child, remote_elem);
1123  }
1124 #endif
1125 
1126  // Remotify any neighbor links to non-subactive elements
1127  if (!this->subactive())
1128  {
1129  for (unsigned int s = 0; s != this->n_sides(); ++s)
1130  {
1131  Elem *neigh = this->neighbor(s);
1132  if (neigh && neigh != remote_elem && !neigh->subactive())
1133  {
1134  // My neighbor should never be more refined than me; my real
1135  // neighbor would have been its parent in that case.
1136  libmesh_assert_greater_equal (this->level(), neigh->level());
1137 
1138  if (this->level() == neigh->level() &&
1139  neigh->has_neighbor(this))
1140  {
1141 #ifdef LIBMESH_ENABLE_AMR
1142  // My neighbor may have descendants which also consider me a
1143  // neighbor
1144  std::vector<const Elem*> family;
1145  neigh->family_tree_by_neighbor (family, this);
1146 
1147  // FIXME - There's a lot of ugly const_casts here; we
1148  // may want to make remote_elem non-const and create
1149  // non-const versions of the family_tree methods
1150  for (unsigned int i=0; i != family.size(); ++i)
1151  {
1152  Elem *n = const_cast<Elem*>(family[i]);
1153  libmesh_assert (n);
1154  if (n == remote_elem)
1155  continue;
1156  unsigned int my_s = n->which_neighbor_am_i(this);
1157  libmesh_assert_less (my_s, n->n_neighbors());
1158  libmesh_assert_equal_to (n->neighbor(my_s), this);
1159  n->set_neighbor(my_s, const_cast<RemoteElem*>(remote_elem));
1160  }
1161 #else
1162  unsigned int my_s = neigh->which_neighbor_am_i(this);
1163  libmesh_assert_less (my_s, neigh->n_neighbors());
1164  libmesh_assert_equal_to (neigh->neighbor(my_s), this);
1165  neigh->set_neighbor(my_s, const_cast<RemoteElem*>(remote_elem));
1166 #endif
1167  }
1168 #ifdef LIBMESH_ENABLE_AMR
1169  // Even if my neighbor doesn't link back to me, it might
1170  // have subactive descendants which do
1171  else if (neigh->has_children())
1172  {
1173  // If my neighbor at the same level doesn't have me as a
1174  // neighbor, I must be subactive
1175  libmesh_assert(this->level() > neigh->level() ||
1176  this->subactive());
1177 
1178  // My neighbor must have some ancestor of mine as a
1179  // neighbor
1180  Elem *my_ancestor = this->parent();
1181  libmesh_assert(my_ancestor);
1182  while (!neigh->has_neighbor(my_ancestor))
1183  {
1184  my_ancestor = my_ancestor->parent();
1185  libmesh_assert(my_ancestor);
1186  }
1187 
1188  // My neighbor may have descendants which consider me a
1189  // neighbor
1190  std::vector<const Elem*> family;
1191  neigh->family_tree_by_subneighbor (family, my_ancestor, this);
1192 
1193  // FIXME - There's a lot of ugly const_casts here; we
1194  // may want to make remote_elem non-const and create
1195  // non-const versions of the family_tree methods
1196  for (unsigned int i=0; i != family.size(); ++i)
1197  {
1198  Elem *n = const_cast<Elem*>(family[i]);
1199  libmesh_assert (n);
1200  if (n == remote_elem)
1201  continue;
1202  unsigned int my_s = n->which_neighbor_am_i(this);
1203  libmesh_assert_less (my_s, n->n_neighbors());
1204  libmesh_assert_equal_to (n->neighbor(my_s), this);
1205  n->set_neighbor(my_s, const_cast<RemoteElem*>(remote_elem));
1206  }
1207  }
1208 #endif
1209  }
1210  }
1211  }
1212 
1213 #ifdef LIBMESH_ENABLE_AMR
1214  // Remotify parent's child link
1215  Elem *my_parent = this->parent();
1216  if (my_parent &&
1217  // As long as it's not already remote
1218  my_parent != remote_elem &&
1219  // And it's a real parent, not an interior parent
1220  this->dim() == my_parent->dim())
1221  {
1222  unsigned int me = my_parent->which_child_am_i(this);
1223  libmesh_assert_equal_to (my_parent->child(me), this);
1224  my_parent->set_child(me, const_cast<RemoteElem*>(remote_elem));
1225  }
1226 #endif
1227 }
unsigned int libMesh::Elem::max_descendant_p_level ( ) const
inlineinherited

Returns the maximum value of the p refinement levels of an ancestor element's descendants

Definition at line 1878 of file elem.h.

References libMesh::Elem::_p_level, libMesh::Elem::active(), libMesh::Elem::child(), libMesh::libmesh_assert(), std::max(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::n_children(), libMesh::Elem::p_level(), and libMesh::Elem::subactive().

Referenced by libMesh::FEGenericBase< T >::coarsened_dof_values(), and libMesh::Elem::max_descendant_p_level().

1879 {
1880  // This is undefined for subactive elements,
1881  // which have no active descendants
1882  libmesh_assert (!this->subactive());
1883  if (this->active())
1884  return this->p_level();
1885 
1886  unsigned int max_p_level = _p_level;
1887  for (unsigned int c=0; c != this->n_children(); c++)
1888  max_p_level = std::max(max_p_level,
1889  this->child(c)->max_descendant_p_level());
1890  return max_p_level;
1891 }
unsigned int libMesh::Elem::min_new_p_level_by_neighbor ( const Elem neighbor,
unsigned int  current_min 
) const
inherited

Returns the minimum new p refinement level (i.e. after refinement and coarsening is done) of elements which are descended from this and which share a side with the active neighbor

Definition at line 1696 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child(), libMesh::Elem::COARSEN, libMesh::Elem::has_neighbor(), libMesh::libmesh_assert(), libMesh::libmesh_assert_greater(), std::min(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::n_children(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::REFINE, libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::MeshRefinement::eliminate_unrefined_patches(), and libMesh::Elem::min_new_p_level_by_neighbor().

1698 {
1699  libmesh_assert(!this->subactive());
1700  libmesh_assert(neighbor_in->active());
1701 
1702  // If we're an active element this is simple
1703  if (this->active())
1704  {
1705  unsigned int new_p_level = this->p_level();
1706  if (this->p_refinement_flag() == Elem::REFINE)
1707  new_p_level += 1;
1708  if (this->p_refinement_flag() == Elem::COARSEN)
1709  {
1710  libmesh_assert_greater (new_p_level, 0);
1711  new_p_level -= 1;
1712  }
1713  return std::min(current_min, new_p_level);
1714  }
1715 
1716  libmesh_assert(has_neighbor(neighbor_in));
1717 
1718  unsigned int min_p_level = current_min;
1719 
1720  for (unsigned int c=0; c<this->n_children(); c++)
1721  {
1722  const Elem* const current_child = this->child(c);
1723  if (current_child && current_child != remote_elem)
1724  if (current_child->has_neighbor(neighbor_in))
1725  min_p_level =
1726  current_child->min_new_p_level_by_neighbor(neighbor_in,
1727  min_p_level);
1728  }
1729 
1730  return min_p_level;
1731 }
unsigned int libMesh::Elem::min_p_level_by_neighbor ( const Elem neighbor,
unsigned int  current_min 
) const
inherited

Returns the minimum p refinement level of elements which are descended from this and which share a side with the active neighbor

Definition at line 1663 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child(), libMesh::Elem::has_neighbor(), libMesh::libmesh_assert(), std::min(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::Elem::n_children(), libMesh::Elem::p_level(), libMesh::remote_elem, and libMesh::Elem::subactive().

Referenced by libMesh::FEGenericBase< T >::compute_periodic_constraints(), libMesh::FEGenericBase< T >::compute_proj_constraints(), and libMesh::Elem::min_p_level_by_neighbor().

1665 {
1666  libmesh_assert(!this->subactive());
1667  libmesh_assert(neighbor_in->active());
1668 
1669  // If we're an active element this is simple
1670  if (this->active())
1671  return std::min(current_min, this->p_level());
1672 
1673  libmesh_assert(has_neighbor(neighbor_in));
1674 
1675  // The p_level() of an ancestor element is already the minimum
1676  // p_level() of its children - so if that's high enough, we don't
1677  // need to examine any children.
1678  if (current_min <= this->p_level())
1679  return current_min;
1680 
1681  unsigned int min_p_level = current_min;
1682 
1683  for (unsigned int c=0; c<this->n_children(); c++)
1684  {
1685  const Elem* const current_child = this->child(c);
1686  if (current_child != remote_elem && current_child->has_neighbor(neighbor_in))
1687  min_p_level =
1688  current_child->min_p_level_by_neighbor(neighbor_in,
1689  min_p_level);
1690  }
1691 
1692  return min_p_level;
1693 }
unsigned int libMesh::Hex::n_children ( ) const
inlinevirtualinherited
Returns
8

Implements libMesh::Elem.

Definition at line 71 of file cell_hex.h.

Referenced by libMesh::Hex::is_child_on_side().

71 { return 8; }
unsigned int libMesh::DofObject::n_comp ( const unsigned int  s,
const unsigned int  var 
) const
inlineinherited
Returns
the number of components for variable var of system s associated with this DofObject. For example, the HIERARCHIC shape functions may have multiple DoFs associated with one node. Another example is the MONOMIALs, where only the elements hold the DoFs. For the different spatial directions, and orders, see FE.

Definition at line 759 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::add_neighbors_to_send_list(), libMesh::FEGenericBase< T >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::dof_indices(), libMesh::DofObject::dof_number(), libMesh::DofObject::DofObject(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofObject::n_dofs(), libMesh::DofMap::old_dof_indices(), libMesh::DofObject::operator=(), libMesh::DofObject::set_dof_number(), libMesh::DofObject::set_n_vars_per_group(), libMesh::DofMap::set_nonlocal_dof_objects(), and libMesh::System::zero_variable().

761 {
762  libmesh_assert_less (s, this->n_systems());
763  libmesh_assert_less (var, this->n_vars(s));
764 
765  return this->n_comp_group(s,this->var_to_vg(s,var));
766 }
unsigned int libMesh::DofObject::n_comp_group ( const unsigned int  s,
const unsigned int  vg 
) const
inlineinherited
Returns
the number of components for VariableGroup vg of system s associated with this DofObject. For example, the HIERARCHIC shape functions may have multiple DoFs associated with one node. Another example is the MONOMIALs, where only the elements hold the DoFs. For the different spatial directions, and orders, see FE.

Definition at line 772 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_n_comp_group(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

774 {
775  libmesh_assert_less (s, this->n_systems());
776  libmesh_assert_less (vg, this->n_var_groups(s));
777 
778  const unsigned int
779  start_idx_sys = this->start_idx(s);
780 
781  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());
782 
783  return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
784 }
unsigned int libMesh::DofObject::n_dofs ( const unsigned int  s,
const unsigned int  var = libMesh::invalid_uint 
) const
inlineinherited
Returns
the number of degrees of freedom associated with system s for this object. Optionally only counts degrees of freedom for variable number var

Definition at line 589 of file dof_object.h.

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

Referenced by libMesh::EquationSystems::build_solution_vector().

591 {
592  libmesh_assert_less (s, this->n_systems());
593 
594  unsigned int num = 0;
595 
596  // Count all variables
597  if (var == libMesh::invalid_uint)
598  for (unsigned int v=0; v<this->n_vars(s); v++)
599  num += this->n_comp(s,v);
600 
601  // Only count specified variable
602  else
603  num = this->n_comp(s,var);
604 
605  return num;
606 }
unsigned int libMesh::Hex::n_edges ( ) const
inlinevirtualinherited
Returns
12. All hexahedrals have 12 edges.

Implements libMesh::Elem.

Definition at line 61 of file cell_hex.h.

Referenced by libMesh::Hex8::build_edge(), build_edge(), libMesh::Hex27::build_edge(), libMesh::Hex::is_edge_on_side(), libMesh::Hex8::is_node_on_edge(), is_node_on_edge(), and libMesh::Hex27::is_node_on_edge().

61 { return 12; }
unsigned int libMesh::Hex::n_faces ( ) const
inlinevirtualinherited
Returns
6. All hexahedrals have 6 faces.

Implements libMesh::Elem.

Definition at line 66 of file cell_hex.h.

66 { return 6; }
virtual unsigned int libMesh::Elem::n_neighbors ( ) const
inlinevirtualinherited
Returns
the number of neighbors the element that has been derived from this class has. By default only face (or edge in 2D) neighbors are stored, so this method returns n_sides(), however it may be overloaded in a derived class

Definition at line 426 of file elem.h.

References libMesh::Elem::n_sides().

Referenced by libMesh::MetisPartitioner::_do_partition(), libMesh::Elem::_last_side(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::ParmetisPartitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::TetGenMeshInterface::check_hull_integrity(), libMesh::Elem::child_neighbor(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::FEGenericBase< T >::compute_proj_constraints(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::has_neighbor(), libMesh::Elem::has_topological_neighbor(), libMesh::LaplaceMeshSmoother::init(), libMesh::MeshTools::libmesh_assert_no_links_to_elem(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_node_pointers(), libMesh::MeshTools::libmesh_assert_valid_remote_elems(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Elem::make_links_to_me_remote(), libMesh::Elem::neighbor(), libMesh::Elem::nullify_neighbors(), libMesh::Parallel::pack(), libMesh::Elem::PackedElem::pack(), libMesh::Parallel::packable_size(), libMesh::Elem::packed_size(), libMesh::Elem::set_neighbor(), libMesh::MeshTools::Modification::smooth(), libMesh::MeshRefinement::test_level_one(), libMesh::Elem::topological_neighbor(), libMesh::Parallel::unpack(), libMesh::Elem::PackedElem::unpack(), and libMesh::Elem::which_neighbor_am_i().

427  { return this->n_sides(); }
unsigned int libMesh::Hex20::n_nodes ( ) const
inlinevirtual
Returns
20

Implements libMesh::Elem.

Definition at line 89 of file cell_hex20.h.

Referenced by second_order_adjacent_vertex(), and second_order_child_vertex().

89 { return 20; }
static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

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

Definition at line 79 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

80  { return _n_objects; }
static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

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

Definition at line 79 of file reference_counter.h.

References libMesh::ReferenceCounter::_n_objects.

80  { return _n_objects; }
unsigned int libMesh::Hex20::n_second_order_adjacent_vertices ( const unsigned int  ) const
inlinevirtual
Returns
2 for all n

Reimplemented from libMesh::Elem.

Definition at line 156 of file cell_hex20.h.

157  { return 2; }
unsigned int libMesh::Hex20::n_sub_elem ( ) const
inlinevirtual
Returns
1

Implements libMesh::Elem.

Definition at line 94 of file cell_hex20.h.

Referenced by connectivity().

94 { return 1; }
unsigned int libMesh::DofObject::n_vars ( const unsigned int  s,
const unsigned int  vg 
) const
inlineinherited
unsigned int libMesh::DofObject::n_vars ( const unsigned int  s) const
inlineinherited
Returns
the number of Variable variables associated with system s for this DofObject

Definition at line 741 of file dof_object.h.

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

742 {
743  libmesh_assert_less (s, this->n_systems());
744 
745  const unsigned int nvg = this->n_var_groups(s);
746 
747  unsigned int val=0;
748 
749  for (unsigned int vg=0; vg<nvg; vg++)
750  val += this->n_vars(s,vg);
751 
752  return val;
753 }
unsigned int libMesh::Hex::n_vertices ( ) const
inlinevirtualinherited
Returns
8. All hexahedrals have 8 vertices.

Implements libMesh::Elem.

Definition at line 56 of file cell_hex.h.

Referenced by second_order_adjacent_vertex(), libMesh::Hex27::second_order_adjacent_vertex(), second_order_child_vertex(), and libMesh::Hex27::second_order_child_vertex().

56 { return 8; }
Elem * libMesh::Elem::neighbor ( const unsigned int  i) const
inlineinherited
Returns
a pointer to the $ i^{th} $ neighbor of this element. If MeshBase::find_neighbors() has not been called this simply returns NULL. If MeshBase::find_neighbors() has been called and this returns NULL then the side is on a boundary of the domain.

Definition at line 1446 of file elem.h.

References libMesh::Elem::_elemlinks, and libMesh::Elem::n_neighbors().

Referenced by libMesh::MetisPartitioner::_do_partition(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::BoundaryInfo::boundary_id(), libMesh::BoundaryInfo::boundary_ids(), libMesh::MeshTools::Generation::build_delaunay_square(), libMesh::ParmetisPartitioner::build_graph(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::TetGenMeshInterface::check_hull_integrity(), libMesh::Elem::child_neighbor(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::FEAbstract::compute_node_constraints(), libMesh::FEGenericBase< T >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< T >::compute_proj_constraints(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::Elem::find_edge_neighbors(), libMesh::Patch::find_face_neighbors(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), libMesh::BoundaryInfo::has_boundary_id(), libMesh::Elem::has_neighbor(), libMesh::LaplaceMeshSmoother::init(), libMesh::MeshTools::libmesh_assert_no_links_to_elem(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_node_pointers(), libMesh::MeshTools::libmesh_assert_valid_remote_elems(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::BoundaryInfo::n_boundary_ids(), libMesh::BoundaryInfo::n_edge_boundary_ids(), libMesh::Elem::nullify_neighbors(), libMesh::SparsityPattern::Build::operator()(), libMesh::Parallel::pack(), libMesh::Elem::PackedElem::pack(), libMesh::GmshIO::read_mesh(), libMesh::REINIT_ERROR(), libMesh::FE< Dim, T >::side_map(), libMesh::Elem::SideIter::side_on_boundary(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::MeshTools::Modification::smooth(), libMesh::SerialMesh::stitching_helper(), libMesh::BoundaryInfo::sync(), libMesh::Elem::topological_neighbor(), libMesh::MeshRefinement::topological_neighbor(), libMesh::Parallel::unpack(), libMesh::Elem::PackedElem::unpack(), libMesh::Elem::which_neighbor_am_i(), libMesh::GnuPlotIO::write_solution(), and libMesh::DivaIO::write_stream().

1447 {
1448  libmesh_assert_less (i, this->n_neighbors());
1449 
1450  return _elemlinks[i+1];
1451 }
dof_id_type libMesh::Elem::node ( const unsigned int  i) const
inlinevirtualinherited
Returns
the global id number of local Node i.

Reimplemented in libMesh::RemoteElem.

Definition at line 1373 of file elem.h.

References libMesh::Elem::_nodes, libMesh::DofObject::id(), libMesh::DofObject::invalid_id, libMesh::libmesh_assert(), and libMesh::Elem::n_nodes().

Referenced by libMesh::DofMap::add_neighbors_to_send_list(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::EquationSystems::build_solution_vector(), libMesh::VTKIO::cells_to_vtk(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::FEMap::compute_face_map(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), libMesh::InfEdge2::connectivity(), libMesh::Edge4::connectivity(), libMesh::Edge2::connectivity(), libMesh::Edge3::connectivity(), libMesh::InfQuad4::connectivity(), libMesh::Quad4::connectivity(), libMesh::InfQuad6::connectivity(), libMesh::Tri3::connectivity(), libMesh::Prism6::connectivity(), libMesh::Pyramid5::connectivity(), libMesh::Hex8::connectivity(), libMesh::InfPrism6::connectivity(), libMesh::Quad9::connectivity(), libMesh::Quad8::connectivity(), libMesh::Tri6::connectivity(), libMesh::InfPrism12::connectivity(), libMesh::InfHex8::connectivity(), libMesh::Tet4::connectivity(), libMesh::Tet10::connectivity(), libMesh::InfHex16::connectivity(), connectivity(), libMesh::Prism15::connectivity(), libMesh::Pyramid14::connectivity(), libMesh::Hex27::connectivity(), libMesh::InfHex18::connectivity(), libMesh::Prism18::connectivity(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::MeshTools::get_not_subactive_node_ids(), libMesh::Tet::key(), libMesh::Prism::key(), libMesh::Pyramid::key(), libMesh::Hex::key(), libMesh::Tri::key(), libMesh::InfPrism::key(), libMesh::InfHex::key(), libMesh::Quad::key(), libMesh::InfQuad::key(), libMesh::Edge::key(), libMesh::Quad9::key(), libMesh::Quad8::key(), libMesh::Tri6::key(), libMesh::Hex27::key(), libMesh::Prism18::key(), libMesh::InfHex18::key(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::Elem::local_node(), libMesh::RemoteElem::node(), libMesh::Elem::operator==(), libMesh::Parallel::pack(), libMesh::Elem::PackedElem::pack(), libMesh::XdrIO::pack_element(), libMesh::SerialMesh::renumber_nodes_and_elements(), libMesh::ParallelMesh::renumber_nodes_and_elements(), libMesh::FE< Dim, T >::side_map(), libMesh::LaplaceMeshSmoother::smooth(), libMesh::SerialMesh::stitching_helper(), libMesh::MeshTools::subdomain_bounding_box(), libMesh::BoundaryInfo::sync(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::Parallel::unpack(), libMesh::Elem::PackedElem::unpack(), libMesh::GMVIO::write_ascii_new_impl(), libMesh::CheckpointIO::write_connectivity(), libMesh::Elem::write_connectivity(), libMesh::ExodusII_IO_Helper::write_elements(), libMesh::EnsightIO::write_geometry_ascii(), libMesh::GmshIO::write_mesh(), libMesh::LegacyXdrIO::write_mesh(), libMesh::GmshIO::write_post(), libMesh::EnsightIO::write_scalar_ascii(), libMesh::GnuPlotIO::write_solution(), libMesh::DivaIO::write_stream(), and libMesh::EnsightIO::write_vector_ascii().

1374 {
1375  libmesh_assert_less (i, this->n_nodes());
1376  libmesh_assert(_nodes[i]);
1377  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
1378 
1379  return _nodes[i]->id();
1380 }
void libMesh::Elem::nullify_neighbors ( )
protectedinherited

Replaces this element with NULL for all of its neighbors. This is useful when deleting an element.

Definition at line 1955 of file elem.C.

References libMesh::Elem::level(), libMesh::Elem::n_neighbors(), libMesh::Elem::neighbor(), libMesh::remote_elem, libMesh::Elem::set_neighbor(), and libMesh::Elem::which_neighbor_am_i().

Referenced by libMesh::MeshRefinement::_coarsen_elements().

1956 {
1957  // Tell any of my neighbors about my death...
1958  // Looks strange, huh?
1959  for (unsigned int n=0; n<this->n_neighbors(); n++)
1960  {
1961  Elem* current_neighbor = this->neighbor(n);
1962  if (current_neighbor && current_neighbor != remote_elem)
1963  {
1964  // Note: it is possible that I see the neighbor
1965  // (which is coarser than me)
1966  // but they don't see me, so avoid that case.
1967  if (current_neighbor->level() == this->level())
1968  {
1969  const unsigned int w_n_a_i = current_neighbor->which_neighbor_am_i(this);
1970  libmesh_assert_less (w_n_a_i, current_neighbor->n_neighbors());
1971  current_neighbor->set_neighbor(w_n_a_i, NULL);
1972  this->set_neighbor(n, NULL);
1973  }
1974  }
1975  }
1976 }
bool libMesh::Elem::on_boundary ( ) const
inlineinherited
Returns
true if this element has a side coincident with a boundary (indicated by a NULL neighbor), false otherwise.

Definition at line 1504 of file elem.h.

References libMesh::Elem::has_neighbor().

1505 {
1506  // By convention, the element is on the boundary
1507  // if it has a NULL neighbor.
1508  return this->has_neighbor(NULL);
1509 }
bool libMesh::Elem::operator== ( const Elem rhs) const
inherited
Returns
true if two elements are identical, false otherwise. This is true if the elements are connected to identical global nodes, regardless of how those nodes might be numbered local to the elements.

Definition at line 440 of file elem.C.

References libMesh::Elem::n_nodes(), and libMesh::Elem::node().

441 {
442 
443  // Cast rhs to an Elem*
444 // const Elem* rhs_elem = dynamic_cast<const Elem*>(&rhs);
445  const Elem* rhs_elem = &rhs;
446 
447  // If we cannot cast to an Elem*, rhs must be a Node
448 // if(rhs_elem == static_cast<const Elem*>(NULL))
449 // return false;
450 
451 // libmesh_assert (n_nodes());
452 // libmesh_assert (rhs.n_nodes());
453 
454 // // Elements can only be equal if they
455 // // contain the same number of nodes.
456 // if (this->n_nodes() == rhs.n_nodes())
457 // {
458 // // Create a set that contains our global
459 // // node numbers and those of our neighbor.
460 // // If the set is the same size as the number
461 // // of nodes in both elements then they must
462 // // be connected to the same nodes.
463 // std::set<unsigned int> nodes_set;
464 
465 // for (unsigned int n=0; n<this->n_nodes(); n++)
466 // {
467 // nodes_set.insert(this->node(n));
468 // nodes_set.insert(rhs.node(n));
469 // }
470 
471 // // If this passes the elements are connected
472 // // to the same global nodes
473 // if (nodes_set.size() == this->n_nodes())
474 // return true;
475 // }
476 
477 // // If we get here it is because the elements either
478 // // do not have the same number of nodes or they are
479 // // connected to different nodes. Either way they
480 // // are not the same element
481 // return false;
482 
483  // Useful typedefs
484  typedef std::vector<dof_id_type>::iterator iterator;
485 
486 
487  // Elements can only be equal if they
488  // contain the same number of nodes.
489  // However, we will only test the vertices,
490  // which is sufficient & cheaper
491  if (this->n_nodes() == rhs_elem->n_nodes())
492  {
493  // The number of nodes in the element
494  const unsigned int nn = this->n_nodes();
495 
496  // Create a vector that contains our global
497  // node numbers and those of our neighbor.
498  // If the sorted, unique vector is the same size
499  // as the number of nodes in both elements then
500  // they must be connected to the same nodes.
501  //
502  // The vector will be no larger than 2*n_nodes(),
503  // so we might as well reserve the space.
504  std::vector<dof_id_type> common_nodes;
505  common_nodes.reserve (2*nn);
506 
507  // Add the global indices of the nodes
508  for (unsigned int n=0; n<nn; n++)
509  {
510  common_nodes.push_back (this->node(n));
511  common_nodes.push_back (rhs_elem->node(n));
512  }
513 
514  // Sort the vector and find out how long
515  // the sorted vector is.
516  std::sort (common_nodes.begin(), common_nodes.end());
517 
518  iterator new_end = std::unique (common_nodes.begin(),
519  common_nodes.end());
520 
521  const int new_size = libmesh_cast_int<int>
522  (std::distance (common_nodes.begin(), new_end));
523 
524  // If this passes the elements are connected
525  // to the same global vertex nodes
526  if (new_size == static_cast<int>(nn))
527  return true;
528  }
529 
530  // If we get here it is because the elements either
531  // do not have the same number of nodes or they are
532  // connected to different nodes. Either way they
533  // are not the same element
534  return false;
535 }
unsigned int libMesh::Hex::opposite_node ( const unsigned int  n,
const unsigned int  s 
) const
virtualinherited
Returns
the local node number for the node opposite to node n on side opposite_side(s) (for a tensor product element), or throws an error otherwise.

Reimplemented from libMesh::Elem.

Definition at line 227 of file cell_hex.C.

References libMesh::Elem::is_node_on_side(), libMesh::libmesh_assert(), libMesh::Elem::n_nodes(), and libMesh::Hex::n_sides().

229 {
230  libmesh_assert_less (node_in, 26);
231  libmesh_assert_less (node_in, this->n_nodes());
232  libmesh_assert_less (side_in, this->n_sides());
233  libmesh_assert(this->is_node_on_side(node_in, side_in));
234 
235  static const unsigned char side05_nodes_map[] =
236  {4, 5, 6, 7, 0, 1, 2, 3, 16, 17, 18, 19, 255, 255, 255, 255, 8, 9, 10, 11, 25, 255, 255, 255, 255, 20};
237  static const unsigned char side13_nodes_map[] =
238  {3, 2, 1, 0, 7, 6, 5, 4, 10, 255, 8, 255, 15, 14, 13, 12, 18, 255, 16, 255, 255, 23, 255, 21, 255, 255};
239  static const unsigned char side24_nodes_map[] =
240  {1, 0, 3, 2, 5, 4, 7, 6, 255, 11, 255, 9, 13, 12, 15, 14, 255, 19, 255, 17, 255, 255, 24, 255, 22, 255};
241 
242  switch (side_in)
243  {
244  case 0:
245  case 5:
246  return side05_nodes_map[node_in];
247  break;
248  case 1:
249  case 3:
250  return side13_nodes_map[node_in];
251  break;
252  case 2:
253  case 4:
254  return side24_nodes_map[node_in];
255  break;
256  }
257 
258  libmesh_error();
259  return 255;
260 }
unsigned int libMesh::Hex::opposite_side ( const unsigned int  s) const
virtualinherited
Returns
the side number opposite to s (for a tensor product element), or throws an error otherwise.

Reimplemented from libMesh::Elem.

Definition at line 218 of file cell_hex.C.

219 {
220  libmesh_assert_less (side_in, 6);
221  static const unsigned char hex_opposites[6] = {5, 3, 4, 1, 2, 0};
222  return hex_opposites[side_in];
223 }
virtual Point libMesh::Elem::origin ( ) const
inlinevirtualinherited
Returns
the origin for an infinite element. Currently, all infinite elements used in a mesh share the same origin. Overload this in infinite element classes. By default, issues an error, because returning the all zero point would very likely lead to unexpected behavior.

Reimplemented in libMesh::InfQuad, libMesh::InfEdge2, and libMesh::InfCell.

Definition at line 1116 of file elem.h.

Referenced by libMesh::InfFE< friend_Dim, friend_T_radial, friend_T_map >::combine_base_radial(), libMesh::InfFE< friend_Dim, friend_T_radial, friend_T_map >::compute_data(), libMesh::Elem::get_info(), libMesh::InfFE< friend_Dim, friend_T_radial, friend_T_map >::inverse_map(), and libMesh::InfFE< friend_Dim, friend_T_radial, friend_T_map >::map().

1116 { libmesh_error(); return Point(); }
unsigned int libMesh::Elem::p_level ( ) const
inlineinherited

Returns the value of the p refinement level of an active element, or the minimum value of the p refinement levels of an ancestor element's descendants

Definition at line 1791 of file elem.h.

References libMesh::Elem::_p_level.

Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::MeshRefinement::_refine_elements(), libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::coarsen(), libMesh::FEGenericBase< T >::coarsened_dof_values(), libMesh::FEInterface::compute_data(), libMesh::FEGenericBase< T >::compute_periodic_constraints(), libMesh::FEGenericBase< T >::compute_proj_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::DofMap::dof_indices(), libMesh::FE< Dim, T >::dofs_on_edge(), libMesh::FE< Dim, T >::dofs_on_side(), libMesh::FE< Dim, T >::edge_reinit(), libMesh::Elem::Elem(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::Elem::get_info(), libMesh::InfFE< friend_Dim, friend_T_radial, friend_T_map >::init_face_shape_functions(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::min_new_p_level_by_neighbor(), libMesh::Elem::min_p_level_by_neighbor(), libMesh::DofMap::old_dof_indices(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::Parallel::pack(), libMesh::Elem::PackedElem::pack(), libMesh::XdrIO::pack_element(), libMesh::Elem::refine(), libMesh::FE< Dim, T >::reinit(), libMesh::InfFE< friend_Dim, friend_T_radial, friend_T_map >::reinit(), libMesh::FEXYZ< Dim >::reinit(), libMesh::DofMap::reinit(), libMesh::REINIT_ERROR(), libMesh::HPCoarsenTest::select_refinement(), libMesh::Elem::set_p_level(), libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::FE< Dim, T >::side_map(), libMesh::MeshRefinement::test_level_one(), libMesh::Parallel::unpack(), libMesh::Elem::PackedElem::unpack(), libMesh::GMVIO::write_ascii_new_impl(), and libMesh::CheckpointIO::write_connectivity().

1792 {
1793 #ifdef LIBMESH_ENABLE_AMR
1794  return _p_level;
1795 #else
1796  return 0;
1797 #endif
1798 }
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 525 of file dof_object.C.

Referenced by libMesh::Parallel::pack(), libMesh::Node::PackedNode::pack(), and libMesh::Elem::PackedElem::pack().

526 {
527 #ifdef LIBMESH_ENABLE_AMR
528  // We might need to pack old_dof_object too
529  *target++ = (old_dof_object == NULL) ? 0 : 1;
530 #endif
531 
532  *target++ = _idx_buf.size();
533  std::copy(_idx_buf.begin(), _idx_buf.end(), target);
534 
535 #ifdef LIBMESH_ENABLE_AMR
536  if (old_dof_object)
537  old_dof_object->pack_indexing(target);
538 #endif
539 }
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 448 of file dof_object.C.

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

Referenced by libMesh::Parallel::pack(), libMesh::Parallel::packable_size(), libMesh::DofObject::packed_indexing_size(), libMesh::Node::packed_size(), libMesh::Elem::packed_size(), and libMesh::Parallel::unpack().

449 {
450  return
451 #ifdef LIBMESH_ENABLE_AMR
452  ((old_dof_object == NULL) ? 0 : old_dof_object->packed_indexing_size()) + 2 +
453 #else
454  1 +
455 #endif
456  _idx_buf.size();
457 }
unsigned int libMesh::Elem::packed_size ( ) const
inlineinherited
const Elem * libMesh::Elem::parent ( ) const
inlineinherited
Returns
a const pointer to the element's parent. Returns NULL if the element was not created via refinement, i.e. was read from file.

Definition at line 1676 of file elem.h.

References libMesh::Elem::_elemlinks.

Referenced by libMesh::LinearPartitioner::_do_partition(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::Elem::add_child(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::BoundaryInfo::boundary_id(), libMesh::BoundaryInfo::boundary_ids(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::Elem::child_neighbor(), libMesh::FEMap::compute_face_map(), libMesh::FEAbstract::compute_node_constraints(), libMesh::UnstructuredMesh::contract(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshRefinement::create_parent_error_vector(), libMesh::MeshCommunication::delete_remote_elements(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::Elem::Elem(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::Elem::family_tree_by_subneighbor(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::for(), libMesh::Elem::get_info(), libMesh::BoundaryInfo::has_boundary_id(), libMesh::Elem::is_ancestor_of(), libMesh::Elem::level(), libMesh::MeshTools::libmesh_assert_no_links_to_elem(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_node_pointers(), libMesh::MeshTools::libmesh_assert_valid_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_refinement_tree(), libMesh::MeshTools::libmesh_assert_valid_remote_elems(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::BoundaryInfo::n_boundary_ids(), libMesh::BoundaryInfo::n_edge_boundary_ids(), libMesh::Parallel::pack(), libMesh::Elem::PackedElem::pack(), libMesh::BoundaryInfo::raw_boundary_ids(), libMesh::BoundaryInfo::raw_edge_boundary_ids(), libMesh::Elem::refine(), libMesh::HPCoarsenTest::select_refinement(), libMesh::Elem::set_p_level(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::MeshTools::Modification::smooth(), libMesh::Elem::subactive(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Elem::top_parent(), libMesh::Elem::topological_neighbor(), libMesh::Parallel::unpack(), libMesh::Elem::which_neighbor_am_i(), libMesh::CheckpointIO::write_connectivity(), and libMesh::LegacyXdrIO::write_mesh().

1677 {
1678  return _elemlinks[0];
1679 }
Elem * libMesh::Elem::parent ( )
inlineinherited
Returns
a pointer to the element's parent. Returns NULL if the element was not created via refinement, i.e. was read from file.

Definition at line 1684 of file elem.h.

References libMesh::Elem::_elemlinks.

1685 {
1686  return _elemlinks[0];
1687 }
const Point & libMesh::Elem::point ( const unsigned int  i) const
inlinevirtualinherited
Returns
the Point associated with local Node i.

Reimplemented in libMesh::RemoteElem.

Definition at line 1351 of file elem.h.

References libMesh::Elem::_nodes, libMesh::DofObject::invalid_id, libMesh::libmesh_assert(), and libMesh::Elem::n_nodes().

Referenced by libMesh::PostscriptIO::_compute_edge_bezier_coeffs(), libMesh::MeshTools::Modification::all_tri(), libMesh::Tet::choose_diagonal(), libMesh::Elem::coarsen(), libMesh::FEMap::compute_affine_map(), libMesh::InfFE< friend_Dim, friend_T_radial, friend_T_map >::compute_data(), libMesh::FEMap::compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), libMesh::FEMap::compute_face_map(), libMesh::FEMap::compute_single_point_map(), libMesh::Elem::contains_edge_of(), libMesh::InfQuad4::contains_point(), libMesh::InfPrism6::contains_point(), libMesh::InfHex8::contains_point(), libMesh::Elem::contains_vertex_of(), libMesh::UnstructuredMesh::create_submesh(), libMesh::FEMContext::elem_position_get(), libMesh::Edge4::has_affine_map(), libMesh::Edge3::has_affine_map(), libMesh::Prism6::has_affine_map(), libMesh::Quad4::has_affine_map(), libMesh::Hex8::has_affine_map(), libMesh::Quad9::has_affine_map(), libMesh::Quad8::has_affine_map(), libMesh::Tri6::has_affine_map(), libMesh::Tet10::has_affine_map(), libMesh::Hex27::has_affine_map(), has_affine_map(), libMesh::Prism18::has_affine_map(), libMesh::Prism15::has_affine_map(), libMesh::Elem::hmax(), libMesh::Elem::hmin(), libMesh::TreeNode< N >::insert(), libMesh::InfFE< friend_Dim, friend_T_radial, friend_T_map >::inverse_map(), libMesh::Elem::length(), libMesh::FE< Dim, T >::map(), libMesh::InfFE< friend_Dim, friend_T_radial, friend_T_map >::map(), libMesh::FE< Dim, T >::map_eta(), libMesh::FE< Dim, T >::map_xi(), libMesh::FE< Dim, T >::map_zeta(), libMesh::Tri3::min_and_max_angle(), libMesh::Tet4::min_and_max_angle(), libMesh::FEMSystem::numerical_jacobian(), libMesh::ProjectSolution::operator()(), libMesh::ProjectFEMSolution::operator()(), libMesh::BoundaryProjectSolution::operator()(), libMesh::InfCell::origin(), libMesh::InfEdge2::origin(), libMesh::InfQuad::origin(), libMesh::PostscriptIO::plot_linear_elem(), libMesh::RemoteElem::point(), libMesh::Elem::point_test(), libMesh::Elem::refine(), libMesh::FE< Dim, T >::reinit(), libMesh::FE< Dim, T >::shape(), libMesh::FE< Dim, T >::shape_deriv(), libMesh::FE< Dim, T >::shape_second_deriv(), libMesh::MeshTools::Modification::smooth(), libMesh::Edge2::volume(), libMesh::Quad4::volume(), libMesh::Edge3::volume(), libMesh::Elem::which_side_am_i(), libMesh::EnsightIO::write_geometry_ascii(), and libMesh::GmshIO::write_post().

1352 {
1353  libmesh_assert_less (i, this->n_nodes());
1354  libmesh_assert(_nodes[i]);
1355  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);
1356 
1357  return *_nodes[i];
1358 }
Point & libMesh::Elem::point ( const unsigned int  i)
inlinevirtualinherited
Returns
the Point associated with local Node i as a writeable reference.

Reimplemented in libMesh::RemoteElem.

Definition at line 1363 of file elem.h.

References libMesh::Elem::_nodes, and libMesh::Elem::n_nodes().

1364 {
1365  libmesh_assert_less (i, this->n_nodes());
1366 
1367  return *_nodes[i];
1368 }
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().

89 {
91 }
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().

89 {
91 }
void libMesh::Elem::print_info ( std::ostream &  os = libMesh::out) const
inherited

Prints relevant information about the element.

Definition at line 1878 of file elem.C.

References libMesh::Elem::get_info().

Referenced by libMesh::FE< Dim, T >::inverse_map(), and libMesh::operator<<().

1879 {
1880  os << this->get_info()
1881  << std::endl;
1882 }
processor_id_type libMesh::DofObject::processor_id ( ) const
inlineinherited
Returns
the processor that this DofObject belongs to.

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

Definition at line 673 of file dof_object.h.

References libMesh::DofObject::_processor_id.

Referenced by libMesh::MetisPartitioner::_do_partition(), libMesh::LinearPartitioner::_do_partition(), libMesh::SFCPartitioner::_do_partition(), libMesh::CentroidPartitioner::_do_partition(), libMesh::ParallelMesh::add_elem(), libMesh::Patch::add_local_face_neighbors(), libMesh::Patch::add_local_point_neighbors(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::ParallelMesh::add_node(), libMesh::SerialMesh::add_point(), libMesh::ParallelMesh::add_point(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::ParmetisPartitioner::assign_partitioning(), libMesh::Patch::build_around_element(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::Nemesis_IO_Helper::compute_border_node_ids(), libMesh::Nemesis_IO_Helper::compute_internal_and_border_elems_and_internal_nodes(), 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::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::Elem::Elem(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::Modification::flatten(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::MeshFunction::gradient(), libMesh::MeshFunction::hessian(), libMesh::DofObject::invalidate_processor_id(), libMesh::Elem::is_semilocal(), libMesh::MeshTools::libmesh_assert_valid_amr_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_elem_ids(), libMesh::MeshTools::libmesh_assert_valid_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_procids< Node >(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshFunction::operator()(), libMesh::Parallel::pack(), libMesh::Node::PackedNode::pack(), libMesh::Elem::PackedElem::pack(), libMesh::XdrIO::pack_element(), 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::MeshData::read_xdr(), libMesh::Elem::refine(), libMesh::DofMap::scatter_constraints(), libMesh::Partitioner::set_node_processor_ids(), libMesh::DofMap::set_nonlocal_dof_objects(), libMesh::Partitioner::set_parent_processor_ids(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_dofobject_data_by_id(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Node::PackedNode::unpack(), libMesh::Parallel::unpack(), libMesh::Elem::PackedElem::unpack(), libMesh::CheckpointIO::write_connectivity(), libMesh::GmshIO::write_mesh(), libMesh::CheckpointIO::write_nodes(), libMesh::XdrIO::write_serialized_connectivity(), and libMesh::Nemesis_IO_Helper::write_sidesets().

674 {
675  return _processor_id;
676 }
processor_id_type & libMesh::DofObject::processor_id ( )
inlineinherited
Returns
the processor that this DofObject belongs to as a writeable reference.

Definition at line 681 of file dof_object.h.

References libMesh::DofObject::_processor_id.

682 {
683  return _processor_id;
684 }
void libMesh::DofObject::processor_id ( const processor_id_type  pid)
inlineinherited

Sets the processor_id for this DofObject.

Definition at line 689 of file dof_object.h.

References libMesh::DofObject::processor_id().

690 {
691  this->processor_id() = pid;
692 }
std::pair< Real, Real > libMesh::Hex::qual_bounds ( const ElemQuality  q) const
virtualinherited

Returns the suggested quality bounds for the hex based on quality measure q. These are the values suggested by the CUBIT User's Manual.

Reimplemented from libMesh::Elem.

Definition at line 412 of file cell_hex.C.

References libMeshEnums::ASPECT_RATIO, libMeshEnums::CONDITION, libMeshEnums::DIAGONAL, libMeshEnums::DISTORTION, libMeshEnums::JACOBIAN, libMesh::out, libMeshEnums::SHAPE, libMeshEnums::SHEAR, libMeshEnums::SIZE, libMeshEnums::SKEW, libMeshEnums::STRETCH, and libMeshEnums::TAPER.

413 {
414  std::pair<Real, Real> bounds;
415 
416  switch (q)
417  {
418 
419  case ASPECT_RATIO:
420  bounds.first = 1.;
421  bounds.second = 4.;
422  break;
423 
424  case SKEW:
425  bounds.first = 0.;
426  bounds.second = 0.5;
427  break;
428 
429  case SHEAR:
430  case SHAPE:
431  bounds.first = 0.3;
432  bounds.second = 1.;
433  break;
434 
435  case CONDITION:
436  bounds.first = 1.;
437  bounds.second = 8.;
438  break;
439 
440  case JACOBIAN:
441  bounds.first = 0.5;
442  bounds.second = 1.;
443  break;
444 
445  case DISTORTION:
446  bounds.first = 0.6;
447  bounds.second = 1.;
448  break;
449 
450  case TAPER:
451  bounds.first = 0.;
452  bounds.second = 0.4;
453  break;
454 
455  case STRETCH:
456  bounds.first = 0.25;
457  bounds.second = 1.;
458  break;
459 
460  case DIAGONAL:
461  bounds.first = 0.65;
462  bounds.second = 1.;
463  break;
464 
465  case SIZE:
466  bounds.first = 0.5;
467  bounds.second = 1.;
468  break;
469 
470  default:
471  libMesh::out << "Warning: Invalid quality measure chosen." << std::endl;
472  bounds.first = -1;
473  bounds.second = -1;
474  }
475 
476  return bounds;
477 }
Real libMesh::Hex::quality ( const ElemQuality  q) const
virtualinherited

Based on the quality metric q specified by the user, returns a quantitative assessment of element quality.

Compue the min/max diagonal ratio. Source: CUBIT User's Manual.

Minimum ratio of lengths derived from opposite edges. Source: CUBIT User's Manual.

Compute the side lengths.

Minimum edge length divided by max diagonal length. Source: CUBIT User's Manual.

Compute the maximum diagonal.

Compute the minimum edge length.

I don't know what to do for this metric. Maybe the base class knows...

Reimplemented from libMesh::Elem.

Definition at line 264 of file cell_hex.C.

References libMeshEnums::DIAGONAL, libMesh::Elem::length(), std::max(), std::min(), libMesh::Elem::quality(), libMesh::Real, libMeshEnums::STRETCH, and libMeshEnums::TAPER.

265 {
266  switch (q)
267  {
268 
273  case DIAGONAL:
274  {
275  // Diagonal between node 0 and node 6
276  const Real d06 = this->length(0,6);
277 
278  // Diagonal between node 3 and node 5
279  const Real d35 = this->length(3,5);
280 
281  // Diagonal between node 1 and node 7
282  const Real d17 = this->length(1,7);
283 
284  // Diagonal between node 2 and node 4
285  const Real d24 = this->length(2,4);
286 
287  // Find the biggest and smallest diagonals
288  const Real min = std::min(d06, std::min(d35, std::min(d17, d24)));
289  const Real max = std::max(d06, std::max(d35, std::max(d17, d24)));
290 
291  libmesh_assert_not_equal_to (max, 0.0);
292 
293  return min / max;
294 
295  break;
296  }
297 
302  case TAPER:
303  {
304 
308  const Real d01 = this->length(0,1);
309  const Real d12 = this->length(1,2);
310  const Real d23 = this->length(2,3);
311  const Real d03 = this->length(0,3);
312  const Real d45 = this->length(4,5);
313  const Real d56 = this->length(5,6);
314  const Real d67 = this->length(6,7);
315  const Real d47 = this->length(4,7);
316  const Real d04 = this->length(0,4);
317  const Real d15 = this->length(1,5);
318  const Real d37 = this->length(3,7);
319  const Real d26 = this->length(2,6);
320 
321  std::vector<Real> edge_ratios(12);
322  // Front
323  edge_ratios[0] = std::min(d01, d45) / std::max(d01, d45);
324  edge_ratios[1] = std::min(d04, d15) / std::max(d04, d15);
325 
326  // Right
327  edge_ratios[2] = std::min(d15, d26) / std::max(d15, d26);
328  edge_ratios[3] = std::min(d12, d56) / std::max(d12, d56);
329 
330  // Back
331  edge_ratios[4] = std::min(d67, d23) / std::max(d67, d23);
332  edge_ratios[5] = std::min(d26, d37) / std::max(d26, d37);
333 
334  // Left
335  edge_ratios[6] = std::min(d04, d37) / std::max(d04, d37);
336  edge_ratios[7] = std::min(d03, d47) / std::max(d03, d47);
337 
338  // Bottom
339  edge_ratios[8] = std::min(d01, d23) / std::max(d01, d23);
340  edge_ratios[9] = std::min(d03, d12) / std::max(d03, d12);
341 
342  // Top
343  edge_ratios[10] = std::min(d45, d67) / std::max(d45, d67);
344  edge_ratios[11] = std::min(d56, d47) / std::max(d56, d47);
345 
346  return *(std::min_element(edge_ratios.begin(), edge_ratios.end())) ;
347 
348  break;
349  }
350 
351 
356  case STRETCH:
357  {
358  const Real sqrt3 = 1.73205080756888;
359 
363  const Real d06 = this->length(0,6);
364  const Real d17 = this->length(1,7);
365  const Real d35 = this->length(3,5);
366  const Real d24 = this->length(2,4);
367  const Real max_diag = std::max(d06, std::max(d17, std::max(d35, d24)));
368 
369  libmesh_assert_not_equal_to ( max_diag, 0.0 );
370 
374  std::vector<Real> edges(12);
375  edges[0] = this->length(0,1);
376  edges[1] = this->length(1,2);
377  edges[2] = this->length(2,3);
378  edges[3] = this->length(0,3);
379  edges[4] = this->length(4,5);
380  edges[5] = this->length(5,6);
381  edges[6] = this->length(6,7);
382  edges[7] = this->length(4,7);
383  edges[8] = this->length(0,4);
384  edges[9] = this->length(1,5);
385  edges[10] = this->length(2,6);
386  edges[11] = this->length(3,7);
387 
388  const Real min_edge = *(std::min_element(edges.begin(), edges.end()));
389  return sqrt3 * min_edge / max_diag ;
390  break;
391  }
392 
393 
398  default:
399  {
400  return Elem::quality(q);
401  }
402  }
403 
404 
405  // Will never get here...
406  libmesh_error();
407  return 0.;
408 }
const Elem * libMesh::Elem::reference_elem ( ) const
inherited
Returns
a pointer to the "reference element" associated with this element. The reference element is the image of this element in reference parametric space. Importantly, it is not an actual element in the mesh, but rather a Singleton-type object, so for example all Quad4 elements share the same reference_elem().

Definition at line 376 of file elem.C.

References libMesh::ReferenceElem::get(), and libMesh::Elem::type().

377 {
378  return &(ReferenceElem::get(this->type()));
379 }
void libMesh::Elem::refine ( MeshRefinement mesh_refinement)
virtualinherited

Refine the element.

The following functions only apply when AMR is enabled and thus are not present otherwise.

Definition at line 41 of file elem_refinement.C.

References libMesh::Elem::_children, libMesh::Elem::active(), libMesh::MeshRefinement::add_elem(), libMesh::MeshRefinement::add_point(), libMesh::Elem::ancestor(), libMesh::Elem::build(), libMesh::Elem::child(), libMesh::Elem::embedding_matrix(), libMesh::Elem::get_node(), libMesh::Elem::hmin(), libMesh::Elem::INACTIVE, libMesh::Elem::JUST_REFINED, libMesh::libmesh_assert(), libMesh::Elem::n_children(), libMesh::Elem::n_nodes(), libMesh::DofObject::n_systems(), libMesh::Elem::p_level(), libMesh::Elem::p_refinement_flag(), libMesh::Elem::parent(), libMesh::Elem::point(), libMesh::DofObject::processor_id(), libMesh::Real, libMesh::Elem::REFINE, libMesh::Elem::refinement_flag(), libMesh::DofObject::set_n_systems(), libMesh::Elem::set_node(), libMesh::Elem::set_p_level(), libMesh::Elem::set_p_refinement_flag(), libMesh::Elem::set_refinement_flag(), libMesh::Elem::subactive(), libMesh::TOLERANCE, and libMesh::Elem::type().

42 {
43  libmesh_assert_equal_to (this->refinement_flag(), Elem::REFINE);
44  libmesh_assert (this->active());
45 
46  // Create my children if necessary
47  if (!_children)
48  {
49  _children = new Elem*[this->n_children()];
50 
51  unsigned int parent_p_level = this->p_level();
52  for (unsigned int c=0; c<this->n_children(); c++)
53  {
54  _children[c] = Elem::build(this->type(), this).release();
56  _children[c]->set_p_level(parent_p_level);
58  }
59 
60  // Compute new nodal locations
61  // and asssign nodes to children
62  // Make these static. It is unlikely the
63  // sizes will change from call to call, so having these
64  // static should save on reallocations
65  std::vector<std::vector<Point> > p (this->n_children());
66  std::vector<std::vector<Node*> > nodes(this->n_children());
67 
68 
69  // compute new nodal locations
70  for (unsigned int c=0; c<this->n_children(); c++)
71  {
72  Elem *current_child = this->child(c);
73  p[c].resize (current_child->n_nodes());
74  nodes[c].resize(current_child->n_nodes());
75 
76  for (unsigned int nc=0; nc<current_child->n_nodes(); nc++)
77  {
78  // zero entries
79  p[c][nc].zero();
80  nodes[c][nc] = NULL;
81 
82  for (unsigned int n=0; n<this->n_nodes(); n++)
83  {
84  // The value from the embedding matrix
85  const float em_val = this->embedding_matrix(c,nc,n);
86 
87  if (em_val != 0.)
88  {
89  p[c][nc].add_scaled (this->point(n), em_val);
90 
91  // We may have found the node, in which case we
92  // won't need to look it up later.
93  if (em_val == 1.)
94  nodes[c][nc] = this->get_node(n);
95  }
96  }
97  }
98 
99  // assign nodes to children & add them to the mesh
100  const Real pointtol = this->hmin() * TOLERANCE;
101  for (unsigned int nc=0; nc<current_child->n_nodes(); nc++)
102  {
103  if (nodes[c][nc] != NULL)
104  {
105  current_child->set_node(nc) = nodes[c][nc];
106  }
107  else
108  {
109  current_child->set_node(nc) =
110  mesh_refinement.add_point(p[c][nc],
111  current_child->processor_id(),
112  pointtol);
113  current_child->get_node(nc)->set_n_systems
114  (this->n_systems());
115  }
116  }
117 
118  mesh_refinement.add_elem (current_child);
119  current_child->set_n_systems(this->n_systems());
120  }
121  }
122  else
123  {
124  unsigned int parent_p_level = this->p_level();
125  for (unsigned int c=0; c<this->n_children(); c++)
126  {
127  Elem *current_child = this->child(c);
128  libmesh_assert(current_child->subactive());
129  current_child->set_refinement_flag(Elem::JUST_REFINED);
130  current_child->set_p_level(parent_p_level);
131  current_child->set_p_refinement_flag(this->p_refinement_flag());
132  }
133  }
134 
135  // Un-set my refinement flag now
138 
139  for (unsigned int c=0; c<this->n_children(); c++)
140  {
141  libmesh_assert_equal_to (this->child(c)->parent(), this);
142  libmesh_assert(this->child(c)->active());
143  }
144  libmesh_assert (this->ancestor());
145 }
Elem::RefinementState libMesh::Elem::refinement_flag ( ) const
inlineinherited

Returns the value of the refinement flag for the element.

Definition at line 1846 of file elem.h.

References libMesh::Elem::_rflag.

Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::MeshRefinement::_refine_elements(), libMesh::Elem::active(), libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::coarsen(), libMesh::MeshRefinement::coarsen_elements(), libMesh::Elem::contract(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::Elem::get_info(), libMesh::MeshTools::libmesh_assert_old_dof_objects(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_flags(), libMesh::MeshTools::libmesh_assert_valid_refinement_flags(), libMesh::MeshRefinement::limit_level_mismatch_at_edge(), libMesh::MeshRefinement::limit_level_mismatch_at_node(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::MeshRefinement::make_flags_parallel_consistent(), libMesh::Elem::make_links_to_me_local(), libMesh::MeshRefinement::make_refinement_compatible(), libMesh::DofMap::old_dof_indices(), libMesh::Parallel::pack(), libMesh::Elem::PackedElem::pack(), libMesh::Elem::refine(), libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::MeshRefinement::refine_elements(), libMesh::DofMap::reinit(), libMesh::HPSingularity::select_refinement(), libMesh::HPCoarsenTest::select_refinement(), libMesh::MeshRefinement::test_unflagged(), libMesh::Parallel::unpack(), and libMesh::Elem::PackedElem::unpack().

1847 {
1848  return static_cast<RefinementState>(_rflag);
1849 }
void libMesh::Elem::replace_child ( Elem elem,
unsigned int  c 
)
inherited

Replaces the child pointer at the specified index in the array of children of this element.

Definition at line 1406 of file elem.C.

References libMesh::Elem::child(), libMesh::Elem::has_children(), libMesh::libmesh_assert(), and libMesh::Elem::set_child().

Referenced by libMesh::UnstructuredMesh::all_first_order().

1407 {
1408  libmesh_assert(this->has_children());
1409 
1410  libmesh_assert(this->child(c));
1411 
1412  this->set_child(c, elem);
1413 }
unsigned short int libMesh::Hex20::second_order_adjacent_vertex ( const unsigned int  n,
const unsigned int  v 
) const
virtual
Returns
the element-local number of the $ v^{th} $ vertex that defines the $ n^{th} $ second-order node. Note that n is counted as depicted above, $ 8 \le n < 20 $.

Reimplemented from libMesh::Elem.

Definition at line 343 of file cell_hex20.C.

References libMesh::Hex::_second_order_adjacent_vertices, n_nodes(), and libMesh::Hex::n_vertices().

345 {
346  libmesh_assert_greater_equal (n, this->n_vertices());
347  libmesh_assert_less (n, this->n_nodes());
348  libmesh_assert_less (v, 2);
349  /*
350  * the _second_order_adjacent_vertices matrix is
351  * stored in cell_hex.C, since this matrix is identical
352  * for Hex20 and Hex27 (for the first 12 higher-order nodes)
353  */
354  return _second_order_adjacent_vertices[n-this->n_vertices()][v];
355 }
std::pair< unsigned short int, unsigned short int > libMesh::Hex20::second_order_child_vertex ( const unsigned int  n) const
virtual
Returns
the child number c and element-local index v of the $ n^{th} $ second-order node on the parent element. Note that the return values are always less this->n_children() and this->child(c)->n_vertices(), while n has to be greater or equal to * this->n_vertices(). For linear elements this returns 0,0. On refined second order elements, the return value will satisfy this->get_node(n)==this->child(c)->get_node(v)

Reimplemented from libMesh::Elem.

Definition at line 360 of file cell_hex20.C.

References libMesh::Hex::_second_order_vertex_child_index, libMesh::Hex::_second_order_vertex_child_number, n_nodes(), and libMesh::Hex::n_vertices().

361 {
362  libmesh_assert_greater_equal (n, this->n_vertices());
363  libmesh_assert_less (n, this->n_nodes());
364  /*
365  * the _second_order_vertex_child_* vectors are
366  * stored in cell_hex.C, since they are identical
367  * for Hex20 and Hex27 (for the first 12 higher-order nodes)
368  */
369  return std::pair<unsigned short int, unsigned short int>
372 }
ElemType libMesh::Elem::second_order_equivalent_type ( const ElemType  et,
const bool  full_ordered = true 
)
staticinherited
Returns
the element type of the associated second-order element, e.g. when this is a TET4, then TET10 is returned. Returns INVALID_ELEM for second order or other elements that should not or cannot be converted into higher order equivalents.

For some elements, there exist two second-order equivalents, e.g. for Quad4 there is Quad8 and Quad9. When the optional full_ordered is true, then QUAD9 is returned. When full_ordered is false, then QUAD8 is returned.

Definition at line 2060 of file elem.C.

References libMeshEnums::EDGE2, libMeshEnums::EDGE3, libMeshEnums::HEX20, libMeshEnums::HEX27, libMeshEnums::HEX8, libMeshEnums::INFEDGE2, libMeshEnums::INFHEX16, libMeshEnums::INFHEX18, libMeshEnums::INFHEX8, libMeshEnums::INFPRISM12, libMeshEnums::INFPRISM6, libMeshEnums::INFQUAD4, libMeshEnums::INFQUAD6, libMeshEnums::INVALID_ELEM, libMeshEnums::PRISM15, libMeshEnums::PRISM18, libMeshEnums::PRISM6, libMeshEnums::PYRAMID14, libMeshEnums::PYRAMID5, libMeshEnums::QUAD4, libMeshEnums::QUAD8, libMeshEnums::QUAD9, libMeshEnums::TET10, libMeshEnums::TET4, libMeshEnums::TRI3, and libMeshEnums::TRI6.

Referenced by libMesh::UnstructuredMesh::all_second_order().

2062 {
2063  /* for second-order elements, always return \p INVALID_ELEM
2064  * since second-order elements should not be converted
2065  * into something else. Only linear elements should
2066  * return something sensible here
2067  */
2068  switch (et)
2069  {
2070  case EDGE2:
2071  {
2072  // full_ordered not relevant
2073  return EDGE3;
2074  }
2075 
2076  case TRI3:
2077  {
2078  // full_ordered not relevant
2079  return TRI6;
2080  }
2081 
2082  case QUAD4:
2083  {
2084  if (full_ordered)
2085  return QUAD9;
2086  else
2087  return QUAD8;
2088  }
2089 
2090  case TET4:
2091  {
2092  // full_ordered not relevant
2093  return TET10;
2094  }
2095 
2096  case HEX8:
2097  {
2098  // see below how this correlates with INFHEX8
2099  if (full_ordered)
2100  return HEX27;
2101  else
2102  return HEX20;
2103  }
2104 
2105  case PRISM6:
2106  {
2107  if (full_ordered)
2108  return PRISM18;
2109  else
2110  return PRISM15;
2111  }
2112 
2113  case PYRAMID5:
2114  {
2115  if (full_ordered)
2116  return PYRAMID14;
2117  else // PYRAMID13 to be added...
2118  libmesh_error();
2119 
2120  return INVALID_ELEM;
2121  }
2122 
2123 
2124 
2125 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
2126 
2127  // infinite elements
2128  case INFEDGE2:
2129  {
2130  // libmesh_error();
2131  return INVALID_ELEM;
2132  }
2133 
2134  case INFQUAD4:
2135  {
2136  // full_ordered not relevant
2137  return INFQUAD6;
2138  }
2139 
2140  case INFHEX8:
2141  {
2142  /*
2143  * Note that this matches with \p Hex8:
2144  * For full-ordered, \p InfHex18 and \p Hex27
2145  * belong together, and for not full-ordered,
2146  * \p InfHex16 and \p Hex20 belong together.
2147  */
2148  if (full_ordered)
2149  return INFHEX18;
2150  else
2151  return INFHEX16;
2152  }
2153 
2154  case INFPRISM6:
2155  {
2156  // full_ordered not relevant
2157  return INFPRISM12;
2158  }
2159 
2160 #endif
2161 
2162 
2163  default:
2164  {
2165  // second-order element
2166  return INVALID_ELEM;
2167  }
2168  }
2169 }
void libMesh::DofObject::set_buffer ( const std::vector< dof_id_type > &  buf)
inlineinherited

Definition at line 491 of file dof_object.h.

References libMesh::DofObject::_idx_buf.

492  { _idx_buf = buf; }
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 407 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().

411 {
412  libmesh_assert_less (s, this->n_systems());
413  libmesh_assert_less (var, this->n_vars(s));
414  libmesh_assert_less (comp, this->n_comp(s,var));
415 
416  const unsigned int
417  vg = this->var_to_vg(s,var),
418  ncg = this->n_comp_group(s,vg),
419  vig = this->system_var_to_vg_var(s,vg,var),
420  start_idx_sys = this->start_idx(s);
421 
422  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());
423 
424  dof_id_type &base_idx = _idx_buf[start_idx_sys + 2*vg + 1];
425 
426  // We intend to change all dof numbers together or not at all
427  if (comp || vig)
428  libmesh_assert ((dn == invalid_id && base_idx == invalid_id) ||
429  (dn == base_idx + vig*ncg + comp));
430 
431  // only explicitly store the base index for vig==0, comp==0
432  else
433  base_idx = dn;
434 
435 // #ifdef DEBUG
436 // libMesh::out << " [ ";
437 // for (unsigned int i=0; i<_idx_buf.size(); i++)
438 // libMesh::out << _idx_buf[i] << " ";
439 // libMesh::out << "]\n";
440 // #endif
441 
442  libmesh_assert_equal_to (this->dof_number(s, var, comp), dn);
443 }
dof_id_type & libMesh::DofObject::set_id ( )
inlineinherited
void libMesh::DofObject::set_id ( const dof_id_type  dofid)
inlineinherited

Sets the id for this DofObject

Definition at line 161 of file dof_object.h.

References libMesh::DofObject::set_id().

162  { this->set_id() = dofid; }
void libMesh::Elem::set_interior_parent ( Elem p)
inlineinherited

Sets the pointer to the element's interior_parent. Dangerous to use in high-level code.

Definition at line 1742 of file elem.h.

References libMesh::Elem::_elemlinks, libMesh::Elem::dim(), libMesh::libmesh_assert(), and libMesh::Elem::n_sides().

Referenced by libMesh::BoundaryInfo::sync().

1743 {
1744  // interior parents make no sense for full-dimensional elements.
1745  libmesh_assert_less (this->dim(), LIBMESH_DIM);
1746 
1747  // this had better be a one-higher-dimensional interior element
1748  libmesh_assert (!p ||
1749  p->dim() == (this->dim()+1));
1750 
1751  _elemlinks[1+this->n_sides()] = p;
1752 }
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 340 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().

343 {
344  libmesh_assert_less (s, this->n_systems());
345  libmesh_assert_less (var, this->n_vars(s));
346 
347  this->set_n_comp_group(s, this->var_to_vg(s,var), ncomp);
348 }
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 352 of file dof_object.C.

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

Referenced by libMesh::DofMap::reinit(), libMesh::DofObject::set_n_comp(), libMesh::DofObject::set_n_vars_per_group(), and libMesh::DofMap::set_nonlocal_dof_objects().

355 {
356  libmesh_assert_less (s, this->n_systems());
357  libmesh_assert_less (vg, this->n_var_groups(s));
358 
359  // Check for trivial return
360  if (ncomp == this->n_comp_group(s,vg)) return;
361 
362 #ifndef NDEBUG
363  if (ncomp >= ncv_magic)
364  {
365  const index_t ncvm = ncv_magic;
366  libMesh::err << "ERROR: ncomp must be less than DofObject::ncv_magic!\n"
367  << "ncomp = " << ncomp << ", ncv_magic = " << ncvm
368  << "\nrecompile and try again!\n";
369  libmesh_error();
370  }
371 #endif
372 
373  const unsigned int
374  start_idx_sys = this->start_idx(s),
375  n_vars_group = this->n_vars(s,vg),
376  base_offset = start_idx_sys + 2*vg;
377 
378  libmesh_assert_less ((base_offset + 1), _idx_buf.size());
379 
380  // if (ncomp)
381  // libMesh::out << "s,vg,ncomp="
382  // << s << ","
383  // << vg << ","
384  // << ncomp << '\n';
385 
386  // set the number of components, maintaining the number
387  // of variables in the group
388  _idx_buf[base_offset] = ncv_magic*n_vars_group + ncomp;
389 
390  // We use (invalid_id - 1) to signify no
391  // components for this object
392  _idx_buf[base_offset + 1] = (ncomp == 0) ? invalid_id - 1 : invalid_id;
393 
394  // this->debug_buffer();
395  // libMesh::out << "s,vg = " << s << "," << vg << '\n'
396  // << "base_offset=" << base_offset << '\n'
397  // << "this->n_comp(s,vg)=" << this->n_comp(s,vg) << '\n'
398  // << "this->n_comp_group(s,vg)=" << this->n_comp_group(s,vg) << '\n'
399  // << "this->n_vars(s,vg)=" << this->n_vars(s,vg) << '\n'
400  // << "this->n_var_groups(s)=" << this->n_var_groups(s) << '\n';
401 
402  libmesh_assert_equal_to (ncomp, this->n_comp_group(s,vg));
403 }
void libMesh::DofObject::set_n_systems ( const unsigned int  s)
inherited

Sets the number of systems for this DofObject

Definition at line 159 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(), and libMesh::Elem::refine().

160 {
161  // Check for trivial return
162  if (ns == this->n_systems())
163  return;
164 
165  // Clear any existing data. This is safe to call
166  // even if we don't have any data.
167  this->clear_dofs();
168 
169  // Set the new number of systems
170  _idx_buf.resize(ns, ns);
171  _idx_buf[0] = ns;
172 
173 
174 #ifdef DEBUG
175 
176  // check that all systems now exist and that they have 0 size
177  libmesh_assert_equal_to (ns, this->n_systems());
178  for (unsigned int s=0; s<this->n_systems(); s++)
179  {
180  libmesh_assert_equal_to (this->n_vars(s), 0);
181  libmesh_assert_equal_to (this->n_var_groups(s), 0);
182  }
183 
184 #endif
185 }
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 salso 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 221 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().

223 {
224 
225  libmesh_assert_less (s, this->n_systems());
226 
227  // number of varaible groups for this system - inferred
228  const unsigned int nvg = libmesh_cast_int<unsigned int>(nvpg.size());
229 
230  // BSK - note that for compatibility with the previous implementation
231  // calling this method when (nvars == this->n_vars()) requires that
232  // we invalidate the DOF indices and set the number of components to 0.
233  // Note this was a bit of a suprise to me - there was no quick return in
234  // the old method, which caused removal and readdition of the DOF indices
235  // even in the case of (nvars == this->n_vars()), resulting in n_comp(s,v)
236  // implicitly becoming 0 regardless of any previous value.
237  // quick return?
238  if (nvg == this->n_var_groups(s))
239  {
240  for (unsigned int vg=0; vg<nvg; vg++)
241  {
242  this->set_n_comp_group(s,vg,0);
243  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
244  }
245  return;
246  }
247 
248  // since there is ample opportunity to screw up other systems, let us
249  // cache their current sizes and later assert that they are unchanged.
250 #ifdef DEBUG
251  DofObject::index_buffer_t old_system_sizes;
252  old_system_sizes.reserve(this->n_systems());
253 
254  for (unsigned int s_ctr=0; s_ctr<this->n_systems(); s_ctr++)
255  old_system_sizes.push_back(this->n_var_groups(s_ctr));
256 #endif
257 
258  // remove current indices if we have some
259  if (this->n_var_groups(s) != 0)
260  {
261  const unsigned int old_nvg_s = this->n_var_groups(s);
262 
263  DofObject::index_buffer_t::iterator
264  it = _idx_buf.begin(),
265  end = _idx_buf.begin();
266 
267  std::advance(it, this->start_idx(s));
268  std::advance(end, this->end_idx(s));
269  _idx_buf.erase(it,end);
270 
271  for (unsigned int ctr=(s+1); ctr<this->n_systems(); ctr++)
272  _idx_buf[ctr] -= 2*old_nvg_s;
273  }
274 
275  // better not have any now!
276  libmesh_assert_equal_to (this->n_var_groups(s), 0);
277 
278  // had better not screwed up any of our sizes!
279 #ifdef DEBUG
280  for (unsigned int s_ctr=0; s_ctr<this->n_systems(); s_ctr++)
281  if (s_ctr != s)
282  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
283 #endif
284 
285  // OK, if the user requested 0 that is what we have
286  if (nvg == 0)
287  return;
288 
289  {
290  // array to hold new indices
291  DofObject::index_buffer_t var_idxs(2*nvg);
292  for (unsigned int vg=0; vg<nvg; vg++)
293  {
294  var_idxs[2*vg ] = ncv_magic*nvpg[vg] + 0;
295  var_idxs[2*vg + 1] = invalid_id - 1;
296  }
297 
298  DofObject::index_buffer_t::iterator it = _idx_buf.begin();
299  std::advance(it, this->end_idx(s));
300  _idx_buf.insert(it, var_idxs.begin(), var_idxs.end());
301 
302  for (unsigned int ctr=(s+1); ctr<this->n_systems(); ctr++)
303  _idx_buf[ctr] += 2*nvg;
304 
305  // resize _idx_buf to fit so no memory is wasted.
307  }
308 
309  // that better had worked. Assert stuff.
310  libmesh_assert_equal_to (nvg, this->n_var_groups(s));
311 
312 #ifdef DEBUG
313 
314  // libMesh::out << " [ ";
315  // for (unsigned int i=0; i<_idx_buf.size(); i++)
316  // libMesh::out << _idx_buf[i] << " ";
317  // libMesh::out << "]\n";
318 
319  libmesh_assert_equal_to (this->n_var_groups(s), nvpg.size());
320 
321  for (unsigned int vg=0; vg<this->n_var_groups(s); vg++)
322  {
323  libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
324  libmesh_assert_equal_to (this->n_comp_group(s,vg), 0);
325  }
326 
327  for (unsigned int v=0; v<this->n_vars(s); v++)
328  libmesh_assert_equal_to (this->n_comp(s,v), 0);
329 
330  // again, all other system sizes shoudl be unchanged!
331  for (unsigned int s_ctr=0; s_ctr<this->n_systems(); s_ctr++)
332  if (s_ctr != s)
333  libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
334 
335 #endif
336 }
Node *& libMesh::Elem::set_node ( const unsigned int  i)
inlinevirtualinherited
Returns
the pointer to local Node i as a writeable reference.

Reimplemented in libMesh::RemoteElem.

Definition at line 1420 of file elem.h.

References libMesh::Elem::_nodes, and libMesh::Elem::n_nodes().

Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::TetGenMeshInterface::assign_nodes_to_elem(), libMesh::MeshTools::Generation::build_cube(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::InfElemBuilder::build_inf_elem(), libMesh::Edge::build_side(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::UnstructuredMesh::create_submesh(), libMesh::UNVIO::element_in(), libMesh::MeshTools::Modification::flatten(), libMesh::ExodusII_IO::read(), libMesh::Nemesis_IO::read(), libMesh::VTKIO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::AbaqusIO::read_elements(), libMesh::UCDIO::read_implementation(), libMesh::GmshIO::read_mesh(), libMesh::LegacyXdrIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::OFFIO::read_stream(), libMesh::MatlabIO::read_stream(), libMesh::Elem::refine(), libMesh::RemoteElem::set_node(), libMesh::Tet::side(), libMesh::Prism::side(), libMesh::Pyramid::side(), libMesh::Hex::side(), libMesh::Tri::side(), libMesh::InfHex::side(), libMesh::InfPrism::side(), libMesh::Quad::side(), libMesh::InfQuad::side(), libMesh::Edge::side(), libMesh::SerialMesh::stitching_helper(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::unpack(), and libMesh::Elem::PackedElem::unpack().

1421 {
1422  libmesh_assert_less (i, this->n_nodes());
1423 
1424  return _nodes[i];
1425 }
void libMesh::DofObject::set_old_dof_object ( )
inherited

Sets the old_dof_object to a copy of this

Definition at line 144 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().

145 {
146  this->clear_old_dof_object();
147 
149 
150  // Make a new DofObject, assign a copy of \p this.
151  // Make sure the copy ctor for DofObject works!!
152  this->old_dof_object = new DofObject(*this);
153 }
void libMesh::Elem::set_p_level ( const unsigned int  p)
inlineinherited

Sets the value of the p refinement level for the element Note that the maximum p refinement level is currently 255

Definition at line 1896 of file elem.h.

References libMesh::Elem::_p_level, libMesh::Elem::child(), std::min(), libMesh::Elem::n_children(), libMesh::Elem::p_level(), libMesh::Elem::parent(), and libMesh::Elem::set_p_level().

Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::MeshRefinement::_refine_elements(), libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::coarsen(), libMesh::Elem::Elem(), libMesh::Elem::refine(), libMesh::DofMap::reinit(), libMesh::Elem::set_p_level(), libMesh::Parallel::unpack(), and libMesh::Elem::PackedElem::unpack().

1897 {
1898  // Maintain the parent's p level as the minimum of it's children
1899  if (this->parent() != NULL)
1900  {
1901  unsigned int parent_p_level = this->parent()->p_level();
1902 
1903  // If our new p level is less than our parents, our parents drops
1904  if (parent_p_level > p)
1905  {
1906  this->parent()->set_p_level(p);
1907  }
1908  // If we are the lowest p level and it increases, so might
1909  // our parent's, but we have to check every other child to see
1910  else if (parent_p_level == _p_level && _p_level < p)
1911  {
1912  _p_level = libmesh_cast_int<unsigned char>(p);
1913  parent_p_level = libmesh_cast_int<unsigned char>(p);
1914  for (unsigned int c=0; c != this->parent()->n_children(); c++)
1915  parent_p_level = std::min(parent_p_level,
1916  this->parent()->child(c)->p_level());
1917 
1918  if (parent_p_level != this->parent()->p_level())
1919  this->parent()->set_p_level(parent_p_level);
1920 
1921  return;
1922  }
1923  }
1924 
1925  _p_level = libmesh_cast_int<unsigned char>(p);
1926 }
void libMesh::Elem::set_parent ( Elem p)
inlineinherited

Sets the pointer to the element's parent. Dangerous to use in high-level code.

Definition at line 1692 of file elem.h.

References libMesh::Elem::_elemlinks.

Referenced by libMesh::UnstructuredMesh::all_first_order(), and libMesh::BoundaryInfo::sync().

1693 {
1694  _elemlinks[0] = p;
1695 }
unique_id_type & libMesh::DofObject::set_unique_id ( )
inlineinherited
Returns
the globally unique_id for this DofObject as a writeable reference.

Definition at line 641 of file dof_object.h.

References libMesh::DofObject::_unique_id.

Referenced by libMesh::SerialMesh::add_elem(), libMesh::ParallelMesh::add_elem(), libMesh::SerialMesh::add_node(), libMesh::ParallelMesh::add_node(), libMesh::CheckpointIO::read_connectivity(), libMesh::CheckpointIO::read_nodes(), libMesh::XdrIO::read_serialized_connectivity(), and libMesh::Parallel::unpack().

642 {
643 #ifdef LIBMESH_ENABLE_UNIQUE_ID
644  return _unique_id;
645 #else
646  libmesh_error();
647 #endif
648 }
void libMesh::DofObject::set_vg_dof_base ( const unsigned int  s,
const unsigned int  vg,
const dof_id_type  db 
)
inlineinherited

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

Definition at line 881 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(), and libMesh::DofMap::set_nonlocal_dof_objects().

884 {
885  libmesh_assert_less (s, this->n_systems());
886  libmesh_assert_less (vg, this->n_var_groups(s));
887 
888  const unsigned int
889  start_idx_sys = this->start_idx(s);
890 
891  libmesh_assert_less ((start_idx_sys + 2*vg + 1),