libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
periodic_boundary_base.h
浏览该文件的文档.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2023 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/dense_matrix.h"
29 
30 // C++ Includes
31 #include <set>
32 #include <memory>
33 
34 namespace libMesh
35 {
36 
37 // Forward Declarations
38 class Elem;
39 class MeshBase;
40 
49 {
50 public:
52  { FORWARD=0,
53  INVERSE=1 };
54 
59 
64 
69 
73  virtual ~PeriodicBoundaryBase() = default;
74 
80  virtual Point get_corresponding_pos(const Point & pt) const = 0;
81 
96  virtual std::unique_ptr<PeriodicBoundaryBase> clone(TransformationType t = FORWARD) const = 0;
97 
98  void set_variable(unsigned int var);
99 
100  void merge(const PeriodicBoundaryBase & pb);
101 
102  bool is_my_variable(unsigned int var_num) const;
103 
107  bool has_transformation_matrix() const;
108 
114 
122  void set_transformation_matrix(const DenseMatrix<Real> & matrix);
123 
127  const std::set<unsigned int> & get_variables() const;
128 
129 protected:
130 
134  std::set<unsigned int> variables;
135 
146  std::unique_ptr<DenseMatrix<Real>> _transformation_matrix;
147 
148 };
149 
150 } // namespace libmesh
151 
152 #endif // LIBMESH_ENABLE_PERIODIC
153 
154 #endif // LIBMESH_PERIODIC_BOUNDARY_BASE_H
const std::set< unsigned int > & get_variables() const
Get the set of variables for this periodic boundary condition.
virtual ~PeriodicBoundaryBase()=default
Destructor.
void merge(const PeriodicBoundaryBase &pb)
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 ...
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
std::set< unsigned int > variables
Set of variables for this periodic boundary, empty means all variables possible.
void set_transformation_matrix(const DenseMatrix< Real > &matrix)
Set the transformation matrix.
virtual std::unique_ptr< 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.
const DenseMatrix< Real > & get_transformation_matrix() const
Get the transformation matrix, if it is defined.
定义用于有限元类型计算的密集矩阵。 用于在求和成全局矩阵之前存储单元刚度矩阵。所有被覆盖的虚函数都记录在dense_matrix_base.h中。
Definition: dof_map.h:65
std::unique_ptr< DenseMatrix< Real > > _transformation_matrix
A DenseMatrix that defines the mapping of variables on this boundary and the counterpart boundary...