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

This class allows one to associate Dirichlet boundary values with a given set of mesh boundary ids and system variable ids. 更多...

#include <dirichlet_boundaries.h>

Public 成员函数

 DirichletBoundary (std::set< boundary_id_type > b_in, std::vector< unsigned int > variables_in, const FunctionBase< Number > *f_in, const FunctionBase< Gradient > *g_in=nullptr)
 Constructor for a system-variable-order boundary using pointers-to-functors. 更多...
 
 DirichletBoundary (std::set< boundary_id_type > b_in, std::vector< unsigned int > variables_in, const FunctionBase< Number > &f_in, VariableIndexing type=SYSTEM_VARIABLE_ORDER)
 Constructor for a boundary from reference-to-functor. 更多...
 
 DirichletBoundary (std::set< boundary_id_type > b_in, std::vector< unsigned int > variables_in, const FunctionBase< Number > &f_in, const FunctionBase< Gradient > &g_in, VariableIndexing type=SYSTEM_VARIABLE_ORDER)
 Constructor for a system-variable-order boundary from references-to-functors. 更多...
 
 DirichletBoundary (std::set< boundary_id_type > b_in, std::vector< unsigned int > variables_in, const System &f_sys_in, const FEMFunctionBase< Number > *f_in, const FEMFunctionBase< Gradient > *g_in=nullptr)
 Constructor for a system-variable-order boundary from pointers-to-fem-functors. 更多...
 
 DirichletBoundary (std::set< boundary_id_type > b_in, std::vector< unsigned int > variables_in, const System &f_sys_in, const FEMFunctionBase< Number > &f_in, VariableIndexing type=SYSTEM_VARIABLE_ORDER)
 Constructor for a system-variable-order boundary from reference-to-fem-functor. 更多...
 
 DirichletBoundary (std::set< boundary_id_type > b_in, std::vector< unsigned int > variables_in, const System &f_sys_in, const FEMFunctionBase< Number > &f_in, const FEMFunctionBase< Gradient > &g_in, VariableIndexing type=SYSTEM_VARIABLE_ORDER)
 Constructor for a system-variable-order boundary from references-to-fem-functors. 更多...
 
 DirichletBoundary (const DirichletBoundary &dirichlet_in)
 Copy assignment/constructor. 更多...
 
DirichletBoundaryoperator= (const DirichletBoundary &)
 
 DirichletBoundary (DirichletBoundary &&)=default
 This class is default move-assignable and move-constructible. 更多...
 
DirichletBoundaryoperator= (DirichletBoundary &&)=default
 
 ~DirichletBoundary ()
 Standard destructor. 更多...
 

Public 属性

std::set< boundary_id_typeb
 
std::vector< unsigned int > variables
 
std::unique_ptr< FunctionBase
< Number > > 
f
 
std::unique_ptr< FunctionBase
< Gradient > > 
g
 
std::unique_ptr
< FEMFunctionBase< Number > > 
f_fem
 
std::unique_ptr
< FEMFunctionBase< Gradient > > 
g_fem
 
const System * f_system
 
Real jacobian_tolerance
 Defaults to zero, but can be set to a custom small negative value to try and avoid spurious zero (or negative) Jacobian values when applying Dirichlet constraints. 更多...
 

详细描述

This class allows one to associate Dirichlet boundary values with a given set of mesh boundary ids and system variable ids.

Dirichlet values must be supplied as the input function "f"; when using some specialized elements, gradient values must be supplied via the input function "g".

Dirichlet functions may be subclasses of FunctionBase or FEMFunctionBase; in the latter case the user must also supply a reference to the System on which the FEMFunctionBase will be evaluated.

Dirichlet functions are allowed to return NaN; if this is encountered, then the degree of freedom values in a patch around the location of the returned NaN will be left unconstrained. E.g. a NaN on a boundary edge in 3D would leave that edge and the two adjoining face interiors unconstrained, but would still permit the other edge and node DoFs around those faces to be constrained.

作者
Roy Stogner
日期
2012 Class for specifying Dirichlet boundary conditions as constraints.

在文件 dirichlet_boundaries.h88 行定义.

构造及析构函数说明

libMesh::DirichletBoundary::DirichletBoundary ( std::set< boundary_id_type b_in,
std::vector< unsigned int >  variables_in,
const FunctionBase< Number > *  f_in,
const FunctionBase< Gradient > *  g_in = nullptr 
)

Constructor for a system-variable-order boundary using pointers-to-functors.

在文件 dirichlet_boundary.C36 行定义.

参考 f , 以及 g.

39  :
40  b(std::move(b_in)),
41  variables(std::move(variables_in)),
42  f(f_in ? f_in->clone() : nullptr),
43  g(g_in ? g_in->clone() : nullptr),
44  f_system(nullptr),
46 {
47  libmesh_assert(f);
48  f->init();
49  if (g)
50  g->init();
51 }
std::unique_ptr< FunctionBase< Number > > f
Real jacobian_tolerance
Defaults to zero, but can be set to a custom small negative value to try and avoid spurious zero (or ...
std::vector< unsigned int > variables
std::unique_ptr< FunctionBase< Gradient > > g
std::set< boundary_id_type > b
libMesh::DirichletBoundary::DirichletBoundary ( std::set< boundary_id_type b_in,
std::vector< unsigned int >  variables_in,
const FunctionBase< Number > &  f_in,
VariableIndexing  type = SYSTEM_VARIABLE_ORDER 
)

Constructor for a boundary from reference-to-functor.

Defaults to system variable indexing for backwards compatibility, but most users will prefer local indexing.

在文件 dirichlet_boundary.C55 行定义.

参考 libMesh::FunctionBase< Output >::clone(), f, libMesh::LOCAL_VARIABLE_ORDER , 以及 variables.

58  :
59  b(std::move(b_in)),
60  variables(std::move(variables_in)),
61  f_system(nullptr),
63 {
64  if (type == LOCAL_VARIABLE_ORDER)
65  {
66  auto c = std::make_unique<CompositeFunction<Number>>();
67  c->attach_subfunction(f_in, variables);
68  f = std::move(c);
69  }
70  else
71  f = f_in.clone();
72 
73  f->init();
74 }
std::unique_ptr< FunctionBase< Number > > f
Real jacobian_tolerance
Defaults to zero, but can be set to a custom small negative value to try and avoid spurious zero (or ...
std::vector< unsigned int > variables
std::set< boundary_id_type > b
libMesh::DirichletBoundary::DirichletBoundary ( std::set< boundary_id_type b_in,
std::vector< unsigned int >  variables_in,
const FunctionBase< Number > &  f_in,
const FunctionBase< Gradient > &  g_in,
VariableIndexing  type = SYSTEM_VARIABLE_ORDER 
)

Constructor for a system-variable-order boundary from references-to-functors.

Defaults to system variable indexing for backwards compatibility, but most users will prefer local indexing.

在文件 dirichlet_boundary.C78 行定义.

参考 libMesh::FunctionBase< Output >::clone(), f, g, libMesh::LOCAL_VARIABLE_ORDER , 以及 variables.

82  :
83  b(std::move(b_in)),
84  variables(std::move(variables_in)),
85  f_system(nullptr),
87 {
88  if (type == LOCAL_VARIABLE_ORDER)
89  {
90  auto cf = std::make_unique<CompositeFunction<Number>>();
91  cf->attach_subfunction(f_in, variables);
92  f = std::move(cf);
93 
94  auto cg = std::make_unique<CompositeFunction<Gradient>>();
95  cg->attach_subfunction(g_in, variables);
96  g = std::move(cg);
97  }
98  else
99  {
100  f = f_in.clone();
101  g = g_in.clone();
102  }
103 
104  f->init();
105  g->init();
106 }
std::unique_ptr< FunctionBase< Number > > f
Real jacobian_tolerance
Defaults to zero, but can be set to a custom small negative value to try and avoid spurious zero (or ...
std::vector< unsigned int > variables
std::unique_ptr< FunctionBase< Gradient > > g
std::set< boundary_id_type > b
libMesh::DirichletBoundary::DirichletBoundary ( std::set< boundary_id_type b_in,
std::vector< unsigned int >  variables_in,
const System &  f_sys_in,
const FEMFunctionBase< Number > *  f_in,
const FEMFunctionBase< Gradient > *  g_in = nullptr 
)

Constructor for a system-variable-order boundary from pointers-to-fem-functors.

在文件 dirichlet_boundary.C110 行定义.

参考 f_fem.

114  :
115  b(std::move(b_in)),
116  variables(std::move(variables_in)),
117  f_fem(f_in ? f_in->clone() : nullptr),
118  g_fem(g_in ? g_in->clone() : nullptr),
119  f_system(&f_sys_in),
121 {
122  libmesh_assert(f_fem);
123 }
std::unique_ptr< FEMFunctionBase< Gradient > > g_fem
Real jacobian_tolerance
Defaults to zero, but can be set to a custom small negative value to try and avoid spurious zero (or ...
std::vector< unsigned int > variables
std::unique_ptr< FEMFunctionBase< Number > > f_fem
std::set< boundary_id_type > b
libMesh::DirichletBoundary::DirichletBoundary ( std::set< boundary_id_type b_in,
std::vector< unsigned int >  variables_in,
const System &  f_sys_in,
const FEMFunctionBase< Number > &  f_in,
VariableIndexing  type = SYSTEM_VARIABLE_ORDER 
)

Constructor for a system-variable-order boundary from reference-to-fem-functor.

Defaults to system variable indexing for backwards compatibility, but most users will prefer local indexing.

在文件 dirichlet_boundary.C127 行定义.

参考 libMesh::FEMFunctionBase< Output >::clone(), f_fem, libMesh::LOCAL_VARIABLE_ORDER , 以及 variables.

131  :
132  b(std::move(b_in)),
133  variables(std::move(variables_in)),
134  f_system(&f_sys_in),
136 {
137  if (type == LOCAL_VARIABLE_ORDER)
138  {
139  auto c = std::make_unique<CompositeFEMFunction<Number>>();
140  c->attach_subfunction(f_in, variables);
141  f_fem = std::move(c);
142  }
143  else
144  f_fem = f_in.clone();
145 }
Real jacobian_tolerance
Defaults to zero, but can be set to a custom small negative value to try and avoid spurious zero (or ...
std::vector< unsigned int > variables
std::unique_ptr< FEMFunctionBase< Number > > f_fem
std::set< boundary_id_type > b
libMesh::DirichletBoundary::DirichletBoundary ( std::set< boundary_id_type b_in,
std::vector< unsigned int >  variables_in,
const System &  f_sys_in,
const FEMFunctionBase< Number > &  f_in,
const FEMFunctionBase< Gradient > &  g_in,
VariableIndexing  type = SYSTEM_VARIABLE_ORDER 
)

Constructor for a system-variable-order boundary from references-to-fem-functors.

Defaults to system variable indexing for backwards compatibility, but most users will prefer local indexing.

在文件 dirichlet_boundary.C149 行定义.

参考 libMesh::FEMFunctionBase< Output >::clone(), f_fem, g_fem, libMesh::LOCAL_VARIABLE_ORDER , 以及 variables.

154  :
155  b(std::move(b_in)),
156  variables(std::move(variables_in)),
157  f_system(&f_sys_in),
159 {
160  if (type == LOCAL_VARIABLE_ORDER)
161  {
162  auto cf = std::make_unique<CompositeFEMFunction<Number>>();
163  cf->attach_subfunction(f_in, variables);
164  f_fem = std::move(cf);
165 
166  auto cg = std::make_unique<CompositeFEMFunction<Gradient>>();
167  cg->attach_subfunction(g_in, variables);
168  g_fem = std::move(cg);
169  }
170  else
171  {
172  f_fem = f_in.clone();
173  g_fem = g_in.clone();
174  }
175 }
std::unique_ptr< FEMFunctionBase< Gradient > > g_fem
Real jacobian_tolerance
Defaults to zero, but can be set to a custom small negative value to try and avoid spurious zero (or ...
std::vector< unsigned int > variables
std::unique_ptr< FEMFunctionBase< Number > > f_fem
std::set< boundary_id_type > b
libMesh::DirichletBoundary::DirichletBoundary ( const DirichletBoundary dirichlet_in)

Copy assignment/constructor.

Deep copies (clones) functors; shallow copies any System reference

在文件 dirichlet_boundary.C179 行定义.

参考 f, f_fem, f_system, g , 以及 g_fem.

179  :
180  b(d_in.b),
181  variables(d_in.variables),
182  f(d_in.f ? d_in.f->clone() : nullptr),
183  g(d_in.g ? d_in.g->clone() : nullptr),
184  f_fem(d_in.f_fem ? d_in.f_fem->clone() : nullptr),
185  g_fem(d_in.g_fem ? d_in.g_fem->clone() : nullptr),
186  f_system(d_in.f_system),
187  jacobian_tolerance(d_in.jacobian_tolerance)
188 {
189  libmesh_assert(f || f_fem);
190  libmesh_assert(!(f && f_fem));
191  libmesh_assert(!(f && g_fem));
192  libmesh_assert(!(f_fem && g));
193  libmesh_assert(!(f_fem && !f_system));
194  if (f)
195  f->init();
196  if (g)
197  g->init();
198 }
std::unique_ptr< FEMFunctionBase< Gradient > > g_fem
std::unique_ptr< FunctionBase< Number > > f
Real jacobian_tolerance
Defaults to zero, but can be set to a custom small negative value to try and avoid spurious zero (or ...
std::vector< unsigned int > variables
std::unique_ptr< FEMFunctionBase< Number > > f_fem
std::unique_ptr< FunctionBase< Gradient > > g
std::set< boundary_id_type > b
libMesh::DirichletBoundary::DirichletBoundary ( DirichletBoundary &&  )
default

This class is default move-assignable and move-constructible.

libMesh::DirichletBoundary::~DirichletBoundary ( )
default

Standard destructor.

成员函数说明

DirichletBoundary & libMesh::DirichletBoundary::operator= ( const DirichletBoundary rhs)

在文件 dirichlet_boundary.C201 行定义.

202 {
203  // Implementation in terms of the copy constructor to avoid code duplication.
204  DirichletBoundary tmp(rhs);
205  std::swap(tmp, *this); // class must be "MoveAssignable" and "MoveConstructible" for std::swap to work.
206  return *this;
207 }
DirichletBoundary(std::set< boundary_id_type > b_in, std::vector< unsigned int > variables_in, const FunctionBase< Number > *f_in, const FunctionBase< Gradient > *g_in=nullptr)
Constructor for a system-variable-order boundary using pointers-to-functors.
DirichletBoundary& libMesh::DirichletBoundary::operator= ( DirichletBoundary &&  )
default

类成员变量说明

std::set<boundary_id_type> libMesh::DirichletBoundary::b
std::unique_ptr<FunctionBase<Number> > libMesh::DirichletBoundary::f

在文件 dirichlet_boundaries.h183 行定义.

参考自 DirichletBoundary().

std::unique_ptr<FEMFunctionBase<Number> > libMesh::DirichletBoundary::f_fem

在文件 dirichlet_boundaries.h186 行定义.

参考自 DirichletBoundary().

const System* libMesh::DirichletBoundary::f_system

在文件 dirichlet_boundaries.h189 行定义.

参考自 DirichletBoundary().

std::unique_ptr<FunctionBase<Gradient> > libMesh::DirichletBoundary::g

在文件 dirichlet_boundaries.h184 行定义.

参考自 DirichletBoundary().

std::unique_ptr<FEMFunctionBase<Gradient> > libMesh::DirichletBoundary::g_fem

在文件 dirichlet_boundaries.h187 行定义.

参考自 DirichletBoundary().

Real libMesh::DirichletBoundary::jacobian_tolerance

Defaults to zero, but can be set to a custom small negative value to try and avoid spurious zero (or negative) Jacobian values when applying Dirichlet constraints.

This can be useful in various different situations, for example: 1.) When specifying DirichletBCs on poorly-shaped elements. 2.) When degenerate Hexahedra are used in place of Prisms for convenience. 3.) On elements (e.g. Pyramids) which always have a zero Jacobian at the "apex" node. In theory there's nothing preventing someone from specifying DirichletBCs in such cases; setting this tolerance to a small negative value makes this possible in practice.

在文件 dirichlet_boundaries.h203 行定义.

std::vector<unsigned int> libMesh::DirichletBoundary::variables

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