$extrastylesheet
libMesh::Tri3Subdivision Class Reference

#include <face_tri3_subdivision.h>

Inheritance diagram for libMesh::Tri3Subdivision:

List of all members.

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

 Tri3Subdivision ()
 Tri3Subdivision (Elem *p)
ElemType type () const
virtual bool has_affine_map () const
virtual bool is_linear () const
Order default_order () const
void prepare_subdivision_properties ()
bool is_subdivision_updated () const
Nodeget_ordered_node (unsigned int node_id) const
unsigned int get_ordered_valence (unsigned int node_id) const
unsigned int local_node_number (unsigned int node_id) const
bool is_ghost () const
void set_ghost (bool ghosted)
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
UniquePtr< Elembuild_side (const unsigned int i, bool proxy) const
virtual void connectivity (const unsigned int sf, const IOPackage iop, std::vector< dof_id_type > &conn) const
virtual Real volume () const
std::pair< Real, Realmin_and_max_angle () const
unsigned int n_nodes () const
unsigned int n_sides () const
unsigned int n_vertices () const
unsigned int n_edges () const
unsigned int n_children () const
virtual bool is_child_on_side (const unsigned int c, const unsigned int s) const
dof_id_type key (const unsigned int s) const
UniquePtr< 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
unsigned int n_faces () const
UniquePtr< Elembuild_edge (const unsigned int i) const
virtual bool is_edge_on_side (const unsigned int e, const unsigned int s) const
bool infinite () const
const Pointpoint (const unsigned int i) const
Pointpoint (const unsigned int i)
dof_id_type node (const unsigned int i) const
unsigned int local_node (const dof_id_type i) const
unsigned int get_node_index (const Node *node_ptr) const
const Node *const * get_nodes () const
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 unsigned int opposite_side (const unsigned int s) const
virtual unsigned int opposite_node (const unsigned int n, const unsigned int s) const
virtual Point centroid () const
virtual Real hmin () const
virtual Real hmax () const
virtual bool contains_point (const Point &p, Real tol=TOLERANCE) const
virtual bool close_to_point (const Point &p, Real tol) 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
virtual unsigned int n_second_order_adjacent_vertices (const unsigned int n) const
virtual 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 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
void nullify_neighbors ()
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 UniquePtr< 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 [3][2]
static const subdomain_id_type invalid_subdomain_id = std::numeric_limits<subdomain_id_type>::max()
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 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 [3]
Elem_elemlinks_data [4+(LIBMESH_DIM >2)]
Node ** _nodes
Elem ** _elemlinks
Elem ** _children
subdomain_id_type _sbd_id
unsigned char _rflag
unsigned char _pflag
unsigned char _p_level

Static Protected Attributes

static const float _embedding_matrix [4][3][3]
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

Private Attributes

Node_ordered_nodes [3]
bool _subdivision_updated
bool _is_ghost

Detailed Description

The Tri3 is an element in 2D composed of 3 nodes.

Definition at line 35 of file face_tri3_subdivision.h.


Member Typedef Documentation

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

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 [protected, inherited]

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 1087 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 845 of file elem.h.


Constructor & Destructor Documentation

Constructor without parent specification.

Definition at line 42 of file face_tri3_subdivision.h.

                    :
    Tri3(), _subdivision_updated(false), _is_ghost(false) {}

Constructor with parent specification.

Definition at line 32 of file face_tri3_subdivision.C.

References _is_ghost, _ordered_nodes, libMesh::TRI3SUBDIVISION, and libMesh::Elem::type().

                                        : Tri3(p), _subdivision_updated(true)
{
  if (p)
    {
      libmesh_assert_equal_to(p->type(), TRI3SUBDIVISION);
      Tri3Subdivision* sd_elem = static_cast<Tri3Subdivision*>(p);
      _is_ghost = sd_elem->is_ghost();

      if (!_is_ghost)
        {
          _ordered_nodes[0] = sd_elem->get_ordered_node(0);
          _ordered_nodes[1] = sd_elem->get_ordered_node(1);
          _ordered_nodes[2] = sd_elem->get_ordered_node(2);
        }
    }
}

Member Function Documentation

bool libMesh::Elem::active ( ) const [inline, inherited]
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 1594 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::DofMap::_dof_indices(), 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< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::UnstructuredMesh::contract(), libMesh::Elem::contract(), libMesh::DofMap::dof_indices(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::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::MeshTools::find_nodal_neighbors(), libMesh::Elem::find_point_neighbors(), libMesh::MeshRefinement::flag_elements_by_nelem_target(), 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::PointLocatorTree::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(), and libMesh::DivaIO::write_stream().

{
#ifdef LIBMESH_ENABLE_AMR
  if ((this->refinement_flag() == INACTIVE) ||
      (this->refinement_flag() == COARSEN_INACTIVE))
    return false;
  else
    return true;
#else
  return true;
#endif
}
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 1460 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().

{
  // The "family tree" doesn't include subactive elements
  libmesh_assert(!this->subactive());

  // Clear the vector if the flag reset tells us to.
  if (reset)
    active_family.clear();

  // Add this element to the family tree if it is active
  if (this->active())
    active_family.push_back(this);

  // Otherwise recurse into the element's children.
  // Do not clear the vector any more.
  else
    for (unsigned int c=0; c<this->n_children(); c++)
      if (!this->child(c)->is_remote())
        this->child(c)->active_family_tree (active_family, false);
}
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 1615 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()().

{
  // The "family tree" doesn't include subactive elements
  libmesh_assert(!this->subactive());

  // Clear the vector if the flag reset tells us to.
  if (reset)
    family.clear();

  // This only makes sense if we're already a neighbor
  if (this->level() >= neighbor_in->level())
    libmesh_assert (this->has_neighbor(neighbor_in));

  // Add an active element to the family tree.
  if (this->active())
    family.push_back(this);

  // Or recurse into an ancestor element's children.
  // Do not clear the vector any more.
  else if (!this->active())
    for (unsigned int c=0; c<this->n_children(); c++)
      {
        Elem *current_child = this->child(c);
        if (current_child != remote_elem && current_child->has_neighbor(neighbor_in))
          current_child->active_family_tree_by_neighbor (family, neighbor_in, false);
      }
}
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 1510 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_active_side_list(), libMesh::BoundaryInfo::build_node_list_from_side_list(), libMesh::ExodusII_IO_Helper::write_sidesets(), and libMesh::Nemesis_IO_Helper::write_sidesets().

{
  // The "family tree" doesn't include subactive elements
  libmesh_assert(!this->subactive());

  // Clear the vector if the flag reset tells us to.
  if (reset)
    family.clear();

  libmesh_assert_less (s, this->n_sides());

  // Add an active element to the family tree.
  if (this->active())
    family.push_back(this);

  // Or recurse into an ancestor element's children.
  // Do not clear the vector any more.
  else
    for (unsigned int c=0; c<this->n_children(); c++)
      if (!this->child(c)->is_remote() && this->is_child_on_side(c, s))
        this->child(c)->active_family_tree_by_side (family, s, false);
}
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 1347 of file elem.C.

References libMesh::Elem::_children, 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::LegacyXdrIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), and libMesh::Parallel::unpack().

{
  if(_children == NULL)
    {
      _children = new Elem*[this->n_children()];

      for (unsigned int c=0; c<this->n_children(); c++)
        this->set_child(c, NULL);
    }

  for (unsigned int c=0; c<this->n_children(); c++)
    {
      if(this->_children[c] == NULL || this->_children[c] == remote_elem)
        {
          libmesh_assert_equal_to (this, elem->parent());
          this->set_child(c, elem);
          return;
        }
    }

  libmesh_error_msg("Error: Tried to add a child to an element with full children array");
}
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 1372 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().

{
  if(!this->has_children())
    {
      _children = new Elem*[this->n_children()];

      for (unsigned int i=0; i<this->n_children(); i++)
        this->set_child(i, NULL);
    }

  libmesh_assert (this->_children[c] == NULL || this->child(c) == remote_elem);
  libmesh_assert (elem == remote_elem || this == elem->parent());

  this->set_child(c, elem);
}
void libMesh::DofObject::add_system ( ) [inherited]

Adds an additional system to the DofObject

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

{
  // quick return?
  if (this->n_systems() == 0)
    {
      this->set_n_systems(1);
      return;
    }

  DofObject::index_buffer_t::iterator it = _idx_buf.begin();

  std::advance(it, this->n_systems());

  // this inserts the current vector size at the position for the new system - creating the
  // entry we need for the new system indicating there are 0 variables.
  _idx_buf.insert(it, cast_int<dof_id_type>(_idx_buf.size()));

  // cache this value before we screw it up!
  const unsigned int ns_orig = this->n_systems();

  // incriment the number of systems and the offsets for each of
  // the systems including the new one we just added.
  for (unsigned int i=0; i<ns_orig+1; i++)
    _idx_buf[i]++;

  libmesh_assert_equal_to (this->n_systems(), (ns_orig+1));
  libmesh_assert_equal_to (this->n_vars(ns_orig), 0);
  libmesh_assert_equal_to (this->n_var_groups(ns_orig), 0);
}
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 1325 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().

{
#ifdef LIBMESH_ENABLE_AMR

  if (this->active())
    return false;

  if (!this->has_children())
    return false;
  if (this->child(0)->active())
    return true;

  return this->child(0)->ancestor();
#else
  return false;
#endif
}

Iterator accessor functions

Definition at line 2157 of file elem.C.

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

{
  Predicates::BoundarySide<SideIter> bsp;
  return side_iterator(this->_first_side(), this->_last_side(), bsp);
}

Definition at line 2166 of file elem.C.

References libMesh::Elem::_last_side().

{
  Predicates::BoundarySide<SideIter> bsp;
  return side_iterator(this->_last_side(), this->_last_side(), bsp);
}
UniquePtr< Elem > libMesh::Elem::build ( const ElemType  type,
Elem p = NULL 
) [static, inherited]

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

Definition at line 212 of file elem.C.

References libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::INFEDGE2, libMesh::INFHEX16, libMesh::INFHEX18, libMesh::INFHEX8, libMesh::INFPRISM12, libMesh::INFPRISM6, libMesh::INFQUAD4, libMesh::INFQUAD6, libMesh::NODEELEM, libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::TET10, libMesh::TET4, libMesh::TRI3, libMesh::TRI3SUBDIVISION, and libMesh::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::Nemesis_IO::read(), libMesh::ExodusII_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(), and libMesh::GMVIO::write_ascii_old_impl().

{
  Elem* elem = NULL;

  switch (type)
    {
      // 0D elements
    case NODEELEM:
      {
        elem = new NodeElem(p);
        break;
      }

      // 1D elements
    case EDGE2:
      {
        elem = new Edge2(p);
        break;
      }
    case EDGE3:
      {
        elem = new Edge3(p);
        break;
      }
    case EDGE4:
      {
        elem = new Edge4(p);
        break;
      }



      // 2D elements
    case TRI3:
      {
        elem = new Tri3(p);
        break;
      }
    case TRI3SUBDIVISION:
      {
        elem = new Tri3Subdivision(p);
        break;
      }
    case TRI6:
      {
        elem = new Tri6(p);
        break;
      }
    case QUAD4:
      {
        elem = new Quad4(p);
        break;
      }
    case QUAD8:
      {
        elem = new Quad8(p);
        break;
      }
    case QUAD9:
      {
        elem = new Quad9(p);
        break;
      }


      // 3D elements
    case TET4:
      {
        elem = new Tet4(p);
        break;
      }
    case TET10:
      {
        elem = new Tet10(p);
        break;
      }
    case HEX8:
      {
        elem = new Hex8(p);
        break;
      }
    case HEX20:
      {
        elem = new Hex20(p);
        break;
      }
    case HEX27:
      {
        elem = new Hex27(p);
        break;
      }
    case PRISM6:
      {
        elem = new Prism6(p);
        break;
      }
    case PRISM15:
      {
        elem = new Prism15(p);
        break;
      }
    case PRISM18:
      {
        elem = new Prism18(p);
        break;
      }
    case PYRAMID5:
      {
        elem = new Pyramid5(p);
        break;
      }
    case PYRAMID13:
      {
        elem = new Pyramid13(p);
        break;
      }
    case PYRAMID14:
      {
        elem = new Pyramid14(p);
        break;
      }



#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS

      // 1D infinite elements
    case INFEDGE2:
      {
        elem = new InfEdge2(p);
        break;
      }


      // 2D infinite elements
    case INFQUAD4:
      {
        elem = new InfQuad4(p);
        break;
      }
    case INFQUAD6:
      {
        elem = new InfQuad6(p);
        break;
      }


      // 3D infinite elements
    case INFHEX8:
      {
        elem = new InfHex8(p);
        break;
      }
    case INFHEX16:
      {
        elem = new InfHex16(p);
        break;
      }
    case INFHEX18:
      {
        elem = new InfHex18(p);
        break;
      }
    case INFPRISM6:
      {
        elem = new InfPrism6(p);
        break;
      }
    case INFPRISM12:
      {
        elem = new InfPrism12(p);
        break;
      }

#endif

    default:
      libmesh_error_msg("ERROR: Undefined element type!");
    }

  return UniquePtr<Elem>(elem);
}
UniquePtr<Elem> libMesh::Face::build_edge ( const unsigned int  i) const [inline, virtual, inherited]

build_side and build_edge are identical for faces

Implements libMesh::Elem.

Definition at line 69 of file face.h.

References libMesh::Elem::build_side().

  { return build_side(i); }
UniquePtr< Elem > libMesh::Tri3::build_side ( const unsigned int  i,
bool  proxy 
) const [virtual, inherited]

Creates an element coincident with side i. The element returned is full-ordered, in contrast to the side method. For example, calling build_side(0) on a 20-noded hex will build a 8-noded quadrilateral coincident with face 0 and pass back the pointer.

A UniquePtr<Elem> is returned to prevent a memory leak. This way the user need not remember to delete the object.

The second argument, which is true by default, specifies that a "proxy" element (of type Side) will be returned. This type of return value is useful because it does not allocate additional memory, and is usually sufficient for FE calculation purposes. If you really need a full-ordered, non-proxy side object, call this function with proxy=false.

Implements libMesh::Elem.

Definition at line 109 of file face_tri3.C.

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

{
  libmesh_assert_less (i, this->n_sides());

  if (proxy)
    return UniquePtr<Elem>(new Side<Edge2,Tri3>(this,i));

  else
    {
      Elem* edge = new Edge2;
      edge->subdomain_id() = this->subdomain_id();

      switch (i)
        {
        case 0:
          {
            edge->set_node(0) = this->get_node(0);
            edge->set_node(1) = this->get_node(1);
            break;
          }
        case 1:
          {
            edge->set_node(0) = this->get_node(1);
            edge->set_node(1) = this->get_node(2);
            break;
          }
        case 2:
          {
            edge->set_node(0) = this->get_node(2);
            edge->set_node(1) = this->get_node(0);
            break;
          }
        default:
          libmesh_error_msg("Invalid side i = " << i);
        }

      return UniquePtr<Elem>(edge);
    }

  libmesh_error_msg("We'll never get here!");
  return UniquePtr<Elem>();
}
Point libMesh::Elem::centroid ( ) const [virtual, inherited]
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 405 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().

{
  Point cp;

  for (unsigned int n=0; n<this->n_vertices(); n++)
    cp.add (this->point(n));

  return (cp /= static_cast<Real>(this->n_vertices()));
}
Elem * libMesh::Elem::child ( const unsigned int  i) const [inline, inherited]
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 1812 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< OutputType >::coarsened_dof_values(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::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::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::which_child_am_i(), and libMesh::XdrIO::write_serialized_connectivity().

Elem * libMesh::Elem::child_neighbor ( Elem elem) const [inline, inherited]

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 1485 of file elem.h.

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

{
  for (unsigned int n=0; n<elem->n_neighbors(); n++)
    if (elem->neighbor(n) &&
        elem->neighbor(n)->parent() == this)
      return elem->neighbor(n);

  return NULL;
}
const Elem * libMesh::Elem::child_neighbor ( const Elem elem) const [inline, inherited]

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 1498 of file elem.h.

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

{
  for (unsigned int n=0; n<elem->n_neighbors(); n++)
    if (elem->neighbor(n) &&
        elem->neighbor(n)->parent() == this)
      return elem->neighbor(n);

  return NULL;
}
void libMesh::DofObject::clear_dofs ( ) [inline, inherited]

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

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

{
  // vector swap trick to force deallocation
  index_buffer_t().swap(_idx_buf);

  libmesh_assert_equal_to (this->n_systems(), 0);
  libmesh_assert (_idx_buf.empty());
}
bool libMesh::Elem::close_to_point ( const Point p,
Real  tol 
) const [virtual, inherited]
Returns:
true if this element is "close" to the point p, where "close" is determined by the tolerance tol.

Definition at line 1747 of file elem.C.

References libMesh::Elem::point_test().

{
  // This test uses the user's passed-in tolerance for the
  // bounding box test as well, thereby allowing the routine to
  // find points which are not only "in" the element, but also
  // "nearby" to within some tolerance.
  return this->point_test(p, tol, tol);
}
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().

{
  libmesh_assert_equal_to (this->refinement_flag(), Elem::COARSEN_INACTIVE);
  libmesh_assert (!this->active());

  // We no longer delete children until MeshRefinement::contract()
  // delete [] _children;
  // _children = NULL;

  unsigned int parent_p_level = 0;

  // re-compute hanging node nodal locations
  for (unsigned int c=0; c<this->n_children(); c++)
    {
      Elem *mychild = this->child(c);
      if (mychild == remote_elem)
        continue;
      for (unsigned int nc=0; nc<mychild->n_nodes(); nc++)
        {
          Point new_pos;
          bool calculated_new_pos = false;

          for (unsigned int n=0; n<this->n_nodes(); n++)
            {
              // The value from the embedding matrix
              const float em_val = this->embedding_matrix(c,nc,n);

              // The node location is somewhere between existing vertices
              if ((em_val != 0.) && (em_val != 1.))
                {
                  new_pos.add_scaled (this->point(n), em_val);
                  calculated_new_pos = true;
                }
            }

          if(calculated_new_pos)
            {
              //Move the existing node back into it's original location
              for(unsigned int i=0; i<LIBMESH_DIM; i++)
                {
                  Point & child_node = *(mychild->get_node(nc));
                  child_node(i)=new_pos(i);
                }
            }
        }
    }

  for (unsigned int c=0; c<this->n_children(); c++)
    {
      Elem *mychild = this->child(c);
      if (mychild == remote_elem)
        continue;
      libmesh_assert_equal_to (mychild->refinement_flag(), Elem::COARSEN);
      mychild->set_refinement_flag(Elem::INACTIVE);
      if (mychild->p_level() > parent_p_level)
        parent_p_level = mychild->p_level();
    }

  this->set_refinement_flag(Elem::JUST_COARSENED);
  this->set_p_level(parent_p_level);

  libmesh_assert (this->active());
}
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1 
) [inline, static, protected, inherited]

