#include <cell_hex27.h>
enum RefinementState { COARSEN = 0, DO_NOTHING, REFINE, JUST_REFINED, JUST_COARSENED, INACTIVE, COARSEN_INACTIVE }
typedef Predicates::multi_predicate Predicate
Hex27 (Elem *p=NULL)
ElemType type () const
unsigned int n_nodes () const
unsigned int n_sub_elem () const
virtual bool is_vertex (const unsigned int i) const
virtual bool is_edge (const unsigned int i) const
virtual bool is_face (const unsigned int i) const
virtual bool is_node_on_side (const unsigned int n, const unsigned int s) const
virtual bool is_node_on_edge (const unsigned int n, const unsigned int e) const
virtual bool has_affine_map () const
Order default_order () const
unsigned int key (const unsigned int s) const
AutoPtr< Elem > build_side (const unsigned int i, bool proxy) const
AutoPtr< Elem > build_edge (const unsigned int i) const
virtual void connectivity (const unsigned int sc, const IOPackage iop, std::vector< unsigned int > &conn) const
unsigned int n_second_order_adjacent_vertices (const unsigned int) const
unsigned short int second_order_adjacent_vertex (const unsigned int n, const unsigned int v) const
virtual std::pair< unsigned short int, unsigned short int > second_order_child_vertex (const unsigned int n) const
unsigned int n_sides () const
unsigned int n_vertices () const
unsigned int n_edges () const
unsigned int n_faces () const
unsigned int n_children () const
virtual bool is_child_on_side (const unsigned int c, const unsigned int s) const
AutoPtr< DofObject > side (const unsigned int i) const
Real quality (const ElemQuality q) const
std::pair< Real, Real > qual_bounds (const ElemQuality q) const
unsigned int dim () const
bool infinite () const
virtual const Point & point (const unsigned int i) const
virtual Point & point (const unsigned int i)
virtual unsigned int node (const unsigned int i) const
virtual Node * get_node (const unsigned int i) const
virtual Node *& set_node (const unsigned int i)
subdomain_id_type subdomain_id () const
subdomain_id_type & subdomain_id ()
virtual bool operator== (const DofObject &rhs) const
Elem * neighbor (const unsigned int i) const
void set_neighbor (const unsigned int i, Elem *n)
bool has_neighbor (const Elem *elem) const
Elem * child_neighbor (Elem *elem) const
const Elem * child_neighbor (const Elem *elem) const
bool on_boundary () const
unsigned int which_neighbor_am_i (const Elem *e) const
bool contains_vertex_of (const Elem *e) const
void find_point_neighbors (std::set< const Elem * > &neighbor_set) const
void make_links_to_me_remote ()
virtual bool is_remote () const
void write_connectivity (std::ostream &out, const IOPackage iop) const
virtual unsigned int n_neighbors () const
virtual Point centroid () const
virtual Real hmin () const
virtual Real hmax () const
virtual Real volume () const
virtual bool contains_point (const Point &p) 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 Elem * parent () const
Elem * parent ()
void set_parent (Elem *p)
const Elem * top_parent () const
const Elem * interior_parent () const
Real length (const unsigned int n1, const unsigned int n2) const
unsigned int level () const
unsigned int p_level () const
Elem * child (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 family_tree (std::vector< const Elem * > &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 clear_old_dof_object ()
void set_old_dof_object ()
void clear_dofs ()
void invalidate_dofs (const unsigned int sys_num=libMesh::invalid_uint)
void invalidate_id ()
void invalidate_processor_id ()
void invalidate ()
unsigned int n_dofs (const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
unsigned int id () const
unsigned int & set_id ()
void set_id (const unsigned int id)
bool valid_id () const
unsigned short int processor_id () const
unsigned short int & processor_id ()
void processor_id (const unsigned int id)
bool valid_processor_id () const
unsigned int n_systems () const
void set_n_systems (const unsigned int s)
void add_system ()
unsigned int n_vars (const unsigned int s) const
void set_n_vars (const unsigned int s, const unsigned int nvars)
unsigned int n_comp (const unsigned int s, const unsigned int var) const
void set_n_comp (const unsigned int s, const unsigned int var, const unsigned int ncomp)
unsigned int dof_number (const unsigned int s, const unsigned int var, const unsigned int comp) const
void set_dof_number (const unsigned int s, const unsigned int var, const unsigned int comp, const unsigned int dn)
bool has_dofs (const unsigned int s=libMesh::invalid_uint) const
static ElemType second_order_equivalent_type (const ElemType et, const bool full_ordered=true)
static ElemType first_order_equivalent_type (const ElemType et)
static AutoPtr< Elem > build (const ElemType type, Elem *p=NULL)
static std::string get_info ()
static std::string get_info ()
static void print_info ()
static void print_info ()
static unsigned int n_objects ()
static unsigned int n_objects ()
static const unsigned int side_nodes_map [6][9]
static const unsigned int edge_nodes_map [12][3]
static const unsigned int type_to_n_nodes_map [INVALID_ELEM]
static const unsigned int invalid_id = libMesh::invalid_uint
static const unsigned short int invalid_processor_id = static_cast<unsigned short int>(-1)
typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
typedef std::map< std::string, std::pair< unsigned int, unsigned int > > Counts
float embedding_matrix (const unsigned int i, const unsigned int j, const unsigned int k) const
void nullify_neighbors ()
void increment_constructor_count (const std::string &name)
void increment_constructor_count (const std::string &name)
void increment_destructor_count (const std::string &name)
void increment_destructor_count (const std::string &name)
static unsigned int compute_key (unsigned int n0)
static unsigned int compute_key (unsigned int n0, unsigned int n1)
static unsigned int compute_key (unsigned int n0, unsigned int n1, unsigned int n2)
static unsigned int compute_key (unsigned int n0, unsigned int n1, unsigned int n2, unsigned int n3)
Node ** _nodes
Elem ** _neighbors
Elem * _parent
Elem ** _children
unsigned char _rflag
unsigned char _pflag
unsigned char _p_level
subdomain_id_type _sbd_id
static const float _embedding_matrix [8][27][27]
static const unsigned short int _second_order_adjacent_vertices [12][2]
static const unsigned short int _second_order_vertex_child_number [27]
static const unsigned short int _second_order_vertex_child_index [27]
static Counts _counts
static Counts _counts
static Threads::atomic< unsigned int > _n_objects
static Threads::atomic< unsigned int > _n_objects
static Threads::spin_mutex _mutex
static Threads::spin_mutex _mutex
static const unsigned short int _remaining_second_order_adjacent_vertices [6][4]
The Hex27 is an element in 3D composed of 27 nodes. It is numbered like this:
HEX27: 7 18 6
o--------------o--------------o
/: / /|
/ : / / |
/ : / / |
19/ : 25/ 17/ |
o--------------o--------------o |
/ : / /| |
/ 15o / 23o / | 14o
/ : / / | /|
4/ : 16/ 5/ | / |
o--------------o--------------o | / |
| : | 26 | |/ |
| 24o : | o | 22o |
| : | 10 | /| |
| 3o....|.........o....|../.|....o
| . | | / | / 2
| . 21| 13|/ | /
12 o--------------o--------------o | /
| . | | |/
| 11o | 20o | o
| . | | / 9
| . | | /
| . | | /
|. | |/
o--------------o--------------o
0 8 1
Definition at line 69 of file cell_hex27.h.
Definition at line 105 of file reference_counter.h.
Definition at line 105 of file reference_counter.h.
Definition at line 844 of file elem.h.
Enumerator:
Definition at line 627 of file elem.h.
{ COARSEN = 0,
DO_NOTHING,
REFINE,
JUST_REFINED,
JUST_COARSENED,
INACTIVE,
COARSEN_INACTIVE };
Definition at line 244 of file cell_hex27.h.
:
Hex(Hex27::n_nodes(), p)
{
}
Definition at line 1303 of file elem.h.
References Elem::COARSEN_INACTIVE, Elem::INACTIVE, and Elem::refinement_flag().
Referenced by MeshRefinement::_coarsen_elements(), MetisPartitioner::_do_partition(), MeshRefinement::_refine_elements(), Elem::active_family_tree(), Elem::active_family_tree_by_neighbor(), Elem::active_family_tree_by_side(), DofMap::add_neighbors_to_send_list(), HPCoarsenTest::add_projection(), Elem::ancestor(), Patch::build_around_element(), ParmetisPartitioner::build_graph(), Elem::coarsen(), MeshRefinement::coarsen_elements(), FEBase::compute_periodic_constraints(), FEBase::compute_proj_constraints(), UnstructuredMesh::contract(), Elem::contract(), DofMap::dof_indices(), MeshRefinement::eliminate_unrefined_patches(), JumpErrorEstimator::estimate_error(), ExactErrorEstimator::estimate_error(), Elem::family_tree(), Elem::family_tree_by_neighbor(), Elem::family_tree_by_side(), Elem::family_tree_by_subneighbor(), Patch::find_face_neighbors(), UnstructuredMesh::find_neighbors(), Elem::find_point_neighbors(), MeshRefinement::flag_elements_by_nelem_target(), ErrorVector::is_active_elem(), Elem::is_ancestor_of(), MeshRefinement::make_coarsening_compatible(), MeshRefinement::make_refinement_compatible(), Elem::min_new_p_level_by_neighbor(), Elem::min_p_level_by_neighbor(), DofMap::old_dof_indices(), PointLocatorTree::operator()(), PointLocatorList::operator()(), Elem::refine(), MeshRefinement::refine_and_coarsen_elements(), MeshRefinement::refine_elements(), Elem::subactive(), Parallel::sync_element_data_by_parent_id(), MeshRefinement::test_level_one(), ExodusII_IO_Helper::write_elements(), and 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
}
Definition at line 903 of file elem.C.
References Elem::active(), Elem::active_family_tree(), Elem::child(), Elem::is_remote(), Elem::n_children(), and Elem::subactive().
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);
}
Definition at line 1059 of file elem.C.
References Elem::active(), Elem::active_family_tree_by_neighbor(), Elem::child(), Elem::has_neighbor(), Elem::level(), Elem::n_children(), remote_elem, and Elem::subactive().
Referenced by Elem::active_family_tree_by_neighbor(), DofMap::add_neighbors_to_send_list(), Patch::find_face_neighbors(), Elem::find_point_neighbors(), and 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->level())
libmesh_assert (this->has_neighbor(neighbor));
// 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 *child = this->child(c);
if (child != remote_elem && child->has_neighbor(neighbor))
child->active_family_tree_by_neighbor (family, neighbor, false);
}
}
Definition at line 954 of file elem.C.
References Elem::active(), Elem::active_family_tree_by_side(), Elem::child(), Elem::is_child_on_side(), Elem::n_children(), Elem::n_sides(), and Elem::subactive().
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);
}
Definition at line 819 of file elem.C.
References Elem::_children, Elem::n_children(), Elem::parent(), and remote_elem.
Referenced by UnstructuredMesh::all_first_order(), UnstructuredMesh::copy_nodes_and_elements(), LegacyXdrIO::read_mesh(), and XdrIO::read_serialized_connectivity().
{
if(_children == NULL)
{
_children = new Elem*[this->n_children()];
for (unsigned int c=0; c<this->n_children(); c++)
_children[c] = NULL;
}
for (unsigned int c=0; c<this->n_children(); c++)
{
if(_children[c] == NULL || _children[c] == remote_elem)
{
libmesh_assert (this == elem->parent());
_children[c] = elem;
return;
}
}
std::cerr << 'Error: Tried to add a child to an element with full children array'
<< std::endl;
libmesh_error();
}
Definition at line 846 of file elem.C.
References Elem::_children, Elem::n_children(), Elem::parent(), and remote_elem.
{
if(_children == NULL)
{
_children = new Elem*[this->n_children()];
for (unsigned int i=0; i<this->n_children(); i++)
_children[i] = NULL;
}
libmesh_assert (_children[c] == NULL || _children[c] == remote_elem);
libmesh_assert (this == elem->parent());
_children[c] = elem;
}
Definition at line 188 of file dof_object.C.
References DofObject::_dof_ids, DofObject::_n_systems, DofObject::_n_v_comp, and DofObject::n_systems().
{
if (this->n_systems() > 0)
{
// Copy the old systems to temporary storage
unsigned char **old_n_v_comp = new unsigned char* [this->n_systems()];
unsigned int **old_dof_ids = new unsigned int* [this->n_systems()];
for (unsigned int s=0; s<this->n_systems(); s++)
{
old_n_v_comp[s] = _n_v_comp[s];
old_dof_ids[s] = _dof_ids[s];
}
// Delete old storage
libmesh_assert (_n_v_comp != NULL); delete [] _n_v_comp; _n_v_comp = NULL;
libmesh_assert (_dof_ids != NULL); delete [] _dof_ids; _dof_ids = NULL;
// Allocate space for new system
_n_v_comp= new unsigned char* [this->n_systems()+1];
_dof_ids = new unsigned int* [this->n_systems()+1];
// Copy the other systems
for (unsigned int s=0; s<this->n_systems(); s++)
{
_n_v_comp[s] = old_n_v_comp[s];
_dof_ids[s] = old_dof_ids[s];
}
// Delete temporary storage
libmesh_assert (old_n_v_comp != NULL); delete [] old_n_v_comp; old_n_v_comp = NULL;
libmesh_assert (old_dof_ids != NULL); delete [] old_dof_ids; old_dof_ids = NULL;
}
else
{
libmesh_assert (_n_v_comp == NULL);
libmesh_assert (_dof_ids == NULL);
// Allocate space for new system
_n_v_comp = new unsigned char* [this->n_systems()+1];
_dof_ids = new unsigned int* [this->n_systems()+1];
}
// Initialize the new system
_n_v_comp[this->n_systems()] = NULL;
_dof_ids[this->n_systems()] = NULL;
// Done. Don't forget to increment the number of systems!
_n_systems++;
}
Definition at line 797 of file elem.C.
References Elem::active(), Elem::ancestor(), Elem::child(), and Elem::has_children().
Referenced by Elem::ancestor(), UnstructuredMesh::contract(), MeshRefinement::eliminate_unrefined_patches(), UnstructuredMesh::find_neighbors(), MeshRefinement::make_coarsening_compatible(), Elem::make_links_to_me_remote(), and 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
}
Definition at line 1394 of file elem.C.
References Elem::_first_side(), and Elem::_last_side().
{
Predicates::BoundarySide<SideIter> bsp;
return side_iterator(this->_first_side(), this->_last_side(), bsp);
}
Definition at line 1403 of file elem.C.
References Elem::_last_side().
{
Predicates::BoundarySide<SideIter> bsp;
return side_iterator(this->_last_side(), this->_last_side(), bsp);
}
Definition at line 108 of file elem.C.
References libMeshEnums::EDGE2, libMeshEnums::EDGE3, libMeshEnums::EDGE4, libMeshEnums::HEX20, libMeshEnums::HEX27, libMeshEnums::HEX8, libMeshEnums::INFEDGE2, libMeshEnums::INFHEX16, libMeshEnums::INFHEX18, libMeshEnums::INFHEX8, libMeshEnums::INFPRISM12, libMeshEnums::INFPRISM6, libMeshEnums::INFQUAD4, libMeshEnums::INFQUAD6, libMeshEnums::PRISM15, libMeshEnums::PRISM18, libMeshEnums::PRISM6, libMeshEnums::PYRAMID5, libMeshEnums::QUAD4, libMeshEnums::QUAD8, libMeshEnums::QUAD9, libMeshEnums::TET10, libMeshEnums::TET4, libMeshEnums::TRI3, and libMeshEnums::TRI6.
Referenced by GMVIO::_read_one_cell(), UnstructuredMesh::all_first_order(), UnstructuredMesh::all_second_order(), UnstructuredMesh::copy_nodes_and_elements(), UnstructuredMesh::create_submesh(), MeshTools::Modification::flatten(), Nemesis_IO::read(), ExodusII_IO::read(), GmshIO::read_mesh(), XdrIO::read_serialized_connectivity(), Elem::refine(), and GMVIO::write_ascii_old_impl().
{
Elem* elem = NULL;
switch (type)
{
// 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 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;
}
#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:
{
std::cerr << 'ERROR: Undefined element type!.' << std::endl;
libmesh_error();
}
}
AutoPtr<Elem> ap(elem);
return ap;
}
Implements Elem.
Definition at line 319 of file cell_hex27.C.
References Hex::n_edges().
{
libmesh_assert (i < this->n_edges());
return AutoPtr<Elem>(new SideEdge<Edge3,Hex27>(this,i));
}
Implements Elem.
Definition at line 202 of file cell_hex27.C.
References Elem::get_node(), and Hex::n_sides().
{
libmesh_assert (i < this->n_sides());
if (proxy)
{
AutoPtr<Elem> ap(new Side<Quad9,Hex27>(this,i));
return ap;
}
else
{
AutoPtr<Elem> face(new Quad9);
// Think of a unit cube: (-1,1) x (-1,1) x (1,1)
switch (i)
{
case 0: // the face at z=0
{
face->set_node(0) = this->get_node(0);
face->set_node(1) = this->get_node(3);
face->set_node(2) = this->get_node(2);
face->set_node(3) = this->get_node(1);
face->set_node(4) = this->get_node(11);
face->set_node(5) = this->get_node(10);
face->set_node(6) = this->get_node(9);
face->set_node(7) = this->get_node(8);
face->set_node(8) = this->get_node(20);
return face;
}
case 1: // the face at y = 0
{
face->set_node(0) = this->get_node(0);
face->set_node(1) = this->get_node(1);
face->set_node(2) = this->get_node(5);
face->set_node(3) = this->get_node(4);
face->set_node(4) = this->get_node(8);
face->set_node(5) = this->get_node(13);
face->set_node(6) = this->get_node(16);
face->set_node(7) = this->get_node(12);
face->set_node(8) = this->get_node(21);
return face;
}
case 2: // the face at x=1
{
face->set_node(0) = this->get_node(1);
face->set_node(1) = this->get_node(2);
face->set_node(2) = this->get_node(6);
face->set_node(3) = this->get_node(5);
face->set_node(4) = this->get_node(9);
face->set_node(5) = this->get_node(14);
face->set_node(6) = this->get_node(17);
face->set_node(7) = this->get_node(13);
face->set_node(8) = this->get_node(22);
return face;
}
case 3: // the face at y=1
{
face->set_node(0) = this->get_node(2);
face->set_node(1) = this->get_node(3);
face->set_node(2) = this->get_node(7);
face->set_node(3) = this->get_node(6);
face->set_node(4) = this->get_node(10);
face->set_node(5) = this->get_node(15);
face->set_node(6) = this->get_node(18);
face->set_node(7) = this->get_node(14);
face->set_node(8) = this->get_node(23);
return face;
}
case 4: // the face at x=0
{
face->set_node(0) = this->get_node(3);
face->set_node(1) = this->get_node(0);
face->set_node(2) = this->get_node(4);
face->set_node(3) = this->get_node(7);
face->set_node(4) = this->get_node(11);
face->set_node(5) = this->get_node(12);
face->set_node(6) = this->get_node(19);
face->set_node(7) = this->get_node(15);
face->set_node(8) = this->get_node(24);
return face;
}
case 5: // the face at z=1
{
face->set_node(0) = this->get_node(4);
face->set_node(1) = this->get_node(5);
face->set_node(2) = this->get_node(6);
face->set_node(3) = this->get_node(7);
face->set_node(4) = this->get_node(16);
face->set_node(5) = this->get_node(17);
face->set_node(6) = this->get_node(18);
face->set_node(7) = this->get_node(19);
face->set_node(8) = this->get_node(25);
return face;
}
default:
{
libmesh_error();
return face;
}
}
}
// We'll never get here.
libmesh_error();
AutoPtr<Elem> ap(NULL); return ap;
}
Definition at line 277 of file elem.C.
References TypeVector< T >::add(), and Elem::n_vertices().
Referenced by SFCPartitioner::_do_partition(), MeshCommunication::assign_global_indices(), CentroidPartitioner::compute_centroids(), UnstructuredMesh::find_neighbors(), LocationMap< T >::point_of(), FE< Dim, T >::shape(), FE< Dim, T >::shape_deriv(), FE< Dim, T >::shape_second_deriv(), Prism6::volume(), and 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()));
}
Referenced by Elem::active_family_tree(), Elem::active_family_tree_by_neighbor(), Elem::active_family_tree_by_side(), HPCoarsenTest::add_projection(), UnstructuredMesh::all_first_order(), Elem::ancestor(), Elem::coarsen(), FEBase::coarsened_dof_values(), MeshRefinement::eliminate_unrefined_patches(), JumpErrorEstimator::estimate_error(), ExactErrorEstimator::estimate_error(), Elem::family_tree(), Elem::family_tree_by_neighbor(), Elem::family_tree_by_side(), Elem::family_tree_by_subneighbor(), UnstructuredMesh::find_neighbors(), MeshRefinement::flag_elements_by_nelem_target(), Elem::has_ancestor_children(), Elem::is_ancestor_of(), MeshTools::libmesh_assert_no_links_to_elem(), MeshTools::libmesh_assert_valid_remote_elems(), MeshRefinement::make_coarsening_compatible(), Elem::make_links_to_me_remote(), MeshRefinement::make_refinement_compatible(), Elem::min_new_p_level_by_neighbor(), Elem::min_p_level_by_neighbor(), Elem::refine(), Tet4::reselect_diagonal(), Partitioner::set_parent_processor_ids(), MeshTools::Modification::smooth(), Elem::subactive(), Parallel::sync_element_data_by_parent_id(), and XdrIO::write_serialized_connectivity().
Definition at line 1245 of file elem.h.
References Elem::n_neighbors(), Elem::neighbor(), and 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;
}
Definition at line 1258 of file elem.h.
References Elem::n_neighbors(), Elem::neighbor(), and 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;
}
Definition at line 388 of file dof_object.h.
References DofObject::_dof_ids, DofObject::_n_systems, DofObject::_n_v_comp, and DofObject::n_systems().
Referenced by DofObject::set_n_systems(), and DofObject::~DofObject().
{
// Only clear if there is data
if (this->n_systems() != 0)
{
libmesh_assert (_n_v_comp != NULL);
libmesh_assert (_dof_ids != NULL);
for (unsigned int s=0; s<this->n_systems(); s++)
{
if (_dof_ids[s] != NULL) // This has only been allocated if
{ // variables were declared
delete [] _dof_ids[s]; _dof_ids[s] = NULL;
}
if (_n_v_comp[s] != NULL) // it is possible the number of variables is 0,
{ // but this was allocated (_n_v_comp[s][0] == 0)
delete [] _n_v_comp[s]; _n_v_comp[s] = NULL;
}
}
delete [] _n_v_comp; _n_v_comp = NULL;
delete [] _dof_ids; _dof_ids = NULL;
}
// Make sure we cleaned up
// (or there was nothing there)
libmesh_assert (_n_v_comp == NULL);
libmesh_assert (_dof_ids == NULL);
// No systems now.
_n_systems = 0;
}
Definition at line 120 of file dof_object.C.
References DofObject::old_dof_object.
Referenced by DofObject::set_old_dof_object(), and DofObject::~DofObject().
{
// If we have been called before...
// prevent a memory leak
if (old_dof_object != NULL)
{
delete this->old_dof_object;
this->old_dof_object = NULL;
}
}
Definition at line 184 of file elem_refinement.C.
References Elem::active(), TypeVector< T >::add_scaled(), Elem::child(), Elem::COARSEN, Elem::COARSEN_INACTIVE, Elem::embedding_matrix(), Elem::get_node(), Elem::INACTIVE, Elem::JUST_COARSENED, Elem::n_children(), Elem::n_nodes(), Elem::p_level(), Elem::point(), Elem::refinement_flag(), remote_elem, Elem::set_p_level(), and Elem::set_refinement_flag().
Referenced by MeshRefinement::_coarsen_elements().
{
libmesh_assert (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 (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());
}
Referenced by Elem::is_ancestor_of(), Tri6::key(), Tri::key(), Quad9::key(), Quad8::key(), Quad::key(), InfQuad::key(), Edge::key(), Tet::key(), Pyramid::key(), Prism::key(), InfPrism::key(), InfHex18::key(), InfHex::key(), key(), and Hex::key().
Implements Elem.
Definition at line 328 of file cell_hex27.C.
References Elem::_nodes, libMeshEnums::INVALID_IO_PACKAGE, n_sub_elem(), Elem::node(), libMeshEnums::TECPLOT, and libMeshEnums::VTK.
{
libmesh_assert (_nodes != NULL);
libmesh_assert (sc < this->n_sub_elem());
libmesh_assert (iop != INVALID_IO_PACKAGE);
conn.resize(8);
switch (iop)
{
case TECPLOT:
{
switch (sc)
{
case 0:
conn[0] = this->node(0)+1;
conn[1] = this->node(8)+1;
conn[2] = this->node(20)+1;
conn[3] = this->node(11)+1;
conn[4] = this->node(12)+1;
conn[5] = this->node(21)+1;
conn[6] = this->node(26)+1;
conn[7] = this->node(24)+1;
return;
case 1:
conn[0] = this->node(8)+1;
conn[1] = this->node(1)+1;
conn[2] = this->node(9)+1;
conn[3] = this->node(20)+1;
conn[4] = this->node(21)+1;
conn[5] = this->node(13)+1;
conn[6] = this->node(22)+1;
conn[7] = this->node(26)+1;
return;
case 2:
conn[0] = this->node(11)+1;
conn[1] = this->node(20)+1;
conn[2] = this->node(10)+1;
conn[3] = this->node(3)+1;
conn[4] = this->node(24)+1;
conn[5] = this->node(26)+1;
conn[6] = this->node(23)+1;
conn[7] = this->node(15)+1;
return;
case 3:
conn[0] = this->node(20)+1;
conn[1] = this->node(9)+1;
conn[2] = this->node(2)+1;
conn[3] = this->node(10)+1;
conn[4] = this->node(26)+1;
conn[5] = this->node(22)+1;
conn[6] = this->node(14)+1;
conn[7] = this->node(23)+1;
return;
case 4:
conn[0] = this->node(12)+1;
conn[1] = this->node(21)+1;
conn[2] = this->node(26)+1;
conn[3] = this->node(24)+1;
conn[4] = this->node(4)+1;
conn[5] = this->node(16)+1;
conn[6] = this->node(25)+1;
conn[7] = this->node(19)+1;
return;
case 5:
conn[0] = this->node(21)+1;
conn[1] = this->node(13)+1;
conn[2] = this->node(22)+1;
conn[3] = this->node(26)+1;
conn[4] = this->node(16)+1;
conn[5] = this->node(5)+1;
conn[6] = this->node(17)+1;
conn[7] = this->node(25)+1;
return;
case 6:
conn[0] = this->node(24)+1;
conn[1] = this->node(26)+1;
conn[2] = this->node(23)+1;
conn[3] = this->node(15)+1;
conn[4] = this->node(19)+1;
conn[5] = this->node(25)+1;
conn[6] = this->node(18)+1;
conn[7] = this->node(7)+1;
return;
case 7:
conn[0] = this->node(26)+1;
conn[1] = this->node(22)+1;
conn[2] = this->node(14)+1;
conn[3] = this->node(23)+1;
conn[4] = this->node(25)+1;
conn[5] = this->node(17)+1;
conn[6] = this->node(6)+1;
conn[7] = this->node(18)+1;
return;
default:
libmesh_error();
}
}
case VTK:
{
switch (sc)
{
case 0:
conn[0] = this->node(0);
conn[1] = this->node(8);
conn[2] = this->node(20);
conn[3] = this->node(11);
conn[4] = this->node(12);
conn[5] = this->node(21);
conn[6] = this->node(26);
conn[7] = this->node(24);
return;
case 1:
conn[0] = this->node(8);
conn[1] = this->node(1);
conn[2] = this->node(9);
conn[3] = this->node(20);
conn[4] = this->node(21);
conn[5] = this->node(13);
conn[6] = this->node(22);
conn[7] = this->node(26);
return;
case 2:
conn[0] = this->node(11);
conn[1] = this->node(20);
conn[2] = this->node(10);
conn[3] = this->node(3);
conn[4] = this->node(24);
conn[5] = this->node(26);
conn[6] = this->node(23);
conn[7] = this->node(15);
return;
case 3:
conn[0] = this->node(20);
conn[1] = this->node(9);
conn[2] = this->node(2);
conn[3] = this->node(10);
conn[4] = this->node(26);
conn[5] = this->node(22);
conn[6] = this->node(14);
conn[7] = this->node(23);
return;
case 4:
conn[0] = this->node(12);
conn[1] = this->node(21);
conn[2] = this->node(26);
conn[3] = this->node(24);
conn[4] = this->node(4);
conn[5] = this->node(16);
conn[6] = this->node(25);
conn[7] = this->node(19);
return;
case 5:
conn[0] = this->node(21);
conn[1] = this->node(13);
conn[2] = this->node(22);
conn[3] = this->node(26);
conn[4] = this->node(16);
conn[5] = this->node(5);
conn[6] = this->node(17);
conn[7] = this->node(25);
return;
case 6:
conn[0] = this->node(24);
conn[1] = this->node(26);
conn[2] = this->node(23);
conn[3] = this->node(15);
conn[4] = this->node(19);
conn[5] = this->node(25);
conn[6] = this->node(18);
conn[7] = this->node(7);
return;
case 7:
conn[0] = this->node(26);
conn[1] = this->node(22);
conn[2] = this->node(14);
conn[3] = this->node(23);
conn[4] = this->node(25);
conn[5] = this->node(17);
conn[6] = this->node(6);
conn[7] = this->node(18);
return;
default:
libmesh_error();
}
}
default:
libmesh_error();
}
libmesh_error();
}
Reimplemented in InfHex8, InfPrism6, and InfQuad4.
Definition at line 1165 of file elem.C.
References Elem::default_order(), Elem::dim(), FEInterface::inverse_map(), FEInterface::on_reference_element(), and Elem::type().
Referenced by Elem::contains_vertex_of(), PointLocatorTree::operator()(), and HPSingularity::select_refinement().
{
// Declare a basic FEType. Will ue a Lagrange
// element by default.
FEType fe_type(this->default_order());
const Point mapped_point = FEInterface::inverse_map(this->dim(),
fe_type,
this,
p,
1.e-4,
false);
return FEInterface::on_reference_element(mapped_point, this->type());
}
Definition at line 432 of file elem.C.
References Elem::contains_point(), Elem::n_vertices(), and Elem::point().
Referenced by 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;
}
Definition at line 250 of file elem_refinement.C.
References Elem::_children, Elem::active(), Elem::DO_NOTHING, Elem::JUST_COARSENED, Elem::refinement_flag(), and Elem::set_refinement_flag().
Referenced by UnstructuredMesh::contract().
{
// Subactive elements get deleted entirely, not contracted
libmesh_assert (this->active());
// Active contracted elements no longer can have children
if (_children)
{
delete [] _children;
_children = NULL;
}
if (this->refinement_flag() == Elem::JUST_COARSENED)
this->set_refinement_flag(Elem::DO_NOTHING);
}
Implements Elem.
Definition at line 131 of file cell_hex27.h.
References libMeshEnums::SECOND.
{ return SECOND; }
Implements Elem.
Definition at line 59 of file cell.h.
{ return 3; }
Definition at line 564 of file dof_object.h.
References DofObject::_dof_ids, DofObject::invalid_id, DofObject::n_comp(), DofObject::n_systems(), and DofObject::n_vars().
Referenced by DofMap::constrain_p_dofs(), GMVIO::copy_nodal_solution(), DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), DofMap::dof_indices(), DofObject::DofObject(), DofMap::old_dof_indices(), DofMap::reinit(), HPCoarsenTest::select_refinement(), DofObject::set_dof_number(), DofMap::set_nonlocal_dof_objects(), VTKIO::solution_to_vtk(), and System::zero_variable().
{
libmesh_assert (s < this->n_systems());
libmesh_assert (var < this->n_vars(s));
libmesh_assert (_dof_ids != NULL);
libmesh_assert (_dof_ids[s] != NULL);
libmesh_assert (comp < this->n_comp(s,var));
if (_dof_ids[s][var] == invalid_id)
return invalid_id;
else
return (_dof_ids[s][var] + comp);
}
Implements Elem.
Definition at line 208 of file cell_hex27.h.
References _embedding_matrix.
{ return _embedding_matrix[i][j][k]; }
Definition at line 880 of file elem.C.
References Elem::active(), Elem::child(), Elem::family_tree(), Elem::is_remote(), Elem::n_children(), and Elem::subactive().
Referenced by 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);
}
Definition at line 981 of file elem.C.
References Elem::active(), Elem::child(), Elem::family_tree_by_neighbor(), Elem::has_neighbor(), Elem::n_children(), remote_elem, and Elem::subactive().
Referenced by Elem::family_tree_by_neighbor(), and 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));
// 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 *child = this->child(c);
if (child != remote_elem && child->has_neighbor(neighbor))
child->family_tree_by_neighbor (family, neighbor, false);
}
}
Definition at line 927 of file elem.C.
References Elem::active(), Elem::child(), Elem::family_tree_by_side(), Elem::is_child_on_side(), Elem::n_children(), Elem::n_sides(), and Elem::subactive().
Referenced by Elem::family_tree_by_side().
{
// 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);
}
Definition at line 1011 of file elem.C.
References Elem::active(), Elem::child(), Elem::family_tree_by_subneighbor(), Elem::has_neighbor(), Elem::is_ancestor_of(), Elem::n_children(), Elem::n_sides(), Elem::neighbor(), Elem::parent(), remote_elem, and Elem::subactive().
Referenced by Elem::family_tree_by_subneighbor(), and 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);
libmesh_assert (neighbor != remote_elem);
libmesh_assert (this->has_neighbor(neighbor));
// This only makes sense if subneighbor descends from neighbor
libmesh_assert (subneighbor);
libmesh_assert (subneighbor != remote_elem);
libmesh_assert (neighbor->is_ancestor_of(subneighbor));
// Add this element to the family tree if applicable.
if (neighbor == 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 *child = this->child(c);
if (child != remote_elem)
for (unsigned int s=0; s != child->n_sides(); ++s)
{
Elem *child_neigh = child->neighbor(s);
if (child_neigh &&
(child_neigh == neighbor ||
(child_neigh->parent() == neighbor &&
child_neigh->is_ancestor_of(subneighbor))))
child->family_tree_by_subneighbor (family, child_neigh,
subneighbor, false);
}
}
}
Definition at line 443 of file elem.C.
References Elem::active(), Elem::active_family_tree_by_neighbor(), Elem::contains_vertex_of(), Elem::n_sides(), Elem::neighbor(), and remote_elem.
Referenced by Patch::find_point_neighbors().
{
neighbor_set.clear();
neighbor_set.insert(this);
unsigned int old_size;
do
{
old_size = neighbor_set.size();
// Loop over all the elements in the patch
std::set<const Elem*>::const_iterator it = neighbor_set.begin();
const std::set<const Elem*>::const_iterator end = neighbor_set.end();
for (; it != end; ++it)
{
const Elem* elem = *it;
for (unsigned int s=0; s<elem->n_sides(); s++)
{
const Elem* neighbor = elem->neighbor(s);
if (neighbor &&
neighbor != remote_elem) // we have a real neighbor on this side
{
if (neighbor->active()) // ... if it is active
{
if (this->contains_vertex_of(neighbor) // ... and touches us
|| neighbor->contains_vertex_of(this))
neighbor_set.insert (neighbor); // ... then add it
}
#ifdef LIBMESH_ENABLE_AMR
else // ... the neighbor is *not* active,
{ // ... so add *all* neighboring
// active children
std::vector<const Elem*> active_neighbor_children;
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)
if (this->contains_vertex_of(*child_it) ||
(*child_it)->contains_vertex_of(this))
neighbor_set.insert (*child_it);
}
#endif // #ifdef LIBMESH_ENABLE_AMR
}
}
}
}
while (old_size != neighbor_set.size());
}
Definition at line 1235 of file elem.C.
References libMeshEnums::EDGE2, libMeshEnums::EDGE3, libMeshEnums::EDGE4, libMeshEnums::HEX20, libMeshEnums::HEX27, libMeshEnums::HEX8, libMeshEnums::INFHEX16, libMeshEnums::INFHEX18, libMeshEnums::INFHEX8, libMeshEnums::INFPRISM12, libMeshEnums::INFPRISM6, libMeshEnums::INFQUAD4, libMeshEnums::INFQUAD6, libMeshEnums::INVALID_ELEM, libMeshEnums::PRISM15, libMeshEnums::PRISM18, libMeshEnums::PRISM6, libMeshEnums::QUAD4, libMeshEnums::QUAD8, libMeshEnums::QUAD9, libMeshEnums::TET10, libMeshEnums::TET4, libMeshEnums::TRI3, and libMeshEnums::TRI6.
Referenced by UnstructuredMesh::all_first_order(), and 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;
#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;
}
}
Definition at line 45 of file reference_counter.C.
References ReferenceCounter::_counts, and Quality::name().
Referenced by ReferenceCounter::print_info().
{
#if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
std::ostringstream out;
out << '
<< ' ----------------------------------------------------------------------------
<< '| Reference count information |
<< ' ---------------------------------------------------------------------------- ;
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;
out << '| ' << name << ' reference count information:
<< '| Creations: ' << creations << '
<< '| Destructions: ' << destructions << ';
}
out << ' ---------------------------------------------------------------------------- ;
return out.str();
#else
return '';
#endif
}
Definition at line 45 of file reference_counter.C.
References ReferenceCounter::_counts, and Quality::name().
Referenced by ReferenceCounter::print_info().
{
#if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
std::ostringstream out;
out << '
<< ' ----------------------------------------------------------------------------
<< '| Reference count information |
<< ' ---------------------------------------------------------------------------- ;
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;
out << '| ' << name << ' reference count information:
<< '| Creations: ' << creations << '
<< '| Destructions: ' << destructions << ';
}
out << ' ---------------------------------------------------------------------------- ;
return out.str();
#else
return '';
#endif
}
Reimplemented in RemoteElem.
Definition at line 1176 of file elem.h.
References Elem::_nodes, and Elem::n_nodes().
Referenced by Elem::_cast_node_address_to_unsigned_int(), UnstructuredMesh::all_first_order(), UnstructuredMesh::all_second_order(), MeshTools::Generation::build_cube(), Tri6::build_side(), Tri3::build_side(), Quad9::build_side(), Quad8::build_side(), Quad4::build_side(), InfQuad6::build_side(), Edge::build_side(), Tet4::build_side(), Tet10::build_side(), Pyramid5::build_side(), Prism6::build_side(), Prism18::build_side(), Prism15::build_side(), InfPrism12::build_side(), InfHex18::build_side(), InfHex16::build_side(), Hex8::build_side(), build_side(), Hex20::build_side(), Elem::coarsen(), DofMap::constrain_p_dofs(), MeshTools::correct_node_proc_ids(), DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), DofMap::dof_indices(), UNVIO::element_out(), MeshTools::Modification::flatten(), Elem::libmesh_assert_valid_node_pointers(), MeshTools::libmesh_assert_valid_node_procids(), DofMap::old_dof_indices(), Tri::quality(), Elem::refine(), DofMap::reinit(), Tet4::reselect_diagonal(), HPCoarsenTest::select_refinement(), Partitioner::set_node_processor_ids(), Tri::side(), Quad::side(), InfQuad::side(), Edge::side(), Tet::side(), Pyramid::side(), Prism::side(), InfPrism::side(), InfHex::side(), Hex::side(), MeshTools::Modification::smooth(), TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), Tri3::volume(), Tet4::volume(), Pyramid5::volume(), and GnuPlotIO::write_solution().
{
libmesh_assert (i < this->n_nodes());
libmesh_assert (_nodes[i] != NULL);
return _nodes[i];
}
Referenced by Elem::is_ancestor_of(), and XdrIO::read_serialized_connectivity().
Reimplemented from Elem.
Definition at line 111 of file cell_hex27.C.
References Elem::point(), and TypeVector< T >::relative_fuzzy_equals().
{
// Make sure x-edge endpoints are affine
Point v = this->point(1) - this->point(0);
if (!v.relative_fuzzy_equals(this->point(2) - this->point(3)) ||
!v.relative_fuzzy_equals(this->point(5) - this->point(4)) ||
!v.relative_fuzzy_equals(this->point(6) - this->point(7)))
return false;
// Make sure x-edges are straight
// and x-face and center points are centered
v /= 2;
if (!v.relative_fuzzy_equals(this->point(8) - this->point(0)) ||
!v.relative_fuzzy_equals(this->point(10) - this->point(3)) ||
!v.relative_fuzzy_equals(this->point(16) - this->point(4)) ||
!v.relative_fuzzy_equals(this->point(18) - this->point(7)) ||
!v.relative_fuzzy_equals(this->point(20) - this->point(11)) ||
!v.relative_fuzzy_equals(this->point(21) - this->point(12)) ||
!v.relative_fuzzy_equals(this->point(23) - this->point(15)) ||
!v.relative_fuzzy_equals(this->point(25) - this->point(19)) ||
!v.relative_fuzzy_equals(this->point(26) - this->point(24)))
return false;
// Make sure xz-faces are identical parallelograms
v = this->point(4) - this->point(0);
if (!v.relative_fuzzy_equals(this->point(7) - this->point(3)))
return false;
v /= 2;
if (!v.relative_fuzzy_equals(this->point(12) - this->point(0)) ||
!v.relative_fuzzy_equals(this->point(13) - this->point(1)) ||
!v.relative_fuzzy_equals(this->point(14) - this->point(2)) ||
!v.relative_fuzzy_equals(this->point(15) - this->point(3)) ||
!v.relative_fuzzy_equals(this->point(22) - this->point(9)) ||
!v.relative_fuzzy_equals(this->point(24) - this->point(11)))
return false;
// Make sure y-edges are straight
v = (this->point(3) - this->point(0))/2;
if (!v.relative_fuzzy_equals(this->point(11) - this->point(0)) ||
!v.relative_fuzzy_equals(this->point(9) - this->point(1)) ||
!v.relative_fuzzy_equals(this->point(17) - this->point(5)) ||
!v.relative_fuzzy_equals(this->point(19) - this->point(4)))
return false;
// If all the above checks out, the map is affine
return true;
}
Definition at line 1351 of file elem.h.
References Elem::_children, Elem::child(), Elem::has_children(), and 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;
}
Definition at line 1337 of file elem.h.
References Elem::_children.
Referenced by UnstructuredMesh::all_first_order(), Elem::ancestor(), UnstructuredMesh::find_neighbors(), MeshRefinement::flag_elements_by_nelem_target(), Elem::has_ancestor_children(), Elem::is_ancestor_of(), MeshTools::libmesh_assert_no_links_to_elem(), MeshRefinement::make_coarsening_compatible(), Elem::make_links_to_me_remote(), MeshRefinement::make_refinement_compatible(), FEMSystem::mesh_position_set(), System::ProjectVector::operator()(), Elem::subactive(), and Parallel::sync_element_data_by_parent_id().
{
#ifdef LIBMESH_ENABLE_AMR
if (_children == NULL)
return false;
else
return true;
#else
return false;
#endif
}
Definition at line 583 of file dof_object.h.
References libMesh::invalid_uint, DofObject::n_systems(), and DofObject::n_vars().
Referenced by 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 (sys < this->n_systems());
if (this->n_vars(sys))
return true;
}
return false;
}
Definition at line 1233 of file elem.h.
References Elem::n_neighbors(), and Elem::neighbor().
Referenced by Elem::active_family_tree_by_neighbor(), Elem::family_tree_by_neighbor(), Elem::family_tree_by_subneighbor(), MeshRefinement::make_coarsening_compatible(), Elem::make_links_to_me_remote(), MeshRefinement::make_refinement_compatible(), Elem::min_new_p_level_by_neighbor(), Elem::min_p_level_by_neighbor(), and Elem::on_boundary().
{
for (unsigned int n=0; n<this->n_neighbors(); n++)
if (this->neighbor(n) == elem)
return true;
return false;
}
Definition at line 306 of file elem.C.
References std::max(), Elem::n_vertices(), Elem::point(), and TypeVector< T >::size().
Referenced by KellyErrorEstimator::boundary_side_integration(), DiscontinuityMeasure::boundary_side_integration(), KellyErrorEstimator::internal_side_integration(), LaplacianErrorEstimator::internal_side_integration(), DiscontinuityMeasure::internal_side_integration(), and HPCoarsenTest::select_refinement().
{
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());
}
return h_max;
}
Definition at line 289 of file elem.C.
References std::min(), Elem::n_vertices(), Elem::point(), and TypeVector< T >::size().
Referenced by UnstructuredMesh::find_neighbors(), FEMSystem::numerical_jacobian(), and Elem::refine().
{
Real h_min=1.e30;
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());
}
return h_min;
}
Definition at line 449 of file dof_object.h.
References DofObject::_id, and DofObject::valid_id().
Referenced by SFCPartitioner::_do_partition(), UniformRefinementEstimator::_estimate_error(), SerialMesh::add_elem(), ParallelMesh::add_elem(), SerialMesh::add_node(), ParallelMesh::add_node(), ParallelMesh::add_point(), UnstructuredMesh::all_first_order(), UnstructuredMesh::all_second_order(), FEMSystem::assembly(), MeshData::assign(), ParmetisPartitioner::assign_partitioning(), MeshTools::Generation::build_delaunay_square(), ParmetisPartitioner::build_graph(), InfElemBuilder::build_inf_elem(), VTKIO::cells_to_vtk(), FEBase::compute_single_point_map(), UnstructuredMesh::copy_nodes_and_elements(), MeshRefinement::create_parent_error_vector(), SerialMesh::delete_elem(), ParallelMesh::delete_elem(), SerialMesh::delete_node(), ParallelMesh::delete_node(), MeshCommunication::delete_remote_elements(), MeshData::elem_to_foreign_id(), JumpErrorEstimator::estimate_error(), ExactErrorEstimator::estimate_error(), UnstructuredMesh::find_neighbors(), MeshTools::find_nodal_neighbors(), MeshRefinement::flag_elements_by_elem_fraction(), MeshRefinement::flag_elements_by_error_fraction(), MeshRefinement::flag_elements_by_error_tolerance(), MeshRefinement::flag_elements_by_mean_stddev(), TetGenMeshInterface::get_node_index(), LaplaceMeshSmoother::init(), ParmetisPartitioner::initialize(), ExodusII_IO_Helper::initialize(), TreeNode< N >::insert(), SerialMesh::insert_elem(), ParallelMesh::insert_elem(), ParallelMesh::insert_node(), FE< Dim, T >::inverse_map(), Elem::is_ancestor_of(), MeshTools::libmesh_assert_valid_elem_ids(), MeshTools::libmesh_assert_valid_node_procids(), MeshTools::libmesh_assert_valid_refinement_flags(), Node::Node(), Elem::node(), MeshData::node_to_foreign_id(), VTKIO::nodes_to_vtk(), PatchRecoveryErrorEstimator::EstimateError::operator()(), XdrIO::pack_element(), ErrorVector::plot_error(), DofObject::processor_id(), Nemesis_IO::read(), ExodusII_IO::read(), ParallelMesh::renumber_elem(), ParallelMesh::renumber_node(), ParallelMesh::renumber_nodes_and_elements(), HPCoarsenTest::select_refinement(), DofObject::set_id(), Partitioner::set_node_processor_ids(), DofMap::set_nonlocal_dof_objects(), Partitioner::set_parent_processor_ids(), FE< Dim, T >::shape(), FE< Dim, T >::shape_deriv(), FE< Dim, T >::shape_second_deriv(), LaplaceMeshSmoother::smooth(), MeshTools::Modification::smooth(), BoundaryInfo::sync(), Parallel::sync_dofobject_data_by_id(), Parallel::sync_element_data_by_parent_id(), GMVIO::write_ascii_new_impl(), GMVIO::write_ascii_old_impl(), ExodusII_IO_Helper::write_elements(), LegacyXdrIO::write_mesh(), GmshIO::write_mesh(), and XdrIO::write_serialized_connectivity().
{
libmesh_assert (this->valid_id());
return _id;
}
Definition at line 149 of file reference_counter.h.
References ReferenceCounter::_counts, Quality::name(), and Threads::spin_mtx.
Referenced by ReferenceCountedObject< Value >::ReferenceCountedObject().
{
Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
std::pair<unsigned int, unsigned int>& p = _counts[name];
p.first++;
}
Definition at line 149 of file reference_counter.h.
References ReferenceCounter::_counts, Quality::name(), and Threads::spin_mtx.
Referenced by ReferenceCountedObject< Value >::ReferenceCountedObject().
{
Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
std::pair<unsigned int, unsigned int>& p = _counts[name];
p.first++;
}
Definition at line 167 of file reference_counter.h.
References ReferenceCounter::_counts, Quality::name(), and Threads::spin_mtx.
Referenced by ReferenceCountedObject< Value >::~ReferenceCountedObject().
{
Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
std::pair<unsigned int, unsigned int>& p = _counts[name];
p.second++;
}
Definition at line 167 of file reference_counter.h.
References ReferenceCounter::_counts, Quality::name(), and Threads::spin_mtx.
Referenced by ReferenceCountedObject< Value >::~ReferenceCountedObject().
{
Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
std::pair<unsigned int, unsigned int>& p = _counts[name];
p.second++;
}
false. All classes derived from Cell are finite elements.
Implements Elem.
Definition at line 73 of file cell.h.
{ return false; }
Referenced by Elem::is_ancestor_of().
Definition at line 378 of file dof_object.h.
References DofObject::invalidate_dofs(), DofObject::invalidate_id(), and DofObject::invalidate_processor_id().
Referenced by DofObject::DofObject().
{
this->invalidate_dofs ();
this->invalidate_id ();
this->invalidate_processor_id ();
}
Definition at line 342 of file dof_object.h.
References DofObject::invalid_id, DofObject::n_comp(), DofObject::n_systems(), DofObject::n_vars(), and DofObject::set_dof_number().
Referenced by DofObject::invalidate().
{
// 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 v=0; v<this->n_vars(s); v++)
if (this->n_comp(s,v))
this->set_dof_number(s,v,0,invalid_id);
}
// ...otherwise invalidate the dofs for all systems
else
for (unsigned int v=0; v<n_vars(sys_num); v++)
if (this->n_comp(sys_num,v))
this->set_dof_number(sys_num,v,0,invalid_id);
}
Definition at line 362 of file dof_object.h.
References DofObject::invalid_id, and DofObject::set_id().
Referenced by DofObject::invalidate().
{
this->set_id (invalid_id);
}
Definition at line 370 of file dof_object.h.
References DofObject::invalid_processor_id, and DofObject::processor_id().
Referenced by MeshTools::correct_node_proc_ids(), DofObject::invalidate(), Partitioner::set_node_processor_ids(), and Partitioner::set_parent_processor_ids().
{
this->processor_id (invalid_processor_id);
}
Convenient way to communicate elements. This class packes up an element so that it can easily be communicated through an MPI array.
Author:
Date:
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.
return the level of this packed element.
return the p-level of this packed element.
return the refinement state of this packed element.
return the p-refinement state of this packed element.
return the element type of this packed element.
return the processor id of this packed element.
return the subdomain id of this packed element.
return the id of this packed element.
return the parent id of this packed element.
return which child this packed element is.
return the number of nodes in this packed element
return the global index of the packed element's nth node.
The definition of the protected nested SideIter class.
The definition of the struct used for iterating over sides.
Definition at line 1368 of file elem.h.
References Elem::_children, Elem::_first_side(), Elem::_last_side(), Elem::_p_level, Elem::_parent, Elem::_pflag, Elem::_rflag, Elem::active(), Elem::build_side(), Elem::child(), Elem::compute_key(), Elem::dim(), Elem::hack_p_level(), Elem::has_children(), DofObject::id(), Elem::interior_parent(), libMesh::invalid_uint, Elem::level(), std::max(), Elem::max_descendant_p_level(), std::min(), Elem::n_children(), Elem::n_neighbors(), Elem::n_nodes(), Elem::neighbor(), Elem::node(), operator*(), Elem::operator==(), Elem::p_level(), Elem::p_refinement_flag(), Elem::parent(), DofObject::processor_id(), Elem::refinement_flag(), Elem::set_p_level(), Elem::set_p_refinement_flag(), Elem::set_parent(), Elem::set_refinement_flag(), Elem::subactive(), Elem::subdomain_id(), Elem::top_parent(), Elem::type(), Elem::type_to_n_nodes_map, and Elem::which_child_am_i().
Referenced by Elem::family_tree_by_subneighbor().
Definition at line 864 of file elem.C.
References Elem::build_edge(), Elem::n_children(), and Elem::n_edges().
Referenced by FEBase::coarsened_dof_values().
{
libmesh_assert (c < this->n_children());
libmesh_assert (e < this->n_edges());
AutoPtr<Elem> my_edge = this->build_edge(e);
AutoPtr<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));
}
Implements Elem.
Definition at line 184 of file cell_hex.C.
References Hex::n_children(), Hex::n_sides(), and Hex8::side_nodes_map.
{
libmesh_assert (c < this->n_children());
libmesh_assert (s < this->n_sides());
for (unsigned int i = 0; i != 4; ++i)
if (Hex8::side_nodes_map[s][i] == c)
return true;
return false;
}
Implements Elem.
Definition at line 71 of file cell_hex27.C.
{
if (i < 8)
return false;
if (i > 19)
return false;
return true;
}
Implements Elem.
Definition at line 80 of file cell_hex27.C.
{
if (i == 26)
return false;
if (i > 19)
return true;
return false;
}
Implements Elem.
Definition at line 99 of file cell_hex27.C.
References edge_nodes_map, and Hex::n_edges().
{
libmesh_assert(e < n_edges());
for (unsigned int i = 0; i != 3; ++i)
if (edge_nodes_map[e][i] == n)
return true;
return false;
}
Implements Elem.
Definition at line 89 of file cell_hex27.C.
References Hex::n_sides(), and side_nodes_map.
{
libmesh_assert(s < n_sides());
for (unsigned int i = 0; i != 9; ++i)
if (side_nodes_map[s][i] == n)
return true;
return false;
}
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().
{ return false; }
Implements Elem.
Definition at line 64 of file cell_hex27.C.
{
if (i < 8)
return true;
return false;
}
We reimplemenet this method here for the Hex27 since we can use the center node of each face to provide a perfect (unique) key.
Reimplemented from Hex.
Definition at line 157 of file cell_hex27.C.
References Elem::compute_key(), Hex::n_sides(), and Elem::node().
{
libmesh_assert (s < this->n_sides());
// Think of a unit cube: (-1,1) x (-1,1) x (1,1)
switch (s)
{
case 0: // the face at z=0
return
this->compute_key (this->node(20));
case 1: // the face at y = 0
return
this->compute_key (this->node(21));
case 2: // the face at x=1
return
this->compute_key (this->node(22));
case 3: // the face at y=1
return
this->compute_key (this->node(23));
case 4: // the face at x=0
return
this->compute_key (this->node(24));
case 5: // the face at z=1
return
this->compute_key (this->node(25));
}
// We'll never get here.
libmesh_error();
return 0;
}
Definition at line 323 of file elem.C.
References Elem::n_vertices(), and Elem::point().
Referenced by Quad::quality(), InfHex::quality(), and Hex::quality().
{
libmesh_assert ( n1 < this->n_vertices() );
libmesh_assert ( n2 < this->n_vertices() );
return (this->point(n1) - this->point(n2)).size();
}
Referenced by MeshRefinement::_coarsen_elements(), Elem::active_family_tree_by_neighbor(), BoundaryInfo::add_side(), UnstructuredMesh::all_second_order(), BoundaryInfo::boundary_id(), JumpErrorEstimator::coarse_n_flux_faces_increment(), FEBase::compute_periodic_constraints(), FEBase::compute_proj_constraints(), MeshRefinement::eliminate_unrefined_patches(), JumpErrorEstimator::estimate_error(), MeshTools::find_hanging_nodes_and_parents(), UnstructuredMesh::find_neighbors(), MeshRefinement::flag_elements_by_elem_fraction(), MeshRefinement::flag_elements_by_error_fraction(), MeshRefinement::flag_elements_by_error_tolerance(), MeshRefinement::flag_elements_by_mean_stddev(), MeshRefinement::flag_elements_by_nelem_target(), Elem::is_ancestor_of(), MeshRefinement::limit_level_mismatch_at_edge(), MeshRefinement::limit_level_mismatch_at_node(), MeshRefinement::make_coarsening_compatible(), Elem::make_links_to_me_remote(), MeshRefinement::make_refinement_compatible(), Elem::nullify_neighbors(), BoundaryInfo::remove_side(), BoundaryInfo::side_with_boundary_id(), MeshRefinement::test_level_one(), Elem::which_neighbor_am_i(), and LegacyXdrIO::write_mesh().
Definition at line 515 of file elem.C.
References Elem::n_neighbors(), Elem::neighbor(), Elem::parent(), remote_elem, Elem::subactive(), and Elem::which_neighbor_am_i().
Referenced by 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);
}
unsigned int rev = neigh->which_neighbor_am_i(elem);
libmesh_assert (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);
}
}
else
{
const Elem *parent = this->parent();
if (parent)
libmesh_assert (!parent->neighbor(s));
}
}
}
Definition at line 503 of file elem.C.
References Elem::get_node(), Elem::n_nodes(), and DofObject::valid_id().
Referenced by 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());
}
}
Definition at line 577 of file elem.C.
References Elem::_children, Elem::ancestor(), Elem::child(), Elem::family_tree_by_neighbor(), Elem::family_tree_by_subneighbor(), Elem::has_children(), Elem::has_neighbor(), Elem::level(), Elem::n_children(), Elem::n_neighbors(), Elem::n_sides(), Elem::neighbor(), Elem::parent(), remote_elem, Elem::set_neighbor(), Elem::subactive(), Elem::which_child_am_i(), and Elem::which_neighbor_am_i().
Referenced by MeshCommunication::delete_remote_elements().
{
libmesh_assert (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 *child = this->child(c);
libmesh_assert (child == remote_elem);
}
#endif
// Remotify any neighbor links
for (unsigned int s = 0; s != this->n_sides(); ++s)
{
Elem *neigh = this->neighbor(s);
if (neigh && neigh != remote_elem)
{
// My neighbor should never be more refined than me; my real
// neighbor would have been its parent in that case.
libmesh_assert(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 (my_s < n->n_neighbors());
libmesh_assert (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 (my_s < neigh->n_neighbors());
libmesh_assert (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 *ancestor = this->parent();
libmesh_assert(ancestor);
while (!neigh->has_neighbor(ancestor))
{
ancestor = ancestor->parent();
libmesh_assert(ancestor);
}
// My neighbor may have descendants which consider me a
// neighbor
std::vector<const Elem*> family;
neigh->family_tree_by_subneighbor (family, 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 (my_s < n->n_neighbors());
libmesh_assert (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 *parent = this->parent();
if (parent && parent != remote_elem)
{
unsigned int me = parent->which_child_am_i(this);
libmesh_assert (parent->_children[me] == this);
parent->_children[me] = const_cast<RemoteElem*>(remote_elem);
}
#endif
}
Referenced by FEBase::coarsened_dof_values(), and Elem::is_ancestor_of().
Definition at line 1124 of file elem.C.
References Elem::active(), Elem::child(), Elem::COARSEN, Elem::has_neighbor(), std::min(), Elem::min_new_p_level_by_neighbor(), Elem::n_children(), Elem::p_level(), Elem::p_refinement_flag(), Elem::REFINE, remote_elem, and Elem::subactive().
Referenced by MeshRefinement::eliminate_unrefined_patches(), and Elem::min_new_p_level_by_neighbor().
{
libmesh_assert(!this->subactive());
libmesh_assert(neighbor->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 (new_p_level > 0);
new_p_level -= 1;
}
return std::min(current_min, new_p_level);
}
libmesh_assert(has_neighbor(neighbor));
unsigned int min_p_level = current_min;
for (unsigned int c=0; c<this->n_children(); c++)
{
const Elem* const child = this->child(c);
if (child && child != remote_elem)
if (child->has_neighbor(neighbor))
min_p_level =
child->min_new_p_level_by_neighbor(neighbor,
min_p_level);
}
return min_p_level;
}
Definition at line 1091 of file elem.C.
References Elem::active(), Elem::child(), Elem::has_neighbor(), std::min(), Elem::min_p_level_by_neighbor(), Elem::n_children(), Elem::p_level(), remote_elem, and Elem::subactive().
Referenced by FEBase::compute_periodic_constraints(), FEBase::compute_proj_constraints(), and Elem::min_p_level_by_neighbor().
{
libmesh_assert(!this->subactive());
libmesh_assert(neighbor->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));
// 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 child = this->child(c);
if (child != remote_elem && child->has_neighbor(neighbor))
min_p_level =
child->min_p_level_by_neighbor(neighbor,
min_p_level);
}
return min_p_level;
}
Implements Elem.
Definition at line 72 of file cell_hex.h.
Referenced by Hex::is_child_on_side().
{ return 8; }
Definition at line 538 of file dof_object.h.
References DofObject::_dof_ids, DofObject::_n_v_comp, DofObject::n_systems(), and DofObject::n_vars().
Referenced by DofMap::constrain_p_dofs(), DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), DofMap::dof_indices(), DofObject::dof_number(), DofObject::DofObject(), DofObject::invalidate_dofs(), DofObject::n_dofs(), DofMap::old_dof_indices(), DofMap::reinit(), DofObject::set_dof_number(), DofObject::set_n_comp(), DofMap::set_nonlocal_dof_objects(), and System::zero_variable().
{
libmesh_assert (s < this->n_systems());
libmesh_assert (_dof_ids != NULL);
libmesh_assert (_dof_ids[s] != NULL);
libmesh_assert (_n_v_comp != NULL);
libmesh_assert (_n_v_comp[s] != NULL);
# ifdef DEBUG
// Does this ever happen? I doubt it... 3/7/2003 (BSK)
if (var >= this->n_vars(s))
{
std::cout << 's=' << s << ', var=' << var << std::endl
<< 'this->n_vars(s)=' << this->n_vars(s) << std::endl
<< 'this->n_systems()=' << this->n_systems() << std::endl;
libmesh_error();
}
# endif
return static_cast<unsigned int>(_n_v_comp[s][var+1]);
}
Definition at line 425 of file dof_object.h.
References libMesh::invalid_uint, DofObject::n_comp(), DofObject::n_systems(), and DofObject::n_vars().
{
libmesh_assert (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;
}
Implements Elem.
Definition at line 62 of file cell_hex.h.
Referenced by Hex8::build_edge(), build_edge(), Hex20::build_edge(), Hex8::is_node_on_edge(), is_node_on_edge(), and Hex20::is_node_on_edge().
{ return 12; }
Implements Elem.
Definition at line 67 of file cell_hex.h.
{ return 6; }
Definition at line 301 of file elem.h.
References Elem::n_sides().
Referenced by MetisPartitioner::_do_partition(), DofMap::add_neighbors_to_send_list(), ParmetisPartitioner::build_graph(), InfElemBuilder::build_inf_elem(), Elem::child_neighbor(), MeshRefinement::eliminate_unrefined_patches(), JumpErrorEstimator::estimate_error(), UnstructuredMesh::find_neighbors(), Elem::has_neighbor(), LaplaceMeshSmoother::init(), Elem::is_ancestor_of(), MeshTools::libmesh_assert_no_links_to_elem(), Elem::libmesh_assert_valid_neighbors(), MeshTools::libmesh_assert_valid_node_pointers(), MeshTools::libmesh_assert_valid_remote_elems(), MeshRefinement::make_coarsening_compatible(), Elem::make_links_to_me_remote(), Elem::neighbor(), Elem::nullify_neighbors(), Elem::set_neighbor(), MeshTools::Modification::smooth(), MeshRefinement::test_level_one(), TetGenMeshInterface::triangulate_conformingDelaunayMesh(), TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and Elem::which_neighbor_am_i().
{ return this->n_sides(); }
Implements Elem.
Definition at line 86 of file cell_hex27.h.
Referenced by second_order_adjacent_vertex(), and second_order_child_vertex().
{ return 27; }
Definition at line 76 of file reference_counter.h.
References ReferenceCounter::_n_objects.
Referenced by System::read_serialized_blocked_dof_objects(), and System::write_serialized_blocked_dof_objects().
{ return _n_objects; }
Definition at line 76 of file reference_counter.h.
References ReferenceCounter::_n_objects.
Referenced by System::read_serialized_blocked_dof_objects(), and System::write_serialized_blocked_dof_objects().
{ return _n_objects; }
Reimplemented from Elem.
Definition at line 577 of file cell_hex27.C.
References libMesh::invalid_uint.
{
switch (n)
{
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
return 2;
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
return 4;
case 26:
return 8;
default:
libmesh_error();
}
libmesh_error();
return libMesh::invalid_uint;
}
Implements Elem.
Definition at line 52 of file cell_hex.h.
Referenced by Hex8::build_side(), build_side(), Hex20::build_side(), Hex::is_child_on_side(), Hex8::is_node_on_side(), is_node_on_side(), Hex20::is_node_on_side(), key(), Hex::key(), and Hex::side().
{ return 6; }
Implements Elem.
Definition at line 91 of file cell_hex27.h.
Referenced by connectivity().
{ return 8; }
Definition at line 517 of file dof_object.h.
References DofObject::_n_systems.
Referenced by DofObject::add_system(), DofObject::clear_dofs(), DofMap::dof_indices(), DofObject::dof_number(), DofObject::DofObject(), DofObject::has_dofs(), DofObject::invalidate_dofs(), DofObject::n_comp(), DofObject::n_dofs(), DofObject::n_vars(), DofMap::old_dof_indices(), Elem::refine(), DofObject::set_dof_number(), DofObject::set_n_comp(), DofObject::set_n_systems(), and DofObject::set_n_vars().
{
return static_cast<unsigned int>(_n_systems);
}
Definition at line 525 of file dof_object.h.
References DofObject::_n_v_comp, and DofObject::n_systems().
Referenced by DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), DofObject::dof_number(), DofObject::DofObject(), DofObject::has_dofs(), DofObject::invalidate_dofs(), DofObject::n_comp(), DofObject::n_dofs(), DofObject::set_dof_number(), DofObject::set_n_comp(), DofObject::set_n_vars(), and DofMap::set_nonlocal_dof_objects().
{
libmesh_assert (s < this->n_systems());
libmesh_assert (_n_v_comp != NULL);
if (_n_v_comp[s] == NULL)
return 0;
return static_cast<unsigned int>(_n_v_comp[s][0]);
}
Implements Elem.
Definition at line 57 of file cell_hex.h.
Referenced by second_order_adjacent_vertex(), Hex20::second_order_adjacent_vertex(), second_order_child_vertex(), and Hex20::second_order_child_vertex().
{ return 8; }
Definition at line 1213 of file elem.h.
References Elem::_neighbors, and Elem::n_neighbors().
Referenced by MetisPartitioner::_do_partition(), DofMap::add_neighbors_to_send_list(), FEMSystem::assemble_qoi(), FEMSystem::assemble_qoi_derivative(), FEMSystem::assembly(), MeshTools::Generation::build_delaunay_square(), ParmetisPartitioner::build_graph(), InfElemBuilder::build_inf_elem(), Elem::child_neighbor(), FEBase::compute_periodic_constraints(), FEBase::compute_proj_constraints(), UnstructuredMesh::create_submesh(), MeshRefinement::eliminate_unrefined_patches(), JumpErrorEstimator::estimate_error(), Elem::family_tree_by_subneighbor(), Patch::find_face_neighbors(), MeshTools::find_hanging_nodes_and_parents(), UnstructuredMesh::find_neighbors(), Elem::find_point_neighbors(), MeshTools::Modification::flatten(), Elem::has_neighbor(), LaplaceMeshSmoother::init(), Elem::is_ancestor_of(), MeshTools::libmesh_assert_no_links_to_elem(), Elem::libmesh_assert_valid_neighbors(), MeshTools::libmesh_assert_valid_node_pointers(), MeshTools::libmesh_assert_valid_remote_elems(), MeshRefinement::make_coarsening_compatible(), Elem::make_links_to_me_remote(), MeshRefinement::make_refinement_compatible(), Elem::nullify_neighbors(), SparsityPattern::Build::operator()(), FEMSystem::postprocess(), GmshIO::read_mesh(), REINIT_ERROR(), MeshTools::Modification::smooth(), BoundaryInfo::sync(), MeshRefinement::test_level_one(), TetGenMeshInterface::triangulate_conformingDelaunayMesh(), TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), Elem::which_neighbor_am_i(), XdrIO::write_serialized_bcs(), GnuPlotIO::write_solution(), and DivaIO::write_stream().
{
libmesh_assert (i < this->n_neighbors());
return _neighbors[i];
}
Reimplemented in RemoteElem.
Definition at line 1164 of file elem.h.
References Elem::_nodes, DofObject::id(), DofObject::invalid_id, and Elem::n_nodes().
Referenced by DofMap::add_neighbors_to_send_list(), EquationSystems::build_solution_vector(), FEBase::compute_face_map(), Tri6::connectivity(), Tri3::connectivity(), Quad9::connectivity(), Quad8::connectivity(), Quad4::connectivity(), InfQuad6::connectivity(), InfQuad4::connectivity(), InfEdge2::connectivity(), Edge4::connectivity(), Edge3::connectivity(), Edge2::connectivity(), Tet4::connectivity(), Tet10::connectivity(), Pyramid5::connectivity(), Prism6::connectivity(), Prism18::connectivity(), Prism15::connectivity(), InfPrism6::connectivity(), InfPrism12::connectivity(), InfHex8::connectivity(), InfHex18::connectivity(), InfHex16::connectivity(), Hex8::connectivity(), connectivity(), Hex20::connectivity(), UnstructuredMesh::copy_nodes_and_elements(), UnstructuredMesh::create_submesh(), MeshCommunication::delete_remote_elements(), MeshTools::find_hanging_nodes_and_parents(), MeshTools::get_not_subactive_node_ids(), Elem::is_ancestor_of(), Tri6::key(), Tri::key(), Quad9::key(), Quad8::key(), Quad::key(), InfQuad::key(), Edge::key(), Tet::key(), Pyramid::key(), Prism::key(), InfPrism::key(), InfHex18::key(), InfHex::key(), key(), Hex::key(), MeshRefinement::limit_level_mismatch_at_node(), Elem::operator==(), XdrIO::pack_element(), SerialMesh::renumber_nodes_and_elements(), ParallelMesh::renumber_nodes_and_elements(), LaplaceMeshSmoother::smooth(), MeshTools::subdomain_bounding_box(), BoundaryInfo::sync(), GMVIO::write_ascii_new_impl(), Elem::write_connectivity(), ExodusII_IO_Helper::write_elements(), EnsightIO::write_geometry_ascii(), LegacyXdrIO::write_mesh(), GmshIO::write_mesh(), GmshIO::write_post(), EnsightIO::write_scalar_ascii(), GnuPlotIO::write_solution(), DivaIO::write_stream(), and EnsightIO::write_vector_ascii().
{
libmesh_assert (i < this->n_nodes());
libmesh_assert (_nodes[i] != NULL);
libmesh_assert (_nodes[i]->id() != Node::invalid_id);
return _nodes[i]->id();
}
Definition at line 1183 of file elem.C.
References Elem::level(), Elem::n_neighbors(), Elem::neighbor(), remote_elem, Elem::set_neighbor(), and Elem::which_neighbor_am_i().
Referenced by 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* neighbor = this->neighbor(n);
if (neighbor && 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 (neighbor->level() == this->level())
{
const unsigned int w_n_a_i = neighbor->which_neighbor_am_i(this);
libmesh_assert (w_n_a_i < neighbor->n_neighbors());
neighbor->set_neighbor(w_n_a_i, NULL);
this->set_neighbor(n, NULL);
}
}
}
}
Definition at line 1271 of file elem.h.
References Elem::has_neighbor().
{
// By convention, the element is on the boundary
// if it has a NULL neighbor.
return this->has_neighbor(NULL);
}
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;
}
Reimplemented in InfCell, InfEdge2, and InfQuad.
Definition at line 891 of file elem.h.
Referenced by InfFE< Dim, T_radial, T_map >::combine_base_radial(), InfFE< Dim, T_radial, T_map >::compute_data(), InfFE< Dim, T_radial, T_map >::inverse_map(), and InfFE< Dim, T_radial, T_map >::map().
{ libmesh_error(); return Point(); }
Referenced by MeshRefinement::_coarsen_elements(), MeshRefinement::_refine_elements(), UnstructuredMesh::all_first_order(), Elem::coarsen(), FEBase::coarsened_dof_values(), FEInterface::compute_data(), FEBase::compute_periodic_constraints(), FEBase::compute_proj_constraints(), DofMap::constrain_p_dofs(), DofMap::dof_indices(), FE< Dim, T >::dofs_on_edge(), FE< Dim, T >::dofs_on_side(), FE< Dim, T >::edge_reinit(), Elem::Elem(), MeshRefinement::eliminate_unrefined_patches(), InfFE< Dim, T_radial, T_map >::init_face_shape_functions(), Elem::is_ancestor_of(), MeshRefinement::limit_level_mismatch_at_edge(), MeshRefinement::limit_level_mismatch_at_node(), MeshRefinement::make_coarsening_compatible(), MeshRefinement::make_refinement_compatible(), Elem::min_new_p_level_by_neighbor(), Elem::min_p_level_by_neighbor(), FE< Dim, T >::nodal_soln(), DofMap::old_dof_indices(), System::ProjectVector::operator()(), PatchRecoveryErrorEstimator::EstimateError::operator()(), XdrIO::pack_element(), Elem::refine(), InfFE< Dim, T_radial, T_map >::reinit(), FEXYZ< Dim >::reinit(), FE< Dim, T >::reinit(), DofMap::reinit(), REINIT_ERROR(), HPCoarsenTest::select_refinement(), FE< Dim, T >::shape(), FE< Dim, T >::shape_deriv(), FE< Dim, T >::shape_second_deriv(), MeshRefinement::test_level_one(), and GMVIO::write_ascii_new_impl().
Referenced by MeshRefinement::_coarsen_elements(), MeshRefinement::_refine_elements(), UnstructuredMesh::all_first_order(), UnstructuredMesh::copy_nodes_and_elements(), MeshRefinement::eliminate_unrefined_patches(), Elem::is_ancestor_of(), ParallelMesh::libmesh_assert_valid_parallel_flags(), MeshTools::libmesh_assert_valid_refinement_flags(), MeshRefinement::limit_level_mismatch_at_edge(), MeshRefinement::limit_level_mismatch_at_node(), MeshRefinement::make_coarsening_compatible(), MeshRefinement::make_flags_parallel_consistent(), MeshRefinement::make_refinement_compatible(), Elem::min_new_p_level_by_neighbor(), DofMap::old_dof_indices(), System::ProjectVector::operator()(), Elem::refine(), and MeshRefinement::test_unflagged().
Referenced by LinearPartitioner::_do_partition(), UniformRefinementEstimator::_estimate_error(), Elem::add_child(), UnstructuredMesh::all_first_order(), Edge::build_side(), Elem::child_neighbor(), FEBase::compute_face_map(), UnstructuredMesh::contract(), UnstructuredMesh::copy_nodes_and_elements(), MeshRefinement::create_parent_error_vector(), MeshCommunication::delete_remote_elements(), Elem::Elem(), MeshRefinement::eliminate_unrefined_patches(), JumpErrorEstimator::estimate_error(), ExactErrorEstimator::estimate_error(), Elem::family_tree_by_subneighbor(), MeshTools::find_hanging_nodes_and_parents(), UnstructuredMesh::find_neighbors(), MeshRefinement::flag_elements_by_elem_fraction(), MeshRefinement::flag_elements_by_error_fraction(), MeshRefinement::flag_elements_by_error_tolerance(), Elem::is_ancestor_of(), MeshTools::libmesh_assert_no_links_to_elem(), Elem::libmesh_assert_valid_neighbors(), MeshTools::libmesh_assert_valid_node_pointers(), MeshTools::libmesh_assert_valid_remote_elems(), MeshRefinement::limit_level_mismatch_at_edge(), Elem::make_links_to_me_remote(), MeshRefinement::make_refinement_compatible(), System::ProjectVector::operator()(), Elem::refine(), HPCoarsenTest::select_refinement(), Partitioner::set_parent_processor_ids(), Edge::side(), MeshTools::Modification::smooth(), Parallel::sync_element_data_by_parent_id(), Elem::which_neighbor_am_i(), and LegacyXdrIO::write_mesh().
Reimplemented in RemoteElem.
Definition at line 1142 of file elem.h.
References Elem::_nodes, DofObject::invalid_id, and Elem::n_nodes().
Referenced by PostscriptIO::_compute_edge_bezier_coeffs(), Elem::coarsen(), FEBase::compute_affine_map(), InfFE< Dim, T_radial, T_map >::compute_data(), FEBase::compute_edge_map(), FEBase::compute_face_map(), FEXYZ< Dim >::compute_face_values(), FEBase::compute_single_point_map(), InfQuad4::contains_point(), InfPrism6::contains_point(), InfHex8::contains_point(), Elem::contains_vertex_of(), UnstructuredMesh::create_submesh(), FEMContext::elem_position_get(), FEMContext::elem_position_set(), Tet4::embedding_matrix(), Tet10::embedding_matrix(), Tri6::has_affine_map(), Quad9::has_affine_map(), Quad8::has_affine_map(), Quad4::has_affine_map(), Edge4::has_affine_map(), Edge3::has_affine_map(), Tet10::has_affine_map(), Prism6::has_affine_map(), Prism18::has_affine_map(), Prism15::has_affine_map(), Hex8::has_affine_map(), has_affine_map(), Hex20::has_affine_map(), Elem::hmax(), Elem::hmin(), TreeNode< N >::insert(), InfFE< Dim, T_radial, T_map >::inverse_map(), Elem::length(), InfFE< Dim, T_radial, T_map >::map(), FE< Dim, T >::map(), FE< Dim, T >::map_eta(), FE< Dim, T >::map_xi(), FE< Dim, T >::map_zeta(), Tri3::min_and_max_angle(), Tet4::min_and_max_angle(), FE< Dim, T >::nodal_soln(), FEMSystem::numerical_jacobian(), System::ProjectVector::operator()(), InfQuad::origin(), InfEdge2::origin(), InfCell::origin(), PostscriptIO::plot_linear_elem(), Elem::refine(), FE< Dim, T >::reinit(), Tet4::reselect_optimal_diagonal(), FE< Dim, T >::shape(), FE< Dim, T >::shape_deriv(), MeshTools::Modification::smooth(), Quad4::volume(), Edge3::volume(), Edge2::volume(), EnsightIO::write_geometry_ascii(), and GmshIO::write_post().
{
libmesh_assert (i < this->n_nodes());
libmesh_assert (_nodes[i] != NULL);
libmesh_assert (_nodes[i]->id() != Node::invalid_id);
return *_nodes[i];
}
Reimplemented in RemoteElem.
Definition at line 1154 of file elem.h.
References Elem::_nodes, and Elem::n_nodes().
{
libmesh_assert (i < this->n_nodes());
return *_nodes[i];
}
Definition at line 83 of file reference_counter.C.
References ReferenceCounter::get_info().
{
#if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
std::cout << ReferenceCounter::get_info();
#endif
}
Definition at line 83 of file reference_counter.C.
References ReferenceCounter::get_info().
{
#if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
std::cout << ReferenceCounter::get_info();
#endif
}
Definition at line 473 of file dof_object.h.
References DofObject::_processor_id.
Referenced by SFCPartitioner::_do_partition(), MetisPartitioner::_do_partition(), LinearPartitioner::_do_partition(), CentroidPartitioner::_do_partition(), GMVIO::_read_materials(), ParallelMesh::add_elem(), Patch::add_local_face_neighbors(), Patch::add_local_point_neighbors(), DofMap::add_neighbors_to_send_list(), ParallelMesh::add_node(), SerialMesh::add_point(), ParallelMesh::add_point(), UnstructuredMesh::all_first_order(), UnstructuredMesh::all_second_order(), MeshTools::Modification::all_tri(), ParmetisPartitioner::assign_partitioning(), Patch::build_around_element(), InfElemBuilder::build_inf_elem(), UnstructuredMesh::copy_nodes_and_elements(), MeshTools::correct_node_proc_ids(), UnstructuredMesh::create_submesh(), DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), Elem::Elem(), UnstructuredMesh::find_neighbors(), MeshTools::Modification::flatten(), DofObject::invalidate_processor_id(), Elem::is_ancestor_of(), MeshTools::libmesh_assert_valid_elem_ids(), MeshRefinement::make_coarsening_compatible(), XdrIO::pack_element(), Partitioner::partition_unpartitioned_elements(), DofObject::processor_id(), Nemesis_IO::read(), XdrIO::read_serialized_connectivity(), MeshData::read_xdr(), Elem::refine(), Partitioner::set_node_processor_ids(), DofMap::set_nonlocal_dof_objects(), Partitioner::set_parent_processor_ids(), BoundaryInfo::sync(), Parallel::sync_dofobject_data_by_id(), Parallel::sync_element_data_by_parent_id(), GmshIO::write_mesh(), and XdrIO::write_serialized_connectivity().
{
return _processor_id;
}
Definition at line 489 of file dof_object.h.
References DofObject::id(), and DofObject::processor_id().
{
#ifdef DEBUG
if (id != static_cast<unsigned int>(static_cast<unsigned short int>(id)))
{
std::cerr << 'ERROR: id too large for unsigned short int!' << std::endl
<< 'Recompile with DofObject::_processor_id larger!' << std::endl;
libmesh_error();
}
#endif
this->processor_id() = id;
}
Definition at line 481 of file dof_object.h.
References DofObject::_processor_id.
{
return _processor_id;
}
Reimplemented from Elem.
Definition at line 346 of file cell_hex.C.
References libMeshEnums::ASPECT_RATIO, libMeshEnums::CONDITION, libMeshEnums::DIAGONAL, libMeshEnums::DISTORTION, libMeshEnums::JACOBIAN, libMeshEnums::SHAPE, libMeshEnums::SHEAR, libMeshEnums::SIZE, libMeshEnums::SKEW, libMeshEnums::STRETCH, and libMeshEnums::TAPER.
{
std::pair<Real, Real> bounds;
switch (q)
{
case ASPECT_RATIO:
bounds.first = 1.;
bounds.second = 4.;
break;
case SKEW:
bounds.first = 0.;
bounds.second = 0.5;
break;
case SHEAR:
case SHAPE:
bounds.first = 0.3;
bounds.second = 1.;
break;
case CONDITION:
bounds.first = 1.;
bounds.second = 8.;
break;
case JACOBIAN:
bounds.first = 0.5;
bounds.second = 1.;
break;
case DISTORTION:
bounds.first = 0.6;
bounds.second = 1.;
break;
case TAPER:
bounds.first = 0.;
bounds.second = 0.4;
break;
case STRETCH:
bounds.first = 0.25;
bounds.second = 1.;
break;
case DIAGONAL:
bounds.first = 0.65;
bounds.second = 1.;
break;
case SIZE:
bounds.first = 0.5;
bounds.second = 1.;
break;
default:
std::cout << 'Warning: Invalid quality measure chosen.' << std::endl;
bounds.first = -1;
bounds.second = -1;
}
return bounds;
}
Compue the min/max diagonal ratio. Source: CUBIT User's Manual.
Minimum ratio of lengths derived from opposite edges. Source: CUBIT User's Manual.
Compute the side lengths.
Minimum edge length divided by max diagonal length. Source: CUBIT User's Manual.
Compute the maximum diagonal.
Compute the minimum edge length.
I don't know what to do for this metric. Maybe the base class knows...
Reimplemented from Elem.
Definition at line 198 of file cell_hex.C.
References libMeshEnums::DIAGONAL, Elem::length(), std::max(), std::min(), libMeshEnums::STRETCH, and libMeshEnums::TAPER.
{
switch (q)
{
case DIAGONAL:
{
// Diagonal between node 0 and node 6
const Real d06 = this->length(0,6);
// Diagonal between node 3 and node 5
const Real d35 = this->length(3,5);
// Diagonal between node 1 and node 7
const Real d17 = this->length(1,7);
// Diagonal between node 2 and node 4
const Real d24 = this->length(2,4);
// Find the biggest and smallest diagonals
const Real min = std::min(d06, std::min(d35, std::min(d17, d24)));
const Real max = std::max(d06, std::max(d35, std::max(d17, d24)));
libmesh_assert (max != 0.0);
return min / max;
break;
}
case TAPER:
{
const Real d01 = this->length(0,1);
const Real d12 = this->length(1,2);
const Real d23 = this->length(2,3);
const Real d03 = this->length(0,3);
const Real d45 = this->length(4,5);
const Real d56 = this->length(5,6);
const Real d67 = this->length(6,7);
const Real d47 = this->length(4,7);
const Real d04 = this->length(0,4);
const Real d15 = this->length(1,5);
const Real d37 = this->length(3,7);
const Real d26 = this->length(2,6);
std::vector<Real> edge_ratios(12);
// Front
edge_ratios[0] = std::min(d01, d45) / std::max(d01, d45);
edge_ratios[1] = std::min(d04, d15) / std::max(d04, d15);
// Right
edge_ratios[2] = std::min(d15, d26) / std::max(d15, d26);
edge_ratios[3] = std::min(d12, d56) / std::max(d12, d56);
// Back
edge_ratios[4] = std::min(d67, d23) / std::max(d67, d23);
edge_ratios[5] = std::min(d26, d37) / std::max(d26, d37);
// Left
edge_ratios[6] = std::min(d04, d37) / std::max(d04, d37);
edge_ratios[7] = std::min(d03, d47) / std::max(d03, d47);
// Bottom
edge_ratios[8] = std::min(d01, d23) / std::max(d01, d23);
edge_ratios[9] = std::min(d03, d12) / std::max(d03, d12);
// Top
edge_ratios[10] = std::min(d45, d67) / std::max(d45, d67);
edge_ratios[11] = std::min(d56, d47) / std::max(d56, d47);
return *(std::min_element(edge_ratios.begin(), edge_ratios.end())) ;
break;
}
case STRETCH:
{
const Real sqrt3 = 1.73205080756888;
const Real d06 = this->length(0,6);
const Real d17 = this->length(1,7);
const Real d35 = this->length(3,5);
const Real d24 = this->length(2,4);
const Real max_diag = std::max(d06, std::max(d17, std::max(d35, d24)));
libmesh_assert ( max_diag != 0.0 );
std::vector<Real> edges(12);
edges[0] = this->length(0,1);
edges[1] = this->length(1,2);
edges[2] = this->length(2,3);
edges[3] = this->length(0,3);
edges[4] = this->length(4,5);
edges[5] = this->length(5,6);
edges[6] = this->length(6,7);
edges[7] = this->length(4,7);
edges[8] = this->length(0,4);
edges[9] = this->length(1,5);
edges[10] = this->length(2,6);
edges[11] = this->length(3,7);
const Real min_edge = *(std::min_element(edges.begin(), edges.end()));
return sqrt3 * min_edge / max_diag ;
break;
}
default:
{
return Elem::quality(q);
}
}
// Will never get here...
libmesh_error();
return 0.;
}
The following functions only apply when AMR is enabled and thus are not present otherwise.
Definition at line 40 of file elem_refinement.C.
References Elem::_children, Elem::active(), MeshRefinement::add_elem(), MeshRefinement::add_point(), Elem::ancestor(), Elem::build(), Elem::child(), Elem::embedding_matrix(), Elem::get_node(), Elem::hmin(), Elem::INACTIVE, Elem::JUST_REFINED, Elem::n_children(), Elem::n_nodes(), DofObject::n_systems(), Elem::p_level(), Elem::p_refinement_flag(), Elem::parent(), Elem::point(), DofObject::processor_id(), Elem::REFINE, Elem::refinement_flag(), DofObject::set_n_systems(), Elem::set_node(), Elem::set_p_level(), Elem::set_p_refinement_flag(), Elem::set_refinement_flag(), Elem::subactive(), and Elem::type().
{
libmesh_assert (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 *child = this->child(c);
p[c].resize (child->n_nodes());
nodes[c].resize(child->n_nodes());
for (unsigned int nc=0; nc<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<child->n_nodes(); nc++)
{
if (nodes[c][nc] != NULL)
{
child->set_node(nc) = nodes[c][nc];
}
else
{
child->set_node(nc) =
mesh_refinement.add_point(p[c][nc],
child->processor_id(),
pointtol);
child->get_node(nc)->set_n_systems
(this->n_systems());
}
}
mesh_refinement.add_elem (child);
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 *child = this->child(c);
libmesh_assert(child->subactive());
child->set_refinement_flag(Elem::JUST_REFINED);
child->set_p_level(parent_p_level);
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(this->child(c)->parent() == this);
libmesh_assert(this->child(c)->active());
}
libmesh_assert (this->ancestor());
}
Referenced by MeshRefinement::_coarsen_elements(), MeshRefinement::_refine_elements(), Elem::active(), UnstructuredMesh::all_first_order(), Elem::coarsen(), MeshRefinement::coarsen_elements(), Elem::contract(), UnstructuredMesh::copy_nodes_and_elements(), MeshRefinement::eliminate_unrefined_patches(), Elem::is_ancestor_of(), ParallelMesh::libmesh_assert_valid_parallel_flags(), MeshTools::libmesh_assert_valid_refinement_flags(), MeshRefinement::limit_level_mismatch_at_edge(), MeshRefinement::limit_level_mismatch_at_node(), MeshRefinement::make_coarsening_compatible(), MeshRefinement::make_flags_parallel_consistent(), MeshRefinement::make_refinement_compatible(), DofMap::old_dof_indices(), System::ProjectVector::operator()(), Elem::refine(), MeshRefinement::refine_and_coarsen_elements(), MeshRefinement::refine_elements(), DofMap::reinit(), Tet4::reselect_diagonal(), HPSingularity::select_refinement(), HPCoarsenTest::select_refinement(), and MeshRefinement::test_unflagged().
Definition at line 616 of file cell_hex27.C.
References _remaining_second_order_adjacent_vertices, Hex::_second_order_adjacent_vertices, n_nodes(), and Hex::n_vertices().
{
libmesh_assert (n >= this->n_vertices());
libmesh_assert (n < this->n_nodes());
switch (n)
{
/*
* these are all nodes that are unique to Hex27,
* use our _remaining.... matrix
*/
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
{
libmesh_assert (v < 4);
return _remaining_second_order_adjacent_vertices[n-20][v];
}
/*
* for the bubble node the return value is simply v.
* Why? -- the user asks for the v-th adjacent vertex,
* from
n_second_order_adjacent_vertices() there
* are 8 adjacent vertices, and these happen to be
* 0..7
*/
case 26:
{
libmesh_assert (v < 8);
return static_cast<unsigned short int>(v);
}
/*
* nodes 8..19:
* these are all nodes that are identical for
* Hex20 and Hex27. Therefore use the
* matrix stored in cell_hex.C
*/
default:
{
libmesh_assert (v < 2);
return _second_order_adjacent_vertices[n-this->n_vertices()][v];
}
}
}
Reimplemented from Elem.
Definition at line 681 of file cell_hex27.C.
References Hex::_second_order_vertex_child_index, Hex::_second_order_vertex_child_number, n_nodes(), and Hex::n_vertices().
{
libmesh_assert (n >= this->n_vertices());
libmesh_assert (n < this->n_nodes());
/*
* the _second_order_vertex_child_* vectors are
* stored in cell_hex.C, since they are identical
* for Hex20 and Hex27 (for the first 12 higher-order nodes)
*/
return std::pair<unsigned short int, unsigned short int>
(_second_order_vertex_child_number[n],
_second_order_vertex_child_index[n]);
}
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 1285 of file elem.C.
References libMeshEnums::EDGE2, libMeshEnums::EDGE3, libMeshEnums::HEX20, libMeshEnums::HEX27, libMeshEnums::HEX8, libMeshEnums::INFEDGE2, libMeshEnums::INFHEX16, libMeshEnums::INFHEX18, libMeshEnums::INFHEX8, libMeshEnums::INFPRISM12, libMeshEnums::INFPRISM6, libMeshEnums::INFQUAD4, libMeshEnums::INFQUAD6, libMeshEnums::INVALID_ELEM, libMeshEnums::PRISM15, libMeshEnums::PRISM18, libMeshEnums::PRISM6, libMeshEnums::PYRAMID5, libMeshEnums::QUAD4, libMeshEnums::QUAD8, libMeshEnums::QUAD9, libMeshEnums::TET10, libMeshEnums::TET4, libMeshEnums::TRI3, and libMeshEnums::TRI6.
Referenced by UnstructuredMesh::all_second_order().
{
/* for second-order elements, always return
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:
{
// libmesh_error();
return INVALID_ELEM;
}
#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
// infinite elements
case INFEDGE2:
{
// libmesh_error();
return INVALID_ELEM;
}
case INFQUAD4:
{
// full_ordered not relevant
return INFQUAD6;
}
case INFHEX8:
{
/*
* Note that this matches with
Hex8:
* For full-ordered,
InfHex18 and
Hex27
* belong together, and for not full-ordered,
*
InfHex16 and
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;
}
}
}
Definition at line 338 of file dof_object.C.
References DofObject::_dof_ids, DofObject::dof_number(), DofObject::invalid_id, DofObject::n_comp(), DofObject::n_systems(), and DofObject::n_vars().
Referenced by DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), DofObject::invalidate_dofs(), DofMap::reinit(), and DofMap::set_nonlocal_dof_objects().
{
libmesh_assert (s < this->n_systems());
libmesh_assert (var < this->n_vars(s));
libmesh_assert (_dof_ids != NULL);
libmesh_assert (_dof_ids[s] != NULL);
libmesh_assert (comp < this->n_comp(s,var));
//We intend to change all dof numbers together or not at all
if (comp)
libmesh_assert ((dn == invalid_id && _dof_ids[s][var] == invalid_id) ||
(dn == _dof_ids[s][var] + comp));
else
_dof_ids[s][var] = dn;
libmesh_assert(this->dof_number(s, var, comp) == dn);
}
Definition at line 458 of file dof_object.h.
References DofObject::_id.
Referenced by GMVIO::_read_one_cell(), SerialMesh::add_elem(), ParallelMesh::add_elem(), SerialMesh::add_node(), ParallelMesh::add_node(), UnstructuredMesh::all_first_order(), MeshCommunication::assign_global_indices(), InfElemBuilder::build_inf_elem(), UNVIO::element_in(), DofObject::invalidate_id(), Node::Node(), VTKIO::read(), Nemesis_IO::read(), UCDIO::read_implementation(), LegacyXdrIO::read_mesh(), GmshIO::read_mesh(), XdrIO::read_serialized_connectivity(), OFFIO::read_stream(), MatlabIO::read_stream(), SerialMesh::renumber_elem(), ParallelMesh::renumber_elem(), SerialMesh::renumber_node(), ParallelMesh::renumber_node(), and SerialMesh::renumber_nodes_and_elements().
{
return _id;
}
Definition at line 143 of file dof_object.h.
References DofObject::id(), and DofObject::set_id().
Referenced by DofObject::set_id().
{ this->set_id() = id; }
Definition at line 298 of file dof_object.C.
References DofObject::_dof_ids, DofObject::_n_v_comp, DofObject::invalid_id, DofObject::n_comp(), DofObject::n_systems(), and DofObject::n_vars().
Referenced by DofMap::reinit(), and DofMap::set_nonlocal_dof_objects().
{
libmesh_assert (s < this->n_systems());
libmesh_assert (var < this->n_vars(s));
libmesh_assert (_dof_ids != NULL);
libmesh_assert (_dof_ids[s] != NULL);
// Check for trivial return
if (ncomp == this->n_comp(s,var)) return;
#ifdef DEBUG
if (ncomp != static_cast<unsigned int>(static_cast<unsigned char>(ncomp)))
{
std::cerr << 'Unsigned char not big enough to hold ncomp!' << std::endl
<< 'Recompile with _n_v_comp set to a bigger type!'
<< std::endl;
libmesh_error();
}
#endif
// We use (invalid_id - 1) to signify no
// components for this object
if (ncomp == 0)
{
_dof_ids[s][var] = (invalid_id - 1);
}
libmesh_assert (_n_v_comp != NULL);
libmesh_assert (_n_v_comp[s] != NULL);
_n_v_comp[s][var+1] = static_cast<unsigned char>(ncomp);
}
Definition at line 148 of file dof_object.C.
References DofObject::_dof_ids, DofObject::_n_systems, DofObject::_n_v_comp, DofObject::clear_dofs(), and DofObject::n_systems().
Referenced by Elem::refine().
{
// Check for trivial return
if (ns == this->n_systems()) return;
#ifdef DEBUG
if (ns != static_cast<unsigned int>(static_cast<unsigned char>(ns)))
{
std::cerr << 'Unsigned char not big enough to hold ns!' << std::endl
<< 'Recompile with _n_systems set to a bigger type!'
<< std::endl;
libmesh_error();
}
#endif
// 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
_n_systems = static_cast<unsigned char>(ns);
// Allocate storage for the systems
_n_v_comp = new unsigned char* [this->n_systems()];
_dof_ids = new unsigned int* [this->n_systems()];
// No variables have been declared yet.
for (unsigned int s=0; s<this->n_systems(); s++)
{
_n_v_comp[s] = NULL;
_dof_ids[s] = NULL;
}
}
Definition at line 241 of file dof_object.C.
References DofObject::_dof_ids, DofObject::_n_v_comp, DofObject::invalid_id, DofObject::n_systems(), and DofObject::n_vars().
{
libmesh_assert (s < this->n_systems());
libmesh_assert (_n_v_comp != NULL);
libmesh_assert (_dof_ids != NULL);
#ifdef DEBUG
if (nvars != static_cast<unsigned int>(static_cast<unsigned char>(nvars)))
{
std::cerr << 'Unsigned char not big enough to hold nvar!' << std::endl
<< 'Recompile with _n_vars set to a bigger type!'
<< std::endl;
libmesh_error();
}
#endif
// If we already have memory allocated clear it.
if (this->n_vars(s) != 0)
{
libmesh_assert (_n_v_comp[s] != NULL); delete [] _n_v_comp[s]; _n_v_comp[s] = NULL;
libmesh_assert (_dof_ids[s] != NULL); delete [] _dof_ids[s]; _dof_ids[s] = NULL;
}
// Reset the number of variables in the system
if (nvars > 0)
{
libmesh_assert (_n_v_comp[s] == NULL);
libmesh_assert (_dof_ids[s] == NULL);
_n_v_comp[s] = new unsigned char [nvars+1];
_dof_ids[s] = new unsigned int [nvars];
_n_v_comp[s][0] = static_cast<unsigned char>(nvars);
libmesh_assert (nvars == this->n_vars(s));
for (unsigned int v=0; v<this->n_vars(s); v++)
{
_n_v_comp[s][v+1] = 0;
_dof_ids[s][v] = invalid_id - 1;
}
}
else // (nvars == 0)
{
libmesh_assert (_n_v_comp[s] == NULL);
libmesh_assert (_dof_ids[s] == NULL);
}
}
Definition at line 1223 of file elem.h.
References Elem::_neighbors, and Elem::n_neighbors().
Referenced by UnstructuredMesh::find_neighbors(), Elem::make_links_to_me_remote(), and Elem::nullify_neighbors().
{
libmesh_assert (i < this->n_neighbors());
_neighbors[i] = n;
}
Reimplemented in RemoteElem.
Definition at line 1187 of file elem.h.
References Elem::_nodes, and Elem::n_nodes().
Referenced by GMVIO::_read_one_cell(), UnstructuredMesh::all_first_order(), MeshTools::Modification::all_tri(), MeshTools::Generation::build_cube(), InfElemBuilder::build_inf_elem(), Tri6::build_side(), Tri3::build_side(), Quad9::build_side(), Quad8::build_side(), Quad4::build_side(), InfQuad6::build_side(), Edge::build_side(), Triangle::copy_tri_to_mesh(), UnstructuredMesh::create_submesh(), UNVIO::element_in(), MeshTools::Modification::flatten(), TetGenMeshInterface::pointset_convexhull(), VTKIO::read(), Nemesis_IO::read(), ExodusII_IO::read(), UCDIO::read_implementation(), LegacyXdrIO::read_mesh(), GmshIO::read_mesh(), XdrIO::read_serialized_connectivity(), MatlabIO::read_stream(), Elem::refine(), Tet4::reselect_diagonal(), Tri::side(), Quad::side(), InfQuad::side(), Edge::side(), Tet::side(), Pyramid::side(), Prism::side(), InfPrism::side(), InfHex::side(), Hex::side(), BoundaryInfo::sync(), TetGenMeshInterface::triangulate_conformingDelaunayMesh_carvehole(), and TetGenMeshInterface::triangulate_pointset().
{
libmesh_assert (i < this->n_nodes());
return _nodes[i];
}
Definition at line 133 of file dof_object.C.
References DofObject::clear_old_dof_object(), DofObject::DofObject(), and DofObject::old_dof_object.
Referenced by DofMap::reinit().
{
this->clear_old_dof_object();
libmesh_assert (this->old_dof_object == NULL);
// Make a new DofObject, assign a copy of
this.
// Make sure the copy ctor for DofObject works!!
this->old_dof_object = new DofObject(*this);
}
Referenced by MeshRefinement::_coarsen_elements(), MeshRefinement::_refine_elements(), UnstructuredMesh::all_first_order(), Elem::coarsen(), Elem::Elem(), Elem::is_ancestor_of(), Elem::refine(), and DofMap::reinit().
Referenced by MeshRefinement::_coarsen_elements(), MeshRefinement::_refine_elements(), UnstructuredMesh::all_first_order(), MeshRefinement::coarsen_elements(), Elem::Elem(), MeshRefinement::eliminate_unrefined_patches(), Elem::is_ancestor_of(), MeshRefinement::limit_level_mismatch_at_edge(), MeshRefinement::limit_level_mismatch_at_node(), MeshRefinement::make_coarsening_compatible(), MeshRefinement::make_flags_parallel_consistent(), MeshRefinement::make_refinement_compatible(), Elem::refine(), MeshRefinement::refine_and_coarsen_elements(), MeshRefinement::refine_elements(), HPSingularity::select_refinement(), and HPCoarsenTest::select_refinement().
Referenced by UnstructuredMesh::all_first_order(), Elem::is_ancestor_of(), and BoundaryInfo::sync().
Referenced by UnstructuredMesh::all_first_order(), Elem::coarsen(), MeshRefinement::coarsen_elements(), Elem::contract(), Elem::Elem(), MeshRefinement::eliminate_unrefined_patches(), MeshRefinement::flag_elements_by_elem_fraction(), MeshRefinement::flag_elements_by_error_fraction(), MeshRefinement::flag_elements_by_error_tolerance(), MeshRefinement::flag_elements_by_mean_stddev(), MeshRefinement::flag_elements_by_nelem_target(), Elem::is_ancestor_of(), MeshRefinement::limit_level_mismatch_at_edge(), MeshRefinement::limit_level_mismatch_at_node(), MeshRefinement::make_coarsening_compatible(), MeshRefinement::make_flags_parallel_consistent(), MeshRefinement::make_refinement_compatible(), LegacyXdrIO::read_mesh(), XdrIO::read_serialized_connectivity(), Elem::refine(), MeshRefinement::refine_and_coarsen_elements(), MeshRefinement::refine_elements(), HPSingularity::select_refinement(), and HPCoarsenTest::select_refinement().
Implements Elem.
Definition at line 97 of file cell_hex.C.
References Elem::get_node(), Hex::n_sides(), and Elem::set_node().
{
libmesh_assert (i < this->n_sides());
Elem* face = new Quad4;
// Think of a unit cube: (-1,1) x (-1,1)x (-1,1)
switch (i)
{
case 0: // the face at z = -1
{
face->set_node(0) = this->get_node(0);
face->set_node(1) = this->get_node(3);
face->set_node(2) = this->get_node(2);
face->set_node(3) = this->get_node(1);
AutoPtr<DofObject> ap(face);
return ap;
}
case 1: // the face at y = -1
{
face->set_node(0) = this->get_node(0);
face->set_node(1) = this->get_node(1);
face->set_node(2) = this->get_node(5);
face->set_node(3) = this->get_node(4);
AutoPtr<DofObject> ap(face);
return ap;
}
case 2: // the face at x = 1
{
face->set_node(0) = this->get_node(1);
face->set_node(1) = this->get_node(2);
face->set_node(2) = this->get_node(6);
face->set_node(3) = this->get_node(5);
AutoPtr<DofObject> ap(face);
return ap;
}
case 3: // the face at y = 1
{
face->set_node(0) = this->get_node(2);
face->set_node(1) = this->get_node(3);
face->set_node(2) = this->get_node(7);
face->set_node(3) = this->get_node(6);
AutoPtr<DofObject> ap(face);
return ap;
}
case 4: // the face at x = -1
{
face->set_node(0) = this->get_node(3);
face->set_node(1) = this->get_node(0);
face->set_node(2) = this->get_node(4);
face->set_node(3) = this->get_node(7);
AutoPtr<DofObject> ap(face);
return ap;
}
case 5: // the face at z = 1
{
face->set_node(0) = this->get_node(4);
face->set_node(1) = this->get_node(5);
face->set_node(2) = this->get_node(6);
face->set_node(3) = this->get_node(7);
AutoPtr<DofObject> ap(face);
return ap;
}
default:
{
libmesh_error();
AutoPtr<DofObject> ap(face);
return ap;
}
}
// We'll never get here.
libmesh_error();
AutoPtr<DofObject> ap(face);
return ap;
}
Definition at line 1321 of file elem.h.
References Elem::active(), Elem::child(), Elem::has_children(), and Elem::subactive().
Referenced by Elem::active_family_tree(), Elem::active_family_tree_by_neighbor(), Elem::active_family_tree_by_side(), HPCoarsenTest::add_projection(), UnstructuredMesh::contract(), Elem::family_tree(), Elem::family_tree_by_neighbor(), Elem::family_tree_by_side(), Elem::family_tree_by_subneighbor(), UnstructuredMesh::find_neighbors(), MeshTools::get_not_subactive_node_ids(), Elem::is_ancestor_of(), Elem::libmesh_assert_valid_neighbors(), Elem::make_links_to_me_remote(), Elem::min_new_p_level_by_neighbor(), Elem::min_p_level_by_neighbor(), Elem::refine(), Elem::subactive(), and LegacyXdrIO::write_mesh().
{
#ifdef LIBMESH_ENABLE_AMR
if (this->active())
return false;
if (!this->has_children())
return true;
return this->child(0)->subactive();
#else
return false;
#endif
}
Definition at line 1205 of file elem.h.
References Elem::_sbd_id.
{
return _sbd_id;
}
Definition at line 1197 of file elem.h.
References Elem::_sbd_id.
Referenced by UnstructuredMesh::all_first_order(), UnstructuredMesh::all_second_order(), MeshTools::Modification::all_tri(), UnstructuredMesh::create_submesh(), DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), DofMap::dof_indices(), Elem::Elem(), MeshTools::Modification::flatten(), ExodusII_IO_Helper::initialize(), Elem::is_ancestor_of(), DofMap::old_dof_indices(), XdrIO::pack_element(), Nemesis_IO::read(), ExodusII_IO::read(), GmshIO::read_mesh(), XdrIO::read_serialized_connectivity(), DofMap::reinit(), MeshTools::subdomain_bounding_box(), BoundaryInfo::sync(), and ExodusII_IO_Helper::write_elements().
{
return _sbd_id;
}
Referenced by BoundaryInfo::boundary_id(), Elem::is_ancestor_of(), BoundaryInfo::side_with_boundary_id(), and BoundaryInfo::sync().
Implements Elem.
Definition at line 81 of file cell_hex27.h.
References libMeshEnums::HEX27.
{ return HEX27; }
Definition at line 466 of file dof_object.h.
References DofObject::_id, and DofObject::invalid_id.
Referenced by SerialMesh::add_elem(), ParallelMesh::add_elem(), SerialMesh::add_node(), ParallelMesh::add_node(), DofObject::id(), and Elem::libmesh_assert_valid_node_pointers().
{
return (DofObject::invalid_id != _id);
}
Definition at line 509 of file dof_object.h.
References DofObject::_processor_id, and DofObject::invalid_processor_id.
{
return (DofObject::invalid_processor_id != _processor_id);
}
Reimplemented in Hex8, Prism6, Pyramid5, Tet4, Edge2, Edge3, Quad4, and Tri3.
Definition at line 1412 of file elem.C.
References FEBase::build(), Elem::default_order(), FEType::default_quadrature_order(), Elem::dim(), and libMeshEnums::LAGRANGE.
{
// The default implementation builds a finite element of the correct
// order and sums up the JxW contributions. This can be expensive,
// so the various element types can overload this method and compute
// the volume more efficiently.
FEType fe_type (this->default_order() , LAGRANGE);
AutoPtr<FEBase> fe (FEBase::build(this->dim(),
fe_type));
const std::vector<Real>& JxW = fe->get_JxW();
// The default quadrature rule should integrate the mass matrix,
// thus it should be plenty to compute the area
QGauss qrule (this->dim(), fe_type.default_quadrature_order());
fe->attach_quadrature_rule(&qrule);
fe->reinit(this);
Real vol=0.;
for (unsigned int qp=0; qp<qrule.n_points(); ++qp)
vol += JxW[qp];
return vol;
}
Referenced by UnstructuredMesh::copy_nodes_and_elements(), Elem::is_ancestor_of(), Elem::make_links_to_me_remote(), and Parallel::sync_element_data_by_parent_id().
Definition at line 1281 of file elem.h.
References libMesh::invalid_uint, Elem::level(), Elem::n_neighbors(), Elem::neighbor(), and Elem::parent().
Referenced by MetisPartitioner::_do_partition(), ParmetisPartitioner::build_graph(), FEBase::compute_proj_constraints(), MeshTools::find_hanging_nodes_and_parents(), Elem::libmesh_assert_valid_neighbors(), Elem::make_links_to_me_remote(), and Elem::nullify_neighbors().
{
libmesh_assert (e != NULL);
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;
}
Definition at line 689 of file elem.C.
References Elem::_nodes, Elem::connectivity(), libMeshEnums::INVALID_IO_PACKAGE, Elem::n_nodes(), Elem::n_sub_elem(), Elem::node(), libMeshEnums::TECPLOT, and libMeshEnums::UCD.
{
libmesh_assert (out.good());
libmesh_assert (_nodes != NULL);
libmesh_assert (iop != INVALID_IO_PACKAGE);
switch (iop)
{
case TECPLOT:
{
// This connectivity vector will be used repeatedly instead
// of being reconstructed inside the loop.
std::vector<unsigned int> 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<unsigned int>(out, ' '));
out << ';
}
return;
}
case UCD:
{
for (unsigned int i=0; i<this->n_nodes(); i++)
out << this->node(i)+1 << ' ';
out << ';
return;
}
default:
libmesh_error();
}
libmesh_error();
}
Do we *really* need to protect the build member? It would seem that we are just getting around it by using friends!
Definition at line 1037 of file elem.h.
Definition at line 993 of file elem.h.
Referenced by Elem::add_child(), Elem::contract(), Elem::Elem(), Elem::has_ancestor_children(), Elem::has_children(), Elem::is_ancestor_of(), Elem::make_links_to_me_remote(), Elem::refine(), Tet4::reselect_diagonal(), and Elem::~Elem().
Definition at line 110 of file reference_counter.h.
Referenced by ReferenceCounter::get_info(), ReferenceCounter::increment_constructor_count(), and ReferenceCounter::increment_destructor_count().
Definition at line 110 of file reference_counter.h.
Referenced by ReferenceCounter::get_info(), ReferenceCounter::increment_constructor_count(), and ReferenceCounter::increment_destructor_count().
Definition at line 217 of file cell_hex27.h.
Referenced by embedding_matrix().
Definition at line 123 of file reference_counter.h.
Definition at line 123 of file reference_counter.h.
Definition at line 118 of file reference_counter.h.
Referenced by ReferenceCounter::n_objects(), ReferenceCounter::ReferenceCounter(), and ReferenceCounter::~ReferenceCounter().
Definition at line 118 of file reference_counter.h.
Referenced by ReferenceCounter::n_objects(), ReferenceCounter::ReferenceCounter(), and ReferenceCounter::~ReferenceCounter().
Definition at line 981 of file elem.h.
Referenced by Elem::Elem(), Elem::neighbor(), Elem::set_neighbor(), and Elem::~Elem().
Definition at line 976 of file elem.h.
Referenced by Tet4::connectivity(), Tet10::connectivity(), Pyramid5::connectivity(), Prism6::connectivity(), Prism18::connectivity(), Prism15::connectivity(), InfPrism6::connectivity(), InfPrism12::connectivity(), InfHex8::connectivity(), InfHex18::connectivity(), InfHex16::connectivity(), Hex8::connectivity(), connectivity(), Hex20::connectivity(), Elem::Elem(), Elem::get_node(), Elem::node(), Elem::point(), Elem::set_node(), Prism6::volume(), Hex8::volume(), Elem::write_connectivity(), and Elem::~Elem().
Definition at line 1017 of file elem.h.
Referenced by Elem::is_ancestor_of().
Definition at line 986 of file elem.h.
Referenced by Elem::is_ancestor_of().
Definition at line 1006 of file elem.h.
Referenced by Elem::is_ancestor_of().
{
{ 0, 1, 2, 3},
{ 0, 1, 4, 5},
{ 1, 2, 5, 6},
{ 2, 3, 6, 7},
{ 0, 3, 4, 7},
{ 4, 5, 6, 7},
}
Matrix that tells which vertices define the location of mid-side (or second-order) nodes. This matrix only covers the nodes that are unique to Hex27, while the second-order-nodes that are identical with Hex20 are covered through the _second_order_adjacent_vertices matrix in cell_hex.C. Note that this matrix also does not cover the bubble node. The interpolation is trivial and would only blow up the size of this matrix.
Definition at line 235 of file cell_hex27.h.
Referenced by second_order_adjacent_vertex().
Definition at line 999 of file elem.h.
Referenced by Elem::is_ancestor_of().
Definition at line 1024 of file elem.h.
Referenced by Elem::subdomain_id().
{
{ 0, 1},
{ 1, 2},
{ 2, 3},
{ 0, 3},
{ 0, 4},
{ 1, 5},
{ 2, 6},
{ 3, 7},
{ 4, 5},
{ 5, 6},
{ 6, 7},
{ 4, 7}
}
Matrix that tells which vertices define the location of mid-side (or second-order) nodes. This matrix is kept here, since the matrix (for the first 12 higher-order nodes) is identical for Hex20 and Hex27.
Definition at line 120 of file cell_hex.h.
Referenced by second_order_adjacent_vertex(), and Hex20::second_order_adjacent_vertex().
{
99,99,99,99,99,99,99,99,
1,2,3,3,4,5,6,7,5,6,7,7,
2,5,6,7,7,6,
6
}
Vector that names the child vertex index for each second order node.
Definition at line 130 of file cell_hex.h.
Referenced by second_order_child_vertex(), and Hex20::second_order_child_vertex().
{
99,99,99,99,99,99,99,99,
0,1,2,0,0,1,2,3,4,5,6,5,
0,0,1,2,0,4,
0
}
Vector that names a child sharing each second order node.
Definition at line 125 of file cell_hex.h.
Referenced by second_order_child_vertex(), and Hex20::second_order_child_vertex().
{
{0, 1, 8},
{1, 2, 9},
{2, 3, 10},
{0, 3, 11},
{0, 4, 12},
{1, 5, 13},
{2, 6, 14},
{3, 7, 15},
{4, 5, 16},
{5, 6, 17},
{6, 7, 18},
{4, 7, 19}
}
This maps the $ j^{th} $ node of the $ i^{th} $ edge to element node numbers.
Definition at line 197 of file cell_hex27.h.
Referenced by is_node_on_edge().
Definition at line 257 of file dof_object.h.
Referenced by Node::active(), SerialMesh::add_point(), MeshRefinement::add_point(), UnstructuredMesh::all_second_order(), FEBase::compute_periodic_constraints(), FEBase::compute_proj_constraints(), DofMap::distribute_local_dofs_node_major(), DofMap::distribute_local_dofs_var_major(), DofMap::dof_indices(), DofObject::dof_number(), DofObject::DofObject(), DofObject::invalidate_dofs(), DofObject::invalidate_id(), ParallelMesh::libmesh_assert_valid_parallel_object_ids(), Node::Node(), Elem::node(), DofMap::old_dof_indices(), Elem::point(), System::read_legacy_data(), System::read_parallel_data(), DofObject::set_dof_number(), DofObject::set_n_comp(), DofObject::set_n_vars(), DofMap::set_nonlocal_dof_objects(), DofObject::valid_id(), DofMap::variable_first_local_dof(), DofMap::variable_last_local_dof(), and System::write_parallel_data().
Definition at line 263 of file dof_object.h.
Referenced by ParallelMesh::add_elem(), ParallelMesh::add_node(), MeshTools::bounding_box(), MeshTools::correct_node_proc_ids(), Elem::Elem(), MeshCommunication::find_global_indices(), DofObject::invalidate_processor_id(), ParallelMesh::libmesh_assert_valid_parallel_object_ids(), ParallelMesh::n_active_elem(), MeshBase::n_elem_on_proc(), MeshBase::n_nodes_on_proc(), MeshBase::n_unpartitioned_elem(), MeshBase::n_unpartitioned_nodes(), ParallelMesh::renumber_dof_objects(), Partitioner::set_node_processor_ids(), DofMap::set_nonlocal_dof_objects(), Partitioner::set_parent_processor_ids(), Parallel::sync_dofobject_data_by_id(), Parallel::sync_dofobject_data_by_xyz(), Parallel::sync_element_data_by_parent_id(), MeshTools::total_weight(), SerialMesh::unpartitioned_elements_begin(), ParallelMesh::unpartitioned_elements_begin(), SerialMesh::unpartitioned_elements_end(), ParallelMesh::unpartitioned_elements_end(), and DofObject::valid_processor_id().
Definition at line 81 of file dof_object.h.
Referenced by DofObject::clear_old_dof_object(), DofMap::old_dof_indices(), DofMap::reinit(), and DofObject::set_old_dof_object().
{
{0, 3, 2, 1, 11, 10, 9, 8, 20},
{0, 1, 5, 4, 8, 13, 16, 12, 21},
{1, 2, 6, 5, 9, 14, 17, 13, 22},
{2, 3, 7, 6, 10, 15, 18, 14, 23},
{3, 0, 4, 7, 11, 12, 19, 15, 24},
{4, 5, 6, 7, 16, 17, 18, 19, 25}
}
This maps the $ j^{th} $ node of the $ i^{th} $ side to element node numbers.
Definition at line 191 of file cell_hex27.h.
Referenced by is_node_on_side().
Definition at line 276 of file elem.h.
Referenced by Elem::is_ancestor_of(), XdrIO::pack_element(), and XdrIO::read_serialized_connectivity().
Generated automatically by Doxygen for libMesh from the source code.