periodic_boundary_base.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2018 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" // deprecated
29 #include "libmesh/dense_matrix.h"
30 
31 // C++ Includes
32 #include <set>
33 #include <memory>
34 
35 namespace libMesh
36 {
37 
38 // Forward Declarations
39 class Elem;
40 class MeshBase;
41 
50 {
51 public:
53  { FORWARD=0,
54  INVERSE=1 };
55 
60 
65 
70 
74  virtual ~PeriodicBoundaryBase() {}
75 
81  virtual Point get_corresponding_pos(const Point & pt) const = 0;
82 
97  virtual std::unique_ptr<PeriodicBoundaryBase> clone(TransformationType t = FORWARD) const = 0;
98 
99  void set_variable(unsigned int var);
100 
101  void merge(const PeriodicBoundaryBase & pb);
102 
103  bool is_my_variable(unsigned int var_num) const;
104 
108  bool has_transformation_matrix() const;
109 
115 
123  void set_transformation_matrix(const DenseMatrix<Real> & matrix);
124 
128  const std::set<unsigned int> & get_variables() const;
129 
130 protected:
131 
135  std::set<unsigned int> variables;
136 
147  std::unique_ptr<DenseMatrix<Real>> _transformation_matrix;
148 
149 };
150 
151 } // namespace libmesh
152 
153 #endif // LIBMESH_ENABLE_PERIODIC
154 
155 #endif // LIBMESH_PERIODIC_BOUNDARY_BASE_H
const std::set< unsigned int > & get_variables() const
void merge(const PeriodicBoundaryBase &pb)
virtual Point get_corresponding_pos(const Point &pt) const =0
void set_variable(unsigned int var)
int8_t boundary_id_type
Definition: id_types.h:51
std::set< unsigned int > variables
void set_transformation_matrix(const DenseMatrix< Real > &matrix)
virtual std::unique_ptr< PeriodicBoundaryBase > clone(TransformationType t=FORWARD) const =0
const DenseMatrix< Real > & get_transformation_matrix() const
bool is_my_variable(unsigned int var_num) const
Base class for all PeriodicBoundary implementations.
A matrix object used for finite element assembly and numerics.
Definition: dense_matrix.h:54
std::unique_ptr< DenseMatrix< Real > > _transformation_matrix
A geometric point in (x,y,z) space.
Definition: point.h:38