Compute a key from the specified nodes.

Definition at line 1954 of file elem.h.

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

{
  // Order the two so that n0 < n1
  if (n0 > n1) std::swap (n0, n1);

  return Utility::hashword2(n0, n1);
}
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1,
dof_id_type  n2 
) [inline, static, protected, inherited]

Compute a key from the specified nodes.

Definition at line 1966 of file elem.h.

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

{
  // Order the numbers such that n0 < n1 < n2.
  // We'll do it in 3 steps like this:
  //
  //     n0         n1                n2
  //     min(n0,n1) max(n0,n1)        n2
  //     min(n0,n1) min(n2,max(n0,n1) max(n2,max(n0,n1)
  //           |\   /|                  |
  //           | \ / |                  |
  //           |  /  |                  |
  //           | /  \|                  |
  //  gb min= min   max              gb max

  // Step 1
  if (n0 > n1) std::swap (n0, n1);

  // Step 2
  if (n1 > n2) std::swap (n1, n2);

  // Step 3
  if (n0 > n1) std::swap (n0, n1);

  libmesh_assert ((n0 < n1) && (n1 < n2));

  dof_id_type array[3] = {n0, n1, n2};
  return Utility::hashword(array, 3);
}
dof_id_type libMesh::Elem::compute_key ( dof_id_type  n0,
dof_id_type  n1,
dof_id_type  n2,
dof_id_type  n3 
) [inline, static, protected, inherited]

Compute a key from the specified nodes.

Definition at line 2000 of file elem.h.

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

{
  // Sort first
  // Step 1
  if (n0 > n1) std::swap (n0, n1);

  // Step 2
  if (n2 > n3) std::swap (n2, n3);

  // Step 3
  if (n0 > n2) std::swap (n0, n2);

  // Step 4
  if (n1 > n3) std::swap (n1, n3);

  // Finally sort step 5
  if (n1 > n2) std::swap (n1, n2);

  libmesh_assert ((n0 < n1) && (n1 < n2) && (n2 < n3));

  dof_id_type array[4] = {n0, n1, n2, n3};
  return Utility::hashword(array, 4);
}
void libMesh::Tri3::connectivity ( const unsigned int  sc,
const IOPackage  iop,
std::vector< dof_id_type > &  conn 
) const [virtual, inherited]

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 154 of file face_tri3.C.

References libMesh::INVALID_IO_PACKAGE, libMesh::Tri3::n_sub_elem(), libMesh::Elem::node(), libMesh::TECPLOT, and libMesh::VTK.

{
  libmesh_assert_less (sf, this->n_sub_elem());
  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);

  switch (iop)
    {
    case TECPLOT:
      {
        conn.resize(4);
        conn[0] = this->node(0)+1;
        conn[1] = this->node(1)+1;
        conn[2] = this->node(2)+1;
        conn[3] = this->node(2)+1;
        return;
      }

    case VTK:
      {
        conn.resize(3);
        conn[0] = this->node(0);
        conn[1] = this->node(1);
        conn[2] = this->node(2);
        return;
      }

    default:
      libmesh_error_msg("Unsupported IO package " << iop);
    }
}
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 593 of file elem.C.

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

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

{
  unsigned int num_contained_edges = 0;

  // Our vertices are the first numbered nodes
  for (unsigned int n = 0; n != e->n_vertices(); ++n)
    {
      if (this->contains_point(e->point(n)))
        {
          num_contained_edges++;
          if(num_contained_edges>=2)
            {
              return true;
            }
        }
    }
  return false;
}
bool libMesh::Elem::contains_point ( const Point p,
Real  tol = TOLERANCE 
) const [virtual, inherited]
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 1722 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::PointLocatorTree::operator()(), libMesh::System::point_gradient(), libMesh::System::point_hessian(), libMesh::System::point_value(), and libMesh::HPSingularity::select_refinement().

{
  // We currently allow the user to enlarge the bounding box by
  // providing a tol > TOLERANCE (so this routine is identical to
  // Elem::close_to_point()), but print a warning so that the
  // user can eventually switch his code over to calling close_to_point()
  // instead, which is intended to be used for this purpose.
  if ( tol > TOLERANCE )
    {
      libmesh_do_once(libMesh::err
                      << "WARNING: Resizing bounding box to match user-specified tolerance!\n"
                      << "In the future, calls to Elem::contains_point() with tol > TOLERANCE\n"
                      << "will be more optimized, but should not be used\n"
                      << "to search for points 'close to' elements!\n"
                      << "Instead, use Elem::close_to_point() for this purpose.\n"
                      << std::endl;);
      return this->point_test(p, tol, tol);
    }
  else
    return this->point_test(p, TOLERANCE, tol);
}
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 582 of file elem.C.

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

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

{
  // Our vertices are the first numbered nodes
  for (unsigned int n = 0; n != e->n_vertices(); ++n)
    if (this->contains_point(e->point(n)))
      return true;
  return false;
}
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().

{
  // Subactive elements get deleted entirely, not contracted
  libmesh_assert (this->active());

  // Active contracted elements no longer can have children
  delete [] _children;
  _children = NULL;

  if (this->refinement_flag() == Elem::JUST_COARSENED)
    this->set_refinement_flag(Elem::DO_NOTHING);
}
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.

{
  libMesh::out << " [ ";
  for (unsigned int i=0; i<_idx_buf.size(); i++)
    libMesh::out << _idx_buf[i] << " ";
  libMesh::out << "]\n";
}
Order libMesh::Tri3Subdivision::default_order ( ) const [inline, virtual]
Returns:
FOURTH

Reimplemented from libMesh::Tri3.

Definition at line 70 of file face_tri3_subdivision.h.

References libMesh::FOURTH.

{ return FOURTH; }
unsigned int libMesh::Face::dim ( ) const [inline, virtual, inherited]
Returns:
2, the dimensionality of the object.

Implements libMesh::Elem.

Definition at line 58 of file face.h.

{ return 2; }
dof_id_type libMesh::DofObject::dof_number ( const unsigned int  s,
const unsigned int  var,
const unsigned int  comp 
) const [inline, inherited]
Returns:
the global degree of freedom number 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 797 of file dof_object.h.

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

