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

The definition of a periodic boundary. 更多...

#include <periodic_boundary.h>

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

Public 类型

enum  TransformationType { FORWARD =0, INVERSE =1 }
 

Public 成员函数

 PeriodicBoundary ()
 Constructor. 更多...
 
virtual ~PeriodicBoundary ()=default
 Destructor. 更多...
 
 PeriodicBoundary (const PeriodicBoundary &o, TransformationType t=FORWARD)
 Copy constructor, with option for the copy to represent an inverse transformation. 更多...
 
 PeriodicBoundary (const RealVectorValue &vector)
 Constructor taking a reference to the translation vector. 更多...
 
virtual Point get_corresponding_pos (const Point &pt) const override
 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 override
 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 属性

RealVectorValue translation_vector
 
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 definition of a periodic boundary.

作者
Roy Stogner
日期
2010 Used for implementing periodic BCs via constraints.

在文件 periodic_boundary.h44 行定义.

成员枚举类型说明

构造及析构函数说明

libMesh::PeriodicBoundary::PeriodicBoundary ( )

Constructor.

在文件 periodic_boundary.C33 行定义.

33  :
36 {
37 }
RealVectorValue translation_vector
virtual libMesh::PeriodicBoundary::~PeriodicBoundary ( )
virtualdefault

Destructor.

libMesh::PeriodicBoundary::PeriodicBoundary ( const PeriodicBoundary o,
TransformationType  t = FORWARD 
)

Copy constructor, with option for the copy to represent an inverse transformation.

在文件 periodic_boundary.C41 行定义.

参考 libMesh::PeriodicBoundaryBase::INVERSE, libMesh::PeriodicBoundaryBase::myboundary, libMesh::PeriodicBoundaryBase::pairedboundary , 以及 translation_vector.

41  :
43  translation_vector(o.translation_vector)
44 {
45  if (t == INVERSE)
46  {
47  std::swap(myboundary, pairedboundary);
48  translation_vector *= -1.0;
49  }
50 }
boundary_id_type myboundary
The boundary ID of this boundary and its counterpart.
RealVectorValue translation_vector
libMesh::PeriodicBoundary::PeriodicBoundary ( const RealVectorValue vector)

Constructor taking a reference to the translation vector.

在文件 periodic_boundary.C54 行定义.

54  :
56  translation_vector(vector)
57 {
58 }
RealVectorValue translation_vector

成员函数说明

std::unique_ptr< PeriodicBoundaryBase > libMesh::PeriodicBoundary::clone ( TransformationType  t = FORWARD) const
overridevirtual

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.

实现了 libMesh::PeriodicBoundaryBase.

在文件 periodic_boundary.C69 行定义.

70 {
71  return std::make_unique<PeriodicBoundary>(*this, t);
72 }
Point libMesh::PeriodicBoundary::get_corresponding_pos ( const Point &  pt) const
overridevirtual

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

实现了 libMesh::PeriodicBoundaryBase.

在文件 periodic_boundary.C62 行定义.

参考 translation_vector.

63 {
64  return pt + translation_vector;
65 }
RealVectorValue translation_vector
const DenseMatrix< Real > & libMesh::PeriodicBoundaryBase::get_transformation_matrix ( ) const
inherited

Get the transformation matrix, if it is defined.

Throw an error if it is not defined.

在文件 periodic_boundary_base.C86 行定义.

参考 libMesh::PeriodicBoundaryBase::_transformation_matrix , 以及 libMesh::PeriodicBoundaryBase::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
inherited

Get the set of variables for this periodic boundary condition.

在文件 periodic_boundary_base.C109 行定义.

参考 libMesh::PeriodicBoundaryBase::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
inherited
返回
true if _transformation_matrix is not null.

在文件 periodic_boundary_base.C79 行定义.

参考 libMesh::PeriodicBoundaryBase::_transformation_matrix.

参考自 libMesh::PeriodicBoundaryBase::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
inherited

在文件 periodic_boundary_base.C71 行定义.

参考 libMesh::PeriodicBoundaryBase::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)
inherited

在文件 periodic_boundary_base.C64 行定义.

参考 libMesh::PeriodicBoundaryBase::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)
inherited

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 行定义.

参考 libMesh::PeriodicBoundaryBase::_transformation_matrix , 以及 libMesh::PeriodicBoundaryBase::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)
inherited

在文件 periodic_boundary_base.C57 行定义.

参考 libMesh::PeriodicBoundaryBase::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
protectedinherited

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 行定义.

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

boundary_id_type libMesh::PeriodicBoundaryBase::myboundary
inherited

The boundary ID of this boundary and its counterpart.

在文件 periodic_boundary_base.h58 行定义.

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

boundary_id_type libMesh::PeriodicBoundaryBase::pairedboundary
inherited
RealVectorValue libMesh::PeriodicBoundary::translation_vector
protected

在文件 periodic_boundary.h85 行定义.

参考自 get_corresponding_pos() , 以及 PeriodicBoundary().

std::set<unsigned int> libMesh::PeriodicBoundaryBase::variables
protectedinherited

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