libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
Public 类型 | Public 成员函数 | Public 属性 | Protected 属性 | 所有成员列表
libMesh::PeriodicBoundaryBase类 参考abstract

The base class for defining periodic boundaries. 更多...

#include <periodic_boundary_base.h>

类 libMesh::PeriodicBoundaryBase 继承关系图:
[图例]

Public 类型

enum  TransformationType { FORWARD =0, INVERSE =1 }
 

Public 成员函数

 PeriodicBoundaryBase ()
 Constructor. 更多...
 
 PeriodicBoundaryBase (const PeriodicBoundaryBase &other)
 Copy constructor. 更多...
 
virtual ~PeriodicBoundaryBase ()=default
 Destructor. 更多...
 
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 periodic boundary pair. 更多...
 
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, this class must be clone'able, i.e. 更多...
 
void set_variable (unsigned int var)
 
void merge (const PeriodicBoundaryBase &pb)
 
bool is_my_variable (unsigned int var_num) const
 
bool has_transformation_matrix () const
 
const DenseMatrix< Real > & get_transformation_matrix () const
 Get the transformation matrix, if it is defined. 更多...
 
void set_transformation_matrix (const DenseMatrix< Real > &matrix)
 Set the transformation matrix. 更多...
 
const std::set< unsigned int > & get_variables () const
 Get the set of variables for this periodic boundary condition. 更多...
 

Public 属性

boundary_id_type myboundary
 The boundary ID of this boundary and its counterpart. 更多...
 
boundary_id_type pairedboundary
 

Protected 属性

std::set< unsigned int > variables
 Set of variables for this periodic boundary, empty means all variables possible. 更多...
 
std::unique_ptr< DenseMatrix
< Real > > 
_transformation_matrix
 A DenseMatrix that defines the mapping of variables on this boundary and the counterpart boundary. 更多...
 

详细描述

The base class for defining periodic boundaries.

作者
Roy Stogner
日期
2010 Base class for all PeriodicBoundary implementations.

在文件 periodic_boundary_base.h48 行定义.

成员枚举类型说明

构造及析构函数说明

libMesh::PeriodicBoundaryBase::PeriodicBoundaryBase ( )

Constructor.

在文件 periodic_boundary_base.C34 行定义.

34  :
35  myboundary(BoundaryInfo::invalid_id),
36  pairedboundary(BoundaryInfo::invalid_id)
37 {
38 }
boundary_id_type myboundary
The boundary ID of this boundary and its counterpart.
libMesh::PeriodicBoundaryBase::PeriodicBoundaryBase ( const PeriodicBoundaryBase other)

Copy constructor.

在文件 periodic_boundary_base.C42 行定义.

参考 _transformation_matrix.

42  :
43  myboundary(o.myboundary),
44  pairedboundary(o.pairedboundary),
45  variables(o.variables)
46 {
47  // Make a deep copy of _transformation_matrix, if it's not null
48  if(o._transformation_matrix)
49  {
50  this->_transformation_matrix = std::make_unique<DenseMatrix<Real>>();
51  *(this->_transformation_matrix) = *(o._transformation_matrix);
52  }
53 }
boundary_id_type myboundary
The boundary ID of this boundary and its counterpart.
std::set< unsigned int > variables
Set of variables for this periodic boundary, empty means all variables possible.
std::unique_ptr< DenseMatrix< Real > > _transformation_matrix
A DenseMatrix that defines the mapping of variables on this boundary and the counterpart boundary...
virtual libMesh::PeriodicBoundaryBase::~PeriodicBoundaryBase ( )
virtualdefault

Destructor.

成员函数说明

virtual std::unique_ptr<PeriodicBoundaryBase> libMesh::PeriodicBoundaryBase::clone ( TransformationType  t = FORWARD) const
pure virtual

If we want the DofMap to be able to make copies of references and store them in the underlying map, this class must be clone'able, i.e.

have a kind of virtual construction mechanism. The user can also pass a flag to enable an 'inverse transformation' to be cloned from a forward transformation. The simplest way to implement a clone function like this is in terms of a copy constructor, see periodic_boundary.h.

注解
Not every transformation needs to provide an automatic way to clone an inverse: you can simply add a pair of PeriodicBoundaryBase objects using the appropriate DofMap interface instead.

libMesh::PeriodicBoundary 内被实现.

参考自 libMesh::DofMap::add_periodic_boundary().

virtual Point libMesh::PeriodicBoundaryBase::get_corresponding_pos ( const Point &  pt) const
pure virtual

This function should be overridden by derived classes to define how one finds corresponding nodes on the periodic boundary pair.

libMesh::PeriodicBoundary 内被实现.

参考自 libMesh::PeriodicBoundaries::neighbor().

const DenseMatrix< Real > & libMesh::PeriodicBoundaryBase::get_transformation_matrix ( ) const

Get the transformation matrix, if it is defined.

Throw an error if it is not defined.

在文件 periodic_boundary_base.C86 行定义.

