该类提供了一个统一的接口,用于预处理器。此基类可继承,以包装来自不同软件包(如 PETSc 或 Trilinos)的预处理器。 更多...
#include <preconditioner.h>
Public 成员函数 | |
Preconditioner (const libMesh::Parallel::Communicator &comm) | |
构造函数。初始化 Preconditioner 的数据结构。 更多... | |
virtual | ~Preconditioner () |
析构函数。 更多... | |
bool | initialized () const |
virtual void | apply (const NumericVector< T > &x, NumericVector< T > &y)=0 |
计算基于输入向量 x 的预处理向量 y。通常通过解 ![]() ![]() | |
virtual void | clear () |
释放所有内存并清除数据结构。 更多... | |
virtual void | init () |
如果尚未初始化数据结构,则初始化数据结构。 更多... | |
virtual void | setup () |
每当 "操作可能已更改" 时都会调用此函数。 更多... | |
void | set_matrix (SparseMatrix< Number > &mat) |
设置要进行预处理的矩阵。 更多... | |
PreconditionerType | type () const |
void | set_type (const PreconditionerType pct) |
设置要使用的预处理器类型。 更多... | |
静态 Public 成员函数 | |
static std::unique_ptr < Preconditioner< T > > | build_preconditioner (const libMesh::Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package()) |
构建一个 Preconditioner,使用由 solver_package 指定的线性求解器软件包, 并以 std::unique_ptr 包装结果以确保安全性。 更多... | |
static std::string | get_info () |
Gets a string containing the reference information. 更多... | |
static void | print_info (std::ostream &out_stream=libMesh::out) |
Prints the reference information, by default to libMesh::out . 更多... | |
static unsigned int | n_objects () |
Prints the number of outstanding (created, but not yet destroyed) objects. 更多... | |
static void | enable_print_counter_info () |
Methods to enable/disable the reference counter output from print_info() 更多... | |
static void | disable_print_counter_info () |
Protected 类型 | |
typedef std::map< std::string, std::pair< unsigned int, unsigned int > > | Counts |
Data structure to log the information. 更多... | |
Protected 成员函数 | |
void | increment_constructor_count (const std::string &name) noexcept |
Increments the construction counter. 更多... | |
void | increment_destructor_count (const std::string &name) noexcept |
Increments the destruction counter. 更多... | |
Protected 属性 | |
SparseMatrix< T > * | _matrix |
要进行预处理的矩阵 P... 更多... | |
PreconditionerType | _preconditioner_type |
枚举类型,表示要使用的预处理器类型。 更多... | |
bool | _is_initialized |
指示数据结构是否已初始化的标志。 更多... | |
静态 Protected 属性 | |
static Counts | _counts |
Actually holds the data. 更多... | |
static Threads::atomic < unsigned int > | _n_objects |
The number of objects. 更多... | |
static Threads::spin_mutex | _mutex |
Mutual exclusion object to enable thread-safe reference counting. 更多... | |
static bool | _enable_print_counter = true |
Flag to control whether reference count information is printed when print_info is called. 更多... | |
该类提供了一个统一的接口,用于预处理器。此基类可继承,以包装来自不同软件包(如 PETSc 或 Trilinos)的预处理器。
在下面的注释中,P 是要进行预处理的矩阵,Apply() 执行的是矩阵向量乘积 P^-1 x 的等效操作。这也可以理解为(通常近似地)解 Py=x。
在文件 preconditioner.h 第 52 行定义.
|
protectedinherited |
Data structure to log the information.
The log is identified by the class name.
在文件 reference_counter.h 第 119 行定义.
|
inline |
构造函数。初始化 Preconditioner 的数据结构。
comm | 通信器对象 |
在文件 preconditioner.C 第 38 行定义.
|
inlinevirtual |
|
pure virtual |
计算基于输入向量 x
的预处理向量 y。通常通过解
来实现此操作,以获得
的作用。
x | 输入向量 |
y | 预处理后的向量 |
在 libMesh::TrilinosPreconditioner< T > , 以及 libMesh::EigenPreconditioner< T > 内被实现.
|
static |
构建一个 Preconditioner,使用由
solver_package
指定的线性求解器软件包, 并以 std::unique_ptr 包装结果以确保安全性。
comm | 通信器对象 |
solver_package | 求解器软件包(默认为 libMesh 的默认求解器软件包) |
在文件 preconditioner.C 第 50 行定义.
参考 libMesh::EIGEN_SOLVERS, libMesh::libmesh_ignore() , 以及 libMesh::TRILINOS_SOLVERS.
|
inlinevirtual |
释放所有内存并清除数据结构。
被 libMesh::TrilinosPreconditioner< T > , 以及 libMesh::EigenPreconditioner< T > 重载.
在文件 preconditioner.h 第 103 行定义.
|
staticinherited |
在文件 reference_counter.C 第 100 行定义.
参考 libMesh::ReferenceCounter::_enable_print_counter.
|
staticinherited |
Methods to enable/disable the reference counter output from print_info()
在文件 reference_counter.C 第 94 行定义.
参考 libMesh::ReferenceCounter::_enable_print_counter.
|
staticinherited |
Gets a string containing the reference information.
在文件 reference_counter.C 第 47 行定义.
参考 libMesh::ReferenceCounter::_counts.
参考自 libMesh::ReferenceCounter::print_info().
|
inlineprotectednoexceptinherited |
Increments the construction counter.
Should be called in the constructor of any derived class that will be reference counted.
在文件 reference_counter.h 第 183 行定义.
参考 libMesh::err.
参考自 libMesh::ReferenceCountedObject< SparseMatrix< T > >::ReferenceCountedObject().
|
inlineprotectednoexceptinherited |
Increments the destruction counter.
Should be called in the destructor of any derived class that will be reference counted.
在文件 reference_counter.h 第 207 行定义.
参考 libMesh::err.
参考自 libMesh::ReferenceCountedObject< SparseMatrix< T > >::~ReferenceCountedObject().
|
inlinevirtual |
如果尚未初始化数据结构,则初始化数据结构。
被 libMesh::TrilinosPreconditioner< T > , 以及 libMesh::EigenPreconditioner< T > 重载.
在文件 preconditioner.h 第 111 行定义.
|
inline |
true,否则返回
false。
在文件 preconditioner.h 第 87 行定义.
参考 libMesh::Preconditioner< T >::_is_initialized.
|
inlinestaticinherited |
Prints the number of outstanding (created, but not yet destroyed) objects.
在文件 reference_counter.h 第 85 行定义.
参考 libMesh::ReferenceCounter::_n_objects.
参考自 libMesh::LibMeshInit::~LibMeshInit().
|
staticinherited |
Prints the reference information, by default to libMesh::out
.
在文件 reference_counter.C 第 81 行定义.
参考 libMesh::ReferenceCounter::_enable_print_counter , 以及 libMesh::ReferenceCounter::get_info().
参考自 libMesh::LibMeshInit::~LibMeshInit().
void libMesh::Preconditioner< T >::set_matrix | ( | SparseMatrix< Number > & | mat | ) |
设置要进行预处理的矩阵。
mat | 要进行预处理的稀疏矩阵 |
在文件 preconditioner.h 第 174 行定义.
参考 libMesh::libMeshPrivateData::_is_initialized.
void libMesh::Preconditioner< T >::set_type | ( | const PreconditionerType | pct | ) |
设置要使用的预处理器类型。
pct | 预处理器类型 |
在文件 preconditioner.h 第 183 行定义.
参考 libMesh::libMeshPrivateData::_is_initialized.
|
inlinevirtual |
|
inline |
在文件 preconditioner.h 第 133 行定义.
参考 libMesh::Preconditioner< T >::_preconditioner_type.
|
staticprotectedinherited |
Actually holds the data.
在文件 reference_counter.h 第 124 行定义.
|
staticprotectedinherited |
Flag to control whether reference count information is printed when print_info is called.
在文件 reference_counter.h 第 143 行定义.
参考自 libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info() , 以及 libMesh::ReferenceCounter::print_info().
|
protected |
|
protected |
|
staticprotectedinherited |
Mutual exclusion object to enable thread-safe reference counting.
在文件 reference_counter.h 第 137 行定义.
|
staticprotectedinherited |
The number of objects.
Print the reference count information when the number returns to 0.
在文件 reference_counter.h 第 132 行定义.
参考自 libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter() , 以及 libMesh::ReferenceCounter::~ReferenceCounter().
|
protected |