Referenced by libMesh::DofMap::_dof_indices(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::DofMap::constrain_p_dofs(), libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::ExodusII_IO::copy_nodal_solution(), libMesh::GMVIO::copy_nodal_solution(), libMesh::DofMap::distribute_dofs(), libMesh::DofObject::DofObject(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::local_variable_indices(), 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().

{
  libmesh_assert_less (s,    this->n_systems());
  libmesh_assert_less (var,  this->n_vars(s));
  libmesh_assert_less (comp, this->n_comp(s,var));

  const unsigned int
    vg            = this->var_to_vg(s,var),
    start_idx_sys = this->start_idx(s);

  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());

  const dof_id_type
    base_idx = _idx_buf[start_idx_sys + 2*vg + 1];

  // if the first component is invalid, they
  // are all invalid
  if (base_idx == invalid_id)
    return invalid_id;

  // otherwise the index is the first component
  // index augemented by the component number
  else
    {
      const unsigned int
        ncg = this->n_comp_group(s,vg),
        vig = this->system_var_to_vg_var(s,vg,var);

      // std::cout << "base_idx, var, vg, vig, ncg, comp="
      // << base_idx << " "
      // << var << " "
      // << vg << " "
      // << vig << " "
      // << ncg << " "
      // << comp << '\n';

      return cast_int<dof_id_type>(base_idx + vig*ncg + comp);
    }
}
float libMesh::Tri3::embedding_matrix ( const unsigned int  i,
const unsigned int  j,
const unsigned int  k 
) const [inline, protected, virtual, inherited]

Matrix used to create the elements children.

Implements libMesh::Elem.

Definition at line 163 of file face_tri3.h.

References libMesh::Tri3::_embedding_matrix.

  { return _embedding_matrix[i][j][k]; }

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.

{
  _enable_print_counter = true;
  return;
}

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.

{
  _enable_print_counter = true;
  return;
}
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 1417 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().

{
  // The "family tree" doesn't include subactive elements
  libmesh_assert(!this->subactive());

  // Clear the vector if the flag reset tells us to.
  if (reset)
    family.clear();

  // Add this element to the family tree.
  family.push_back(this);

  // Recurse into the elements children, if it has them.
  // Do not clear the vector any more.
  if (!this->active())
    for (unsigned int c=0; c<this->n_children(); c++)
      if (!this->child(c)->is_remote())
        this->child(c)->family_tree (family, false);
}
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 1537 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().

{
  // The "family tree" doesn't include subactive elements
  libmesh_assert(!this->subactive());

  // Clear the vector if the flag reset tells us to.
  if (reset)
    family.clear();

  // This only makes sense if we're already a neighbor
  libmesh_assert (this->has_neighbor(neighbor_in));

  // Add this element to the family tree.
  family.push_back(this);

  // Recurse into the elements children, if it's not active.
  // Do not clear the vector any more.
  if (!this->active())
    for (unsigned int c=0; c<this->n_children(); c++)
      {
        Elem *current_child = this->child(c);
        if (current_child != remote_elem && current_child->has_neighbor(neighbor_in))
          current_child->family_tree_by_neighbor (family, neighbor_in, false);
      }
}
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 1484 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(), and libMesh::Elem::make_links_to_me_local().

{
  // The "family tree" doesn't include subactive elements
  libmesh_assert(!this->subactive());

  // Clear the vector if the flag reset tells us to.
  if (reset)
    family.clear();

  libmesh_assert_less (s, this->n_sides());

  // Add this element to the family tree.
  family.push_back(this);

  // Recurse into the elements children, if it has them.
  // Do not clear the vector any more.
  if (!this->active())
    for (unsigned int c=0; c<this->n_children(); c++)
      if (!this->child(c)->is_remote() && this->is_child_on_side(c, s))
        this->child(c)->family_tree_by_side (family, s, false);
}
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 1567 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().

{
  // The "family tree" doesn't include subactive elements
  libmesh_assert(!this->subactive());

  // Clear the vector if the flag reset tells us to.
  if (reset)
    family.clear();

  // To simplifly this function we need an existing neighbor
  libmesh_assert (neighbor_in);
  libmesh_assert_not_equal_to (neighbor_in, remote_elem);
  libmesh_assert (this->has_neighbor(neighbor_in));

  // This only makes sense if subneighbor descends from neighbor
  libmesh_assert (subneighbor);
  libmesh_assert_not_equal_to (subneighbor, remote_elem);
  libmesh_assert (neighbor_in->is_ancestor_of(subneighbor));

  // Add this element to the family tree if applicable.
  if (neighbor_in == subneighbor)
    family.push_back(this);

  // Recurse into the elements children, if it's not active.
  // Do not clear the vector any more.
  if (!this->active())
    for (unsigned int c=0; c != this->n_children(); ++c)
      {
        Elem *current_child = this->child(c);
        if (current_child != remote_elem)
          for (unsigned int s=0; s != current_child->n_sides(); ++s)
            {
              Elem *child_neigh = current_child->neighbor(s);
              if (child_neigh &&
                  (child_neigh == neighbor_in ||
                   (child_neigh->parent() == neighbor_in &&
                    child_neigh->is_ancestor_of(subneighbor))))
                current_child->family_tree_by_subneighbor (family, child_neigh,
                                                           subneighbor, false);
            }
      }
}
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 767 of file elem.C.

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

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

{
  // Simple but perhaps suboptimal code: find elements containing the
  // first point, then winnow this set down by removing elements which
  // don't also contain the second point

  libmesh_assert(this->contains_point(p2));
  this->find_point_neighbors(p1, neighbor_set);

  std::set<const Elem*>::iterator        it = neighbor_set.begin();
  const std::set<const Elem*>::iterator end = neighbor_set.end();

  while(it != end) {
    std::set<const Elem*>::iterator current = it++;

    const Elem* elem = *current;
    // This won't invalidate iterator it, because it is already
    // pointing to the next element
    if (!elem->contains_point(p2))
      neighbor_set.erase(current);
  }
}
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 794 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.

{
  neighbor_set.clear();
  neighbor_set.insert(this);

  std::set<const Elem *> untested_set, next_untested_set;
  untested_set.insert(this);

  while (!untested_set.empty())
    {
      // Loop over all the elements in the patch that haven't already
      // been tested
      std::set<const Elem*>::const_iterator       it  = untested_set.begin();
      const std::set<const Elem*>::const_iterator end = untested_set.end();

      for (; it != end; ++it)
        {
          const Elem* elem = *it;

          for (unsigned int s=0; s<elem->n_sides(); s++)
            {
              const Elem* current_neighbor = elem->neighbor(s);
              if (current_neighbor &&
                  current_neighbor != remote_elem)    // we have a real neighbor on this side
                {
                  if (current_neighbor->active())                // ... if it is active
                    {
                      if (this->contains_edge_of(current_neighbor) // ... and touches us
                          || current_neighbor->contains_edge_of(this))
                        {
                          // Make sure we'll test it
                          if (!neighbor_set.count(current_neighbor))
                            next_untested_set.insert (current_neighbor);

                          // And add it
                          neighbor_set.insert (current_neighbor);
                        }
                    }
#ifdef LIBMESH_ENABLE_AMR
                  else                                 // ... the neighbor is *not* active,
                    {                                  // ... so add *all* neighboring
                                                       // active children
                      std::vector<const Elem*> active_neighbor_children;

                      current_neighbor->active_family_tree_by_neighbor
                        (active_neighbor_children, elem);

                      std::vector<const Elem*>::const_iterator
                        child_it = active_neighbor_children.begin();
                      const std::vector<const Elem*>::const_iterator
                        child_end = active_neighbor_children.end();
                      for (; child_it != child_end; ++child_it)
                        {
                          const Elem *current_child = *child_it;
                          if (this->contains_edge_of(*child_it) ||
                              (*child_it)->contains_edge_of(this))
                            {
                              // Make sure we'll test it
                              if (!neighbor_set.count(current_child))
                                next_untested_set.insert (current_child);

                              neighbor_set.insert (current_child);
                            }
                        }
                    }
#endif // #ifdef LIBMESH_ENABLE_AMR
                }
            }
        }
      untested_set.swap(next_untested_set);
      next_untested_set.clear();
    }
}
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 614 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::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::Elem::find_edge_neighbors(), libMesh::MeshFunction::find_element(), libMesh::Patch::find_point_neighbors(), and libMesh::Elem::is_semilocal().

{
  libmesh_assert(this->contains_point(p));

  neighbor_set.clear();
  neighbor_set.insert(this);

  std::set<const Elem *> untested_set, next_untested_set;
  untested_set.insert(this);

  while (!untested_set.empty())
    {
      // Loop over all the elements in the patch that haven't already
      // been tested
      std::set<const Elem*>::const_iterator       it  = untested_set.begin();
      const std::set<const Elem*>::const_iterator end = untested_set.end();

      for (; it != end; ++it)
        {
          const Elem* elem = *it;

          for (unsigned int s=0; s<elem->n_sides(); s++)
            {
              const Elem* current_neighbor = elem->neighbor(s);
              if (current_neighbor &&
                  current_neighbor != remote_elem)    // we have a real neighbor on this side
                {
                  if (current_neighbor->active())                // ... if it is active
                    {
                      if (current_neighbor->contains_point(p))   // ... and touches p
                        {
                          // Make sure we'll test it
                          if (!neighbor_set.count(current_neighbor))
                            next_untested_set.insert (current_neighbor);

                          // And add it
                          neighbor_set.insert (current_neighbor);
                        }
                    }
#ifdef LIBMESH_ENABLE_AMR
                  else                                 // ... the neighbor is *not* active,
                    {                                  // ... so add *all* neighboring
                                                       // active children that touch p
                      std::vector<const Elem*> active_neighbor_children;

                      current_neighbor->active_family_tree_by_neighbor
                        (active_neighbor_children, elem);

                      std::vector<const Elem*>::const_iterator
                        child_it = active_neighbor_children.begin();
                      const std::vector<const Elem*>::const_iterator
                        child_end = active_neighbor_children.end();
                      for (; child_it != child_end; ++child_it)
                        {
                          const Elem *current_child = *child_it;
                          if (current_child->contains_point(p))
                            {
                              // Make sure we'll test it
                              if (!neighbor_set.count(current_child))
                                next_untested_set.insert (current_child);

                              neighbor_set.insert (current_child);
                            }
                        }
                    }
#endif // #ifdef LIBMESH_ENABLE_AMR
                }
            }
        }
      untested_set.swap(next_untested_set);
      next_untested_set.clear();
    }
}
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 691 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.

{
  neighbor_set.clear();
  neighbor_set.insert(this);

  std::set<const Elem *> untested_set, next_untested_set;
  untested_set.insert(this);

  while (!untested_set.empty())
    {
      // Loop over all the elements in the patch that haven't already
      // been tested
      std::set<const Elem*>::const_iterator       it  = untested_set.begin();
      const std::set<const Elem*>::const_iterator end = untested_set.end();

      for (; it != end; ++it)
        {
          const Elem* elem = *it;

          for (unsigned int s=0; s<elem->n_sides(); s++)
            {
              const Elem* current_neighbor = elem->neighbor(s);
              if (current_neighbor &&
                  current_neighbor != remote_elem)    // we have a real neighbor on this side
                {
                  if (current_neighbor->active())                // ... if it is active
                    {
                      if (this->contains_vertex_of(current_neighbor) // ... and touches us
                          || current_neighbor->contains_vertex_of(this))
                        {
                          // Make sure we'll test it
                          if (!neighbor_set.count(current_neighbor))
                            next_untested_set.insert (current_neighbor);

                          // And add it
                          neighbor_set.insert (current_neighbor);
                        }
                    }
#ifdef LIBMESH_ENABLE_AMR
                  else                                 // ... the neighbor is *not* active,
                    {                                  // ... so add *all* neighboring
                                                       // active children
                      std::vector<const Elem*> active_neighbor_children;

                      current_neighbor->active_family_tree_by_neighbor
                        (active_neighbor_children, elem);

                      std::vector<const Elem*>::const_iterator
                        child_it = active_neighbor_children.begin();
                      const std::vector<const Elem*>::const_iterator
                        child_end = active_neighbor_children.end();
                      for (; child_it != child_end; ++child_it)
                        {
                          const Elem *current_child = *child_it;
                          if (this->contains_vertex_of(current_child) ||
                              (current_child)->contains_vertex_of(this))
                            {
                              // Make sure we'll test it
                              if (!neighbor_set.count(current_child))
                                next_untested_set.insert (current_child);

                              neighbor_set.insert (current_child);
                            }
                        }
                    }
#endif // #ifdef LIBMESH_ENABLE_AMR
                }
            }
        }
      untested_set.swap(next_untested_set);
      next_untested_set.clear();
    }
}
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 1991 of file elem.C.

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

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

{
  switch (et)
    {
    case EDGE2:
    case EDGE3:
    case EDGE4:
      return EDGE2;
    case TRI3:
    case TRI6:
      return TRI3;
    case QUAD4:
    case QUAD8:
    case QUAD9:
      return QUAD4;
    case TET4:
    case TET10:
      return TET4;
    case HEX8:
    case HEX27:
    case HEX20:
      return HEX8;
    case PRISM6:
    case PRISM15:
    case PRISM18:
      return PRISM6;
    case PYRAMID5:
    case PYRAMID13:
    case PYRAMID14:
      return PYRAMID5;

#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS

    case INFQUAD4:
    case INFQUAD6:
      return INFQUAD4;
    case INFHEX8:
    case INFHEX16:
    case INFHEX18:
      return INFHEX8;
    case INFPRISM6:
    case INFPRISM12:
      return INFPRISM6;

#endif

    default:
      // unknown element
      return INVALID_ELEM;
    }
}
std::string libMesh::ReferenceCounter::get_info ( ) [static, inherited]

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

{
#if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)

  std::ostringstream oss;

  oss << '\n'
      << " ---------------------------------------------------------------------------- \n"
      << "| Reference count information                                                |\n"
      << " ---------------------------------------------------------------------------- \n";

  for (Counts::iterator it = _counts.begin();
       it != _counts.end(); ++it)
    {
      const std::string name(it->first);
      const unsigned int creations    = it->second.first;
      const unsigned int destructions = it->second.second;

      oss << "| " << name << " reference count information:\n"
          << "|  Creations:    " << creations    << '\n'
          << "|  Destructions: " << destructions << '\n';
    }

  oss << " ---------------------------------------------------------------------------- \n";

  return oss.str();

#else

  return "";

#endif
}
std::string libMesh::ReferenceCounter::get_info ( ) [static, inherited]

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

{
#if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)

  std::ostringstream oss;

  oss << '\n'
      << " ---------------------------------------------------------------------------- \n"
      << "| Reference count information                                                |\n"
      << " ---------------------------------------------------------------------------- \n";

  for (Counts::iterator it = _counts.begin();
       it != _counts.end(); ++it)
    {
      const std::string name(it->first);
      const unsigned int creations    = it->second.first;
      const unsigned int destructions = it->second.second;

      oss << "| " << name << " reference count information:\n"
          << "|  Creations:    " << creations    << '\n'
          << "|  Destructions: " << destructions << '\n';
    }

  oss << " ---------------------------------------------------------------------------- \n";

  return oss.str();

#else

  return "";

#endif
}
std::string libMesh::Elem::get_info ( ) const [inherited]

Prints relevant information about the element to a string.

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

{
  std::ostringstream oss;

  oss << "  Elem Information"                                      << '\n'
      << "   id()=";

  if (this->valid_id())
    oss << this->id();
  else
    oss << "invalid";

  oss << ", processor_id()=" << this->processor_id()               << '\n';

  oss << "   type()="    << Utility::enum_to_string(this->type())  << '\n'
      << "   dim()="     << this->dim()                            << '\n'
      << "   n_nodes()=" << this->n_nodes()                        << '\n';

  for (unsigned int n=0; n != this->n_nodes(); ++n)
    oss << "    " << n << *this->get_node(n);

  oss << "   n_sides()=" << this->n_sides()                        << '\n';

  for (unsigned int s=0; s != this->n_sides(); ++s)
    {
      oss << "    neighbor(" << s << ")=";
      if (this->neighbor(s))
        oss << this->neighbor(s)->id() << '\n';
      else
        oss << "NULL\n";
    }

  oss << "   hmin()=" << this->hmin()
      << ", hmax()=" << this->hmax()                               << '\n'
      << "   volume()=" << this->volume()                          << '\n'
      << "   active()=" << this->active()
      << ", ancestor()=" << this->ancestor()
      << ", subactive()=" << this->subactive()
      << ", has_children()=" << this->has_children()               << '\n'
      << "   parent()=";
  if (this->parent())
    oss << this->parent()->id() << '\n';
  else
    oss << "NULL\n";
  oss << "   level()=" << this->level()
      << ", p_level()=" << this->p_level()                         << '\n'
#ifdef LIBMESH_ENABLE_AMR
      << "   refinement_flag()=" << Utility::enum_to_string(this->refinement_flag())        << '\n'
      << "   p_refinement_flag()=" << Utility::enum_to_string(this->p_refinement_flag())    << '\n'
#endif
#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
      << "   infinite()=" << this->infinite()    << '\n';
  if (this->infinite())
    oss << "   origin()=" << this->origin()    << '\n'
#endif
      ;

  oss << "   DoFs=";
  for (unsigned int s=0; s != this->n_systems(); ++s)
    for (unsigned int v=0; v != this->n_vars(s); ++v)
      for (unsigned int c=0; c != this->n_comp(s,v); ++c)
        oss << '(' << s << '/' << v << '/' << this->dof_number(s,v,c) << ") ";


  return oss.str();
}
Node * libMesh::Elem::get_node ( const unsigned int  i) const [inline, inherited]
Returns:
the pointer to local Node i.

Reimplemented in libMesh::RemoteElem.

Definition at line 1404 of file elem.h.

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

Referenced by libMesh::MeshTools::Subdivision::add_boundary_ghosts(), 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::Quad4::build_side(), libMesh::InfQuad4::build_side(), libMesh::InfQuad6::build_side(), libMesh::InfHex8::build_side(), libMesh::Tri3::build_side(), libMesh::InfPrism6::build_side(), libMesh::Hex8::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(), libMesh::Hex20::build_side(), libMesh::Pyramid13::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::FEMap::compute_affine_map(), libMesh::FEMap::compute_map(), libMesh::FEGenericBase< OutputType >::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::UNVIO::elements_out(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshTools::Subdivision::find_one_ring(), libMesh::MeshTools::Modification::flatten(), libMesh::Elem::get_info(), 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::local_variable_indices(), libMesh::DofMap::old_dof_indices(), prepare_subdivision_properties(), 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::InfPrism::side(), libMesh::InfHex::side(), libMesh::Quad::side(), libMesh::InfQuad::side(), libMesh::Edge::side(), libMesh::MeshTools::Modification::smooth(), libMesh::SerialMesh::stitching_helper(), libMesh::BoundaryInfo::sync(), libMesh::Parallel::sync_node_data_by_element_id(), libMesh::Tri3::volume(), libMesh::Pyramid5::volume(), libMesh::Tet4::volume(), and libMesh::GnuPlotIO::write_solution().

{
  libmesh_assert_less (i, this->n_nodes());
  libmesh_assert(_nodes[i]);

  return _nodes[i];
}
unsigned int libMesh::Elem::get_node_index ( const Node node_ptr) const [inline, inherited]
Returns:
the local index for the Node pointer node_ptr, or invalid_id if node_ptr is not a local node.

Definition at line 1415 of file elem.h.

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

Referenced by libMesh::ElemCutter::find_intersection_points().

{
  for (unsigned int n=0; n != this->n_nodes(); ++n)
    if (this->_nodes[n] == node_ptr)
      return n;

  return libMesh::invalid_uint;
}
const Node *const * libMesh::Elem::get_nodes ( ) const [inline, inherited]
Returns:
a pointer to an array of local node pointers.

Definition at line 1396 of file elem.h.

References libMesh::Elem::_nodes.

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

{
  return _nodes;
}
Node * libMesh::Tri3Subdivision::get_ordered_node ( unsigned int  node_id) const
Returns:
a pointer to the node whose ordered id is node_id.

Definition at line 113 of file face_tri3_subdivision.C.

References _ordered_nodes, _subdivision_updated, and libMesh::libmesh_assert().

Referenced by libMesh::MeshTools::Subdivision::find_one_ring(), and get_ordered_valence().

{
  libmesh_assert_less(node_id, 3);
  libmesh_assert(_subdivision_updated);
  return _ordered_nodes[node_id];
}
unsigned int libMesh::Tri3Subdivision::get_ordered_valence ( unsigned int  node_id) const
Returns:
the number of nodes connected to the ordered node whose id is node_id.

Definition at line 105 of file face_tri3_subdivision.C.

References _subdivision_updated, get_ordered_node(), libMesh::libmesh_assert(), libMesh::Elem::n_neighbors(), and libMesh::Node::valence().

Referenced by libMesh::MeshTools::Subdivision::find_one_ring().

{
  libmesh_assert_less(node_id, n_neighbors());
  libmesh_assert(_subdivision_updated);
  return get_ordered_node(node_id)->valence();
}
void libMesh::Elem::hack_p_level ( const unsigned int  p) [inline, inherited]

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

Definition at line 1935 of file elem.h.

References libMesh::Elem::_p_level.

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

{
  _p_level = cast_int<unsigned char>(p);
}
virtual bool libMesh::Tri3Subdivision::has_affine_map ( ) const [inline, virtual]
Returns:
true iff the element map is definitely affine within numerical tolerances

Reimplemented from libMesh::Tri3.

Definition at line 59 of file face_tri3_subdivision.h.

{ return false; }
bool libMesh::Elem::has_ancestor_children ( ) const [inline, inherited]
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 1646 of file elem.h.

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

{
#ifdef LIBMESH_ENABLE_AMR
  if (_children == NULL)
    return false;
  else
    for (unsigned int c=0; c != this->n_children(); c++)
      if (this->child(c)->has_children())
        return true;
#endif
  return false;
}
bool libMesh::DofObject::has_dofs ( const unsigned int  s = libMesh::invalid_uint) const [inline, inherited]
Returns:
true if any system has variables which have been assigned, false otherwise

Definition at line 842 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::old_dof_indices(), and libMesh::DofMap::reinit().

{
  if (sys == libMesh::invalid_uint)
    {
      for (unsigned int s=0; s<this->n_systems(); s++)
        if (this->n_vars(s))
          return true;
    }

  else
    {
      libmesh_assert_less (sys, this->n_systems());

      if (this->n_vars(sys))
        return true;
    }

  return false;
}
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 947 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().

{
  // First see if this is a normal "interior" neighbor
  if (has_neighbor(elem))
    return true;

  for (unsigned int n=0; n<this->n_neighbors(); n++)
    if (this->topological_neighbor(n, mesh, point_locator, pb))
      return true;

  return false;
}
Real libMesh::Elem::hmax ( ) const [virtual, inherited]
Returns:
the maximum vertex separation for the element.

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

{
  Real h_max=0;

  for (unsigned int n_outer=0; n_outer<this->n_vertices(); n_outer++)
    for (unsigned int n_inner=n_outer+1; n_inner<this->n_vertices(); n_inner++)
      {
        const Point diff = (this->point(n_outer) - this->point(n_inner));

        h_max = std::max(h_max,diff.size_sq());
      }

  return std::sqrt(h_max);
}
Real libMesh::Elem::hmin ( ) const [virtual, inherited]
Returns:
the minimum vertex separation for the element.

Definition at line 417 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< OutputType >::compute_periodic_constraints(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::Elem::get_info(), libMesh::FEMSystem::numerical_jacobian(), libMesh::Elem::refine(), and libMesh::SerialMesh::stitching_helper().

{
  Real h_min=std::numeric_limits<Real>::max();

  for (unsigned int n_outer=0; n_outer<this->n_vertices(); n_outer++)
    for (unsigned int n_inner=n_outer+1; n_inner<this->n_vertices(); n_inner++)
      {
        const Point diff = (this->point(n_outer) - this->point(n_inner));

        h_min = std::min(h_min,diff.size_sq());
      }

  return std::sqrt(h_min);
}
dof_id_type libMesh::DofObject::id ( ) const [inline, inherited]
Returns:
the id for this DofObject

Definition at line 619 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::MeshTools::Subdivision::add_boundary_ghosts(), 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::Subdivision::all_subdivision(), 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< OutputType >::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::UNVIO::elements_out(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::UnstructuredMesh::find_neighbors(), libMesh::MeshTools::find_nodal_neighbors(), libMesh::MeshRefinement::flag_elements_by_elem_fraction(), libMesh::MeshRefinement::flag_elements_by_error_fraction(), libMesh::MeshRefinement::flag_elements_by_error_tolerance(), libMesh::MeshRefinement::flag_elements_by_mean_stddev(), libMesh::MeshTools::Modification::flatten(), libMesh::Node::get_info(), libMesh::Elem::get_info(), libMesh::DofMap::get_local_constraints(), libMesh::EquationSystems::get_solution(), libMesh::UNVIO::groups_in(), libMesh::LaplaceMeshSmoother::init(), libMesh::ParmetisPartitioner::initialize(), libMesh::ExodusII_IO_Helper::initialize(), 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(), local_node_number(), libMesh::Elem::node(), libMesh::MeshData::node_to_foreign_id(), libMesh::UNVIO::nodes_out(), libMesh::VTKIO::nodes_to_vtk(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::BoundaryInfo::operator=(), libMesh::Parallel::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::Parallel::sync_node_data_by_element_id(), libMesh::Elem::topological_neighbor(), libMesh::TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), libMesh::Parallel::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::GmshIO::write_mesh(), libMesh::LegacyXdrIO::write_mesh(), libMesh::ExodusII_IO_Helper::write_nodal_coordinates(), libMesh::CheckpointIO::write_nodes(), and libMesh::XdrIO::write_serialized_connectivity().

{
  libmesh_assert (this->valid_id());
  return _id;
}
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name) [inline, protected, inherited]

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

Definition at line 163 of file reference_counter.h.

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

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

{
  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
  std::pair<unsigned int, unsigned int>& p = _counts[name];

  p.first++;
}
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name) [inline, protected, inherited]

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

Definition at line 163 of file reference_counter.h.

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

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

{
  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
  std::pair<unsigned int, unsigned int>& p = _counts[name];

  p.first++;
}
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name) [inline, protected, inherited]

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

Definition at line 176 of file reference_counter.h.

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

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

{
  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
  std::pair<unsigned int, unsigned int>& p = _counts[name];

  p.second++;
}
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name) [inline, protected, inherited]

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

Definition at line 176 of file reference_counter.h.

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

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

{
  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
  std::pair<unsigned int, unsigned int>& p = _counts[name];

  p.second++;
}
bool libMesh::Face::infinite ( ) const [inline, virtual, inherited]
Returns:
2
false. All classes derived from Face are finite elements.

Implements libMesh::Elem.

Definition at line 90 of file face.h.

{ return false; }
const Elem * libMesh::Elem::interior_parent ( ) const [inline, inherited]

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 1725 of file elem.h.

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

{
  // interior parents make no sense for full-dimensional elements.
  libmesh_assert_less (this->dim(), LIBMESH_DIM);

  // // and they [USED TO BE] only good for level-0 elements
  // if (this->level() != 0)
  // return this->parent()->interior_parent();

  // We store the interior_parent pointer after both the parent
  // neighbor and neighbor pointers
  Elem *interior_p = _elemlinks[1+this->n_sides()];

  // If we have an interior_parent, it had better be the
  // one-higher-dimensional interior element we are looking for.
  libmesh_assert (!interior_p ||
                  interior_p->dim() == (this->dim()+1));

  return interior_p;
}
void libMesh::DofObject::invalidate ( ) [inline, inherited]
void libMesh::DofObject::invalidate_dofs ( const unsigned int  sys_num = libMesh::invalid_uint) [inline, inherited]

Sets all degree of freedom numbers to invalid_id

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

{
  // If the user does not specify the system number...
  if (sys_num >= this->n_systems())
    {
      for (unsigned int s=0; s<this->n_systems(); s++)
        for (unsigned int vg=0; vg<this->n_var_groups(s); vg++)
          if (this->n_comp_group(s,vg))
            this->set_vg_dof_base(s,vg,invalid_id);
    }
  // ...otherwise invalidate the dofs for all systems
  else
    for (unsigned int vg=0; vg<this->n_var_groups(sys_num); vg++)
      if (this->n_comp_group(sys_num,vg))
        this->set_vg_dof_base(sys_num,vg,invalid_id);
}
void libMesh::DofObject::invalidate_id ( ) [inline, inherited]

Sets the id to invalid_id

Definition at line 559 of file dof_object.h.

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

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

{
  this->set_id (invalid_id);
}
bool libMesh::Elem::is_ancestor_of ( const Elem descendant) const [inline, inherited]
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 1662 of file elem.h.

References libMesh::Elem::parent().

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

{
#ifdef LIBMESH_ENABLE_AMR
  const Elem *e = descendant;
  while (e)
    {
      if (this == e)
        return true;
      e = e->parent();
    }
#endif
  return false;
}
bool libMesh::Elem::is_child_on_edge ( const unsigned int  c,
const unsigned int  e 
) const [virtual, inherited]
Returns:
true iff the specified child is on the specified edge

Definition at line 1401 of file elem.C.

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

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

{
  libmesh_assert_less (c, this->n_children());
  libmesh_assert_less (e, this->n_edges());

  UniquePtr<Elem> my_edge = this->build_edge(e);
  UniquePtr<Elem> child_edge = this->build_edge(e);

  // We're assuming that an overlapping child edge has the same
  // number and orientation as its parent
  return (child_edge->node(0) == my_edge->node(0) ||
          child_edge->node(1) == my_edge->node(1));
}
bool libMesh::Tri::is_child_on_side ( const unsigned int  c,
const unsigned int  s 
) const [virtual, inherited]
Returns:
true iff the specified child is on the specified side

