libMesh
periodic_boundaries.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 #ifndef LIBMESH_PERIODIC_BOUNDARIES_H
19 #define LIBMESH_PERIODIC_BOUNDARIES_H
20 
21 // Local Includes
22 #include "libmesh/libmesh_config.h"
23 
24 #ifdef LIBMESH_ENABLE_PERIODIC
25 
26 // Local Includes
27 #include "libmesh/vector_value.h" // RealVectorValue
28 
29 // C++ Includes
30 #include <map>
31 #include <memory>
32 
33 namespace libMesh
34 {
35 
36 // Forward Declarations
37 class Elem;
38 class PeriodicBoundaryBase;
39 class PointLocatorBase;
40 
49 class PeriodicBoundaries : public std::map<boundary_id_type, std::unique_ptr<PeriodicBoundaryBase>>
50 {
51 public:
53 
55 
56  PeriodicBoundaries() = default;
57 
59 
60  // \returns the periodic neighbor of \p e in direction \p side, if it
61  // exists, nullptr otherwise.
62  //
63  // If \p neigh_side is nullptr it is left alone; if not then it is
64  // used to output the side of the neighbor which corresponds to the
65  // given \p side of \p e, or invalid_uint if no possible neighbor or
66  // no corresponding side exists.
67  const Elem * neighbor(boundary_id_type boundary_id,
68  const PointLocatorBase & point_locator,
69  const Elem * e,
70  unsigned int side,
71  unsigned int * neigh_side = nullptr) const;
72 };
73 
74 } // namespace libMesh
75 
76 #endif // LIBMESH_ENABLE_PERIODIC
77 
78 #endif // LIBMESH_PERIODIC_BOUNDARIES_H
We&#39;re using a class instead of a typedef to allow forward declarations and future flexibility...
This is the base class from which all geometric element types are derived.
Definition: elem.h:94
PeriodicBoundaryBase * boundary(boundary_id_type id)
The libMesh namespace provides an interface to certain functionality in the library.
int8_t boundary_id_type
Definition: id_types.h:51
This is the base class for point locators.
const Elem * neighbor(boundary_id_type boundary_id, const PointLocatorBase &point_locator, const Elem *e, unsigned int side, unsigned int *neigh_side=nullptr) const
The base class for defining periodic boundaries.