这个类提供了一个方便的接口,用于操作并行稀疏矩阵的 PETSc C 库数据结构。 所有覆盖的虚拟函数都在 sparse_matrix.h 中有详细的文档说明。 更多...
#include <petsc_matrix.h>
Public 成员函数 | |
PetscMatrix (const Parallel::Communicator &comm_in) | |
构造函数:将矩阵初始化为空,没有任何结构。这个构造函数只适用于类的成员矩阵。 所有其他矩阵应该在所有必要信息都可用的数据流中的某一点创建。 更多... | |
PetscMatrix (Mat m, const Parallel::Communicator &comm_in) | |
构造函数:创建一个 PetscMatrix,假设您已经有一个有效的 Mat 对象。 在这种情况下,矩阵 m 不会在 PetscMatrix 析构函数中销毁,这允许 m 的所有权保留给原始创建者,并为 PetscMatrix 提供额外的功能。 更多... | |
PetscMatrix (PetscMatrix &&)=delete | |
删除默认生成的复制和移动函数,以及默认析构函数,因为此类手动管理 C 风格的 Mat 结构。 更多... | |
PetscMatrix (const PetscMatrix &)=delete | |
PetscMatrix & | operator= (const PetscMatrix &)=delete |
PetscMatrix & | operator= (PetscMatrix &&)=delete |
virtual | ~PetscMatrix () |
析构函数,释放矩阵资源。 更多... | |
void | set_matrix_type (PetscMatrixType mat_type) |
设置矩阵的类型(如稀疏矩阵类型)。 更多... | |
virtual void | init (const numeric_index_type m, const numeric_index_type n, const numeric_index_type m_l, const numeric_index_type n_l, const numeric_index_type nnz=30, const numeric_index_type noz=10, const numeric_index_type blocksize=1) override |
初始化 PETSc 矩阵。 更多... | |
void | init (const numeric_index_type m, const numeric_index_type n, const numeric_index_type m_l, const numeric_index_type n_l, const std::vector< numeric_index_type > &n_nz, const std::vector< numeric_index_type > &n_oz, const numeric_index_type blocksize=1) |
初始化 PETSc 矩阵。 更多... | |
virtual void | init (ParallelType=PARALLEL) override |
使用由 dof_map 计算的稀疏性结构初始化此矩阵。 更多... | |
void | update_preallocation_and_zero () |
更新基于 dof_map 的稀疏模式,并将矩阵置零。这在稀疏模式在计算过程中发生变化的情况下很有用。 更多... | |
void | reset_preallocation () |
重置矩阵以使用用户提供的原始非零模式。 更多... | |
virtual void | clear () noexceptoverride |
clear() 在析构函数中调用,因此它不应该抛出异常。 更多... | |
virtual void | zero () override |
将矩阵所有元素置为零。 更多... | |
virtual std::unique_ptr < SparseMatrix< T > > | zero_clone () const override |
创建一个新的空矩阵,并将其所有元素置为零。 更多... | |
virtual std::unique_ptr < SparseMatrix< T > > | clone () const override |
克隆当前矩阵。 更多... | |
virtual void | zero_rows (std::vector< numeric_index_type > &rows, T diag_value=0.0) override |
将指定行的所有元素置为零,并在对角线位置放置一个指定值。 更多... | |
virtual void | close () override |
完成任何挂起的插入或添加操作。 更多... | |
virtual void | flush () override |
刷新矩阵的内部缓冲区,确保所有操作都已完成。 更多... | |
virtual numeric_index_type | m () const override |
获取矩阵的行数。 更多... | |
virtual numeric_index_type | local_m () const final |
获取由该进程拥有的矩阵行数。 更多... | |
virtual numeric_index_type | n () const override |
获取矩阵的列数。 更多... | |
numeric_index_type | local_n () const |
获取由该进程拥有的矩阵列数。 更多... | |
void | get_local_size (numeric_index_type &m, numeric_index_type &n) const |
获取由该进程拥有的矩阵行数和列数。 更多... | |
virtual numeric_index_type | row_start () const override |
获取本地处理的行的起始索引。 更多... | |
virtual numeric_index_type | row_stop () const override |
获取本地处理的行的结束索引。 更多... | |
virtual void | set (const numeric_index_type i, const numeric_index_type j, const T value) override |
设置矩阵中特定位置的值。 更多... | |
virtual void | add (const numeric_index_type i, const numeric_index_type j, const T value) override |
在矩阵的特定位置添加值。 更多... | |
virtual void | add_matrix (const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols) override |
将稠密矩阵添加到此稀疏矩阵的指定行和列。 更多... | |
virtual void | add_matrix (const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &dof_indices) override |
将稠密矩阵添加到此稀疏矩阵的指定位置。 更多... | |
virtual void | add_block_matrix (const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &brows, const std::vector< numeric_index_type > &bcols) override |
将稠密块矩阵添加到此稀疏矩阵的指定块行和块列。 更多... | |
virtual void | add_block_matrix (const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &dof_indices) override |
将稠密块矩阵添加到此稀疏矩阵的指定位置。 更多... | |
virtual void | add (const T a, const SparseMatrix< T > &X) override |
计算 A += a*X,其中 a 是标量,X 是矩阵。 更多... | |
virtual void | matrix_matrix_mult (SparseMatrix< T > &X, SparseMatrix< T > &Y, bool reuse=false) override |
计算 Y = A*X,其中 A 是当前矩阵,X 是另一个矩阵。 更多... | |
virtual void | add_sparse_matrix (const SparseMatrix< T > &spm, const std::map< numeric_index_type, numeric_index_type > &row_ltog, const std::map< numeric_index_type, numeric_index_type > &col_ltog, const T scalar) override |
将标量乘以稀疏矩阵 spm 添加到此矩阵的指定行和列。 更多... | |
virtual T | operator() (const numeric_index_type i, const numeric_index_type j) const override |
获取矩阵中特定位置的值。 更多... | |
virtual Real | l1_norm () const override |
计算矩阵的 L1 范数。 更多... | |
virtual Real | linfty_norm () const override |
计算矩阵的无穷范数。 更多... | |
virtual bool | closed () const override |
检查矩阵是否已经关闭,即所有的插入和添加操作是否已经完成。 更多... | |
virtual void | set_destroy_mat_on_exit (bool destroy=true) |
设置析构时是否删除 Mat 对象。如果设置为 false,则允许 PETSc 管理它。 更多... | |
virtual void | print_personal (std::ostream &os=libMesh::out) const override |
使用 PETSc 查看器将矩阵的内容打印到屏幕。 由于我们限制了一个 PETSc 实现,所以此函数仅允许打印到标准输出。 更多... | |
virtual void | print_matlab (const std::string &name="") const override |
将矩阵内容以 MATLAB 格式打印出来。 更多... | |
virtual void | get_diagonal (NumericVector< T > &dest) const override |
获取矩阵的对角线并将其存储在给定的向量中。 更多... | |
virtual void | get_transpose (SparseMatrix< T > &dest) const override |
获取矩阵的转置。 更多... | |
void | swap (PetscMatrix< T > &) |
交换两个 PetscMatrix 的内部数据指针,不交换实际值。 更多... | |
Mat | mat () |
返回原始的 PETSc 矩阵指针。 更多... | |
virtual void | get_row (numeric_index_type i, std::vector< numeric_index_type > &indices, std::vector< T > &values) const override |
获取矩阵中指定行的索引和值。 更多... | |
virtual void | create_submatrix_nosort (SparseMatrix< T > &submatrix, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols) const override |
根据给定的 rows 和 cols 向量中的索引创建一个子矩阵,类似于 create_submatrix 函数。 更多... | |
virtual bool | initialized () const |
void | attach_dof_map (const DofMap &dof_map) |
设置要使用的 DofMap 的指针。如果不使用单独的稀疏性模式, 则使用来自 DofMap 的模式。 更多... | |
void | attach_sparsity_pattern (const SparsityPattern::Build &sp) |
设置要使用的稀疏性模式的指针。在矩阵需要比系统中的大(或更小以提高效率)的模式, 或者在 DofMap 未计算系统稀疏性模式的情况下使用。 更多... | |
virtual bool | need_full_sparsity_pattern () const |
virtual void | update_sparsity_pattern (const SparsityPattern::Graph &) |
更新矩阵的稀疏性模式。当您的 SparseMatrix<T> 实现不需要此数据时, 只需不覆盖此方法。 更多... | |
void | print (std::ostream &os=libMesh::out, const bool sparse=false) const |
将矩阵的内容以统一的样式打印到屏幕上,而不考虑正在使用的矩阵/求解器包。 更多... | |
template<> | |
void | print (std::ostream &os, const bool sparse) const |
virtual void | create_submatrix (SparseMatrix< T > &submatrix, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols) const |
此函数创建一个名为 "submatrix" 的矩阵,其定义由 "rows" 和 "cols" 条目中的行和列索引给定。 目前,此操作仅对 PetscMatrix 类型定义。 注意:rows 和 cols 向量需要排序; 如果 rows 和 cols 向量未排序,则使用下面的 nosort 版本; rows 和 cols 仅包含由此处理器拥有的索引。 更多... | |
virtual void | reinit_submatrix (SparseMatrix< T > &submatrix, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols) const |
此函数与上述函数类似,但允许您重用 "submatrix" 的现有稀疏性模式,而不是再次分配它。 如果经常提取相同大小的子矩阵,这应该更有效。 更多... | |
void | vector_mult (NumericVector< T > &dest, const NumericVector< T > &arg) const |
将矩阵乘以 NumericVector arg 并将结果存储在 NumericVector dest 中。 更多... | |
void | vector_mult_add (NumericVector< T > &dest, const NumericVector< T > &arg) const |
将矩阵乘以 NumericVector arg ,并将结果添加到 NumericVector dest 中。 更多... | |
静态 Public 成员函数 | |
static std::unique_ptr < SparseMatrix< T > > | build (const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package(), const MatrixBuildType matrix_build_type=MatrixBuildType::AUTOMATIC) |
使用由 solver_package 指定的线性求解器包构建一个 SparseMatrix<T>。 更多... | |
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 成员函数 | |
virtual void | _get_submatrix (SparseMatrix< T > &submatrix, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols, const bool reuse_submatrix) const override |
创建或重新初始化一个由 rows 和 cols 向量中给出的索引定义的矩阵 submatrix。 更多... | |
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 属性 | |
DofMap const * | _dof_map |
与此对象关联的 DofMap 对象。可以查询其在处理器上的自由度计数。 更多... | |
SparsityPattern::Build const * | _sp |
与此对象关联的 sparsity pattern。在需要时, 应查询其入口计数(或使用 need_full_sparsity_pattern,模式)。 更多... | |
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. 更多... | |
Private 属性 | |
Mat | _mat |
用于存储值的 PETSc 矩阵数据类型。 更多... | |
bool | _destroy_mat_on_exit |
此布尔值仅应在接受 PETSc Mat 对象的构造函数中设置为 false。 更多... | |
PetscMatrixType | _mat_type |
存储 PETSc 矩阵的类型。 更多... | |
std::mutex | _petsc_matrix_mutex |
用于线程安全的互斥锁(C++11 线程)。 更多... | |
Threads::spin_mutex | _petsc_matrix_mutex |
用于线程安全的旋转锁。 更多... | |
这个类提供了一个方便的接口,用于操作并行稀疏矩阵的 PETSc C 库数据结构。 所有覆盖的虚拟函数都在 sparse_matrix.h 中有详细的文档说明。
在文件 petsc_matrix.h 第 92 行定义.
|
protectedinherited |
Data structure to log the information.
The log is identified by the class name.
在文件 reference_counter.h 第 119 行定义.
|
explicit |
构造函数:将矩阵初始化为空,没有任何结构。这个构造函数只适用于类的成员矩阵。 所有其他矩阵应该在所有必要信息都可用的数据流中的某一点创建。
在使用之前,您必须使用 init(...) 初始化矩阵。
comm_in | 通信器,指定了矩阵的并行性质。 |
在文件 petsc_matrix.C 第 83 行定义.
|
explicit |
构造函数:创建一个 PetscMatrix,假设您已经有一个有效的 Mat 对象。 在这种情况下,矩阵 m 不会在 PetscMatrix 析构函数中销毁,这允许 m 的所有权保留给原始创建者,并为 PetscMatrix 提供额外的功能。
m | 已有的 Mat 对象。 |
comm_in | 通信器,指定了矩阵的并行性质。 |
在文件 petsc_matrix.C 第 95 行定义.
参考 libMesh::SparseMatrix< T >::_is_initialized , 以及 libMesh::PetscMatrix< T >::_mat.
|
delete |
删除默认生成的复制和移动函数,以及默认析构函数,因为此类手动管理 C 风格的 Mat 结构。
|
delete |
|
virtual |
析构函数,释放矩阵资源。
在文件 petsc_matrix.C 第 109 行定义.
|
overrideprotectedvirtual |
创建或重新初始化一个由 rows
和 cols
向量中给出的索引定义的矩阵 submatrix。
submatrix | 要创建或重新初始化的子矩阵。 |
rows | 定义子矩阵的行索引。 |
cols | 定义子矩阵的列索引。 |
reuse_submatrix | 确定 PETSc 是否将 submatrix 视为已使用过(已分配内存)的矩阵,还是新矩阵。 |
重载 libMesh::SparseMatrix< T > .
在文件 petsc_matrix.C 第 812 行定义.
参考 libMesh::SparseMatrix< T >::_is_initialized, libMesh::PetscMatrix< T >::_mat, libMesh::SparseMatrix< T >::clear(), libMesh::PetscMatrix< T >::close(), libMesh::closed(), libMesh::WrappedPetsc< T >::get(), libMesh::SparseMatrix< T >::initialized() , 以及 libMesh::numeric_petsc_cast().
|
overridevirtual |
在矩阵的特定位置添加值。
i | 行索引。 |
j | 列索引。 |
value | 要添加的值。 |
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 1127 行定义.
|
overridevirtual |
计算 A += a*X,其中 a 是标量,X 是矩阵。
a | 标量值。 |
X | 要添加的矩阵。 |
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 1158 行定义.
参考 libMesh::PetscMatrix< T >::_mat, libMesh::PetscMatrix< T >::closed(), libMesh::initialized(), libMesh::SparseMatrix< T >::m() , 以及 libMesh::SparseMatrix< T >::n().
|
overridevirtual |
将稠密块矩阵添加到此稀疏矩阵的指定块行和块列。
dm | 要添加的稠密块矩阵。 |
brows | 稀疏矩阵中的块行索引。 |
bcols | 稀疏矩阵中的块列索引。 |
重载 libMesh::SparseMatrix< T > .
在文件 petsc_matrix.C 第 768 行定义.
参考 libMesh::DenseMatrix< T >::get_values(), libMesh::initialized(), libMesh::DenseMatrixBase< T >::m(), libMesh::DenseMatrixBase< T >::n(), libMesh::numeric_petsc_cast() , 以及 libMesh::pPS().
|
overridevirtual |
|
overridevirtual |
将稠密矩阵添加到此稀疏矩阵的指定行和列。
dm | 要添加的稠密矩阵。 |
rows | 稀疏矩阵中的行索引。 |
cols | 稀疏矩阵中的列索引。 |
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 741 行定义.
参考 libMesh::DenseMatrix< T >::get_values(), libMesh::initialized(), libMesh::DenseMatrixBase< T >::m(), libMesh::DenseMatrixBase< T >::n(), libMesh::numeric_petsc_cast() , 以及 libMesh::pPS().
|
overridevirtual |
将稠密矩阵添加到此稀疏矩阵的指定位置。
dm | 要添加的稠密矩阵。 |
dof_indices | 稀疏矩阵中的行和列索引。 |
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 1145 行定义.
|
overridevirtual |
将标量乘以稀疏矩阵 spm 添加到此矩阵的指定行和列。
spm | 要添加的稀疏矩阵。 |
row_ltog | 行的本地到全局索引映射。 |
col_ltog | 列的本地到全局索引映射。 |
scalar | 乘以 spm 的标量值。 |
重载 libMesh::SparseMatrix< T > .
在文件 petsc_matrix.C 第 1221 行定义.
参考 libMesh::closed(), libMesh::SparseMatrix< T >::m(), libMesh::SparseMatrix< T >::n() , 以及 libMesh::PS().
|
inherited |
设置要使用的 DofMap
的指针。如果不使用单独的稀疏性模式, 则使用来自 DofMap 的模式。
dof_map
的生命周期必须超过 this
的生命周期。
在文件 sparse_matrix.C 第 58 行定义.
参考 libMesh::DofMap::get_sparsity_pattern().
参考自 libMesh::DofMap::update_sparsity_pattern().
|
inherited |
设置要使用的稀疏性模式的指针。在矩阵需要比系统中的大(或更小以提高效率)的模式, 或者在 DofMap 未计算系统稀疏性模式的情况下使用。
sp
的生命周期必须超过 this
的生命周期。
在文件 sparse_matrix.C 第 68 行定义.
参考自 libMesh::DofMap::update_sparsity_pattern().
|
staticinherited |
使用由 solver_package
指定的线性求解器包构建一个 SparseMatrix<T>。
在文件 sparse_matrix.C 第 151 行定义.
参考 libMesh::EIGEN_SOLVERS, libMesh::LASPACK_SOLVERS, libMesh::libmesh_ignore() , 以及 libMesh::TRILINOS_SOLVERS.
参考自 libMesh::DofMap::process_mesh_constraint_rows().
|
overridevirtualnoexcept |
clear() 在析构函数中调用,因此它不应该抛出异常。
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 503 行定义.
参考 libMesh::libMeshPrivateData::_is_initialized , 以及 libMesh::initialized().
|
overridevirtual |
克隆当前矩阵。
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 483 行定义.
|
overridevirtual |
完成任何挂起的插入或添加操作。
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 983 行定义.
参考自 libMesh::PetscMatrix< T >::_get_submatrix(), libMesh::PetscMatrix< T >::create_submatrix_nosort() , 以及 libMesh::PetscMatrix< T >::get_transpose().
|
overridevirtual |
检查矩阵是否已经关闭,即所有的插入和添加操作是否已经完成。
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 1390 行定义.
参考自 libMesh::PetscMatrix< T >::add().
|
inlinevirtualinherited |
此函数创建一个名为 "submatrix" 的矩阵,其定义由 "rows" 和 "cols" 条目中的行和列索引给定。 目前,此操作仅对 PetscMatrix 类型定义。 注意:rows
和 cols
向量需要排序; 如果 rows
和 cols
向量未排序,则使用下面的 nosort 版本; rows
和 cols
仅包含由此处理器拥有的索引。
在文件 sparse_matrix.h 第 388 行定义.
参考 libMesh::SparseMatrix< T >::_get_submatrix().
|
overridevirtual |
根据给定的 rows
和 cols
向量中的索引创建一个子矩阵,类似于 create_submatrix
函数。
submatrix | 存储创建的子矩阵。 |
rows | 定义子矩阵的行索引。 |
cols | 定义子矩阵的列索引。 |
rows
和 cols
可以是未排序的; 如果你的索引是排序的,使用上面的函数可以获得更好的效率; rows
和 cols
可以包含由其他处理器拥有的索引。 重载 libMesh::SparseMatrix< T > .
在文件 petsc_matrix.C 第 863 行定义.
参考 libMesh::SparseMatrix< T >::_is_initialized, libMesh::PetscMatrix< T >::_mat, libMesh::PetscMatrix< T >::close() , 以及 libMesh::closed().
|
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.
|
overridevirtual |
|
overridevirtual |
获取矩阵的对角线并将其存储在给定的向量中。
dest | 存储对角线的向量。 |
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 937 行定义.
参考 libMesh::PetscVector< T >::vec().
|
staticinherited |
Gets a string containing the reference information.
在文件 reference_counter.C 第 47 行定义.
参考 libMesh::ReferenceCounter::_counts.
参考自 libMesh::ReferenceCounter::print_info().
void libMesh::PetscMatrix< T >::get_local_size | ( | numeric_index_type & | m, |
numeric_index_type & | n | ||
) | const |
获取由该进程拥有的矩阵行数和列数。
m | 行大小。 |
n | 列大小。 |
在文件 petsc_matrix.C 第 1062 行定义.
|
overridevirtual |
获取矩阵中指定行的索引和值。
i | 行索引。 |
indices | 存储该行中非零元素的列索引的向量。 |
values | 存储该行中非零元素的值的向量。 |
重载 libMesh::SparseMatrix< T > .
在文件 petsc_matrix.C 第 1333 行定义.
参考 libMesh::closed() , 以及 libMesh::initialized().
|
overridevirtual |
获取矩阵的转置。
dest | 存储转置矩阵的对象。 |
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 950 行定义.
参考 libMesh::SparseMatrix< T >::_is_initialized, libMesh::PetscMatrix< T >::_mat, libMesh::SparseMatrix< T >::clear() , 以及 libMesh::PetscMatrix< T >::close().
|
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().
|
overridevirtual |
初始化 PETSc 矩阵。
m | 全局行数。 |
n | 全局列数。 |
m_l | 本地行数。 |
n_l | 本地列数。 |
nnz | 对角线部分本地子矩阵中每行的非零元素数。 |
noz | 非对角线部分本地子矩阵中每行的非零元素数。 |
blocksize | 多个相同类型变量的系统中,用于指示密集耦合块的可选值。 |
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 121 行定义.
参考 libMesh::libMeshPrivateData::_is_initialized, libMesh::AIJ, libMesh::HYPRE, libMesh::initialized(), libMesh::libmesh_ignore() , 以及 libMesh::zero.
void libMesh::PetscMatrix< T >::init | ( | const numeric_index_type | m, |
const numeric_index_type | n, | ||
const numeric_index_type | m_l, | ||
const numeric_index_type | n_l, | ||
const std::vector< numeric_index_type > & | n_nz, | ||
const std::vector< numeric_index_type > & | n_oz, | ||
const numeric_index_type | blocksize = 1 |
||
) |
初始化 PETSc 矩阵。
m | 全局行数。 |
n | 全局列数。 |
m_l | 本地行数。 |
n_l | 本地列数。 |
n_nz | 包含本地子矩阵对角线部分每行的非零元素数的数组。 |
n_oz | 包含本地子矩阵非对角线部分每行的非零元素数的数组。 |
blocksize | 多个相同类型变量的系统中,用于指示密集耦合块的可选值。 |
在文件 petsc_matrix.C 第 237 行定义.
参考 libMesh::libMeshPrivateData::_is_initialized, libMesh::AIJ, libMesh::HYPRE, libMesh::initialized(), libMesh::libmesh_ignore(), libMesh::numeric_petsc_cast() , 以及 libMesh::zero.
|
overridevirtual |
使用由 dof_map
计算的稀疏性结构初始化此矩阵。
type | 矩阵的串行/并行/幽灵类型 |
dof_map
计算的稀疏性结构初始化矩阵。 实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 379 行定义.
|
inlinevirtualinherited |
true,否则为
false。
在文件 sparse_matrix.h 第 102 行定义.
参考 libMesh::SparseMatrix< T >::_is_initialized.
参考自 libMesh::PetscMatrix< T >::_get_submatrix().
|
overridevirtual |
计算矩阵的 L1 范数。
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 522 行定义.
参考 libMesh::closed(), libMesh::initialized() , 以及 libMesh::Real.
|
overridevirtual |
计算矩阵的无穷范数。
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 545 行定义.
参考 libMesh::closed(), libMesh::initialized() , 以及 libMesh::Real.
|
finalvirtual |
获取由该进程拥有的矩阵行数。
重载 libMesh::SparseMatrix< T > .
在文件 petsc_matrix.C 第 1022 行定义.
numeric_index_type libMesh::PetscMatrix< T >::local_n | ( | ) | const |
获取由该进程拥有的矩阵列数。
在文件 petsc_matrix.C 第 1049 行定义.
|
overridevirtual |
|
inline |
返回原始的 PETSc 矩阵指针。
在文件 petsc_matrix.h 第 455 行定义.
参考 libMesh::PetscMatrix< T >::_mat.
|
overridevirtual |
计算 Y = A*X,其中 A 是当前矩阵,X 是另一个矩阵。
X | 输入矩阵。 |
Y | 结果矩阵。 |
reuse | 如果 this->_mat 和 X 有相同的非零模式,并且 Y 是从之前对此函数的调用中获得的,则设置为 true。 |
重载 libMesh::SparseMatrix< T > .
在文件 petsc_matrix.C 第 1185 行定义.
参考 libMesh::initialized() , 以及 libMesh::SparseMatrix< T >::m().
|
overridevirtual |
|
inlinestaticinherited |
Prints the number of outstanding (created, but not yet destroyed) objects.
在文件 reference_counter.h 第 85 行定义.
参考 libMesh::ReferenceCounter::_n_objects.
参考自 libMesh::LibMeshInit::~LibMeshInit().
|
inlinevirtualinherited |
true。
这对于 LaspackMatrix
是 true,但对于 PetscMatrix
是 false。 在不需要完整图形的情况下,我们可以有效地近似它以提供对稀疏矩阵所需大小的良好估计。
被 libMesh::EpetraMatrix< T > , 以及 libMesh::LaspackMatrix< T > 重载.
在文件 sparse_matrix.h 第 126 行定义.
参考自 libMesh::DofMap::attach_matrix() , 以及 libMesh::DofMap::update_sparsity_pattern().
|
overridevirtual |
获取矩阵中特定位置的值。
i | 行索引。 |
j | 列索引。 |
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 1276 行定义.
参考 libMesh::closed() , 以及 libMesh::initialized().
|
delete |
|
delete |
|
inherited |
在文件 sparse_matrix.C 第 117 行定义.
参考 std::imag() , 以及 std::real().
|
inherited |
将矩阵的内容以统一的样式打印到屏幕上,而不考虑正在使用的矩阵/求解器包。
在文件 sparse_matrix.C 第 225 行定义.
参考自 libMesh::EigenSparseMatrix< T >::print_personal() , 以及 libMesh::LaspackMatrix< T >::print_personal().
|
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().
|
overridevirtual |
将矩阵内容以 MATLAB 格式打印出来。
name | 输出的矩阵名称,默认为空字符串。 |
重载 libMesh::SparseMatrix< T > .
在文件 petsc_matrix.C 第 568 行定义.
参考 libMesh::closed(), libMesh::WrappedPetsc< T >::get() , 以及 libMesh::initialized().
|
overridevirtual |
使用 PETSc 查看器将矩阵的内容打印到屏幕。 由于我们限制了一个 PETSc 实现,所以此函数仅允许打印到标准输出。
os | 要写入的输出流,默认为 libMesh::out。 |
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 635 行定义.
参考 libMesh::closed(), libMesh::initialized() , 以及 mkstemp().
|
inlinevirtualinherited |
此函数与上述函数类似,但允许您重用 "submatrix" 的现有稀疏性模式,而不是再次分配它。 如果经常提取相同大小的子矩阵,这应该更有效。
在文件 sparse_matrix.h 第 415 行定义.
参考 libMesh::SparseMatrix< T >::_get_submatrix().
void libMesh::PetscMatrix< T >::reset_preallocation | ( | ) |
|
overridevirtual |
获取本地处理的行的起始索引。
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 1077 行定义.
参考 libMesh::initialized() , 以及 libMesh::MacroFunctions::stop().
|
overridevirtual |
获取本地处理的行的结束索引。
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 1093 行定义.
参考 libMesh::initialized() , 以及 libMesh::MacroFunctions::stop().
|
overridevirtual |
设置矩阵中特定位置的值。
i | 行索引。 |
j | 列索引。 |
value | 要设置的值。 |
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 1109 行定义.
|
virtual |
设置析构时是否删除 Mat 对象。如果设置为 false,则允许 PETSc 管理它。
destroy | 如果为 true,则析构时删除 Mat 对象;如果为 false,则不删除。 |
在文件 petsc_matrix.C 第 1404 行定义.
void libMesh::PetscMatrix< T >::set_matrix_type | ( | PetscMatrixType | mat_type | ) |
设置矩阵的类型(如稀疏矩阵类型)。
mat_type | 矩阵的类型。 |
在文件 petsc_matrix.C 第 115 行定义.
void libMesh::PetscMatrix< T >::swap | ( | PetscMatrix< T > & | m_in | ) |
交换两个 PetscMatrix 的内部数据指针,不交换实际值。
matrix | 要交换的另一个 PetscMatrix 对象。 |
在文件 petsc_matrix.C 第 1411 行定义.
参考 libMesh::PetscMatrix< T >::_destroy_mat_on_exit , 以及 libMesh::PetscMatrix< T >::_mat.
void libMesh::PetscMatrix< T >::update_preallocation_and_zero | ( | ) |
更新基于 dof_map
的稀疏模式,并将矩阵置零。这在稀疏模式在计算过程中发生变化的情况下很有用。
在文件 petsc_matrix.C 第 396 行定义.
|
inlinevirtualinherited |
更新矩阵的稀疏性模式。当您的 SparseMatrix<T>
实现不需要此数据时, 只需不覆盖此方法。
被 libMesh::EpetraMatrix< T > , 以及 libMesh::LaspackMatrix< T > 重载.
在文件 sparse_matrix.h 第 133 行定义.
|
inherited |
将矩阵乘以 NumericVector arg
并将结果存储在 NumericVector dest
中。
dest | 存储结果的目标 NumericVector。 |
arg | 乘法的源 NumericVector。 |
arg
并将结果存储在 dest
中。 在文件 sparse_matrix.C 第 195 行定义.
参考 libMesh::NumericVector< T >::zero().
|
inherited |
将矩阵乘以 NumericVector arg
,并将结果添加到 NumericVector dest
中。
在文件 sparse_matrix.C 第 205 行定义.
|
overridevirtual |
|
overridevirtual |
创建一个新的空矩阵,并将其所有元素置为零。
实现了 libMesh::SparseMatrix< T >.
在文件 petsc_matrix.C 第 461 行定义.
|
overridevirtual |
将指定行的所有元素置为零,并在对角线位置放置一个指定值。
rows | 要置零的行的索引。 |
diag_value | 对角线上要放置的值,默认为 0.0。 |
重载 libMesh::SparseMatrix< T > .
在文件 petsc_matrix.C 第 438 行定义.
参考 libMesh::initialized(), libMesh::numeric_petsc_cast() , 以及 libMesh::PS().
|
staticprotectedinherited |
Actually holds the data.
在文件 reference_counter.h 第 124 行定义.
|
private |
此布尔值仅应在接受 PETSc Mat 对象的构造函数中设置为 false。
在文件 petsc_matrix.h 第 508 行定义.
|
protectedinherited |
与此对象关联的 DofMap
对象。可以查询其在处理器上的自由度计数。
在文件 sparse_matrix.h 第 494 行定义.
|
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().
|
protectedinherited |
标志,指示矩阵是否已初始化。
在文件 sparse_matrix.h 第 505 行定义.
参考自 libMesh::PetscMatrix< T >::_get_submatrix(), libMesh::PetscMatrix< T >::create_submatrix_nosort(), libMesh::EpetraMatrix< T >::EpetraMatrix(), libMesh::PetscMatrix< T >::get_transpose(), libMesh::SparseMatrix< T >::initialized() , 以及 libMesh::PetscMatrix< T >::PetscMatrix().
|
private |
用于存储值的 PETSc 矩阵数据类型。
在文件 petsc_matrix.h 第 503 行定义.
参考自 libMesh::PetscMatrix< T >::_get_submatrix(), libMesh::PetscMatrix< T >::add(), libMesh::PetscMatrix< T >::create_submatrix_nosort(), libMesh::PetscMatrix< T >::get_transpose(), libMesh::PetscMatrix< T >::mat(), libMesh::PetscMatrix< T >::PetscMatrix() , 以及 libMesh::PetscMatrix< T >::swap().
|
private |
存储 PETSc 矩阵的类型。
在文件 petsc_matrix.h 第 513 行定义.
|
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().
|
mutableprivate |
用于线程安全的互斥锁(C++11 线程)。
在文件 petsc_matrix.h 第 519 行定义.
|
mutableprivate |
用于线程安全的旋转锁。
在文件 petsc_matrix.h 第 524 行定义.
|
protectedinherited |
与此对象关联的 sparsity
pattern。在需要时, 应查询其入口计数(或使用 need_full_sparsity_pattern,模式)。
在文件 sparse_matrix.h 第 500 行定义.