Implements libMesh::Elem.

Definition at line 98 of file face_tri.C.

References libMesh::Tri::n_children(), and libMesh::Tri::n_sides().

{
  libmesh_assert_less (c, this->n_children());
  libmesh_assert_less (s, this->n_sides());

  return (c == s || c == (s+1)%3);
}
bool libMesh::Tri3::is_edge ( const unsigned int  i) const [virtual, inherited]
Returns:
true iff the specified (local) node number is an edge.

Implements libMesh::Elem.

Definition at line 89 of file face_tri3.C.

{
  return false;
}
virtual bool libMesh::Face::is_edge_on_side ( const unsigned int  e,
const unsigned int  s 
) const [inline, virtual, inherited]

Implements libMesh::Elem.

Definition at line 75 of file face.h.

  { return (e == s); }
bool libMesh::Tri3::is_face ( const unsigned int  i) const [virtual, inherited]
Returns:
true iff the specified (local) node number is a face.

Implements libMesh::Elem.

Definition at line 94 of file face_tri3.C.

{
  return false;
}
bool libMesh::Tri3Subdivision::is_ghost ( ) const [inline]
Returns:
true iff the element is a ghost element.

Definition at line 105 of file face_tri3_subdivision.h.

References _is_ghost.

Referenced by libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::DofMap::dof_indices(), and libMesh::MeshTools::Subdivision::prepare_subdivision_mesh().

{ return _is_ghost; }
virtual bool libMesh::Tri3Subdivision::is_linear ( ) const [inline, virtual]
Returns:
true iff the Lagrange shape functions on this element are linear

Reimplemented from libMesh::Tri3.

Definition at line 65 of file face_tri3_subdivision.h.

{ return false; }
virtual bool libMesh::Tri3::is_node_on_edge ( const unsigned int  n,
const unsigned int  e 
) const [inline, virtual, inherited]

Implements libMesh::Elem.

Definition at line 102 of file face_tri3.h.

References libMesh::Tri3::is_node_on_side().

  { return this->is_node_on_side(n,e); }
bool libMesh::Tri3::is_node_on_side ( const unsigned int  n,
const unsigned int  s 
) const [virtual, inherited]

Implements libMesh::Elem.

Definition at line 99 of file face_tri3.C.

References libMesh::Tri::n_sides(), and libMesh::Tri3::side_nodes_map.

Referenced by libMesh::Tri3::is_node_on_edge().

{
  libmesh_assert_less (s, n_sides());
  for (unsigned int i = 0; i != 2; ++i)
    if (side_nodes_map[s][i] == n)
      return true;
  return false;
}
virtual bool libMesh::Elem::is_remote ( ) const [inline, virtual, inherited]

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

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

{
  std::set<const Elem *> point_neighbors;

  this->find_point_neighbors(point_neighbors);

  std::set<const Elem*>::const_iterator       it  = point_neighbors.begin();
  const std::set<const Elem*>::const_iterator end = point_neighbors.end();

  for (; it != end; ++it)
    {
      const Elem* elem = *it;
      if (elem->processor_id() == my_pid)
        return true;
    }

  return false;
}
Returns:
true iff the subdivision element is ready for use, i.e. the nodes have been reordered.

Definition at line 83 of file face_tri3_subdivision.h.

References _subdivision_updated.

Referenced by libMesh::MeshTools::Subdivision::find_one_ring().

bool libMesh::Tri3::is_vertex ( const unsigned int  i) const [virtual, inherited]
Returns:
true iff the specified (local) node number is a vertex.

Implements libMesh::Elem.

Definition at line 84 of file face_tri3.C.

{
  return true;
}
dof_id_type libMesh::Tri::key ( const unsigned int  s) const [virtual, inherited]
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::Tri6.

Definition at line 33 of file face_tri.C.

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

{
  libmesh_assert_less (s, this->n_sides());

  switch (s)
    {
    case 0:
      return
        this->compute_key (this->node(0),
                           this->node(1));

    case 1:
      return
        this->compute_key (this->node(1),
                           this->node(2));
    case 2:
      return
        this->compute_key (this->node(2),
                           this->node(0));

    default:
      libmesh_error_msg("Invalid side s = " << s);
    }

  libmesh_error_msg("We'll never get here!");
  return 0;
}
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 451 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().

{
  libmesh_assert_less ( n1, this->n_vertices() );
  libmesh_assert_less ( n2, this->n_vertices() );

  return (this->point(n1) - this->point(n2)).size();
}
unsigned int libMesh::Elem::level ( ) const [inline, inherited]
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 1764 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< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), 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::Parallel::packable_size(), libMesh::BoundaryInfo::remove_edge(), libMesh::BoundaryInfo::remove_side(), libMesh::BoundaryInfo::side_with_boundary_id(), libMesh::SerialMesh::stitching_helper(), libMesh::MeshRefinement::test_level_one(), libMesh::Elem::top_parent(), libMesh::Elem::topological_neighbor(), libMesh::Parallel::unpack(), libMesh::Elem::which_neighbor_am_i(), and libMesh::LegacyXdrIO::write_mesh().

{
#ifdef LIBMESH_ENABLE_AMR

  // if I don't have a parent I was
  // created directly from file
  // or by the user, so I am a
  // level-0 element
  if (this->parent() == NULL)
    return 0;

  // if the parent and this element are of different
  // dimensionality we are at the same level as
  // the parent (e.g. we are the 2D side of a
  // 3D element)
  if (this->dim() != this->parent()->dim())
    return this->parent()->level();

  // otherwise we are at a level one
  // higher than our parent
  return (this->parent()->level() + 1);

#else

  // Without AMR all elements are
  // at level 0.
  return 0;

#endif
}

This function checks for consistent neighbor links at this element.

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

{
  for (unsigned int s=0; s<this->n_neighbors(); s++)
    {
      const Elem *neigh = this->neighbor(s);

      // Any element might have a remote neighbor; checking
      // to make sure that's not inaccurate is tough.
      if (neigh == remote_elem)
        continue;

      if (neigh)
        {
          // Only subactive elements have subactive neighbors
          libmesh_assert (this->subactive() || !neigh->subactive());

          const Elem *elem = this;

          // If we're subactive but our neighbor isn't, its
          // return neighbor link will be to our first active
          // ancestor OR to our inactive ancestor of the same
          // level as neigh,
          if (this->subactive() && !neigh->subactive())
            {
              for (elem = this; !elem->active();
                   elem = elem->parent())
                libmesh_assert(elem);
            }
          else
            {
              unsigned int rev = neigh->which_neighbor_am_i(elem);
              libmesh_assert_less (rev, neigh->n_neighbors());

              if (this->subactive() && !neigh->subactive())
                {
                  while (neigh->neighbor(rev) != elem)
                    {
                      libmesh_assert(elem->parent());
                      elem = elem->parent();
                    }
                }
              else
                {
                  Elem *nn = neigh->neighbor(rev);
                  libmesh_assert(nn);

                  for (; elem != nn; elem = elem->parent())
                    libmesh_assert(elem);
                }
            }
        }
      // If we don't have a neighbor and we're not subactive, our
      // ancestors shouldn't have any neighbors in this same
      // direction.
      else if (!this->subactive())
        {
          const Elem *my_parent = this->parent();
          if (my_parent &&
              // A parent with a different dimension isn't really one of
              // our ancestors, it means we're on a boundary mesh and this
              // is an interior mesh element for which we're on a side.
              // Nothing to test for in that case.
              (my_parent->dim() == this->dim()))
            libmesh_assert (!my_parent->neighbor(s));
        }
    }
}

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

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

{
  libmesh_assert(this->valid_id());
  for (unsigned int n=0; n != this->n_nodes(); ++n)
    {
      libmesh_assert(this->get_node(n));
      libmesh_assert(this->get_node(n)->valid_id());
    }
}
unsigned int libMesh::Elem::local_node ( const dof_id_type  i) const [inline, inherited]
Returns:
the local id number of global Node id i, or invalid_uint if Node id i is not local.

Definition at line 1384 of file elem.h.

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

Referenced by libMesh::MeshTools::find_nodal_neighbors(), and libMesh::SerialMesh::stitching_helper().

{
  for (unsigned int n=0; n != this->n_nodes(); ++n)
    if (this->node(n) == i)
      return n;

  return libMesh::invalid_uint;
}
unsigned int libMesh::Tri3Subdivision::local_node_number ( unsigned int  node_id) const
Returns:
the order number of the node whose unordered id is node_id. This is the inverse of an _ordered_nodes lookup.

Definition at line 99 of file face_tri3_subdivision.C.

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

Referenced by libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::MeshTools::Subdivision::find_one_ring(), and libMesh::FE< Dim, T >::nodal_soln().

{
  return (_nodes[0]->id() == node_id) ? 0 : ( (_nodes[1]->id() == node_id) ? 1 : ( (_nodes[2]->id() == node_id) ? 2 : 3 ) );
}
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 1052 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().

{
  Elem *neigh = this->neighbor(n);

  // Don't bother calling this function unless it's necessary
  libmesh_assert(neigh);
  libmesh_assert(!neigh->is_remote());

  // We never have neighbors more refined than us
  libmesh_assert_less_equal (neigh->level(), this->level());

  // We never have subactive neighbors of non subactive elements
  libmesh_assert(!neigh->subactive() || this->subactive());

  // If we have a neighbor less refined than us then it must not
  // have any more refined active descendants we could have
  // pointed to instead.
  libmesh_assert(neigh->level() == this->level() ||
                 neigh->active());

  // If neigh is at our level, then its family might have
  // remote_elem neighbor links which need to point to us
  // instead, but if not, then we're done.
  if (neigh->level() != this->level())
    return;

  // If neigh is subactive then we're not updating its neighbor links
  // FIXME - this needs to change when we start using subactive
  // elements for more than just the two-phase
  // restriction/prolongation projections.
  if (neigh->subactive())
    return;

  // What side of neigh are we on?  We can't use the usual Elem
  // method because we're in the middle of restoring topology
  const UniquePtr<Elem> my_side = this->side(n);
  unsigned int nn = 0;
  for (; nn != neigh->n_sides(); ++nn)
    {
      const UniquePtr<Elem> neigh_side = neigh->side(nn);
      if (*my_side == *neigh_side)
        break;
    }

  // we had better be on *some* side of neigh
  libmesh_assert_less (nn, neigh->n_sides());

  // Find any elements that ought to point to elem
  std::vector<const Elem*> neigh_family;
#ifdef LIBMESH_ENABLE_AMR
  if (this->active())
    neigh->family_tree_by_side(neigh_family, nn);
  else
#endif
    neigh_family.push_back(neigh);

  // And point them to elem
  for (unsigned int i = 0; i != neigh_family.size(); ++i)
    {
      Elem* neigh_family_member = const_cast<Elem*>(neigh_family[i]);

      // Ideally, the neighbor link ought to either be correct
      // already or ought to be to remote_elem.
      //
      // However, if we're redistributing a newly created elem,
      // after an AMR step but before find_neighbors has fixed up
      // neighbor links, we might have an out of date neighbor
      // link to elem's parent instead.
#ifdef LIBMESH_ENABLE_AMR
      libmesh_assert((neigh_family_member->neighbor(nn) == this) ||
                     (neigh_family_member->neighbor(nn) == remote_elem)
                     || ((this->refinement_flag() == JUST_REFINED) &&
                         (this->parent() != NULL) &&
                         (neigh_family_member->neighbor(nn) == this->parent())));
#else
      libmesh_assert((neigh_family_member->neighbor(nn) == this) ||
                     (neigh_family_member->neighbor(nn) == remote_elem));
#endif

      neigh_family_member->set_neighbor(nn, this);
    }
}

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

{
  libmesh_assert_not_equal_to (this, remote_elem);

  // We need to have handled any children first
#if defined(LIBMESH_ENABLE_AMR) && defined(DEBUG)
  if (this->has_children())
    for (unsigned int c = 0; c != this->n_children(); ++c)
      {
        Elem *current_child = this->child(c);
        libmesh_assert_equal_to (current_child, remote_elem);
      }
#endif

  // Remotify any neighbor links to non-subactive elements
  if (!this->subactive())
    {
      for (unsigned int s = 0; s != this->n_sides(); ++s)
        {
          Elem *neigh = this->neighbor(s);
          if (neigh && neigh != remote_elem && !neigh->subactive())
            {
              // My neighbor should never be more refined than me; my real
              // neighbor would have been its parent in that case.
              libmesh_assert_greater_equal (this->level(), neigh->level());

              if (this->level() == neigh->level() &&
                  neigh->has_neighbor(this))
                {
#ifdef LIBMESH_ENABLE_AMR
                  // My neighbor may have descendants which also consider me a
                  // neighbor
                  std::vector<const Elem*> family;
                  neigh->family_tree_by_neighbor (family, this);

                  // FIXME - There's a lot of ugly const_casts here; we
                  // may want to make remote_elem non-const and create
                  // non-const versions of the family_tree methods
                  for (unsigned int i=0; i != family.size(); ++i)
                    {
                      Elem *n = const_cast<Elem*>(family[i]);
                      libmesh_assert (n);
                      if (n == remote_elem)
                        continue;
                      unsigned int my_s = n->which_neighbor_am_i(this);
                      libmesh_assert_less (my_s, n->n_neighbors());
                      libmesh_assert_equal_to (n->neighbor(my_s), this);
                      n->set_neighbor(my_s, const_cast<RemoteElem*>(remote_elem));
                    }
#else
                  unsigned int my_s = neigh->which_neighbor_am_i(this);
                  libmesh_assert_less (my_s, neigh->n_neighbors());
                  libmesh_assert_equal_to (neigh->neighbor(my_s), this);
                  neigh->set_neighbor(my_s, const_cast<RemoteElem*>(remote_elem));
#endif
                }
#ifdef LIBMESH_ENABLE_AMR
              // Even if my neighbor doesn't link back to me, it might
              // have subactive descendants which do
              else if (neigh->has_children())
                {
                  // If my neighbor at the same level doesn't have me as a
                  // neighbor, I must be subactive
                  libmesh_assert(this->level() > neigh->level() ||
                                 this->subactive());

                  // My neighbor must have some ancestor of mine as a
                  // neighbor
                  Elem *my_ancestor = this->parent();
                  libmesh_assert(my_ancestor);
                  while (!neigh->has_neighbor(my_ancestor))
                    {
                      my_ancestor = my_ancestor->parent();
                      libmesh_assert(my_ancestor);
                    }

                  // My neighbor may have descendants which consider me a
                  // neighbor
                  std::vector<const Elem*> family;
                  neigh->family_tree_by_subneighbor (family, my_ancestor, this);

                  // FIXME - There's a lot of ugly const_casts here; we
                  // may want to make remote_elem non-const and create
                  // non-const versions of the family_tree methods
                  for (unsigned int i=0; i != family.size(); ++i)
                    {
                      Elem *n = const_cast<Elem*>(family[i]);
                      libmesh_assert (n);
                      if (n == remote_elem)
                        continue;
                      unsigned int my_s = n->which_neighbor_am_i(this);
                      libmesh_assert_less (my_s, n->n_neighbors());
                      libmesh_assert_equal_to (n->neighbor(my_s), this);
                      n->set_neighbor(my_s, const_cast<RemoteElem*>(remote_elem));
                    }
                }
#endif
            }
        }
    }

#ifdef LIBMESH_ENABLE_AMR
  // Remotify parent's child link
  Elem *my_parent = this->parent();
  if (my_parent &&
      // As long as it's not already remote
      my_parent != remote_elem &&
      // And it's a real parent, not an interior parent
      this->dim() == my_parent->dim())
    {
      unsigned int me = my_parent->which_child_am_i(this);
      libmesh_assert_equal_to (my_parent->child(me), this);
      my_parent->set_child(me, const_cast<RemoteElem*>(remote_elem));
    }
#endif
}
unsigned int libMesh::Elem::max_descendant_p_level ( ) const [inline, inherited]

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

Definition at line 1882 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< OutputType >::coarsened_dof_values(), and libMesh::Elem::max_descendant_p_level().

{
  // This is undefined for subactive elements,
  // which have no active descendants
  libmesh_assert (!this->subactive());
  if (this->active())
    return this->p_level();

  unsigned int max_p_level = _p_level;
  for (unsigned int c=0; c != this->n_children(); c++)
    max_p_level = std::max(max_p_level,
                           this->child(c)->max_descendant_p_level());
  return max_p_level;
}
std::pair< Real, Real > libMesh::Tri3::min_and_max_angle ( ) const [inherited]

Returns the minimum and maximum angles for the triangle (in radians) in a std::pair. The first entry in the pair is the minimum angle, the second entry is the max angle.

Definition at line 204 of file face_tri3.C.

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

{
  Point v10 ( this->point(1) - this->point(0) );
  Point v20 ( this->point(2) - this->point(0) );
  Point v21 ( this->point(2) - this->point(1) );

  const Real
    len_10=v10.size(),
    len_20=v20.size(),
    len_21=v21.size()
    ;

  const Real
    theta0=std::acos(( v10*v20)/len_10/len_20),
    theta1=std::acos((-v10*v21)/len_10/len_21),
    theta2=libMesh::pi - theta0 - theta1
    ;

  libmesh_assert_greater (theta0, 0.);
  libmesh_assert_greater (theta1, 0.);
  libmesh_assert_greater (theta2, 0.);

  return std::make_pair(std::min(theta0, std::min(theta1,theta2)),
                        std::max(theta0, std::max(theta1,theta2)));
}
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 1680 of file elem.C.

References libMesh::Elem::active(), libMesh::Elem::child(), libMesh::Elem::COARSEN, libMesh::Elem::has_neighbor(), libMesh::libmesh_assert(), 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().

{
  libmesh_assert(!this->subactive());
  libmesh_assert(neighbor_in->active());

  // If we're an active element this is simple
  if (this->active())
    {
      unsigned int new_p_level = this->p_level();
      if (this->p_refinement_flag() == Elem::REFINE)
        new_p_level += 1;
      if (this->p_refinement_flag() == Elem::COARSEN)
        {
          libmesh_assert_greater (new_p_level, 0);
          new_p_level -= 1;
        }
      return std::min(current_min, new_p_level);
    }

  libmesh_assert(has_neighbor(neighbor_in));

  unsigned int min_p_level = current_min;

  for (unsigned int c=0; c<this->n_children(); c++)
    {
      const Elem* const current_child = this->child(c);
      if (current_child && current_child != remote_elem)
        if (current_child->has_neighbor(neighbor_in))
          min_p_level =
            current_child->min_new_p_level_by_neighbor(neighbor_in,
                                                       min_p_level);
    }

  return min_p_level;
}
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 1647 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< OutputType >::compute_periodic_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), and libMesh::Elem::min_p_level_by_neighbor().

