void Elem::active_family_tree (std::vector< const Elem * > &active_family, const boolreset = 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.

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

{
// 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);
}

Referenced by Elem::active_family_tree_by_side(), and BoundaryInfo::build_node_list_from_side_list().

{
// 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(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_child_on_side(c, s))
this->child(c)->active_family_tree_by_side (family, s, false);
}

void Elem::add_child (Elem *elem, unsigned intc) [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.

void 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.

Point 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.

Elem * 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.

const Elem * 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.

void 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

void Elem::family_tree (std::vector< const Elem * > &family, const boolreset = 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' 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);
}

{
// 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(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_child_on_side(c, s))
this->child(c)->family_tree_by_side (family, s, false);
}

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.

void ReferenceCounter::increment_constructor_count (const std::string &name) [inline, protected, inherited]Increments the construction counter. Should be called in the constructor of any derived class that will be reference counted.

void ReferenceCounter::increment_constructor_count (const std::string &name) [inline, protected, inherited]Increments the construction counter. Should be called in the constructor of any derived class that will be reference counted.

void ReferenceCounter::increment_destructor_count (const std::string &name) [inline, protected, inherited]Increments the destruction counter. Should be called in the destructor of any derived class that will be reference counted.

void ReferenceCounter::increment_destructor_count (const std::string &name) [inline, protected, inherited]Increments the destruction counter. Should be called in the destructor of any derived class that will be reference counted.

bool InfCell::infinite () const [inline, virtual, inherited]Returns:

true. All classes derived from InfCell are infinite elements.

Implements Elem.

Definition at line 65 of file cell_inf.h.

{ return true; }

const Elem* Elem::interior_parent () const [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.

Referenced by Elem::is_ancestor_of().

void DofObject::invalidate () [inline, inherited]Invalidates all the indices for this DofObject

true if descendant is a child of this, or a child of a child of this, etc. Always returns false if AMR is disabled.

Convenient way to communicate elements. This class packes up an element so that it can easily be communicated through an MPI array.

Author:

Benjamin S. Kirk

Date:

2008

Iterator pointing to the beginning of this packed element's index buffer.

Constructor. Takes an input iterator pointing to the beginning of the connectivity block for this element.

An Elem can be packed into an integer array which is header_size + elem->n_nodes() in length.

For each element it is of the form [ level p_level r_flag p_r_flag etype processor_id subdomain_id self_ID parent_ID which_child node_0 node_1 ... node_n] We cannot use unsigned int because parent_ID can be negative

Unpacks this packed element. Returns a pointer to the new element. Takes a pointer to the parent, which is required unless this packed element is at level 0.

virtual bool 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 RemoteElem.

Definition at line 238 of file elem.h.

Referenced by Elem::active_family_tree(), Elem::family_tree(), and Partitioner::set_parent_processor_ids().

void Elem::make_links_to_me_remote () [inherited]Resets this element's neighbors' appropriate neighbor pointers and its parent's and children's appropriate pointers to point to the global remote_elem instead of this. Used by the library before a remote element is deleted on the local processor.

Referenced by FEBase::coarsened_dof_values(), and Elem::is_ancestor_of().

unsigned int Elem::min_new_p_level_by_neighbor (const Elem *neighbor, unsigned intcurrent_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

unsigned int Elem::min_p_level_by_neighbor (const Elem *neighbor, unsigned intcurrent_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

the number of components for variable var of system s associated with this DofObject. For example, the HIERARCHIC shape functions may have multiple dof's associated with one node. Another example is the MONOMIALs, where only the elements hold the dof's, but for the different spatial directions, and orders, see FE.

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

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.

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.

Reimplemented from DofObject.

Definition at line 334 of file elem.C.

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

Referenced by Elem::is_ancestor_of().

{
// Cast rhs to an Elem*
const Elem* rhs_elem = dynamic_cast<const 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<unsigned int>::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<unsigned int> 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 = 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;
}

Point InfCell::origin () const [inline, virtual, inherited]Returns:

the origin of this infinite element.

Reimplemented from Elem.

Definition at line 78 of file cell_inf.h.

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

Referenced by InfPrism6::contains_point(), and InfHex8::contains_point().

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)

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.

const Elem* Elem::top_parent () const [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...

void Elem::write_connectivity (std::ostream &out, const IOPackageiop) 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.

Friends And Related Function Documentation

friend class MeshRefinement [friend, inherited]Make the classes that need to access our build member friends. These classes do not really fit the profile of what a 'friend' should be, but if we are going to protect the constructor and the build method, there's no way around it.

Do we *really* need to protect the build member? It would seem that we are just getting around it by using friends!

unsigned char 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.

For higher-order elements, namely InfHex16 and InfHex18, the matrices for adjacent vertices of second order nodes are quite similar (apart from the face nodes, which are directly handled by InfHex18). Therefore hold this matrix here, so that both can re-use this. Matrix that tells which vertices define the location of mid-side (or second-order) nodes.

Definition at line 139 of file cell_inf_hex.h.

Referenced by second_order_adjacent_vertex(), and InfHex16::second_order_adjacent_vertex().

const unsigned short int DofObject::invalid_processor_id = static_cast<unsigned short int>(-1) [static, inherited]An invalid processor_id to distinguish DOFs that have not been assigned to a processor.