libMesh
periodic_boundary_base.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 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_BOUNDARY_BASE_H
19 #define LIBMESH_PERIODIC_BOUNDARY_BASE_H
20 
21 // Local Includes
22 #include "libmesh/libmesh_config.h"
23 
24 #ifdef LIBMESH_ENABLE_PERIODIC
25 
26 // Local Includes
27 #include "libmesh/point.h"
28 #include "libmesh/auto_ptr.h"
29 
30 // C++ Includes
31 #include <set>
32 
33 namespace libMesh
34 {
35 
36 // Forward Declarations
37 class Elem;
38 class MeshBase;
39 
48 {
49 public:
51  { FORWARD=0,
52  INVERSE=1 };
53 
58 
63 
68 
72  virtual ~PeriodicBoundaryBase() {}
73 
79  virtual Point get_corresponding_pos(const Point & pt) const = 0;
80 
96 
97  void set_variable(unsigned int var);
98 
99  void merge(const PeriodicBoundaryBase & pb);
100 
101  bool is_my_variable(unsigned int var_num) const;
102 
103 protected:
104 
108  std::set<unsigned int> variables;
109 };
110 
111 } // namespace libmesh
112 
113 #endif // LIBMESH_ENABLE_PERIODIC
114 
115 #endif // LIBMESH_PERIODIC_BOUNDARY_BASE_H
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 libMesh namespace provides an interface to certain functionality in the library.
std::unique_ptr< T > UniquePtr
Definition: auto_ptr.h:46
void merge(const PeriodicBoundaryBase &pb)
void set_variable(unsigned int var)
boundary_id_type myboundary
The boundary ID of this boundary and its counterpart.
int8_t boundary_id_type
Definition: id_types.h:51
virtual ~PeriodicBoundaryBase()
Destructor.
std::set< unsigned int > variables
Set of variables for this periodic boundary, empty means all variables possible.
virtual UniquePtr< PeriodicBoundaryBase > clone(TransformationType t=FORWARD) const =0
If we want the DofMap to be able to make copies of references and store them in the underlying map...
bool is_my_variable(unsigned int var_num) const
The base class for defining periodic boundaries.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38