libMesh
ghost_point_neighbors.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_GHOST_POINT_NEIGHBORS_H
21 #define LIBMESH_GHOST_POINT_NEIGHBORS_H
22 
23 // Local Includes
24 #include "libmesh/ghosting_functor.h"
25 
26 // C++ Includes
27 #include <memory>
28 
29 namespace libMesh
30 {
31 #ifdef LIBMESH_ENABLE_PERIODIC
32 class PeriodicBoundaries;
33 #endif
34 
44 {
45 public:
46 
52 #ifdef LIBMESH_ENABLE_PERIODIC
53  ,
54  _periodic_bcs(nullptr)
55 #endif
56  {}
57 
62  GhostingFunctor(other)
63 #ifdef LIBMESH_ENABLE_PERIODIC
64  ,
65  // We do not simply want to copy over the other's periodic bcs because
66  // they may very well correspond to periodic bcs from a \p DofMap entirely
67  // unrelated to any \p DofMaps that depend on this objects ghosting
68  _periodic_bcs(nullptr)
69 #endif
70  {}
71 
76  virtual std::unique_ptr<GhostingFunctor> clone () const override
77  { return std::make_unique<GhostPointNeighbors>(*this); }
78 
79 #ifdef LIBMESH_ENABLE_PERIODIC
80  // Set PeriodicBoundaries to couple
81  void set_periodic_boundaries(const PeriodicBoundaries * periodic_bcs) override
82  { _periodic_bcs = periodic_bcs; }
83 #endif
84 
89  virtual void mesh_reinit () override;
90 
91  virtual void redistribute () override
92  { this->mesh_reinit(); }
93 
94  virtual void delete_remote_elements() override
95  { this->mesh_reinit(); }
96 
102  virtual void operator() (const MeshBase::const_element_iterator & range_begin,
103  const MeshBase::const_element_iterator & range_end,
105  map_type & coupled_elements) override;
106 
107 private:
108 #ifdef LIBMESH_ENABLE_PERIODIC
110 #endif
111 };
112 
113 } // namespace libMesh
114 
115 #endif // LIBMESH_GHOST_POINT_NEIGHBORS_H
virtual void mesh_reinit()
GhostingFunctor subclasses which cache data will need to initialize that cache.
This abstract base class defines the interface by which library code and user code can report associa...
The definition of the const_element_iterator struct.
Definition: mesh_base.h:2121
We&#39;re using a class instead of a typedef to allow forward declarations and future flexibility...
MeshBase & mesh
const PeriodicBoundaries * _periodic_bcs
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?
GhostingFunctor()
Constructor.
The libMesh namespace provides an interface to certain functionality in the library.
uint8_t processor_id_type
Definition: id_types.h:104
This is the MeshBase class.
Definition: mesh_base.h:74
virtual void set_periodic_boundaries(const PeriodicBoundaries *)
virtual void delete_remote_elements() override
GhostingFunctor subclasses with relatively long-lasting caches may want to delete the no-longer-relev...
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
For the specified range of active elements, find their point neighbors and interior_parent elements...
virtual std::unique_ptr< GhostingFunctor > clone() const
A clone() is needed because GhostingFunctor can not be shared between different meshes.
This class implements the original default geometry ghosting requirements in libMesh: point neighbors...
virtual GhostPointNeighbors(const MeshBase &mesh) void redistribute() override
Constructor.