19 #include "libmesh/libmesh_config.h"
21 #ifdef LIBMESH_ENABLE_PERIODIC
23 #include "libmesh/periodic_boundaries.h"
24 #include "libmesh/boundary_info.h"
25 #include "libmesh/elem.h"
26 #include "libmesh/mesh_base.h"
27 #include "libmesh/periodic_boundary.h"
28 #include "libmesh/point_locator_base.h"
29 #include "libmesh/remote_elem.h"
40 iterator i = this->find(
id);
43 return i->second.get();
50 const_iterator i = this->find(
id);
53 return i->second.get();
60 const PointLocatorBase & point_locator,
63 unsigned int * neigh_side)
const
65 std::unique_ptr<const Elem> neigh_side_proxy;
68 Point p = e->build_side_ptr(side)->vertex_average();
74 std::set<const Elem *> candidate_elements;
75 point_locator.operator()(p, candidate_elements);
80 const MeshBase & mesh = point_locator.get_mesh();
81 for(
const Elem * elem_it : candidate_elements)
83 std::vector<unsigned int> neigh_sides =
84 mesh.get_boundary_info().sides_with_boundary_id(elem_it, b->
pairedboundary);
86 for (
auto ns : neigh_sides)
90 elem_it->build_side_ptr(neigh_side_proxy, ns);
91 if (neigh_side_proxy->contains_point(p))
107 libmesh_error_msg_if(mesh.is_serial() ||
108 (e->processor_id() == mesh.processor_id()),
109 "Periodic boundary neighbor not found");
122 #endif // LIBMESH_ENABLE_PERIODIC
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
const Elem * neighbor(boundary_id_type boundary_id, const PointLocatorBase &point_locator, const Elem *e, unsigned int side, unsigned int *neigh_side=nullptr) const
boundary_id_type pairedboundary
PeriodicBoundaryBase * boundary(boundary_id_type id)
virtual Point get_corresponding_pos(const Point &pt) const =0
This function should be overridden by derived classes to define how one finds corresponding nodes on ...
The base class for defining periodic boundaries.