{
  libmesh_assert(!this->subactive());
  libmesh_assert(neighbor_in->active());

  // If we're an active element this is simple
  if (this->active())
    return std::min(current_min, this->p_level());

  libmesh_assert(has_neighbor(neighbor_in));

  // The p_level() of an ancestor element is already the minimum
  // p_level() of its children - so if that's high enough, we don't
  // need to examine any children.
  if (current_min <= this->p_level())
    return current_min;

  unsigned int min_p_level = current_min;

  for (unsigned int c=0; c<this->n_children(); c++)
    {
      const Elem* const current_child = this->child(c);
      if (current_child != remote_elem && current_child->has_neighbor(neighbor_in))
        min_p_level =
          current_child->min_p_level_by_neighbor(neighbor_in,
                                                 min_p_level);
    }

  return min_p_level;
}
unsigned int libMesh::Tri::n_children ( ) const [inline, virtual, inherited]
Returns:
4

Implements libMesh::Elem.

Definition at line 91 of file face_tri.h.

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

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

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

{
  libmesh_assert_less (s,  this->n_systems());
  libmesh_assert_less (vg, this->n_var_groups(s));

  const unsigned int
    start_idx_sys = this->start_idx(s);

  libmesh_assert_less ((start_idx_sys + 2*vg), _idx_buf.size());

  return (_idx_buf[start_idx_sys + 2*vg] % ncv_magic);
}
unsigned int libMesh::DofObject::n_dofs ( const unsigned int  s,
const unsigned int  var = libMesh::invalid_uint 
) const [inline, inherited]
Returns:
the number of degrees of freedom associated with system s for this object. Optionally only counts degrees of freedom for variable number var

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

{
  libmesh_assert_less (s, this->n_systems());

  unsigned int num = 0;

  // Count all variables
  if (var == libMesh::invalid_uint)
    for (unsigned int v=0; v<this->n_vars(s); v++)
      num += this->n_comp(s,v);

  // Only count specified variable
  else
    num = this->n_comp(s,var);

  return num;
}
unsigned int libMesh::Tri::n_edges ( ) const [inline, virtual, inherited]
Returns:
3. All triangles have 3 edges.

Implements libMesh::Elem.

Definition at line 86 of file face_tri.h.

{ return 3; }
unsigned int libMesh::Face::n_faces ( ) const [inline, virtual, inherited]
Returns:
0. All 2D elements have no faces, just edges.

Implements libMesh::Elem.

Definition at line 64 of file face.h.