参考 _transformation_matrix , 以及 has_transformation_matrix().

87 {
88  libmesh_error_msg_if(!has_transformation_matrix(),
89  "Transformation matrix is not defined");
90 
91  return *_transformation_matrix;
92 }
std::unique_ptr< DenseMatrix< Real > > _transformation_matrix
A DenseMatrix that defines the mapping of variables on this boundary and the counterpart boundary...
const std::set< unsigned int > & libMesh::PeriodicBoundaryBase::get_variables ( ) const

Get the set of variables for this periodic boundary condition.

在文件 periodic_boundary_base.C109 行定义.

参考 variables.

110 {
111  return variables;
112 }
std::set< unsigned int > variables
Set of variables for this periodic boundary, empty means all variables possible.
bool libMesh::PeriodicBoundaryBase::has_transformation_matrix ( ) const
返回
true if _transformation_matrix is not null.

在文件 periodic_boundary_base.C79 行定义.

参考 _transformation_matrix.

参考自 get_transformation_matrix().

80 {
81  return bool(_transformation_matrix);
82 }
std::unique_ptr< DenseMatrix< Real > > _transformation_matrix
A DenseMatrix that defines the mapping of variables on this boundary and the counterpart boundary...
bool libMesh::PeriodicBoundaryBase::is_my_variable ( unsigned int  var_num) const

在文件 periodic_boundary_base.C71 行定义.

参考 variables.

72 {
73  bool a = variables.empty() || (!variables.empty() && variables.find(var_num) != variables.end());
74  return a;
75 }
std::set< unsigned int > variables
Set of variables for this periodic boundary, empty means all variables possible.
void libMesh::PeriodicBoundaryBase::merge ( const PeriodicBoundaryBase pb)

在文件 periodic_boundary_base.C64 行定义.

参考 variables.

参考自 libMesh::DofMap::add_periodic_boundary().

65 {
66  variables.insert(pb.variables.begin(), pb.variables.end());
67 }
std::set< unsigned int > variables
Set of variables for this periodic boundary, empty means all variables possible.
void libMesh::PeriodicBoundaryBase::set_transformation_matrix ( const DenseMatrix< Real > &  matrix)

Set the transformation matrix.

When calling this method we require the following conditions: 1) matrix is square with size that matches this->variables.size() 2) the list of variables in this->variables set must all have the same FE type Both of these conditions are asserted in DBG mode.

在文件 periodic_boundary_base.C96 行定义.

参考 _transformation_matrix , 以及 variables.

97 {
98  // Make a deep copy of matrix
99  this->_transformation_matrix = std::make_unique<DenseMatrix<Real>>();
100  *(this->_transformation_matrix) = matrix;
101 
102  // if _transformation_matrix is defined then it must be the same sie as variables.
103  libmesh_assert_equal_to(_transformation_matrix->m(), variables.size());
104  libmesh_assert_equal_to(_transformation_matrix->n(), variables.size());
105 }
std::set< unsigned int > variables
Set of variables for this periodic boundary, empty means all variables possible.
std::unique_ptr< DenseMatrix< Real > > _transformation_matrix
A DenseMatrix that defines the mapping of variables on this boundary and the counterpart boundary...
void libMesh::PeriodicBoundaryBase::set_variable ( unsigned int  var)

在文件 periodic_boundary_base.C57 行定义.

参考 variables.

58 {
59  variables.insert(var);
60 }
std::set< unsigned int > variables
Set of variables for this periodic boundary, empty means all variables possible.

类成员变量说明

std::unique_ptr<DenseMatrix<Real> > libMesh::PeriodicBoundaryBase::_transformation_matrix
protected

A DenseMatrix that defines the mapping of variables on this boundary and the counterpart boundary.

This is necessary for periodic-boundaries with vector-valued quantities (e.g. velocity or displacement) on a sector of a circular domain, for example, since in that case we must map each variable to a corresponding linear combination of all the variables. We store the DenseMatrix via a unique_ptr, and an uninitialized pointer is treated as equivalent to the identity matrix.

在文件 periodic_boundary_base.h146 行定义.

参考自 get_transformation_matrix(), has_transformation_matrix(), PeriodicBoundaryBase() , 以及 set_transformation_matrix().

boundary_id_type libMesh::PeriodicBoundaryBase::myboundary

The boundary ID of this boundary and its counterpart.

在文件 periodic_boundary_base.h58 行定义.

参考自 libMesh::DofMap::add_periodic_boundary() , 以及 libMesh::PeriodicBoundary::PeriodicBoundary().

boundary_id_type libMesh::PeriodicBoundaryBase::pairedboundary
std::set<unsigned int> libMesh::PeriodicBoundaryBase::variables
protected

Set of variables for this periodic boundary, empty means all variables possible.

在文件 periodic_boundary_base.h134 行定义.

参考自 get_variables(), is_my_variable(), merge(), set_transformation_matrix() , 以及 set_variable().


该类的文档由以下文件生成: