libMesh
Loading...
Searching...
No Matches
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
7using libMesh::Elem;
12
13// Convenient typedef for a map for (element, side id) --> element neighbor
14typedef std::map<std::pair<const Elem *, unsigned char>, const Elem *> ElementSideMap;
15
16// And the inverse map, but without sides in the key
17typedef std::map<const Elem *, const Elem *> ElementMap;
18
20{
21private:
22
27
34
39
44
49
50public:
51
56 boundary_id_type crack_boundary_lower,
57 boundary_id_type crack_boundary_upper);
58
59
60 virtual std::unique_ptr<GhostingFunctor> clone () const override
61 {
62 return std::make_unique<AugmentSparsityOnInterface>
64 }
65
69 const ElementSideMap & get_lower_to_upper() const;
70
74 virtual void operator() (const MeshBase::const_element_iterator & range_begin,
75 const MeshBase::const_element_iterator & range_end,
76 processor_id_type p,
77 map_type & coupled_elements) override;
78
83 virtual void mesh_reinit () override;
84
89 virtual void redistribute () override
90 { this->mesh_reinit(); }
91
92
93};
94
95#endif
std::map< const Elem *, const Elem * > ElementMap
std::map< std::pair< const Elem *, unsigned char >, const Elem * > ElementSideMap
ElementSideMap _lower_to_upper
A map from (lower element ID, side ID) to matching upper element ID.
const ElementSideMap & get_lower_to_upper() const
boundary_id_type _crack_boundary_lower
Boundary IDs for the lower and upper faces of the "crack" in the mesh.
bool _initialized
Make sure we've been initialized before use.
ElementMap _upper_to_lower
The inverse (ignoring sides) of the above map.
virtual void redistribute() override
Update the cached _lower_to_upper map whenever our Mesh has been redistributed.
MeshBase & _mesh
The Mesh we're calculating on.
virtual void mesh_reinit() override
Rebuild the cached _lower_to_upper map whenever our Mesh has changed.
virtual std::unique_ptr< GhostingFunctor > clone() const override
A clone() is needed because GhostingFunctor can not be shared between different meshes.
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) override
User-defined function to augment the sparsity pattern.
This is the base class from which all geometric element types are derived.
Definition elem.h:96
This abstract base class defines the interface by which library code and user code can report associa...
std::map< const Elem *, const CouplingMatrix *, CompareDofObjectsByPIDAndThenID > map_type
What elements do we care about and what variables do we care about on each element?
This is the MeshBase class.
Definition mesh_base.h:81
MeshBase & mesh
int8_t boundary_id_type
Definition id_types.h:51
uint8_t processor_id_type
Definition id_types.h:104