{ return 0; }
virtual unsigned int libMesh::Elem::n_neighbors ( ) const [inline, virtual, inherited]
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 444 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< OutputType >::compute_proj_constraints(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::MeshRefinement::eliminate_unrefined_patches(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::UnstructuredMesh::find_neighbors(), get_ordered_valence(), 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::Parallel::packable_size(), libMesh::Elem::set_neighbor(), libMesh::MeshTools::Modification::smooth(), libMesh::SerialMesh::stitching_helper(), libMesh::MeshRefinement::test_level_one(), libMesh::Elem::topological_neighbor(), libMesh::Parallel::unpack(), and libMesh::Elem::which_neighbor_am_i().

  { return this->n_sides(); }
unsigned int libMesh::Tri::n_nodes ( ) const [inline, virtual, inherited]
Returns:
3. All tri-derivatives are guaranteed to have at least 3 nodes.

Implements libMesh::Elem.

Reimplemented in libMesh::Tri6.

Definition at line 71 of file face_tri.h.

{ return 3; }
static unsigned int libMesh::ReferenceCounter::n_objects ( ) [inline, static, inherited]

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.

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

  { return _n_objects; }
static unsigned int libMesh::ReferenceCounter::n_objects ( ) [inline, static, inherited]

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.

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

  { return _n_objects; }
unsigned int libMesh::Elem::n_second_order_adjacent_vertices ( const unsigned int  n) const [virtual, inherited]
Returns:
the number of adjacent vertices, that uniquely define the location of the $ n^{th} $ second-order node. For linear elements ( default_order()==FIRST ), this returns 0. This method is useful when converting linear elements to quadratic elements. Note that n has to be greater or equal this->n_vertices().

Reimplemented in libMesh::InfHex18, libMesh::Prism18, libMesh::Hex27, libMesh::Pyramid14, libMesh::InfHex16, libMesh::Prism15, libMesh::Pyramid13, libMesh::Hex20, libMesh::Tet10, libMesh::InfPrism12, libMesh::Quad8, libMesh::Tri6, libMesh::Quad9, libMesh::InfQuad6, libMesh::Edge3, and libMesh::Edge4.

Definition at line 1965 of file elem.C.

Referenced by libMesh::LaplaceMeshSmoother::smooth(), and libMesh::MeshTools::Modification::smooth().

{
  // for linear elements, always return 0
  return 0;
}
unsigned int libMesh::Tri3::n_sub_elem ( ) const [inline, virtual, inherited]
Returns:
1

Implements libMesh::Elem.

Definition at line 74 of file face_tri3.h.

Referenced by libMesh::Tri3::connectivity().

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

Definition at line 749 of file dof_object.h.

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

{
  libmesh_assert_less (s, this->n_systems());

  const unsigned int nvg = this->n_var_groups(s);

  unsigned int val=0;

  for (unsigned int vg=0; vg<nvg; vg++)
    val += this->n_vars(s,vg);

  return val;
}
unsigned int libMesh::Tri::n_vertices ( ) const [inline, virtual, inherited]
Returns:
3. All triangles have 3 vertices.

Implements libMesh::Elem.

Definition at line 81 of file face_tri.h.

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

{ return 3; }
Elem * libMesh::Elem::neighbor ( const unsigned int  i) const [inline, inherited]
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 1453 of file elem.h.

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

Referenced by libMesh::MetisPartitioner::_do_partition(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), 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< OutputType >::compute_periodic_constraints(), libMesh::FEAbstract::compute_periodic_node_constraints(), libMesh::FEGenericBase< OutputType >::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::MeshTools::Subdivision::find_one_ring(), 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::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::MeshTools::Subdivision::tag_boundary_ghosts(), libMesh::Elem::topological_neighbor(), libMesh::MeshRefinement::topological_neighbor(), libMesh::Parallel::unpack(), libMesh::Elem::which_neighbor_am_i(), libMesh::GnuPlotIO::write_solution(), and libMesh::DivaIO::write_stream().

{
  libmesh_assert_less (i, this->n_neighbors());

  return _elemlinks[i+1];
}
dof_id_type libMesh::Elem::node ( const unsigned int  i) const [inline, inherited]
Returns:
the global id number of local Node i.

Reimplemented in libMesh::RemoteElem.

Definition at line 1372 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::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::UnstructuredMesh::all_first_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::DofMap::allgather_recursive_constraints(), libMesh::AbaqusIO::assign_sideset_ids(), 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::Quad4::connectivity(), libMesh::InfQuad4::connectivity(), libMesh::InfQuad6::connectivity(), libMesh::Prism6::connectivity(), libMesh::Pyramid5::connectivity(), libMesh::Tri3::connectivity(), libMesh::InfHex8::connectivity(), libMesh::Hex8::connectivity(), libMesh::InfPrism6::connectivity(), libMesh::Quad9::connectivity(), libMesh::Quad8::connectivity(), libMesh::Tri6::connectivity(), libMesh::InfPrism12::connectivity(), libMesh::Tet4::connectivity(), libMesh::Tet10::connectivity(), libMesh::InfHex16::connectivity(), libMesh::Hex20::connectivity(), libMesh::Prism15::connectivity(), libMesh::InfHex18::connectivity(), libMesh::Hex27::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::find_nodal_neighbors(), libMesh::MeshTools::get_not_subactive_node_ids(), libMesh::UNVIO::groups_in(), libMesh::Tet::key(), libMesh::Prism::key(), libMesh::Pyramid::key(), libMesh::Hex::key(), libMesh::Tri::key(), libMesh::InfHex::key(), libMesh::InfPrism::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::Elem::operator==(), libMesh::Parallel::pack(), libMesh::XdrIO::pack_element(), libMesh::GmshIO::read_mesh(), libMesh::VariationalMeshSmoother::readgr(), 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::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().

{
  libmesh_assert_less (i, this->n_nodes());
  libmesh_assert(_nodes[i]);
  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);

  return _nodes[i]->id();
}
void libMesh::Elem::nullify_neighbors ( ) [inherited]

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

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

{
  // Tell any of my neighbors about my death...
  // Looks strange, huh?
  for (unsigned int n=0; n<this->n_neighbors(); n++)
    {
      Elem* current_neighbor = this->neighbor(n);
      if (current_neighbor && current_neighbor != remote_elem)
        {
          // Note:  it is possible that I see the neighbor
          // (which is coarser than me)
          // but they don't see me, so avoid that case.
          if (current_neighbor->level() == this->level())
            {
              const unsigned int w_n_a_i = current_neighbor->which_neighbor_am_i(this);
              libmesh_assert_less (w_n_a_i, current_neighbor->n_neighbors());
              current_neighbor->set_neighbor(w_n_a_i, NULL);
              this->set_neighbor(n, NULL);
            }
        }
    }
}
bool libMesh::Elem::on_boundary ( ) const [inline, inherited]
Returns:
true if this element has a side coincident with a boundary (indicated by a NULL neighbor), false otherwise.

Definition at line 1511 of file elem.h.

References libMesh::Elem::has_neighbor().

{
  // By convention, the element is on the boundary
  // if it has a NULL neighbor.
  return this->has_neighbor(NULL);
}
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 462 of file elem.C.

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

{

  // Cast rhs to an Elem*
  //    const Elem* rhs_elem = dynamic_cast<const Elem*>(&rhs);
  const Elem* rhs_elem = &rhs;

  // If we cannot cast to an Elem*, rhs must be a Node
  //    if(rhs_elem == static_cast<const Elem*>(NULL))
  //        return false;

  //   libmesh_assert (n_nodes());
  //   libmesh_assert (rhs.n_nodes());

  //   // Elements can only be equal if they
  //   // contain the same number of nodes.
  //   if (this->n_nodes() == rhs.n_nodes())
  //     {
  //       // Create a set that contains our global
  //       // node numbers and those of our neighbor.
  //       // If the set is the same size as the number
  //       // of nodes in both elements then they must
  //       // be connected to the same nodes.
  //       std::set<unsigned int> nodes_set;

  //       for (unsigned int n=0; n<this->n_nodes(); n++)
  //         {
  //           nodes_set.insert(this->node(n));
  //           nodes_set.insert(rhs.node(n));
  //         }

  //       // If this passes the elements are connected
  //       // to the same global nodes
  //       if (nodes_set.size() == this->n_nodes())
  //         return true;
  //     }

  //   // If we get here it is because the elements either
  //   // do not have the same number of nodes or they are
  //   // connected to different nodes.  Either way they
  //   // are not the same element
  //   return false;

  // Useful typedefs
  typedef std::vector<dof_id_type>::iterator iterator;


  // Elements can only be equal if they
  // contain the same number of nodes.
  // However, we will only test the vertices,
  // which is sufficient & cheaper
  if (this->n_nodes() == rhs_elem->n_nodes())
    {
      // The number of nodes in the element
      const unsigned int nn = this->n_nodes();

      // Create a vector that contains our global
      // node numbers and those of our neighbor.
      // If the sorted, unique vector is the same size
      // as the number of nodes in both elements then
      // they must be connected to the same nodes.
      //
      // The vector will be no larger than 2*n_nodes(),
      // so we might as well reserve the space.
      std::vector<dof_id_type> common_nodes;
      common_nodes.reserve (2*nn);

      // Add the global indices of the nodes
      for (unsigned int n=0; n<nn; n++)
        {
          common_nodes.push_back (this->node(n));
          common_nodes.push_back (rhs_elem->node(n));
        }

      // Sort the vector and find out how long
      // the sorted vector is.
      std::sort (common_nodes.begin(), common_nodes.end());

      iterator new_end = std::unique (common_nodes.begin(),
                                      common_nodes.end());

      const int new_size = cast_int<int>
        (std::distance (common_nodes.begin(), new_end));

      // If this passes the elements are connected
      // to the same global vertex nodes
      if (new_size == static_cast<int>(nn))
        return true;
    }

  // If we get here it is because the elements either
  // do not have the same number of nodes or they are
  // connected to different nodes.  Either way they
  // are not the same element
  return false;
}
unsigned int libMesh::Elem::opposite_node ( const unsigned int  n,
const unsigned int  s 
) const [virtual, inherited]

Reimplemented in libMesh::Edge, libMesh::Quad, and libMesh::Hex.

Definition at line 2214 of file elem.C.

{
  // If the subclass didn't rederive this, using it is an error
  libmesh_not_implemented();
}
unsigned int libMesh::Elem::opposite_side ( const unsigned int  s) const [virtual, inherited]

Reimplemented in libMesh::Edge, libMesh::Quad, and libMesh::Hex.

Definition at line 2206 of file elem.C.

{
  // If the subclass didn't rederive this, using it is an error
  libmesh_not_implemented();
}
virtual Point libMesh::Elem::origin ( ) const [inline, virtual, inherited]
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 1134 of file elem.h.

Referenced by libMesh::InfFE< Dim, T_radial, T_map >::combine_base_radial(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::Elem::get_info(), libMesh::InfFE< Dim, T_radial, T_map >::inverse_map(), and libMesh::InfFE< Dim, T_radial, T_map >::map().

{ libmesh_not_implemented(); return Point(); }
unsigned int libMesh::Elem::p_level ( ) const [inline, inherited]

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 1798 of file elem.h.

References libMesh::Elem::_p_level.

Referenced by libMesh::MeshRefinement::_coarsen_elements(), libMesh::DofMap::_dof_indices(), libMesh::MeshRefinement::_refine_elements(), libMesh::UnstructuredMesh::all_first_order(), libMesh::Elem::coarsen(), libMesh::FEGenericBase< OutputType >::coarsened_dof_values(), libMesh::FEInterface::compute_data(), libMesh::FEGenericBase< OutputType >::compute_periodic_constraints(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::DofMap::constrain_p_dofs(), 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::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), libMesh::Elem::get_info(), libMesh::InfFE< Dim, T_radial, 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::XdrIO::pack_element(), libMesh::Elem::refine(), libMesh::FE< Dim, T >::reinit(), libMesh::InfFE< Dim, T_radial, 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::GMVIO::write_ascii_new_impl(), and libMesh::CheckpointIO::write_connectivity().

{
#ifdef LIBMESH_ENABLE_AMR
  return _p_level;
#else
  return 0;
#endif
}
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().

{
#ifdef LIBMESH_ENABLE_AMR
  // We might need to pack old_dof_object too
  *target++ = (old_dof_object == NULL) ? 0 : 1;
#endif

  *target++ = _idx_buf.size();
  std::copy(_idx_buf.begin(), _idx_buf.end(), target);

#ifdef LIBMESH_ENABLE_AMR
  if (old_dof_object)
    old_dof_object->pack_indexing(target);
#endif
}
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 450 of file dof_object.C.

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

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

{
  return
    cast_int<unsigned int> (
#ifdef LIBMESH_ENABLE_AMR
                            ((old_dof_object == NULL) ? 0 : old_dof_object->packed_indexing_size()) + 2 +
#else
                            1 +
#endif
                            _idx_buf.size());
}
const Elem * libMesh::Elem::parent ( ) const [inline, inherited]
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 1683 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::ExactErrorEstimator::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::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::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().

{
  return _elemlinks[0];
}
Elem * libMesh::Elem::parent ( ) [inline, inherited]
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 1691 of file elem.h.

References libMesh::Elem::_elemlinks.

{
  return _elemlinks[0];
}
const Point & libMesh::Elem::point ( const unsigned int  i) const [inline, inherited]
Returns:
the Point associated with local Node i.

Reimplemented in libMesh::RemoteElem.

Definition at line 1350 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::Subdivision::add_boundary_ghosts(), libMesh::MeshTools::Modification::all_tri(), libMesh::Tet::choose_diagonal(), libMesh::Elem::coarsen(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::FEMap::compute_edge_map(), libMesh::FEXYZMap::compute_face_map(), libMesh::FEMap::compute_face_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::ElemCutter::cut_2D(), libMesh::ElemCutter::cut_3D(), 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(), libMesh::Hex20::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< Dim, T_radial, T_map >::inverse_map(), libMesh::Elem::length(), libMesh::FE< Dim, T >::map(), libMesh::InfFE< Dim, T_radial, 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::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().

{
  libmesh_assert_less (i, this->n_nodes());
  libmesh_assert(_nodes[i]);
  libmesh_assert_not_equal_to (_nodes[i]->id(), Node::invalid_id);

  return *_nodes[i];
}
Point & libMesh::Elem::point ( const unsigned int  i) [inline, inherited]
Returns:
the Point associated with local Node i as a writeable reference.

Reimplemented in libMesh::RemoteElem.

Definition at line 1362 of file elem.h.

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

{
  libmesh_assert_less (i, this->n_nodes());

  return *_nodes[i];
}

Prepares the element for use by reordering the nodes such that the irregular node (valence != 6), if there is one, is the first. The nodes are ordered once in advance for efficiency.

Definition at line 50 of file face_tri3_subdivision.C.

References _ordered_nodes, _subdivision_updated, libMesh::Elem::get_node(), libMesh::MeshTools::Subdivision::next, and libMesh::MeshTools::Subdivision::prev.

Referenced by libMesh::MeshTools::Subdivision::prepare_subdivision_mesh().

{
  /*
   * Find the index of the irregular vertex, if any.
   * The current implementation can only handle triangles with
   * no more than one irregular vertex. That is, a vertex with
   * valence != 6.
   */
  unsigned int irregular_idx = 0;
  for (unsigned int i = 0; i < 3; ++i)
    {
      if (this->get_node(i)->valence() != 6)
        {
          irregular_idx = i;
          if (this->get_node(MeshTools::Subdivision::next[i])->valence() != 6 || this->get_node(MeshTools::Subdivision::prev[i])->valence() != 6)
            libmesh_error_msg("Error: The mesh contains elements with more than one irregular vertex!");
        }
    }

  /*
   * Rotate ordered vertices such that ordered_nodes[0] is the
   * irregular vertex. Doing this once in advance lets the evaluation
   * of subdivision interpolation be much more efficient afterwards.
   */
  switch (irregular_idx)
    {
    case 0:
      _ordered_nodes[0] = this->get_node(0);
      _ordered_nodes[1] = this->get_node(1);
      _ordered_nodes[2] = this->get_node(2);
      break;
    case 1:
      _ordered_nodes[0] = this->get_node(1);
      _ordered_nodes[1] = this->get_node(2);
      _ordered_nodes[2] = this->get_node(0);
      break;
    case 2:
      _ordered_nodes[0] = this->get_node(2);
      _ordered_nodes[1] = this->get_node(0);
      _ordered_nodes[2] = this->get_node(1);
      break;
    default:
      libmesh_error_msg("Unrecognized irregular_idx = " << irregular_idx);
    }

  _subdivision_updated = true;
}
void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out) [static, inherited]

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

Definition at line 88 of file reference_counter.C.

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

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

void libMesh::ReferenceCounter::print_info ( std::ostream &  out = libMesh::out) [static, inherited]

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

Definition at line 88 of file reference_counter.C.

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

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

void libMesh::Elem::print_info ( std::ostream &  os = libMesh::out) const [inherited]

Prints relevant information about the element.

Definition at line 1862 of file elem.C.

References libMesh::Elem::get_info().

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

{
  os << this->get_info()
     << std::endl;
}
processor_id_type libMesh::DofObject::processor_id ( ) const [inline, inherited]
Returns:
the processor that this DofObject belongs to.

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

Definition at line 681 of file dof_object.h.

References libMesh::DofObject::_processor_id.

Referenced by libMesh::LinearPartitioner::_do_partition(), libMesh::MetisPartitioner::_do_partition(), libMesh::SFCPartitioner::_do_partition(), libMesh::CentroidPartitioner::_do_partition(), libMesh::GMVIO::_read_materials(), 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::ParallelMesh::delete_elem(), libMesh::ParallelMesh::delete_node(), libMesh::DofMap::distribute_dofs(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::Elem::Elem(), libMesh::MeshFunction::find_element(), libMesh::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::ParallelMesh::insert_elem(), 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::DofMap::local_variable_indices(), libMesh::MeshRefinement::make_coarsening_compatible(), libMesh::Parallel::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::Parallel::sync_node_data_by_element_id(), libMesh::Parallel::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().

{
  return _processor_id;
}
Returns:
the processor that this DofObject belongs to as a writeable reference.

Definition at line 689 of file dof_object.h.

References libMesh::DofObject::_processor_id.

{
  return _processor_id;
}
void libMesh::DofObject::processor_id ( const processor_id_type  pid) [inline, inherited]

Sets the processor_id for this DofObject.

Definition at line 697 of file dof_object.h.

References libMesh::DofObject::processor_id().

{
  this->processor_id() = pid;
}
std::pair< Real, Real > libMesh::Tri::qual_bounds ( const ElemQuality  q) const [virtual, inherited]

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 161 of file face_tri.C.

References libMesh::CONDITION, libMesh::DISTORTION, libMesh::JACOBIAN, libMesh::MAX_ANGLE, libMesh::MIN_ANGLE, libMesh::out, libMesh::SHAPE, and libMesh::SIZE.

{
  std::pair<Real, Real> bounds;

  switch (q)
    {

    case MAX_ANGLE:
      bounds.first  = 60.;
      bounds.second = 90.;
      break;

    case MIN_ANGLE:
      bounds.first  = 30.;
      bounds.second = 60.;
      break;

    case CONDITION:
      bounds.first  = 1.;
      bounds.second = 1.3;
      break;

    case JACOBIAN:
      bounds.first  = 0.5;
      bounds.second = 1.155;
      break;

    case SIZE:
    case SHAPE:
      bounds.first  = 0.25;
      bounds.second = 1.;
      break;

    case DISTORTION:
      bounds.first  = 0.6;
      bounds.second = 1.;
      break;

    default:
      libMesh::out << "Warning: Invalid quality measure chosen." << std::endl;
      bounds.first  = -1;
      bounds.second = -1;
    }

  return bounds;
}
Real libMesh::Tri::quality ( const ElemQuality  q) const [virtual, inherited]

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

Source: Netgen, meshtool.cpp, TriangleQualityInst

I don't know what to do for this metric. Maybe the base class knows. We won't get here because of the defualt case above.

Reimplemented from libMesh::Elem.

Definition at line 109 of file face_tri.C.

References libMesh::DISTORTION, libMesh::Elem::get_node(), libMesh::Real, libMesh::TypeVector< T >::size(), and libMesh::STRETCH.

{
  switch (q)
    {

    case DISTORTION:
    case STRETCH:
      {
        const Node* p1 = this->get_node(0);
        const Node* p2 = this->get_node(1);
        const Node* p3 = this->get_node(2);

        Point v1 = (*p2) - (*p1);
        Point v2 = (*p3) - (*p1);
        Point v3 = (*p3) - (*p2);
        const Real l1 = v1.size();
        const Real l2 = v2.size();
        const Real l3 = v3.size();

        // if one length is 0, quality is quite bad!
        if ((l1 <=0.) || (l2 <= 0.) || (l3 <= 0.))
          return 0.;

        const Real s1 = std::sin(std::acos(v1*v2/l1/l2)/2.);
        v1 *= -1;
        const Real s2 = std::sin(std::acos(v1*v3/l1/l3)/2.);
        const Real s3 = std::sin(std::acos(v2*v3/l2/l3)/2.);

        return 8. * s1 * s2 * s3;

      }
    default:
      return Elem::quality(q);
    }

  return Elem::quality(q);

}
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 398 of file elem.C.

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

Referenced by libMesh::QComposite< QSubCell >::init().

{
  return &(ReferenceElem::get(this->type()));
}
void libMesh::Elem::refine ( MeshRefinement mesh_refinement) [virtual, inherited]

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

{
  libmesh_assert_equal_to (this->refinement_flag(), Elem::REFINE);
  libmesh_assert (this->active());

  // Create my children if necessary
  if (!_children)
    {
      _children = new Elem*[this->n_children()];

      unsigned int parent_p_level = this->p_level();
      for (unsigned int c=0; c<this->n_children(); c++)
        {
          _children[c] = Elem::build(this->type(), this).release();
          _children[c]->set_refinement_flag(Elem::JUST_REFINED);
          _children[c]->set_p_level(parent_p_level);
          _children[c]->set_p_refinement_flag(this->p_refinement_flag());
        }

      // Compute new nodal locations
      // and asssign nodes to children
      // Make these static.  It is unlikely the
      // sizes will change from call to call, so having these
      // static should save on reallocations
      std::vector<std::vector<Point> >        p    (this->n_children());
      std::vector<std::vector<Node*> >        nodes(this->n_children());


      // compute new nodal locations
      for (unsigned int c=0; c<this->n_children(); c++)
        {
          Elem *current_child = this->child(c);
          p[c].resize    (current_child->n_nodes());
          nodes[c].resize(current_child->n_nodes());

          for (unsigned int nc=0; nc<current_child->n_nodes(); nc++)
            {
              // zero entries
              p[c][nc].zero();
              nodes[c][nc] = NULL;

              for (unsigned int n=0; n<this->n_nodes(); n++)
                {
                  // The value from the embedding matrix
                  const float em_val = this->embedding_matrix(c,nc,n);

                  if (em_val != 0.)
                    {
                      p[c][nc].add_scaled (this->point(n), em_val);

                      // We may have found the node, in which case we
                      // won't need to look it up later.
                      if (em_val == 1.)
                        nodes[c][nc] = this->get_node(n);
                    }
                }
            }

          // assign nodes to children & add them to the mesh
          const Real pointtol = this->hmin() * TOLERANCE;
          for (unsigned int nc=0; nc<current_child->n_nodes(); nc++)
            {
              if (nodes[c][nc] != NULL)
                {
                  current_child->set_node(nc) = nodes[c][nc];
                }
              else
                {
                  current_child->set_node(nc) =
                    mesh_refinement.add_point(p[c][nc],
                                              current_child->processor_id(),
                                              pointtol);
                  current_child->get_node(nc)->set_n_systems
                    (this->n_systems());
                }
            }

          mesh_refinement.add_elem (current_child);
          current_child->set_n_systems(this->n_systems());
        }
    }
  else
    {
      unsigned int parent_p_level = this->p_level();
      for (unsigned int c=0; c<this->n_children(); c++)
        {
          Elem *current_child = this->child(c);
          libmesh_assert(current_child->subactive());
          current_child->set_refinement_flag(Elem::JUST_REFINED);
          current_child->set_p_level(parent_p_level);
          current_child->set_p_refinement_flag(this->p_refinement_flag());
        }
    }

  // Un-set my refinement flag now
  this->set_refinement_flag(Elem::INACTIVE);
  this->set_p_refinement_flag(Elem::INACTIVE);

  for (unsigned int c=0; c<this->n_children(); c++)
    {
      libmesh_assert_equal_to (this->child(c)->parent(), this);
      libmesh_assert(this->child(c)->active());
    }
  libmesh_assert (this->ancestor());
}

Returns the value of the refinement flag for the element.

Definition at line 1850 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::MeshRefinement::enforce_mismatch_limit_prior_to_refinement(), 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::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(), and libMesh::Parallel::unpack().

{
  return static_cast<RefinementState>(_rflag);
}
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 1390 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().

{
  libmesh_assert(this->has_children());

  libmesh_assert(this->child(c));

  this->set_child(c, elem);
}
unsigned short int libMesh::Elem::second_order_adjacent_vertex ( const unsigned int  n,
const unsigned int  v 
) const [virtual, inherited]
Returns:
the element-local number of the $ v^{th} $ vertex that defines the $ n^{th} $ second-order node. Note that the return value is always less this->n_vertices(), while n has to be greater or equal this->n_vertices(). For linear elements this returns 0.

Reimplemented in libMesh::InfHex18, libMesh::Prism18, libMesh::Hex27, libMesh::InfHex16, libMesh::Pyramid14, libMesh::Prism15, libMesh::Hex20, libMesh::Pyramid13, libMesh::Tet10, libMesh::InfPrism12, libMesh::Quad8, libMesh::Tri6, libMesh::Quad9, libMesh::InfQuad6, libMesh::Edge3, and libMesh::Edge4.

Definition at line 1973 of file elem.C.

Referenced by libMesh::LaplaceMeshSmoother::smooth(), and libMesh::MeshTools::Modification::smooth().

{
  // for linear elements, always return 0
  return 0;
}
std::pair< unsigned short int, unsigned short int > libMesh::Elem::second_order_child_vertex ( const unsigned int  n) const [virtual, inherited]
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 in libMesh::InfHex18, libMesh::Prism18, libMesh::Hex27, libMesh::InfHex16, libMesh::Prism15, libMesh::Hex20, libMesh::Tet10, libMesh::InfPrism12, libMesh::Quad8, libMesh::Tri6, libMesh::Quad9, libMesh::InfQuad6, and libMesh::Edge3.

Definition at line 1983 of file elem.C.

{
  // for linear elements, always return 0
  return std::pair<unsigned short int, unsigned short int>(0,0);
}
ElemType libMesh::Elem::second_order_equivalent_type ( const ElemType  et,
const bool  full_ordered = true 
) [static, inherited]
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 2045 of file elem.C.

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

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

{
  /* for second-order elements, always return \p INVALID_ELEM
   * since second-order elements should not be converted
   * into something else.  Only linear elements should
   * return something sensible here
   */
  switch (et)
    {
    case EDGE2:
      {
        // full_ordered not relevant
        return EDGE3;
      }

    case TRI3:
      {
        // full_ordered not relevant
        return TRI6;
      }

    case QUAD4:
      {
        if (full_ordered)
          return QUAD9;
        else
          return QUAD8;
      }

    case TET4:
      {
        // full_ordered not relevant
        return TET10;
      }

    case HEX8:
      {
        // see below how this correlates with INFHEX8
        if (full_ordered)
          return HEX27;
        else
          return HEX20;
      }

    case PRISM6:
      {
        if (full_ordered)
          return PRISM18;
        else
          return PRISM15;
      }

    case PYRAMID5:
      {
        if (full_ordered)
          return PYRAMID14;
        else
          return PYRAMID13;

        return INVALID_ELEM;
      }



#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS

      // infinite elements
    case INFEDGE2:
      {
        return INVALID_ELEM;
      }

    case INFQUAD4:
      {
        // full_ordered not relevant
        return INFQUAD6;
      }

    case INFHEX8:
      {
        /*
         * Note that this matches with \p Hex8:
         * For full-ordered, \p InfHex18 and \p Hex27
         * belong together, and for not full-ordered,
         * \p InfHex16 and \p Hex20 belong together.
         */
        if (full_ordered)
          return INFHEX18;
        else
          return INFHEX16;
      }

    case INFPRISM6:
      {
        // full_ordered not relevant
        return INFPRISM12;
      }

#endif


    default:
      {
        // second-order element
        return INVALID_ELEM;
      }
    }
}
void libMesh::DofObject::set_buffer ( const std::vector< dof_id_type > &  buf) [inline, inherited]

Definition at line 499 of file dof_object.h.

References libMesh::DofObject::_idx_buf.

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

{
  libmesh_assert_less (s,    this->n_systems());
  libmesh_assert_less (var,  this->n_vars(s));
  libmesh_assert_less (comp, this->n_comp(s,var));

  const unsigned int
    vg            = this->var_to_vg(s,var),
#ifndef NDEBUG
    ncg           = this->n_comp_group(s,vg),
#endif
    vig           = this->system_var_to_vg_var(s,vg,var),
    start_idx_sys = this->start_idx(s);

  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());

  dof_id_type &base_idx = _idx_buf[start_idx_sys + 2*vg + 1];

  // We intend to change all dof numbers together or not at all
  if (comp || vig)
    libmesh_assert ((dn == invalid_id && base_idx == invalid_id) ||
                    (dn == base_idx + vig*ncg + comp));

  // only explicitly store the base index for vig==0, comp==0
  else
    base_idx = dn;

  // #ifdef DEBUG
  //   libMesh::out << " [ ";
  //   for (unsigned int i=0; i<_idx_buf.size(); i++)
  //     libMesh::out << _idx_buf[i] << " ";
  //   libMesh::out << "]\n";
  // #endif

  libmesh_assert_equal_to (this->dof_number(s, var, comp), dn);
}
void libMesh::Tri3Subdivision::set_ghost ( bool  ghosted) [inline]

Sets the boolean flag identifying ghost elements.

Definition at line 110 of file face_tri3_subdivision.h.

References _is_ghost.

Referenced by libMesh::MeshTools::Subdivision::add_boundary_ghosts(), and libMesh::MeshTools::Subdivision::tag_boundary_ghosts().

{ _is_ghost = ghosted; }
void libMesh::DofObject::set_id ( const dof_id_type  dofid) [inline, inherited]

Sets the id for this DofObject

Definition at line 161 of file dof_object.h.

References libMesh::DofObject::set_id().

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

  { this->set_id() = dofid; }
void libMesh::Elem::set_interior_parent ( Elem p) [inline, inherited]

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

Definition at line 1749 of file elem.h.

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

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

{
  // interior parents make no sense for full-dimensional elements.
  libmesh_assert_less (this->dim(), LIBMESH_DIM);

  // this had better be a one-higher-dimensional interior element
  libmesh_assert (!p ||
                  p->dim() == (this->dim()+1));

  _elemlinks[1+this->n_sides()] = p;
}
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 338 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().

{
  libmesh_assert_less (s,   this->n_systems());
  libmesh_assert_less (var, this->n_vars(s));

  this->set_n_comp_group(s, this->var_to_vg(s,var), ncomp);
}
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 350 of file dof_object.C.

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

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

{
  libmesh_assert_less (s,  this->n_systems());
  libmesh_assert_less (vg, this->n_var_groups(s));

  // Check for trivial return
  if (ncomp == this->n_comp_group(s,vg)) return;

#ifndef NDEBUG
  if (ncomp >= ncv_magic)
    {
      const index_t ncvm = ncv_magic;
      libmesh_error_msg("ERROR: ncomp must be less than DofObject::ncv_magic!\n" \
                        << "ncomp = "                                   \
                        << ncomp                                \
                        << ", ncv_magic = "                     \
                        << ncvm                                 \
                        << "\nrecompile and try again!");
    }
#endif

  const unsigned int
    start_idx_sys = this->start_idx(s),
    n_vars_group  = this->n_vars(s,vg),
    base_offset   = start_idx_sys + 2*vg;

  libmesh_assert_less ((base_offset + 1), _idx_buf.size());

  // if (ncomp)
  //   libMesh::out << "s,vg,ncomp="
  //       << s  << ","
  //       << vg << ","
  //       << ncomp << '\n';

  // set the number of components, maintaining the number
  // of variables in the group
  _idx_buf[base_offset] = ncv_magic*n_vars_group + ncomp;

  // We use (invalid_id - 1) to signify no
  // components for this object
  _idx_buf[base_offset + 1] = (ncomp == 0) ? invalid_id - 1 : invalid_id;

  // this->debug_buffer();
  // libMesh::out << "s,vg = " << s << "," << vg << '\n'
  //     << "base_offset=" << base_offset << '\n'
  //     << "this->n_comp(s,vg)=" << this->n_comp(s,vg) << '\n'
  //     << "this->n_comp_group(s,vg)=" << this->n_comp_group(s,vg) << '\n'
  //     << "this->n_vars(s,vg)=" << this->n_vars(s,vg) << '\n'
  //     << "this->n_var_groups(s)=" << this->n_var_groups(s) << '\n';

  libmesh_assert_equal_to (ncomp, this->n_comp_group(s,vg));
}
void libMesh::DofObject::set_n_systems ( const unsigned int  s) [inherited]

Sets the number of systems for this DofObject

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

{
  // Check for trivial return
  if (ns == this->n_systems())
    return;

  // Clear any existing data.  This is safe to call
  // even if we don't have any data.
  this->clear_dofs();

  // Set the new number of systems
  _idx_buf.resize(ns, ns);
  _idx_buf[0] = ns;


#ifdef DEBUG

  // check that all systems now exist and that they have 0 size
  libmesh_assert_equal_to (ns, this->n_systems());
  for (unsigned int s=0; s<this->n_systems(); s++)
    {
      libmesh_assert_equal_to (this->n_vars(s),       0);
      libmesh_assert_equal_to (this->n_var_groups(s), 0);
    }

#endif
}
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 219 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().

{

  libmesh_assert_less (s, this->n_systems());

  // number of varaible groups for this system - inferred
  const unsigned int nvg = cast_int<unsigned int>(nvpg.size());

  // BSK - note that for compatibility with the previous implementation
  // calling this method when (nvars == this->n_vars()) requires that
  // we invalidate the DOF indices and set the number of components to 0.
  // Note this was a bit of a suprise to me - there was no quick return in
  // the old method, which caused removal and readdition of the DOF indices
  // even in the case of (nvars == this->n_vars()), resulting in n_comp(s,v)
  // implicitly becoming 0 regardless of any previous value.
  // quick return?
  if (nvg == this->n_var_groups(s))
    {
      for (unsigned int vg=0; vg<nvg; vg++)
        {
          this->set_n_comp_group(s,vg,0);
          libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
        }
      return;
    }

  // since there is ample opportunity to screw up other systems, let us
  // cache their current sizes and later assert that they are unchanged.
#ifdef DEBUG
  DofObject::index_buffer_t old_system_sizes;
  old_system_sizes.reserve(this->n_systems());

  for (unsigned int s_ctr=0; s_ctr<this->n_systems(); s_ctr++)
    old_system_sizes.push_back(this->n_var_groups(s_ctr));
#endif

  // remove current indices if we have some
  if (this->n_var_groups(s) != 0)
    {
      const unsigned int old_nvg_s = this->n_var_groups(s);

      DofObject::index_buffer_t::iterator
        it  = _idx_buf.begin(),
        end = _idx_buf.begin();

      std::advance(it,  this->start_idx(s));
      std::advance(end, this->end_idx(s));
      _idx_buf.erase(it,end);

      for (unsigned int ctr=(s+1); ctr<this->n_systems(); ctr++)
        _idx_buf[ctr] -= 2*old_nvg_s;
    }

  // better not have any now!
  libmesh_assert_equal_to (this->n_var_groups(s), 0);

  // had better not screwed up any of our sizes!
#ifdef DEBUG
  for (unsigned int s_ctr=0; s_ctr<this->n_systems(); s_ctr++)
    if (s_ctr != s)
      libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);
#endif

  // OK, if the user requested 0 that is what we have
  if (nvg == 0)
    return;

  {
    // array to hold new indices
    DofObject::index_buffer_t var_idxs(2*nvg);
    for (unsigned int vg=0; vg<nvg; vg++)
      {
        var_idxs[2*vg    ] = ncv_magic*nvpg[vg] + 0;
        var_idxs[2*vg + 1] = invalid_id - 1;
      }

    DofObject::index_buffer_t::iterator it = _idx_buf.begin();
    std::advance(it, this->end_idx(s));
    _idx_buf.insert(it, var_idxs.begin(), var_idxs.end());

    for (unsigned int ctr=(s+1); ctr<this->n_systems(); ctr++)
      _idx_buf[ctr] += 2*nvg;

    // resize _idx_buf to fit so no memory is wasted.
    DofObject::index_buffer_t(_idx_buf).swap(_idx_buf);
  }

  // that better had worked.  Assert stuff.
  libmesh_assert_equal_to (nvg, this->n_var_groups(s));

#ifdef DEBUG

  // libMesh::out << " [ ";
  // for (unsigned int i=0; i<_idx_buf.size(); i++)
  //   libMesh::out << _idx_buf[i] << " ";
  // libMesh::out << "]\n";

  libmesh_assert_equal_to (this->n_var_groups(s), nvpg.size());

  for (unsigned int vg=0; vg<this->n_var_groups(s); vg++)
    {
      libmesh_assert_equal_to (this->n_vars(s,vg), nvpg[vg]);
      libmesh_assert_equal_to (this->n_comp_group(s,vg), 0);
    }

  for (unsigned int v=0; v<this->n_vars(s); v++)
    libmesh_assert_equal_to (this->n_comp(s,v), 0);

  // again, all other system sizes shoudl be unchanged!
  for (unsigned int s_ctr=0; s_ctr<this->n_systems(); s_ctr++)
    if (s_ctr != s)
      libmesh_assert_equal_to (this->n_var_groups(s_ctr), old_system_sizes[s_ctr]);

#endif
}
Node *& libMesh::Elem::set_node ( const unsigned int  i) [inline, virtual, inherited]
Returns:
the pointer to local Node i as a writeable reference.

Reimplemented in libMesh::RemoteElem.

Definition at line 1427 of file elem.h.

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

Referenced by libMesh::GMVIO::_read_one_cell(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), 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::Prism6::build_side(), libMesh::Quad4::build_side(), libMesh::Pyramid5::build_side(), libMesh::InfQuad4::build_side(), libMesh::InfQuad6::build_side(), libMesh::InfHex8::build_side(), libMesh::Tri3::build_side(), libMesh::InfPrism6::build_side(), libMesh::Hex8::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(), libMesh::Hex20::build_side(), libMesh::Pyramid13::build_side(), libMesh::Prism15::build_side(), libMesh::Edge::build_side(), libMesh::Pyramid14::build_side(), libMesh::Hex27::build_side(), libMesh::Prism18::build_side(), libMesh::TriangleWrapper::copy_tri_to_mesh(), libMesh::UnstructuredMesh::create_submesh(), libMesh::UNVIO::elements_in(), libMesh::MeshTools::Modification::flatten(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_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::Tet::side(), libMesh::Prism::side(), libMesh::Pyramid::side(), libMesh::Hex::side(), libMesh::Tri::side(), libMesh::InfPrism::side(), libMesh::InfHex::side(), libMesh::Quad::side(), libMesh::InfQuad::side(), libMesh::Edge::side(), libMesh::SerialMesh::stitching_helper(), libMesh::BoundaryInfo::sync(), and libMesh::Parallel::unpack().

{
  libmesh_assert_less (i, this->n_nodes());

  return _nodes[i];
}

Sets the old_dof_object to a copy of this

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

{
  this->clear_old_dof_object();

  libmesh_assert (!this->old_dof_object);

  // Make a new DofObject, assign a copy of \p this.
  // Make sure the copy ctor for DofObject works!!
  this->old_dof_object = new DofObject(*this);
}
void libMesh::Elem::set_p_level ( const unsigned int  p) [inline, inherited]

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

Definition at line 1900 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(), and libMesh::Parallel::unpack().

{
  // Maintain the parent's p level as the minimum of it's children
  if (this->parent() != NULL)
    {
      unsigned int parent_p_level = this->parent()->p_level();

      // If our new p level is less than our parents, our parents drops
      if (parent_p_level > p)
        {
          this->parent()->set_p_level(p);
        }
      // If we are the lowest p level and it increases, so might
      // our parent's, but we have to check every other child to see
      else if (parent_p_level == _p_level && _p_level < p)
        {
          _p_level = cast_int<unsigned char>(p);
          parent_p_level = cast_int<unsigned char>(p);
          for (unsigned int c=0; c != this->parent()->n_children(); c++)
            parent_p_level = std::min(parent_p_level,
                                      this->parent()->child(c)->p_level());

          if (parent_p_level != this->parent()->p_level())
            this->parent()->set_p_level(parent_p_level);

          return;
        }
    }

  _p_level = cast_int<unsigned char>(p);
}
void libMesh::Elem::set_parent ( Elem p) [inline, inherited]

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

Definition at line 1699 of file elem.h.

References libMesh::Elem::_elemlinks.

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

{
  _elemlinks[0] = p;
}
void libMesh::Elem::set_refinement_flag ( const RefinementState  rflag) [inline, inherited]
void libMesh::DofObject::set_vg_dof_base ( const unsigned int  s,
const unsigned int  vg,
const dof_id_type  db 
) [inline, inherited]

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

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

{
  libmesh_assert_less (s,  this->n_systems());
  libmesh_assert_less (vg, this->n_var_groups(s));

  const unsigned int
    start_idx_sys = this->start_idx(s);

  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());

  _idx_buf[start_idx_sys + 2*vg + 1] = db;

  libmesh_assert_equal_to (this->vg_dof_base(s,vg), db);
}
UniquePtr< Elem > libMesh::Tri::side ( const unsigned int  i) const [virtual, inherited]
Returns:
a primitive (2-noded) edge for edge i.

Implements libMesh::Elem.

Definition at line 63 of file face_tri.C.

References libMesh::Elem::get_node(), libMesh::Tri::n_sides(), and libMesh::Elem::set_node().

{
  libmesh_assert_less (i, this->n_sides());

  Elem* edge = new Edge2;

  switch (i)
    {
    case 0:
      {
        edge->set_node(0) = this->get_node(0);
        edge->set_node(1) = this->get_node(1);
        break;
      }
    case 1:
      {
        edge->set_node(0) = this->get_node(1);
        edge->set_node(1) = this->get_node(2);
        break;
      }
    case 2:
      {
        edge->set_node(0) = this->get_node(2);
        edge->set_node(1) = this->get_node(0);
        break;
      }
    default:
      libmesh_error_msg("Invalid side i = " << i);
    }

  return UniquePtr<Elem>(edge);
}
bool libMesh::Elem::subactive ( ) const [inline, inherited]
Returns:
true if the element is subactive (i.e. has no active descendants), false otherwise. Always returns false if AMR is disabled.

Definition at line 1612 of file elem.h.

References libMesh::Elem::active(), libMesh::Elem::has_children(), and libMesh::Elem::parent().

Referenced by libMesh::Elem::active_family_tree(), libMesh::Elem::active_family_tree_by_neighbor(), libMesh::Elem::active_family_tree_by_side(), libMesh::HPCoarsenTest::add_projection(), libMesh::FEAbstract::compute_node_constraints(), libMesh::UnstructuredMesh::contract(), libMesh::MeshCommunication::delete_remote_elements(), 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::Elem::get_info(), libMesh::MeshTools::get_not_subactive_node_ids(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::MeshTools::libmesh_assert_valid_procids< Elem >(), libMesh::MeshTools::libmesh_assert_valid_refinement_tree(), libMesh::Elem::make_links_to_me_local(), libMesh::Elem::make_links_to_me_remote(), 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::SerialMesh::stitching_helper(), and libMesh::LegacyXdrIO::write_mesh().

{
#ifdef LIBMESH_ENABLE_AMR
  if (this->active())
    return false;
  if (!this->has_children())
    return true;
  for (const Elem* my_ancestor = this->parent();
       my_ancestor != NULL;
       my_ancestor = my_ancestor->parent())
    if (my_ancestor->active())
      return true;
#endif

  return false;
}
subdomain_id_type libMesh::Elem::subdomain_id ( ) const [inline, inherited]
Returns:
the subdomain that this element belongs to.

Definition at line 1437 of file elem.h.

References libMesh::Elem::_sbd_id.

Referenced by libMesh::ExactSolution::_compute_error(), libMesh::DofMap::_dof_indices(), libMesh::DofMap::add_neighbors_to_send_list(), libMesh::UnstructuredMesh::all_first_order(), libMesh::UnstructuredMesh::all_second_order(), libMesh::MeshTools::Modification::all_tri(), libMesh::AbaqusIO::assign_subdomain_ids(), libMesh::Nemesis_IO_Helper::build_element_and_node_maps(), libMesh::MeshTools::Generation::build_extrusion(), libMesh::Prism6::build_side(), libMesh::Quad4::build_side(), libMesh::Pyramid5::build_side(), libMesh::InfQuad4::build_side(), libMesh::InfQuad6::build_side(), libMesh::InfHex8::build_side(), libMesh::InfPrism6::build_side(), libMesh::Tri3::build_side(), libMesh::Hex8::build_side(), libMesh::InfPrism12::build_side(), libMesh::Quad9::build_side(), libMesh::Quad8::build_side(), libMesh::Tri6::build_side(), libMesh::Tet4::build_side(), libMesh::Tet10::build_side(), libMesh::InfHex16::build_side(), libMesh::InfHex18::build_side(), libMesh::Hex20::build_side(), libMesh::Prism15::build_side(), libMesh::Pyramid13::build_side(), libMesh::Pyramid14::build_side(), libMesh::Hex27::build_side(), libMesh::Prism18::build_side(), libMesh::VTKIO::cells_to_vtk(), libMesh::MeshTools::Modification::change_subdomain_id(), libMesh::Nemesis_IO_Helper::compute_num_global_elem_blocks(), libMesh::UnstructuredMesh::copy_nodes_and_elements(), libMesh::UnstructuredMesh::create_submesh(), libMesh::DofMap::distribute_local_dofs_node_major(), libMesh::DofMap::distribute_local_dofs_var_major(), libMesh::DofMap::dof_indices(), libMesh::Elem::Elem(), libMesh::MeshTools::Modification::flatten(), libMesh::UNVIO::groups_in(), libMesh::SystemSubsetBySubdomain::init(), libMesh::ExodusII_IO_Helper::initialize(), libMesh::DofMap::old_dof_indices(), libMesh::PointLocatorList::operator()(), libMesh::ProjectSolution::operator()(), libMesh::ProjectFEMSolution::operator()(), libMesh::BoundaryProjectSolution::operator()(), libMesh::Parallel::pack(), libMesh::XdrIO::pack_element(), libMesh::Nemesis_IO::read(), libMesh::ExodusII_IO::read(), libMesh::CheckpointIO::read_connectivity(), libMesh::GmshIO::read_mesh(), libMesh::XdrIO::read_serialized_connectivity(), libMesh::DofMap::reinit(), libMesh::MeshTools::subdomain_bounding_box(), libMesh::Parallel::unpack(), libMesh::CheckpointIO::write_connectivity(), libMesh::ExodusII_IO_Helper::write_element_values(), libMesh::ExodusII_IO_Helper::write_elements(), and libMesh::GmshIO::write_mesh().

{
  return _sbd_id;
}
Returns:
the subdomain that this element belongs to as a writeable reference.

Definition at line 1445 of file elem.h.

References libMesh::Elem::_sbd_id.

{
  return _sbd_id;
}
const Elem * libMesh::Elem::top_parent ( ) const [inline, inherited]
Returns:
a pointer to the element's top-most (i.e. level-0) parent. Returns this if this is a level-0 element, this element's parent if this is a level-1 element, this element's grandparent if this is a level-2 element, etc...

Definition at line 1707 of file elem.h.

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

Referenced by libMesh::BoundaryInfo::boundary_id(), libMesh::BoundaryInfo::boundary_ids(), libMesh::BoundaryInfo::edge_boundary_ids(), libMesh::BoundaryInfo::has_boundary_id(), libMesh::BoundaryInfo::n_boundary_ids(), libMesh::BoundaryInfo::n_edge_boundary_ids(), libMesh::BoundaryInfo::side_with_boundary_id(), and libMesh::BoundaryInfo::sync().

{
  const Elem* tp = this;

  // Keep getting the element's parent
  // until that parent is at level-0
  while (tp->parent() != NULL)
    tp = tp->parent();

  libmesh_assert(tp);
  libmesh_assert_equal_to (tp->level(), 0);

  return tp;
}
const Elem * libMesh::Elem::topological_neighbor ( const unsigned int  i,
const MeshBase mesh,
const PointLocatorBase point_locator,
const PeriodicBoundaries pb 
) const [inherited]
Returns:
a pointer to the $ i^{th} $ neighbor of this element for interior elements. If an element is on a periodic boundary, it will return a corresponding element on the opposite side.

Definition at line 909 of file elem.C.

References libMesh::PeriodicBoundaries::boundary(), libMesh::BoundaryInfo::boundary_ids(), libMesh::MeshBase::elem(), libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::Elem::level(), libMesh::Elem::n_neighbors(), libMesh::PeriodicBoundaries::neighbor(), libMesh::Elem::neighbor(), and libMesh::Elem::parent().

Referenced by libMesh::Elem::has_topological_neighbor(), and libMesh::MeshRefinement::topological_neighbor().

{
  libmesh_assert_less (i, this->n_neighbors());

  const Elem * neighbor_i = this->neighbor(i);
  if (neighbor_i != NULL)
    return neighbor_i;

  if (pb)
    {
      // Since the neighbor is NULL it must be on a boundary. We need
      // see if this is a periodic boundary in which case it will have a
      // topological neighbor

      std::vector<boundary_id_type> boundary_ids =
        mesh.get_boundary_info().boundary_ids(this, cast_int<unsigned short>(i));
      for (std::vector<boundary_id_type>::iterator j = boundary_ids.begin(); j != boundary_ids.end(); ++j)
        if (pb->boundary(*j))
          {
            // Since the point locator inside of periodic boundaries
            // returns a const pointer we will retrieve the proper
            // pointer directly from the mesh object.  Also since coarse
            // elements do not have more refined neighbors we need to make
            // sure that we don't return one of these types of neighbors.
            neighbor_i = mesh.elem(pb->neighbor(*j, point_locator, this, i)->id());
            if (level() < neighbor_i->level())
              neighbor_i = neighbor_i->parent();
            return neighbor_i;
          }
    }

  return NULL;
}
Elem * libMesh::Elem::topological_neighbor ( const unsigned int  i,
MeshBase mesh,
const PointLocatorBase point_locator,
const PeriodicBoundaries pb 
) [inherited]
Returns:
a writeable pointer to the $ i^{th} $ neighbor of this element for interior elements. If an element is on a periodic boundary, it will return a corresponding element on the opposite side.

Definition at line 870 of file elem.C.

References libMesh::PeriodicBoundaries::boundary(), libMesh::BoundaryInfo::boundary_ids(), libMesh::MeshBase::elem(), libMesh::MeshBase::get_boundary_info(), libMesh::DofObject::id(), libMesh::Elem::level(), libMesh::Elem::n_neighbors(), libMesh::PeriodicBoundaries::neighbor(), libMesh::Elem::neighbor(), and libMesh::Elem::parent().

{
  libmesh_assert_less (i, this->n_neighbors());

  Elem * neighbor_i = this->neighbor(i);
  if (neighbor_i != NULL)
    return neighbor_i;

  if (pb)
    {
      // Since the neighbor is NULL it must be on a boundary. We need
      // see if this is a periodic boundary in which case it will have a
      // topological neighbor

      std::vector<boundary_id_type> boundary_ids =
        mesh.get_boundary_info().boundary_ids(this, cast_int<unsigned short>(i));
      for (std::vector<boundary_id_type>::iterator j = boundary_ids.begin(); j != boundary_ids.end(); ++j)
        if (pb->boundary(*j))
          {
            // Since the point locator inside of periodic boundaries
            // returns a const pointer we will retrieve the proper
            // pointer directly from the mesh object.  Also since coarse
            // elements do not have more refined neighbors we need to make
            // sure that we don't return one of these types of neighbors.
            neighbor_i = mesh.elem(pb->neighbor(*j, point_locator, this, i)->id());
            if (level() < neighbor_i->level())
              neighbor_i = neighbor_i->parent();
            return neighbor_i;
          }
    }

  return NULL;
}
void libMesh::Elem::total_family_tree ( std::vector< const Elem * > &  active_family,
const bool  reset = true 
) const [inherited]

Same as the family_tree() member, but also adds any subactive descendants.

Definition at line 1440 of file elem.C.

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

Referenced by libMesh::Partitioner::set_parent_processor_ids(), and libMesh::Elem::total_family_tree().

{
  // Clear the vector if the flag reset tells us to.
  if (reset)
    family.clear();

  // Add this element to the family tree.
  family.push_back(this);

  // Recurse into the elements children, if it has them.
  // Do not clear the vector any more.
  if (this->has_children())
    for (unsigned int c=0; c<this->n_children(); c++)
      if (!this->child(c)->is_remote())
        this->child(c)->total_family_tree (family, false);
}
ElemType libMesh::Tri3Subdivision::type ( ) const [inline, virtual]
Returns:
TRI3SUBDIVISION

Reimplemented from libMesh::Tri3.

Definition at line 53 of file face_tri3_subdivision.h.

References libMesh::TRI3SUBDIVISION.

{ return TRI3SUBDIVISION; }
void libMesh::DofObject::unpack_indexing ( std::vector< largest_id_type >::const_iterator  begin) [inherited]

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

Definition at line 487 of file dof_object.C.

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

Referenced by libMesh::Parallel::unpack(), and libMesh::DofObject::unpack_indexing().

{
  _idx_buf.clear();

#ifdef LIBMESH_ENABLE_AMR
  this->clear_old_dof_object();
  const bool has_old_dof_object = cast_int<bool>(*begin++);
#endif

  const largest_id_type size = *begin++;
  _idx_buf.reserve(size);
  std::copy(begin, begin+size, back_inserter(_idx_buf));

  // Check as best we can for internal consistency now
  libmesh_assert(_idx_buf.empty() ||
                 (_idx_buf[0] <= _idx_buf.size()));
#ifdef DEBUG
  if (!_idx_buf.empty())
    for (unsigned int i=1; i < _idx_buf[0]; ++i)
      {
        libmesh_assert_greater_equal (_idx_buf[i], _idx_buf[i-1]);
        libmesh_assert_equal_to ((_idx_buf[i] - _idx_buf[i-1])%2, 0);
        libmesh_assert_less_equal (_idx_buf[i], _idx_buf.size());
      }
#endif

#ifdef LIBMESH_ENABLE_AMR
  if (has_old_dof_object)
    {
      this->old_dof_object = new DofObject();
      this->old_dof_object->unpack_indexing(begin+size);
    }
#endif
}
unsigned int libMesh::DofObject::unpackable_indexing_size ( std::vector< largest_id_type >::const_iterator  begin) [static, inherited]

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

Definition at line 466 of file dof_object.C.

Referenced by libMesh::Parallel::pack(), libMesh::Parallel::packed_size(), and libMesh::Parallel::unpack().

{
#ifdef LIBMESH_ENABLE_AMR
  const bool has_old_dof_object = cast_int<bool>(*begin++);

  static const int dof_header_size = 2;
#else
  static const bool has_old_dof_object = false;
  static const int dof_header_size = 1;
#endif

  const largest_id_type this_indexing_size = *begin++;

  return cast_int<unsigned int>
    (dof_header_size + this_indexing_size +
     (has_old_dof_object ?
      unpackable_indexing_size(begin+this_indexing_size) : 0));
}
bool libMesh::DofObject::valid_processor_id ( ) const [inline, inherited]
Returns:
true if this DofObject has a valid id set, false otherwise.

Definition at line 705 of file dof_object.h.

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

bool libMesh::DofObject::valid_unique_id ( ) const [inline, inherited]
Returns:
true if this DofObject has a valid unique_id set, false otherwise.

Definition at line 669 of file dof_object.h.

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

Referenced by libMesh::SerialMesh::add_elem(), libMesh::ParallelMesh::add_elem(), libMesh::SerialMesh::add_node(), libMesh::ParallelMesh::add_node(), libMesh::Parallel::pack(), and libMesh::DofObject::unique_id().

{
#ifdef LIBMESH_ENABLE_UNIQUE_ID
  return (DofObject::invalid_unique_id != _unique_id);
#else
  return false;
#endif
}
dof_id_type libMesh::DofObject::vg_dof_base ( const unsigned int  s,
const unsigned int  vg 
) const [inline, inherited]

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

Definition at line 909 of file dof_object.h.

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

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

{
  libmesh_assert_less (s,  this->n_systems());
  libmesh_assert_less (vg, this->n_var_groups(s));

  const unsigned int
    start_idx_sys = this->start_idx(s);

  libmesh_assert_less ((start_idx_sys + 2*vg + 1), _idx_buf.size());

  // #ifdef DEBUG
  //   std::cout << " [ ";
  //   for (unsigned int i=0; i<_idx_buf.size(); i++)
  //     std::cout << _idx_buf[i] << " ";
  //   std::cout << "]\n";
  // #endif

  return _idx_buf[start_idx_sys + 2*vg + 1];
}
Real libMesh::Tri3::volume ( ) const [virtual, inherited]

An optimized method for computing the area of a 3-node triangle.

Reimplemented from libMesh::Elem.

Definition at line 192 of file face_tri3.C.

References libMesh::TypeVector< T >::cross(), and libMesh::Elem::get_node().

{
  // 3-node triangles have the following formula for computing the area
  Point v10 ( *(this->get_node(1)) - *(this->get_node(0)) );

  Point v20 ( *(this->get_node(2)) - *(this->get_node(0)) );

  return 0.5 * (v10.cross(v20)).size() ;
}
unsigned int libMesh::Elem::which_neighbor_am_i ( const Elem e) const [inline, inherited]

This function tells you which neighbor you (e) are. I.e. if s = a->which_neighbor_am_i(e); then a->neighbor(s) will be an ancestor of e;

Definition at line 1521 of file elem.h.

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

Referenced by libMesh::MetisPartitioner::_do_partition(), libMesh::ParmetisPartitioner::build_graph(), libMesh::FEGenericBase< OutputType >::compute_proj_constraints(), libMesh::MeshTools::find_hanging_nodes_and_parents(), libMesh::Elem::libmesh_assert_valid_neighbors(), libMesh::Elem::make_links_to_me_remote(), and libMesh::Elem::nullify_neighbors().

{
  libmesh_assert(e);

  const Elem* eparent = e;

  while (eparent->level() > this->level())
    {
      eparent = eparent->parent();
      libmesh_assert(eparent);
    }

  for (unsigned int s=0; s<this->n_neighbors(); s++)
    if (this->neighbor(s) == eparent)
      return s;

  return libMesh::invalid_uint;
}
unsigned int libMesh::Elem::which_side_am_i ( const Elem e) const [inline, inherited]

This function tells you which side the boundary element e is. I.e. if e = a->build_side(s) or e = a->side(s); then a->which_side_am_i(e) will be s.

Returns invalid_uint if e is not a side of this

Definition at line 1543 of file elem.h.

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

{
  libmesh_assert(e);

  const unsigned int ns = this->n_sides();
  const unsigned int nn = this->n_nodes();

  const unsigned int en = e->n_nodes();

  // e might be on any side until proven otherwise
  std::vector<bool> might_be_side(ns, true);

  for (unsigned int i=0; i != en; ++i)
    {
      Point side_point = e->point(i);
      unsigned int local_node_id = libMesh::invalid_uint;

      // Look for a node of this that's contiguous with node i of e
      for (unsigned int j=0; j != nn; ++j)
        if (this->point(j) == side_point)
          local_node_id = j;

      // If a node of e isn't contiguous with some node of this, then
      // e isn't a side of this.
      if (local_node_id == libMesh::invalid_uint)
        return libMesh::invalid_uint;

      // If a node of e isn't contiguous with some node on side s of
      // this, then e isn't on side s.
      for (unsigned int s=0; s != ns; ++s)
        if (!this->is_node_on_side(local_node_id, s))
          might_be_side[s] = false;
    }

  for (unsigned int s=0; s != ns; ++s)
    if (might_be_side[s])
      {
#ifdef DEBUG
        for (unsigned int s2=s+1; s2 < ns; ++s2)
          libmesh_assert (!might_be_side[s2]);
#endif
        return s;
      }

  // Didn't find any matching side
  return libMesh::invalid_uint;
}
void libMesh::Elem::write_connectivity ( std::ostream &  out,
const IOPackage  iop 
) const [inherited]

Writes the element connectivity for various IO packages to the passed ostream "out". Not virtual, since it is implemented in the base class. This function supercedes the write_tecplot_connectivity(...) and write_ucd_connectivity(...) routines.

Definition at line 1255 of file elem.C.

References libMesh::Elem::_nodes, libMesh::Elem::connectivity(), libMesh::INVALID_IO_PACKAGE, libMesh::libmesh_assert(), libMesh::Elem::n_nodes(), libMesh::Elem::n_sub_elem(), libMesh::Elem::node(), libMesh::TECPLOT, and libMesh::UCD.

{
  libmesh_assert (out_stream.good());
  libmesh_assert(_nodes);
  libmesh_assert_not_equal_to (iop, INVALID_IO_PACKAGE);

  switch (iop)
    {
    case TECPLOT:
      {
        // This connectivity vector will be used repeatedly instead
        // of being reconstructed inside the loop.
        std::vector<dof_id_type> conn;
        for (unsigned int sc=0; sc <this->n_sub_elem(); sc++)
          {
            this->connectivity(sc, TECPLOT, conn);

            std::copy(conn.begin(),
                      conn.end(),
                      std::ostream_iterator<dof_id_type>(out_stream, " "));

            out_stream << '\n';
          }
        return;
      }

    case UCD:
      {
        for (unsigned int i=0; i<this->n_nodes(); i++)
          out_stream << this->node(i)+1 << "\t";

        out_stream << '\n';
        return;
      }

    default:
      libmesh_error_msg("Unsupported IO package " << iop);
    }
}

Member Data Documentation

Elem** libMesh::Elem::_elemlinks [protected, inherited]

Pointers to this element's parent and neighbors, and for lower-dimensional elements interior_parent.

Definition at line 1217 of file elem.h.

Referenced by libMesh::Elem::Elem(), libMesh::Elem::interior_parent(), libMesh::Elem::neighbor(), libMesh::Elem::parent(), libMesh::Elem::set_interior_parent(), libMesh::Elem::set_neighbor(), and libMesh::Elem::set_parent().

Elem* libMesh::Tri::_elemlinks_data[4+(LIBMESH_DIM >2)] [protected, inherited]

Data for links to parent/neighbor/interior_parent elements.

Definition at line 132 of file face_tri.h.

const float libMesh::Tri3::_embedding_matrix [static, protected, inherited]

Matrix that computes new nodal locations/solution values from current nodes/solution.

Definition at line 172 of file face_tri3.h.

Referenced by libMesh::Tri3::embedding_matrix().

bool libMesh::ReferenceCounter::_enable_print_counter = true [static, protected, inherited]

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

Definition at line 137 of file reference_counter.h.

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

bool libMesh::ReferenceCounter::_enable_print_counter = true [static, protected, inherited]

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

Definition at line 137 of file reference_counter.h.

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

true iff the element is a ghost element (e.g. for boundary conditions).

Definition at line 130 of file face_tri3_subdivision.h.

Referenced by is_ghost(), set_ghost(), and Tri3Subdivision().

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 131 of file reference_counter.h.

Mutual exclusion object to enable thread-safe reference counting.

Definition at line 131 of file reference_counter.h.

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

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

Definition at line 126 of file reference_counter.h.

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

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

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

Definition at line 126 of file reference_counter.h.

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

Node* libMesh::Tri3::_nodelinks_data[3] [protected, inherited]

Data for links to nodes

Definition at line 154 of file face_tri3.h.

A list containing the ordered nodes such that the irregular node (valence != 6), if there is one, is the first.

Definition at line 118 of file face_tri3_subdivision.h.

Referenced by get_ordered_node(), prepare_subdivision_properties(), and Tri3Subdivision().

unsigned char libMesh::Elem::_p_level [protected, inherited]

p refinement level - the difference between the polynomial degree on this element and the minimum polynomial degree on the mesh. This is stored as an unsigned char to save space. In theory, these last four bytes might have been padding anyway.

Definition at line 1254 of file elem.h.

Referenced by libMesh::Elem::hack_p_level(), libMesh::Elem::max_descendant_p_level(), libMesh::Elem::p_level(), and libMesh::Elem::set_p_level().

unsigned char libMesh::Elem::_pflag [protected, inherited]

p refinement flag. This is stored as an unsigned char to save space.

Definition at line 1243 of file elem.h.

Referenced by libMesh::Elem::p_refinement_flag(), and libMesh::Elem::set_p_refinement_flag().

unsigned char libMesh::Elem::_rflag [protected, inherited]

h refinement flag. This is stored as an unsigned char to save space.

Definition at line 1236 of file elem.h.

Referenced by libMesh::Elem::refinement_flag(), and libMesh::Elem::set_refinement_flag().

subdomain_id_type libMesh::Elem::_sbd_id [protected, inherited]

The subdomain to which this element belongs.

Definition at line 1229 of file elem.h.

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

true iff the subdivision element is ready for use, i.e. the nodes have been reordered.

Definition at line 124 of file face_tri3_subdivision.h.

Referenced by get_ordered_node(), get_ordered_valence(), is_subdivision_updated(), and prepare_subdivision_properties().

const dof_id_type libMesh::DofObject::invalid_id = static_cast<dof_id_type>(-1) [static, inherited]

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

Definition at line 346 of file dof_object.h.

Referenced by libMesh::ParallelMesh::add_elem(), libMesh::ParallelMesh::add_node(), libMesh::MeshCommunication::allgather(), libMesh::MeshTools::bounding_box(), libMesh::MeshTools::correct_node_proc_ids(), libMesh::ParallelMesh::delete_elem(), libMesh::ParallelMesh::delete_node(), libMesh::Elem::Elem(), libMesh::MeshCommunication::find_global_indices(), libMesh::ParallelMesh::insert_elem(), libMesh::DofObject::invalidate_processor_id(), libMesh::ParallelMesh::libmesh_assert_valid_parallel_object_ids(), libMesh::ParallelMesh::n_active_elem(), libMesh::MeshBase::n_elem_on_proc(), libMesh::MeshBase::n_nodes_on_proc(), libMesh::MeshBase::n_unpartitioned_elem(), libMesh::MeshBase::n_unpartitioned_nodes(), libMesh::CheckpointIO::read_connectivity(), libMesh::ParallelMesh::renumber_dof_objects(), 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_dofobject_data_by_xyz(), libMesh::Parallel::sync_element_data_by_parent_id(), libMesh::Parallel::sync_node_data_by_element_id(), libMesh::MeshTools::total_weight(), libMesh::Parallel::unpack(), libMesh::SerialMesh::unpartitioned_elements_begin(), libMesh::ParallelMesh::unpartitioned_elements_begin(), libMesh::SerialMesh::unpartitioned_elements_end(), libMesh::ParallelMesh::unpartitioned_elements_end(), libMesh::DofObject::valid_processor_id(), and libMesh::CheckpointIO::write_connectivity().

const subdomain_id_type libMesh::Elem::invalid_subdomain_id = std::numeric_limits<subdomain_id_type>::max() [static, inherited]

A static integral constant representing an invalid subdomain id. See also DofObject::{invalid_id, invalid_unique_id, invalid_processor_id}.

Note 1: we don't use the static_cast(-1) trick here since subdomain_id_type is sometimes a *signed* integer for compatibility reasons (see libmesh/id_types.h).

Note 2: Normally you can declare static const integral types directly in the header file (C++ standard, 9.4.2/4) but std::numeric_limits<T>::max() is not considered a "constant expression". This one is therefore defined in elem.C. http://stackoverflow.com/questions/2738435/using-numeric-limitsmax-in-constant-expressions

Definition at line 182 of file elem.h.

Referenced by libMesh::MeshBase::get_id_by_name().

const unique_id_type libMesh::DofObject::invalid_unique_id = static_cast<unique_id_type>(-1) [static, inherited]

An invaild unique_id to distinguish an uninitialized DofObject

Definition at line 340 of file dof_object.h.

Referenced by libMesh::Parallel::pack(), libMesh::ParallelMesh::renumber_dof_objects(), libMesh::DofObject::unique_id(), and libMesh::DofObject::valid_unique_id().

const unsigned int libMesh::Tri3::side_nodes_map [static, inherited]
Initial value:
  {
    {0, 1}, 
    {1, 2}, 
    {2, 0}  
  }

This maps the $ j^{th} $ node of the $ i^{th} $ side to element node numbers.

Definition at line 134 of file face_tri3.h.

Referenced by libMesh::Tri3::is_node_on_side().

const unsigned int libMesh::Elem::type_to_n_edges_map [static, inherited]

This array maps the integer representation of the ElemType enum to the number of edges on the element.

Definition at line 463 of file elem.h.

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

const unsigned int libMesh::Elem::type_to_n_nodes_map [static, inherited]

This array maps the integer representation of the ElemType enum to the number of nodes in the element.

Definition at line 418 of file elem.h.

Referenced by libMesh::XdrIO::pack_element(), libMesh::Parallel::packed_size(), libMesh::CheckpointIO::read_connectivity(), libMesh::XdrIO::read_serialized_connectivity(), and libMesh::Parallel::unpack().

const unsigned int libMesh::Elem::type_to_n_sides_map [static, inherited]

This array maps the integer representation of the ElemType enum to the number of sides on the element.

Definition at line 429 of file elem.h.

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


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