21 #include "libmesh/overlap_coupling.h" 23 #include "libmesh/elem.h" 24 #include "libmesh/enum_quadrature_type.h" 25 #include "libmesh/periodic_boundaries.h" 26 #include "libmesh/remote_elem.h" 27 #include "libmesh/libmesh_logging.h" 30 #include <unordered_set> 36 _dof_coupling(nullptr)
47 _dof_coupling(other._dof_coupling)
57 (std::unique_ptr<QBase> new_q_rule)
60 const unsigned int dim = new_q_rule->get_dim();
61 _q_rules[
dim-1] = std::move(new_q_rule);
79 void OverlapCoupling::operator()
85 LOG_SCOPE(
"operator()",
"OverlapCoupling");
87 std::unique_ptr<PointLocatorBase> point_locator
88 = _mesh->sub_point_locator();
90 const std::vector<Point> & xyz = this->_fe_map.get_xyz();
92 for (
const auto & elem :
as_range(range_begin, range_end))
94 const unsigned int dim = elem->dim();
99 _fe_map.init_reference_to_physical_map(
dim, qrule.
get_points(), elem);
102 std::set<const Elem *> overlapping_elements;
103 for (
const Point & qp : xyz)
104 (*point_locator)(qp, overlapping_elements);
109 for (
const Elem * e : overlapping_elements)
110 if (e->processor_id() != p)
111 coupled_elements.emplace(e, _dof_coupling);
This abstract base class defines the interface by which library code and user code can report associa...
std::unique_ptr< PointLocatorBase > sub_point_locator() const
The definition of the const_element_iterator struct.
virtual void mesh_reinit() override
We need an updated point locator to see what other elements might share each quadrature point...
This is the base class from which all geometric element types are derived.
const std::vector< Real > & get_weights() const
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?
The libMesh namespace provides an interface to certain functionality in the library.
OverlapCoupling()
Constructor.
uint8_t processor_id_type
std::array< std::unique_ptr< QBase >, 3 > _q_rules
This class implements ghosting of elements that overlap or touch at at least one sampled point...
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
const std::vector< Point > & get_points() const
void set_quadrature_rule(std::unique_ptr< QBase > new_q_rule)
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
virtual void init(const Elem &e, unsigned int p_level=invalid_uint)
Initializes the data structures for a quadrature rule for the element e.
static std::unique_ptr< QBase > build(std::string_view name, const unsigned int dim, const Order order=INVALID_ORDER)
Builds a specific quadrature rule based on the name string.
A Point defines a location in LIBMESH_DIM dimensional Real space.
The QBase class provides the basic functionality from which various quadrature rules can be derived...