libMesh
augment_sparsity_on_interface.h
Go to the documentation of this file.
1 #ifndef AUGMENT_SPARSITY_ON_INTERFACE_H
2 #define AUGMENT_SPARSITY_ON_INTERFACE_H
3 
4 #include "libmesh/ghosting_functor.h"
5 #include "libmesh/mesh_base.h"
6 
7 using libMesh::Elem;
12 
13 // Convenient typedef for a map for (element, side id) --> element neighbor
14 typedef std::map<std::pair<const Elem *, unsigned char>, const Elem *> ElementSideMap;
15 
16 // And the inverse map, but without sides in the key
17 typedef std::map<const Elem *, const Elem *> ElementMap;
18 
20 {
21 private:
22 
27 
34 
39 
44 
49 
50 public:
51 
56  boundary_id_type crack_boundary_lower,
57  boundary_id_type crack_boundary_upper);
58 
62  const ElementSideMap & get_lower_to_upper() const;
63 
67  virtual void operator() (const MeshBase::const_element_iterator & range_begin,
68  const MeshBase::const_element_iterator & range_end,
70  map_type & coupled_elements) libmesh_override;
71 
76  virtual void mesh_reinit () libmesh_override;
77 
82  virtual void redistribute () libmesh_override
83  { this->mesh_reinit(); }
84 
85 
86 };
87 
88 #endif
This abstract base class defines the interface by which library code and user code can report associa...
std::map< const Elem *, const Elem * > ElementMap
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
MeshBase & mesh
uint8_t processor_id_type
Definition: id_types.h:99
bool _initialized
Make sure we&#39;ve been initialized before use.
const ElementSideMap & get_lower_to_upper() const
This is the MeshBase class.
Definition: mesh_base.h:68
boundary_id_type _crack_boundary_lower
Boundary IDs for the lower and upper faces of the "crack" in the mesh.
AugmentSparsityOnInterface(MeshBase &mesh, boundary_id_type crack_boundary_lower, boundary_id_type crack_boundary_upper)
Constructor.
int8_t boundary_id_type
Definition: id_types.h:51
virtual void operator()(const MeshBase::const_element_iterator &range_begin, const MeshBase::const_element_iterator &range_end, processor_id_type p, map_type &coupled_elements) libmesh_override
User-defined function to augment the sparsity pattern.
std::unordered_map< const Elem *, const CouplingMatrix * > map_type
What elements do we care about and what variables do we care about on each element?
ElementMap _upper_to_lower
The inverse (ignoring sides) of the above map.
virtual void redistribute() libmesh_override
Update the cached _lower_to_upper map whenever our Mesh has been redistributed.
ElementSideMap _lower_to_upper
A map from (lower element ID, side ID) to matching upper element ID.
virtual void mesh_reinit() libmesh_override
Rebuild the cached _lower_to_upper map whenever our Mesh has changed.
std::map< std::pair< const Elem *, unsigned char >, const Elem * > ElementSideMap
MeshBase & _mesh
The Mesh we&#39;re calculating on.