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

这个类为基于laspackc的串行向量数据结构提供了一个很好的接口。 所有被覆盖的虚函数都记录在numeric_vector.h中。 更多...

#include <laspack_matrix.h>

类 libMesh::LaspackVector< T > 继承关系图:
[图例]

Public 成员函数

 LaspackVector (const Parallel::Communicator &comm, const ParallelType=AUTOMATIC)
 Dummy-Constructor. 更多...
 
 LaspackVector (const Parallel::Communicator &comm, const numeric_index_type n, const ParallelType=AUTOMATIC)
 Constructor. 更多...
 
 LaspackVector (const Parallel::Communicator &comm, const numeric_index_type n, const numeric_index_type n_local, const ParallelType=AUTOMATIC)
 Constructor. 更多...
 
 LaspackVector (const Parallel::Communicator &comm, const numeric_index_type N, const numeric_index_type n_local, const std::vector< numeric_index_type > &ghost, const ParallelType=AUTOMATIC)
 Constructor. 更多...
 
LaspackVector< T > & operator= (const LaspackVector< T > &v)
 Copy assignment operator. 更多...
 
 LaspackVector (LaspackVector &&)=delete
 This class manages a C-style struct (QVector) manually, so we don't want to allow any automatic copy/move functions to be generated, and we can't default the destructor. 更多...
 
 LaspackVector (const LaspackVector &)=delete
 
LaspackVectoroperator= (LaspackVector &&)=delete
 
virtual ~LaspackVector ()
 LaspackVector 对象的析构函数。 更多...
 
virtual void close () override
 Close the vector. 更多...
 
virtual void clear () override
 Clear the vector. 更多...
 
virtual void zero () override
 Set all elements of the vector to zero. 更多...
 
virtual std::unique_ptr
< NumericVector< T > > 
zero_clone () const override
 创建并返回一个指向该对象的零克隆的 unique_ptr。 更多...
 
virtual std::unique_ptr
< NumericVector< T > > 
clone () const override
 创建并返回一个指向该对象的克隆的 unique_ptr。 更多...
 
virtual void init (const numeric_index_type N, const numeric_index_type n_local, const bool fast=false, const ParallelType ptype=AUTOMATIC) override
 使用给定的全局大小和局部大小初始化向量。 更多...
 
virtual void init (const numeric_index_type N, const bool fast=false, const ParallelType ptype=AUTOMATIC) override
 使用给定的全局大小初始化向量。 更多...
 
virtual void init (const numeric_index_type N, const numeric_index_type n_local, const std::vector< numeric_index_type > &ghost, const bool fast=false, const ParallelType=AUTOMATIC) override
 使用给定的全局大小、局部大小和 ghost 参数指定的索引初始化向量,并为其保留内存。 更多...
 
virtual void init (const NumericVector< T > &other, const bool fast=false) override
 使用另一个向量的内容初始化向量。 更多...
 
virtual NumericVector< T > & operator= (const T s) override
 将标量值赋给向量的所有元素。 更多...
 
virtual NumericVector< T > & operator= (const NumericVector< T > &v) override
 将一个向量的内容赋值给另一个向量。 更多...
 
virtual NumericVector< T > & operator= (const std::vector< T > &v) override
 将一个 std::vector 的内容赋给向量。 更多...
 
virtual Real min () const override
 返回向量的最小元素。 更多...
 
virtual Real max () const override
 返回向量的最大元素。 更多...
 
virtual T sum () const override
 返回向量的所有元素之和。 更多...
 
virtual Real l1_norm () const override
 返回向量的 L1 范数。 更多...
 
virtual Real l2_norm () const override
 返回向量的 L2 范数。 更多...
 
virtual Real linfty_norm () const override
 返回向量的 Linfinity 范数。 更多...
 
virtual numeric_index_type size () const override
 返回向量的大小(全局维度)。 更多...
 
virtual numeric_index_type local_size () const override
 返回向量的局部大小(局部维度)。 更多...
 
virtual numeric_index_type first_local_index () const override
 返回向量的第一个局部索引。 更多...
 
virtual numeric_index_type last_local_index () const override
 返回向量的最后一个局部索引。 更多...
 
virtual T operator() (const numeric_index_type i) const override
 返回指定索引处向量的值。 更多...
 
virtual NumericVector< T > & operator+= (const NumericVector< T > &v) override
 将另一个向量的元素按元素加到该向量。 更多...
 
virtual NumericVector< T > & operator-= (const NumericVector< T > &v) override
 将另一个向量的元素按元素从该向量中减去。 更多...
 
virtual NumericVector< T > & operator*= (const NumericVector< T > &v) override
 将该向量的元素按元素与另一个向量的元素相乘。 更多...
 
virtual NumericVector< T > & operator/= (const NumericVector< T > &v) override
 将该向量的元素按元素除以另一个向量的元素。 更多...
 
virtual void reciprocal () override
 计算向量中所有元素的倒数(1/x)。 更多...
 
virtual void conjugate () override
 计算向量中所有元素的复共轭。 更多...
 
virtual void set (const numeric_index_type i, const T value) override
 设置指定索引处的元素值。 更多...
 
virtual void add (const numeric_index_type i, const T value) override
 将指定值添加到指定索引处的元素。 更多...
 
virtual void add (const T s) override
 将指定的标量值添加到向量的每个元素。 更多...
 
virtual void add (const NumericVector< T > &v) override
 将另一个向量的元素按元素加到该向量。 更多...
 
virtual void add (const T a, const NumericVector< T > &v) override
 将另一个向量的元素按元素乘以标量值并添加到该向量。 更多...
 
virtual void add_vector (const NumericVector< T > &v, const SparseMatrix< T > &A) override
 将一个向量添加到该向量并将结果存储在其中。 更多...
 
virtual void add_vector_transpose (const NumericVector< T > &v, const SparseMatrix< T > &A) override
 将一个向量的转置添加到该向量并将结果存储在其中。 更多...
 
virtual void scale (const T factor) override
 缩放向量的所有元素,将它们乘以指定的标量因子。 更多...
 
virtual void abs () override
 计算向量的每个元素的绝对值。 更多...
 
virtual T dot (const NumericVector< T > &v) const override
 计算向量与另一个向量的点积。 更多...
 
virtual void localize (std::vector< T > &v_local) const override
 将向量的元素本地化,以便在不同处理器之间交换。 更多...
 
virtual void localize (NumericVector< T > &v_local) const override
 将向量的元素本地化,以便在不同处理器之间交换。 更多...
 
virtual void localize (NumericVector< T > &v_local, const std::vector< numeric_index_type > &send_list) const override
 将向量的元素本地化,以便在不同处理器之间交换,但仅发送指定的索引。 更多...
 
virtual void localize (std::vector< T > &v_local, const std::vector< numeric_index_type > &indices) const override
 将向量的元素本地化,以便在不同处理器之间交换,但仅发送指定的索引。 更多...
 
virtual void localize (const numeric_index_type first_local_idx, const numeric_index_type last_local_idx, const std::vector< numeric_index_type > &send_list) override
 本地化向量的一部分,以便在不同处理器之间交换,但仅发送指定的索引。 更多...
 
virtual void localize_to_one (std::vector< T > &v_local, const processor_id_type proc_id=0) const override
 将向量本地化到指定处理器。 更多...
 
virtual void pointwise_mult (const NumericVector< T > &vec1, const NumericVector< T > &vec2) override
 对向量的每个元素执行逐元素乘法。 更多...
 
virtual void pointwise_divide (const NumericVector< T > &vec1, const NumericVector< T > &vec2) override
 对向量的每个元素执行逐元素除法。 更多...
 
virtual void swap (NumericVector< T > &v) override
 交换两个向量的内容。 更多...
 
virtual std::size_t max_allowed_id () const override
 获取允许的最大ID(索引)。 更多...
 
virtual bool initialized () const
 检查向量是否已经初始化。 更多...
 
ParallelType type () const
 获取向量的类型。 更多...
 
ParallelType & type ()
 获取向量的类型。 更多...
 
virtual bool closed () const
 检查向量是否已经关闭并准备好进行计算。 更多...
 
virtual Real subset_l1_norm (const std::set< numeric_index_type > &indices) const
 获取指定条目的向量的 $ \ell_1 $-范数,即指定条目的绝对值之和。 更多...
 
virtual Real subset_l2_norm (const std::set< numeric_index_type > &indices) const
 获取指定条目的向量的 $ \ell_2 $-范数,即指定条目平方和的平方根。 更多...
 
virtual Real subset_linfty_norm (const std::set< numeric_index_type > &indices) const
 获取指定条目的向量的最大绝对值,即指定条目的 $ \ell_{\infty} $-范数。 更多...
 
Real l2_norm_diff (const NumericVector< T > &other_vec) const
 获取 $ \ell_2 $-范数的向量差值 $ \vec{u} - \vec{v} $, 其中 $ \vec{u} $this。 更多...
 
virtual T el (const numeric_index_type i) const
 获取向量的第 i 个条目。 更多...
 
virtual void get (const std::vector< numeric_index_type > &index, T *values) const
 一次访问多个组件。 values 将 *不会* 重新分配空间;它应该已经具有足够的空间。 默认实现对每个索引调用 operator() ,但某些实现可能在此处提供更快的方法。 更多...
 
void get (const std::vector< numeric_index_type > &index, std::vector< T > &values) const
 一次访问多个组件。 values 将被调整大小,如果需要,将被填充。 默认实现对每个索引调用 operator() ,但某些实现可能在此处提供更快的方法。 更多...
 
NumericVector< T > & operator*= (const T a)
 将向量缩放为 a$ \vec{u} \leftarrow a\vec{u} $。等价于 u.scale(a)。 更多...
 
NumericVector< T > & operator/= (const T a)
 将向量缩放为 1/a$ \vec{u} \leftarrow \frac{1}{a}\vec{u} $。等价于 u.scale(1. 更多...
 
virtual void add_vector (const T *v, const std::vector< numeric_index_type > &dof_indices)
 计算 $ \vec{u} \leftarrow \vec{u} + \vec{v} $,其中 v 是一个指针, 每个 dof_indices[i] 指定了要添加的值 v[i] 的位置。 这应该在子类中进行重写以提高效率。请注意,此方法的库实现是线程安全的。 更多...
 
void add_vector (const std::vector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 计算 $ \vec{u} \leftarrow \vec{u} + \vec{v} $,其中 v 是一个 std::vector, 每个 dof_indices[i] 指定了要添加的值 v[i] 的位置 默认实现对每个索引调用 operator() ,但某些实现可能在此处提供更快的方法。 请注意,此方法的库实现是线程安全的。 更多...
 
void add_vector (const NumericVector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 计算 $ \vec{u} \leftarrow \vec{u} + \vec{v} $,其中 v 是一个 NumericVector, 每个 dof_indices[i] 指定了要添加的值 v(i) 的位置。此方法是线程安全的。 更多...
 
void add_vector (const DenseVector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 计算 $ \vec{u} \leftarrow \vec{u} + \vec{v} $,其中 v 是一个 DenseVector, 每个 dof_indices[i] 指定了要添加的值 v(i) 的位置。此方法是线程安全的。 更多...
 
void add_vector (const NumericVector< T > &v, const ShellMatrix< T > &A)
 计算 $ \vec{u} \leftarrow \vec{u} + A \vec{v} $, 即将 ShellMatrix ANumericVector v 的乘积添加到 this。 更多...
 
virtual void insert (const T *v, const std::vector< numeric_index_type > &dof_indices)
 v 的条目插入到 *this 中,位置由 dof_indices 指定。请注意,此方法的库实现是线程安全的。 更多...
 
void insert (const NumericVector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 v 的条目插入到 *this 中,位置由 v 指定。 只要使用 NumericVector 的库实现,此方法是线程安全的。 更多...
 
void insert (const DenseVector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 v 的条目插入到 *this 中,位置由 v 指定。 只要使用 NumericVector 的库实现,此方法是线程安全的。 更多...
 
void insert (const DenseSubVector< T > &v, const std::vector< numeric_index_type > &dof_indices)
 v 的条目插入到 *this 中,位置由 v 指定。 只要使用 NumericVector 的库实现,此方法是线程安全的。 更多...
 
virtual int compare (const NumericVector< T > &other_vector, const Real threshold=TOLERANCE) const
 比较 thisother_vector 的等效性,(在给定的 threshold 内) 如果等效则返回 -1 ,或者返回第一个索引,其中 abs(a[i]-b[i]) 超过阈值。 更多...
 
virtual int local_relative_compare (const NumericVector< T > &other_vector, const Real threshold=TOLERANCE) const
 比较该向量与另一个向量的局部相对差异。 更多...
 
virtual void print (std::ostream &os=libMesh::out) const
 打印本地向量的内容,默认输出到 libMesh::out 流。 更多...
 
template<>
void print (std::ostream &os) const
 
virtual void print_global (std::ostream &os=libMesh::out) const
 打印全局向量的内容,默认输出到 libMesh::out 流。 更多...
 
template<>
void print_global (std::ostream &os) const
 
virtual void print_matlab (const std::string &="") const
 以Matlab的稀疏矩阵格式打印向量内容。可选择将向量打印到名为 name 的文件中。 如果未指定 name,则内容将被打印到屏幕上。 更多...
 
virtual void create_subvector (NumericVector< T > &subvector, const std::vector< numeric_index_type > &rows) const
 使用 rows 中的索引从该向量中填充 subvector。类似于 SparseMatrix 类的 create_submatrix() 函数, 当前仅对 PetscVectors 实现了此功能。 更多...
 
bool readable () const
 检查该向量是否能够用于全局操作。 更多...
 
bool compatible (const NumericVector< T > &v) const
 检查该向量和向量 v 是否能够一起用于全局操作。 更多...
 

静态 Public 成员函数

static std::unique_ptr
< NumericVector< T > > 
build (const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
 构建一个 NumericVector 对象。 更多...
 
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 属性

bool _is_closed
 用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。 更多...
 
bool _is_initialized
 在调用 init() 后设置为 true。 更多...
 
ParallelType _type
 向量的类型。 更多...
 
std::mutex _numeric_vector_mutex
 用于执行线程安全操作的互斥锁。 更多...
 

静态 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 属性

QVector _vec
 用于保存向量条目的实际 Laspack 向量数据类型。 更多...
 

友元

class LaspackLinearSolver< T >
 使其他 Laspack 数据类型成为友元类,以便它们可以访问私有成员。 更多...
 

详细描述

template<typename T>
class libMesh::LaspackVector< T >

这个类为基于laspackc的串行向量数据结构提供了一个很好的接口。 所有被覆盖的虚函数都记录在numeric_vector.h中。

作者
Benjamin S. Kirk
日期
2002

在文件 laspack_matrix.h42 行定义.

成员类型定义说明

typedef std::map<std::string, std::pair<unsigned int, unsigned int> > libMesh::ReferenceCounter::Counts
protectedinherited

Data structure to log the information.

The log is identified by the class name.

在文件 reference_counter.h119 行定义.

构造及析构函数说明

template<typename T >
libMesh::LaspackVector< T >::LaspackVector ( const Parallel::Communicator &  comm,
const ParallelType  ptype = AUTOMATIC 
)
inlineexplicit

Dummy-Constructor.

使用通信器 comm 和并行类型 ptype 创建 LaspackVector 对象,维度为 0。

Dimension=0 创建一个维度为0的 LaspackVector 对象。

参数
comm通信器对象,用于并行计算。
parallel_type并行类型,默认为 AUTOMATIC。

在文件 laspack_vector.h552 行定义.

参考 libMesh::NumericVector< T >::_type.

554  : NumericVector<T>(comm, ptype)
555 {
556  this->_type = ptype;
557 }
ParallelType _type
向量的类型。
template<typename T >
libMesh::LaspackVector< T >::LaspackVector ( const Parallel::Communicator &  comm,
const numeric_index_type  n,
const ParallelType  ptype = AUTOMATIC 
)
inlineexplicit

Constructor.

使用通信器 comm 和维度 n,初始化 LaspackVector 对象并将所有元素初始化为零。

Set dimension to n and initialize all elements with zero. 构造函数。将向量维度设置为 n 并将所有元素初始化为零。

参数
comm通信器对象,用于并行计算。
n向量的全局维度。
parallel_type并行类型,默认为 AUTOMATIC。

在文件 laspack_vector.h565 行定义.

参考 libMesh::LaspackVector< T >::init().

568  : NumericVector<T>(comm, ptype)
569 {
570  this->init(n, n, false, ptype);
571 }
virtual void init(const numeric_index_type N, const numeric_index_type n_local, const bool fast=false, const ParallelType ptype=AUTOMATIC) override
使用给定的全局大小和局部大小初始化向量。
template<typename T >
libMesh::LaspackVector< T >::LaspackVector ( const Parallel::Communicator &  comm,
const numeric_index_type  n,
const numeric_index_type  n_local,
const ParallelType  ptype = AUTOMATIC 
)
inline

Constructor.

使用通信器 comm、维度 n、本地维度 n_local 初始化 LaspackVector 对象并将所有元素初始化为零。

Set local dimension to n_local, the global dimension to n, and initialize all elements with zero. 构造函数。将向量的局部维度设置为 n_local,全局维度设置为 n,并将所有元素初始化为零。

参数
comm通信器对象,用于并行计算。
n向量的全局维度。
n_local向量的局部维度。
parallel_type并行类型,默认为 AUTOMATIC。

在文件 laspack_vector.h579 行定义.

参考 libMesh::LaspackVector< T >::init().

583  : NumericVector<T>(comm, ptype)
584 {
585  this->init(n, n_local, false, ptype);
586 }
virtual void init(const numeric_index_type N, const numeric_index_type n_local, const bool fast=false, const ParallelType ptype=AUTOMATIC) override
使用给定的全局大小和局部大小初始化向量。
template<typename T >
libMesh::LaspackVector< T >::LaspackVector ( const Parallel::Communicator &  comm,
const numeric_index_type  N,
const numeric_index_type  n_local,
const std::vector< numeric_index_type > &  ghost,
const ParallelType  ptype = AUTOMATIC 
)
inline

Constructor.

使用通信器 comm、维度 N、本地维度 n_local 和幽灵元素索引 ghost 初始化 LaspackVector 对象。

Set local dimension to n_local, the global dimension to n, but additionally reserve memory for the indices specified by the ghost argument. 构造函数。将向量的局部维度设置为 n_local,全局维度设置为 n,同时为 ghost 参数指定的索引保留内存。

参数
comm通信器对象,用于并行计算。
N向量的全局维度。
n_local向量的局部维度。
ghost要为其保留内存的索引。
parallel_type并行类型,默认为 AUTOMATIC。

在文件 laspack_vector.h594 行定义.

参考 libMesh::LaspackVector< T >::init().

599  : NumericVector<T>(comm, ptype)
600 {
601  this->init(N, n_local, ghost, false, ptype);
602 }
virtual void init(const numeric_index_type N, const numeric_index_type n_local, const bool fast=false, const ParallelType ptype=AUTOMATIC) override
使用给定的全局大小和局部大小初始化向量。
template<typename T>
libMesh::LaspackVector< T >::LaspackVector ( LaspackVector< T > &&  )
delete

This class manages a C-style struct (QVector) manually, so we don't want to allow any automatic copy/move functions to be generated, and we can't default the destructor.

由于这个类手动管理 C 风格的结构体 (QVector),因此不希望生成任何自动生成的复制/移动函数,也不能默认析构函数。

template<typename T>
libMesh::LaspackVector< T >::LaspackVector ( const LaspackVector< T > &  )
delete
template<typename T >
libMesh::LaspackVector< T >::~LaspackVector ( )
inlinevirtual

LaspackVector 对象的析构函数。

在文件 laspack_vector.h610 行定义.

611 {
612  this->clear ();
613 }
virtual void clear() override
Clear the vector.

成员函数说明

template<typename T >
void libMesh::LaspackVector< T >::abs ( )
overridevirtual

计算向量的每个元素的绝对值。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C298 行定义.

参考 std::abs() , 以及 libMesh::initialized().

299 {
300  libmesh_assert (this->initialized());
301 
302  const numeric_index_type n = this->size();
303 
304  for (numeric_index_type i=0; i!=n; ++i)
305  this->set(i,std::abs((*this)(i)));
306 }
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual void set(const numeric_index_type i, const T value) override
设置指定索引处的元素值。
virtual bool initialized() const
检查向量是否已经初始化。
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的绝对值。
Definition: type_vector.h:112
dof_id_type numeric_index_type
Definition: id_types.h:99
template<typename T >
void libMesh::LaspackVector< T >::add ( const numeric_index_type  i,
const T  value 
)
inlineoverridevirtual

将指定值添加到指定索引处的元素。

参数
i索引值。
value要添加的值。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h832 行定义.

参考 libMesh::initialized().

833 {
834  libmesh_assert (this->initialized());
835  libmesh_assert_less (i, this->size());
836 
837  std::scoped_lock lock(this->_numeric_vector_mutex);
838  V_AddCmp (&_vec, i+1, value);
839 
840 #ifndef NDEBUG
841  this->_is_closed = false;
842 #endif
843 }
std::mutex _numeric_vector_mutex
用于执行线程安全操作的互斥锁。
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual bool initialized() const
检查向量是否已经初始化。
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
bool _is_closed
用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。
template<typename T >
void libMesh::LaspackVector< T >::add ( const T  s)
overridevirtual

将指定的标量值添加到向量的每个元素。

参数
s要添加的标量值。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C211 行定义.

212 {
213 #ifndef NDEBUG
214  const bool was_closed = this->_is_closed;
215 #endif
216 
217  const numeric_index_type n = this->size();
218 
219  for (numeric_index_type i=0; i<n; i++)
220  this->add (i, v);
221 
222  // This is an embarrassingly parallel method, but set() isn't in
223  // general so set() overzealously marked us as non-closed
224 #ifndef NDEBUG
225  this->_is_closed = was_closed;
226 #endif
227 }
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
dof_id_type numeric_index_type
Definition: id_types.h:99
virtual void add(const numeric_index_type i, const T value) override
将指定值添加到指定索引处的元素。
bool _is_closed
用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。
template<typename T >
void libMesh::LaspackVector< T >::add ( const NumericVector< T > &  v)
overridevirtual

将另一个向量的元素按元素加到该向量。

参数
v要相加的向量。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C233 行定义.

234 {
235  this->add (1., v);
236 }
virtual void add(const numeric_index_type i, const T value) override
将指定值添加到指定索引处的元素。
template<typename T >
void libMesh::LaspackVector< T >::add ( const T  a,
const NumericVector< T > &  v 
)
overridevirtual

将另一个向量的元素按元素乘以标量值并添加到该向量。

参数
a用于乘法的标量值。
v要相加的向量。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C241 行定义.

参考 libMesh::LaspackVector< T >::size().

242 {
243  // Make sure the vector passed in is really a LaspackVector
244  const LaspackVector * v = cast_ptr<const LaspackVector *>(&v_in);
245 
246 #ifndef NDEBUG
247  const bool was_closed = this->_is_closed;
248 #endif
249 
250  libmesh_assert(v);
251  libmesh_assert_equal_to (this->size(), v->size());
252 
253  for (auto i : make_range(v->size()))
254  this->add (i, a*(*v)(i));
255 
256 #ifndef NDEBUG
257  this->_is_closed = was_closed;
258 #endif
259 }
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
LaspackVector(const Parallel::Communicator &comm, const ParallelType=AUTOMATIC)
Dummy-Constructor.
virtual void add(const numeric_index_type i, const T value) override
将指定值添加到指定索引处的元素。
bool _is_closed
用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。
template<typename T >
void libMesh::LaspackVector< T >::add_vector ( const NumericVector< T > &  v,
const SparseMatrix< T > &  A 
)
overridevirtual

将一个向量添加到该向量并将结果存储在其中。

参数
v要相加的向量。
A用于相加的稀疏矩阵。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C264 行定义.

参考 libMesh::LaspackVector< T >::_vec.

266 {
267  // Make sure the data passed in are really in Laspack types
268  const LaspackVector<T> * vec = cast_ptr<const LaspackVector<T> *>(&vec_in);
269  const LaspackMatrix<T> * mat = cast_ptr<const LaspackMatrix<T> *>(&mat_in);
270 
271  libmesh_assert(vec);
272  libmesh_assert(mat);
273 
274  // += mat*vec
275  AddAsgn_VV (&_vec, Mul_QV(const_cast<QMatrix*>(&mat->_QMat),
276  const_cast<QVector*>(&vec->_vec)));
277 }
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
template<typename T >
void libMesh::NumericVector< T >::add_vector ( const T *  v,
const std::vector< numeric_index_type > &  dof_indices 
)
virtualinherited

计算 $ \vec{u} \leftarrow \vec{u} + \vec{v} $,其中 v 是一个指针, 每个 dof_indices[i] 指定了要添加的值 v[i] 的位置。 这应该在子类中进行重写以提高效率。请注意,此方法的库实现是线程安全的。

参数
v一个指向值的指针。
dof_indices每个要添加值的位置的索引集合。

libMesh::PetscVector< T > , 以及 libMesh::EpetraVector< T > 重载.

在文件 numeric_vector.C379 行定义.

参考自 libMesh::SparseMatrix< T >::vector_mult_add().

381 {
382  libmesh_assert(v);
383 
384  for (auto i : index_range(dof_indices))
385  this->add (dof_indices[i], v[i]);
386 }
virtual void add(const numeric_index_type i, const T value)=0
将 value 添加到由 i 指定的向量条目。 请注意,此方法的库实现是线程安全的, 例如,将在写入向量之前锁定 _numeric_vector_mutex 。
template<typename T >
void libMesh::NumericVector< T >::add_vector ( const std::vector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)
inlineinherited

计算 $ \vec{u} \leftarrow \vec{u} + \vec{v} $,其中 v 是一个 std::vector, 每个 dof_indices[i] 指定了要添加的值 v[i] 的位置 默认实现对每个索引调用 operator() ,但某些实现可能在此处提供更快的方法。 请注意,此方法的库实现是线程安全的。

参数
v包含要添加的值的 std::vector。
dof_indices每个要添加值的位置的索引集合。

在文件 numeric_vector.h1041 行定义.

1043 {
1044  libmesh_assert(v.size() == dof_indices.size());
1045  if (!v.empty())
1046  this->add_vector(v.data(), dof_indices);
1047 }
virtual void add_vector(const T *v, const std::vector< numeric_index_type > &dof_indices)
计算 ,其中 v 是一个指针, 每个 dof_indices[i] 指定了要添加的值 v[i] 的位置。 这应该在子类中进行重写以提高效率。请注意,此方法的库实现是线程安全的。 ...
template<typename T >
void libMesh::NumericVector< T >::add_vector ( const NumericVector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)
inherited

计算 $ \vec{u} \leftarrow \vec{u} + \vec{v} $,其中 v 是一个 NumericVector, 每个 dof_indices[i] 指定了要添加的值 v(i) 的位置。此方法是线程安全的。

参数
v另一个数值向量。
dof_indices每个要添加值的位置的索引集合。

在文件 numeric_vector.C391 行定义.

参考 libMesh::NumericVector< T >::readable() , 以及 libMesh::NumericVector< T >::size().

393 {
394  libmesh_assert(v.readable());
395 
396  const std::size_t n = dof_indices.size();
397  libmesh_assert_equal_to(v.size(), n);
398  for (numeric_index_type i=0; i != n; i++)
399  this->add (dof_indices[i], v(i));
400 }
dof_id_type numeric_index_type
Definition: id_types.h:99
virtual void add(const numeric_index_type i, const T value)=0
将 value 添加到由 i 指定的向量条目。 请注意,此方法的库实现是线程安全的, 例如,将在写入向量之前锁定 _numeric_vector_mutex 。
template<typename T >
void libMesh::NumericVector< T >::add_vector ( const DenseVector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)
inlineinherited

计算 $ \vec{u} \leftarrow \vec{u} + \vec{v} $,其中 v 是一个 DenseVector, 每个 dof_indices[i] 指定了要添加的值 v(i) 的位置。此方法是线程安全的。

参数
v另一个数值向量。
dof_indices每个要添加值的位置的索引集合。

在文件 numeric_vector.h1053 行定义.

参考 libMesh::DenseVector< T >::empty() , 以及 libMesh::DenseVector< T >::size().

1055 {
1056  libmesh_assert(v.size() == dof_indices.size());
1057  if (!v.empty())
1058  this->add_vector(&v(0), dof_indices);
1059 }
virtual void add_vector(const T *v, const std::vector< numeric_index_type > &dof_indices)
计算 ,其中 v 是一个指针, 每个 dof_indices[i] 指定了要添加的值 v[i] 的位置。 这应该在子类中进行重写以提高效率。请注意,此方法的库实现是线程安全的。 ...
template<typename T >
void libMesh::NumericVector< T >::add_vector ( const NumericVector< T > &  v,
const ShellMatrix< T > &  A 
)
inherited

计算 $ \vec{u} \leftarrow \vec{u} + A \vec{v} $, 即将 ShellMatrix ANumericVector v 的乘积添加到 this。

参数
v另一个数值向量。
AShell 矩阵。

在文件 numeric_vector.C405 行定义.

参考 libMesh::ShellMatrix< T >::vector_mult_add().

407 {
408  libmesh_assert(this->compatible(v));
409 
410  a.vector_mult_add(*this,v);
411 }
bool compatible(const NumericVector< T > &v) const
检查该向量和向量 v 是否能够一起用于全局操作。
template<typename T >
void libMesh::LaspackVector< T >::add_vector_transpose ( const NumericVector< T > &  v,
const SparseMatrix< T > &  A 
)
overridevirtual

将一个向量的转置添加到该向量并将结果存储在其中。

参数
v要相加的向量的转置。
A用于相加的稀疏矩阵。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C281 行定义.

283 {
284  libmesh_not_implemented();
285 }
template<typename T >
std::unique_ptr< NumericVector< T > > libMesh::NumericVector< T >::build ( const Parallel::Communicator &  comm,
const SolverPackage  solver_package = libMesh::default_solver_package() 
)
staticinherited

构建一个 NumericVector 对象。

参数
comm通信器对象,表示通信方式。
solver_package线性求解器包的类型。
返回
指向构建的 NumericVector 对象的 unique_ptr。

在文件 numeric_vector.C50 行定义.

参考 libMesh::EIGEN_SOLVERS, libMesh::LASPACK_SOLVERS , 以及 libMesh::TRILINOS_SOLVERS.

参考自 libMesh::DiagonalMatrix< T >::DiagonalMatrix(), libMesh::DofMap::enforce_adjoint_constraints_exactly(), libMesh::DofMap::enforce_constraints_exactly(), libMesh::DofMap::enforce_constraints_on_residual() , 以及 libMesh::DofMap::process_mesh_constraint_rows().

51 {
52  // Build the appropriate vector
53  switch (solver_package)
54  {
55 
56 #ifdef LIBMESH_HAVE_LASPACK
57  case LASPACK_SOLVERS:
58  return std::make_unique<LaspackVector<T>>(comm, AUTOMATIC);
59 #endif
60 
61 #ifdef LIBMESH_HAVE_PETSC
62  case PETSC_SOLVERS:
63  return std::make_unique<PetscVector<T>>(comm, AUTOMATIC);
64 #endif
65 
66 #ifdef LIBMESH_TRILINOS_HAVE_EPETRA
67  case TRILINOS_SOLVERS:
68  return std::make_unique<EpetraVector<T>>(comm, AUTOMATIC);
69 #endif
70 
71 #ifdef LIBMESH_HAVE_EIGEN
72  case EIGEN_SOLVERS:
73  return std::make_unique<EigenSparseVector<T>>(comm, AUTOMATIC);
74 #endif
75 
76  default:
77  return std::make_unique<DistributedVector<T>>(comm, AUTOMATIC);
78  }
79 }
EIGEN_SOLVERS
Definition: libmesh.C:249
TRILINOS_SOLVERS
Definition: libmesh.C:247
LASPACK_SOLVERS
Definition: libmesh.C:251
template<typename T >
void libMesh::LaspackVector< T >::clear ( )
inlineoverridevirtual

Clear the vector.

清空向量,将所有元素设为零。

重载 libMesh::NumericVector< T > .

在文件 laspack_vector.h715 行定义.

参考 libMesh::libMeshPrivateData::_is_initialized , 以及 libMesh::initialized().

716 {
717  if (this->initialized())
718  {
719  V_Destr (&_vec);
720  }
721 
722  this->_is_initialized = false;
723 #ifndef NDEBUG
724  this->_is_closed = false;
725 #endif
726 }
bool _is_initialized
在调用 init() 后设置为 true。
virtual bool initialized() const
检查向量是否已经初始化。
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
bool _is_closed
用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。
template<typename T >
std::unique_ptr< NumericVector< T > > libMesh::LaspackVector< T >::clone ( ) const
inlineoverridevirtual

创建并返回一个指向该对象的克隆的 unique_ptr。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h756 行定义.

参考 libMesh::NumericVector< T >::init().

757 {
758  NumericVector<T> * cloned_vector = new LaspackVector<T>(this->comm());
759 
760  cloned_vector->init(*this, true);
761 
762  *cloned_vector = *this;
763 
764  return std::unique_ptr<NumericVector<T>>(cloned_vector);
765 }
template<typename T >
void libMesh::LaspackVector< T >::close ( )
inlineoverridevirtual

Close the vector.

关闭向量。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h702 行定义.

参考 libMesh::initialized().

703 {
704  libmesh_assert (this->initialized());
705 
706 #ifndef NDEBUG
707  this->_is_closed = true;
708 #endif
709 }
virtual bool initialized() const
检查向量是否已经初始化。
bool _is_closed
用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。
template<typename T>
virtual bool libMesh::NumericVector< T >::closed ( ) const
inlinevirtualinherited

检查向量是否已经关闭并准备好进行计算。

返回
如果向量已经关闭并准备好进行计算,则返回 true;否则返回 false。

在文件 numeric_vector.h180 行定义.

参考 libMesh::NumericVector< T >::_is_closed.

参考自 libMesh::DofMap::enforce_adjoint_constraints_exactly(), libMesh::DofMap::enforce_constraints_exactly(), libMesh::PetscVector< T >::localize(), libMesh::DofMap::max_constraint_error(), libMesh::EigenSparseVector< T >::operator=(), libMesh::LaspackVector< T >::operator=() , 以及 libMesh::PetscVector< T >::operator=().

180 { return _is_closed; }
bool _is_closed
用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。
template<typename T >
int libMesh::NumericVector< T >::compare ( const NumericVector< T > &  other_vector,
const Real  threshold = TOLERANCE 
) const
virtualinherited

比较 thisother_vector 的等效性,(在给定的 threshold 内) 如果等效则返回 -1 ,或者返回第一个索引,其中 abs(a[i]-b[i]) 超过阈值。

注解
"等效" 表示两个向量非常相似或几乎相同,其差异小于或等于给定的阈值。 这个阈值通常用于考虑浮点数精度问题,因为在计算机中,浮点数运算可能会导致微小的数值差异。 当两个向量被认为等效时,它们的差异小于或等于阈值。 具体来说,这是通过计算两个向量的每个元素之间的差异并将其与阈值进行比较来确定的。 如果两个向量的差异小于阈值,就可以说它们是等效的。 否则,如果差异大于阈值,就可以说它们不等效。
参数
other_vector另一个数值向量。
threshold阈值。
返回
如果向量等效则返回 -1 ,否则返回第一个不等效的索引。

在文件 numeric_vector.C109 行定义.

参考 std::abs().

111 {
112  libmesh_assert(this->compatible(other_vector));
113 
114  int first_different_i = std::numeric_limits<int>::max();
116 
117  while (first_different_i==std::numeric_limits<int>::max()
118  && i<last_local_index())
119  {
120  if (std::abs((*this)(i) - other_vector(i)) > threshold)
121  first_different_i = i;
122  else
123  i++;
124  }
125 
126  // Find the correct first differing index in parallel
127  this->comm().min(first_different_i);
128 
129  if (first_different_i == std::numeric_limits<int>::max())
130  return -1;
131 
132  return first_different_i;
133 }
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的绝对值。
Definition: type_vector.h:112
dof_id_type numeric_index_type
Definition: id_types.h:99
virtual numeric_index_type first_local_index() const =0
获取实际存储在该处理器上的第一个向量元素的索引。
virtual numeric_index_type last_local_index() const =0
获取实际存储在该处理器上的最后一个向量元素的索引+1。
bool compatible(const NumericVector< T > &v) const
检查该向量和向量 v 是否能够一起用于全局操作。
template<typename T >
bool libMesh::NumericVector< T >::compatible ( const NumericVector< T > &  v) const
inherited

检查该向量和向量 v 是否能够一起用于全局操作。

参数
v要比较的另一个向量。
返回
如果这两个向量可以一起用于全局操作,则返回 true,否则返回 false。

在文件 numeric_vector.C423 行定义.

参考 libMesh::NumericVector< T >::first_local_index(), libMesh::NumericVector< T >::last_local_index(), libMesh::NumericVector< T >::local_size(), libMesh::NumericVector< T >::readable() , 以及 libMesh::NumericVector< T >::size().

424 {
425  return this->readable() && v.readable() &&
426  this->size() == v.size() &&
427  this->local_size() == v.local_size() &&
428  this->first_local_index() == v.first_local_index() &&
429  this->last_local_index() == v.last_local_index();
430 }
virtual numeric_index_type size() const =0
获取向量的大小。
bool readable() const
检查该向量是否能够用于全局操作。
virtual numeric_index_type first_local_index() const =0
获取实际存储在该处理器上的第一个向量元素的索引。
virtual numeric_index_type local_size() const =0
获取向量的本地大小,即 index_stop - index_start。
virtual numeric_index_type last_local_index() const =0
获取实际存储在该处理器上的最后一个向量元素的索引+1。
template<typename T >
void libMesh::LaspackVector< T >::conjugate ( )
overridevirtual

计算向量中所有元素的复共轭。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C187 行定义.

参考 libMesh::libmesh_conj().

188 {
189  const numeric_index_type n = this->size();
190 
191 #ifndef NDEBUG
192  const bool was_closed = this->_is_closed;
193 #endif
194 
195  for (numeric_index_type i=0; i<n; i++)
196  {
197  T v = (*this)(i);
198 
199  this->set(i, libmesh_conj(v) );
200  }
201 
202  // This is an embarrassingly parallel method, but set() isn't in
203  // general so set() overzealously marked us as non-closed
204 #ifndef NDEBUG
205  this->_is_closed = was_closed;
206 #endif
207 }
T libmesh_conj(T a)
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual void set(const numeric_index_type i, const T value) override
设置指定索引处的元素值。
dof_id_type numeric_index_type
Definition: id_types.h:99
bool _is_closed
用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。
template<typename T>
virtual void libMesh::NumericVector< T >::create_subvector ( NumericVector< T > &  subvector,
const std::vector< numeric_index_type > &  rows 
) const
inlinevirtualinherited

使用 rows 中的索引从该向量中填充 subvector。类似于 SparseMatrix 类的 create_submatrix() 函数, 当前仅对 PetscVectors 实现了此功能。

参数
subvector要填充的子向量。
rows包含用于选择要填充到子向量的索引的向量。

libMesh::PetscVector< T > , 以及 libMesh::EpetraVector< T > 重载.

在文件 numeric_vector.h871 行定义.

873  {
874  libmesh_not_implemented();
875  }
void libMesh::ReferenceCounter::disable_print_counter_info ( )
staticinherited

在文件 reference_counter.C100 行定义.

参考 libMesh::ReferenceCounter::_enable_print_counter.

101 {
102  _enable_print_counter = false;
103  return;
104 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
template<typename T >
T libMesh::LaspackVector< T >::dot ( const NumericVector< T > &  v) const
overridevirtual

计算向量与另一个向量的点积。

参数
v用于计算点积的向量。
返回
点积的结果。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C309 行定义.

参考 libMesh::LaspackVector< T >::_vec , 以及 libMesh::initialized().

310 {
311  libmesh_assert (this->initialized());
312 
313  // Make sure the NumericVector passed in is really a LaspackVector
314  const LaspackVector<T> * v = cast_ptr<const LaspackVector<T> *>(&v_in);
315  libmesh_assert(v);
316 
317  return Mul_VV (const_cast<QVector*>(&(this->_vec)),
318  const_cast<QVector*>(&(v->_vec)));
319 }
virtual bool initialized() const
检查向量是否已经初始化。
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
template<typename T>
virtual T libMesh::NumericVector< T >::el ( const numeric_index_type  i) const
inlinevirtualinherited

获取向量的第 i 个条目。

参数
i要获取的条目的索引。
返回
第 i 个条目的值。

在文件 numeric_vector.h416 行定义.

416 { return (*this)(i); }
void libMesh::ReferenceCounter::enable_print_counter_info ( )
staticinherited

Methods to enable/disable the reference counter output from print_info()

在文件 reference_counter.C94 行定义.

参考 libMesh::ReferenceCounter::_enable_print_counter.

95 {
96  _enable_print_counter = true;
97  return;
98 }
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
template<typename T >
numeric_index_type libMesh::LaspackVector< T >::first_local_index ( ) const
inlineoverridevirtual

返回向量的第一个局部索引。

返回
向量的第一个局部索引。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h793 行定义.

参考 libMesh::initialized().

794 {
795  libmesh_assert (this->initialized());
796 
797  return 0;
798 }
virtual bool initialized() const
检查向量是否已经初始化。
template<typename T >
void libMesh::NumericVector< T >::get ( const std::vector< numeric_index_type > &  index,
T *  values 
) const
inlinevirtualinherited

一次访问多个组件。 values 将 *不会* 重新分配空间;它应该已经具有足够的空间。 默认实现对每个索引调用 operator() ,但某些实现可能在此处提供更快的方法。

参数
index要获取的索引集合。
values存储获取值的数组。

libMesh::PetscVector< T > 重载.

在文件 numeric_vector.h1012 行定义.

参考自 libMesh::DofMap::enforce_adjoint_constraints_exactly(), libMesh::DofMap::enforce_constraints_exactly(), libMesh::DofMap::enforce_constraints_on_residual() , 以及 libMesh::DofMap::max_constraint_error().

1014 {
1015  const std::size_t num = index.size();
1016  for (std::size_t i=0; i<num; i++)
1017  {
1018  values[i] = (*this)(index[i]);
1019  }
1020 }
template<typename T >
void libMesh::NumericVector< T >::get ( const std::vector< numeric_index_type > &  index,
std::vector< T > &  values 
) const
inlineinherited

一次访问多个组件。 values 将被调整大小,如果需要,将被填充。 默认实现对每个索引调用 operator() ,但某些实现可能在此处提供更快的方法。

参数
index要获取的索引集合。
values存储获取值的向量。

在文件 numeric_vector.h1026 行定义.

1028 {
1029  const std::size_t num = index.size();
1030  values.resize(num);
1031  if (!num)
1032  return;
1033 
1034  this->get(index, values.data());
1035 }
std::string libMesh::ReferenceCounter::get_info ( )
staticinherited

Gets a string containing the reference information.

在文件 reference_counter.C47 行定义.

参考 libMesh::ReferenceCounter::_counts.

参考自 libMesh::ReferenceCounter::print_info().

48 {
49 #if defined(LIBMESH_ENABLE_REFERENCE_COUNTING) && defined(DEBUG)
50 
51  std::ostringstream oss;
52 
53  oss << '\n'
54  << " ---------------------------------------------------------------------------- \n"
55  << "| Reference count information |\n"
56  << " ---------------------------------------------------------------------------- \n";
57 
58  for (const auto & [name, cd] : _counts)
59  oss << "| " << name << " reference count information:\n"
60  << "| Creations: " << cd.first << '\n'
61  << "| Destructions: " << cd.second << '\n';
62 
63  oss << " ---------------------------------------------------------------------------- \n";
64 
65  return oss.str();
66 
67 #else
68 
69  return "";
70 
71 #endif
72 }
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_constructor_count ( const std::string &  name)
inlineprotectednoexceptinherited

Increments the construction counter.

Should be called in the constructor of any derived class that will be reference counted.

在文件 reference_counter.h183 行定义.

参考 libMesh::err.

参考自 libMesh::ReferenceCountedObject< SparseMatrix< T > >::ReferenceCountedObject().

184 {
185  libmesh_try
186  {
187  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
188  std::pair<unsigned int, unsigned int> & p = _counts[name];
189  p.first++;
190  }
191  libmesh_catch (...)
192  {
193  auto stream = libMesh::err.get();
194  stream->exceptions(stream->goodbit); // stream must not throw
195  libMesh::err << "Encountered unrecoverable error while calling "
196  << "ReferenceCounter::increment_constructor_count() "
197  << "for a(n) " << name << " object." << std::endl;
198  std::terminate();
199  }
200 }
OStreamProxy err
static Counts _counts
Actually holds the data.
void libMesh::ReferenceCounter::increment_destructor_count ( const std::string &  name)
inlineprotectednoexceptinherited

Increments the destruction counter.

Should be called in the destructor of any derived class that will be reference counted.

在文件 reference_counter.h207 行定义.

参考 libMesh::err.

参考自 libMesh::ReferenceCountedObject< SparseMatrix< T > >::~ReferenceCountedObject().

208 {
209  libmesh_try
210  {
211  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
212  std::pair<unsigned int, unsigned int> & p = _counts[name];
213  p.second++;
214  }
215  libmesh_catch (...)
216  {
217  auto stream = libMesh::err.get();
218  stream->exceptions(stream->goodbit); // stream must not throw
219  libMesh::err << "Encountered unrecoverable error while calling "
220  << "ReferenceCounter::increment_destructor_count() "
221  << "for a(n) " << name << " object." << std::endl;
222  std::terminate();
223  }
224 }
OStreamProxy err
static Counts _counts
Actually holds the data.
template<typename T>
virtual void libMesh::LaspackVector< T >::init ( const numeric_index_type  N,
const numeric_index_type  n_local,
const bool  fast = false,
const ParallelType  ptype = AUTOMATIC 
)
overridevirtual

使用给定的全局大小和局部大小初始化向量。

参数
N向量的全局维度。
n_local向量的局部维度。
fast快速初始化标志,默认为 false。
ptype并行类型,默认为 AUTOMATIC。

实现了 libMesh::NumericVector< T >.

参考自 libMesh::LaspackVector< T >::LaspackVector().

template<typename T >
void libMesh::LaspackVector< T >::init ( const numeric_index_type  N,
const bool  fast = false,
const ParallelType  ptype = AUTOMATIC 
)
inlineoverridevirtual

使用给定的全局大小初始化向量。

参数
N向量的全局维度。
fast快速初始化标志,默认为 false。
ptype并行类型,默认为 AUTOMATIC。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h667 行定义.

670 {
671  this->init(n,n,fast,ptype);
672 }
virtual void init(const numeric_index_type N, const numeric_index_type n_local, const bool fast=false, const ParallelType ptype=AUTOMATIC) override
使用给定的全局大小和局部大小初始化向量。
template<typename T>
virtual void libMesh::LaspackVector< T >::init ( const numeric_index_type  N,
const numeric_index_type  n_local,
const std::vector< numeric_index_type > &  ghost,
const bool  fast = false,
const ParallelType  = AUTOMATIC 
)
overridevirtual

使用给定的全局大小、局部大小和 ghost 参数指定的索引初始化向量,并为其保留内存。

参数
N向量的全局维度。
n_local向量的局部维度。
ghost要为其保留内存的索引。
fast快速初始化标志,默认为 false。
ptype并行类型,默认为 AUTOMATIC。

实现了 libMesh::NumericVector< T >.

template<class T >
void libMesh::LaspackVector< T >::init ( const NumericVector< T > &  other,
const bool  fast = false 
)
overridevirtual

使用另一个向量的内容初始化向量。

参数
other要复制内容的向量。
fast快速初始化标志,默认为 false。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h692 行定义.

参考 libMesh::NumericVector< T >::local_size(), libMesh::NumericVector< T >::size() , 以及 libMesh::NumericVector< T >::type().

694 {
695  this->init(other.size(),other.local_size(),fast,other.type());
696 }
virtual void init(const numeric_index_type N, const numeric_index_type n_local, const bool fast=false, const ParallelType ptype=AUTOMATIC) override
使用给定的全局大小和局部大小初始化向量。
template<typename T>
virtual bool libMesh::NumericVector< T >::initialized ( ) const
inlinevirtualinherited

检查向量是否已经初始化。

返回
如果向量已经初始化,则返回 true;否则返回 false。

在文件 numeric_vector.h159 行定义.

参考 libMesh::NumericVector< T >::_is_initialized.

参考自 libMesh::PetscVector< T >::create_subvector() , 以及 libMesh::PetscVector< T >::init().

159 { return _is_initialized; }
bool _is_initialized
在调用 init() 后设置为 true。
template<typename T >
void libMesh::NumericVector< T >::insert ( const T *  v,
const std::vector< numeric_index_type > &  dof_indices 
)
virtualinherited

v 的条目插入到 *this 中,位置由 dof_indices 指定。请注意,此方法的库实现是线程安全的。

参数
v一个指向值的指针。
dof_indices每个要插入值的位置的索引集合。

libMesh::PetscVector< T > , 以及 libMesh::EpetraVector< T > 重载.

在文件 numeric_vector.C84 行定义.

86 {
87  libmesh_assert (v);
88 
89  for (auto i : index_range(dof_indices))
90  this->set (dof_indices[i], v[i]);
91 }
virtual void set(const numeric_index_type i, const T value)=0
设置 v(i) = value 。 请注意,此方法的库实现是线程安全的, 例如,将在写入向量之前锁定 _numeric_vector_mutex 。
template<typename T >
void libMesh::NumericVector< T >::insert ( const NumericVector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)
inherited

v 的条目插入到 *this 中,位置由 v 指定。 只要使用 NumericVector 的库实现,此方法是线程安全的。

参数
v一个数值向量。
dof_indices每个要插入值的位置的索引集合。

在文件 numeric_vector.C96 行定义.

参考 libMesh::NumericVector< T >::readable() , 以及 libMesh::NumericVector< T >::size().

98 {
99  libmesh_assert_equal_to (V.size(), dof_indices.size());
100  libmesh_assert (V.readable());
101 
102  for (auto i : index_range(dof_indices))
103  this->set (dof_indices[i], V(i));
104 }
virtual void set(const numeric_index_type i, const T value)=0
设置 v(i) = value 。 请注意,此方法的库实现是线程安全的, 例如,将在写入向量之前锁定 _numeric_vector_mutex 。
template<typename T >
void libMesh::NumericVector< T >::insert ( const DenseVector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)
inlineinherited

v 的条目插入到 *this 中,位置由 v 指定。 只要使用 NumericVector 的库实现,此方法是线程安全的。

参数
v一个 DenseVector。
dof_indices每个要插入值的位置的索引集合。

在文件 numeric_vector.h1077 行定义.

参考 libMesh::DenseVector< T >::empty() , 以及 libMesh::DenseVector< T >::size().

1079 {
1080  libmesh_assert(v.size() == dof_indices.size());
1081  if (!v.empty())
1082  this->insert(&v(0), dof_indices);
1083 }
virtual void insert(const T *v, const std::vector< numeric_index_type > &dof_indices)
将 v 的条目插入到 *this 中,位置由 dof_indices 指定。请注意,此方法的库实现是线程安全的。
template<typename T >
void libMesh::NumericVector< T >::insert ( const DenseSubVector< T > &  v,
const std::vector< numeric_index_type > &  dof_indices 
)
inlineinherited

v 的条目插入到 *this 中,位置由 v 指定。 只要使用 NumericVector 的库实现,此方法是线程安全的。

参数
v一个 DenseSubVector。
dof_indices每个要插入值的位置的索引集合。

在文件 numeric_vector.h1089 行定义.

参考 libMesh::DenseSubVector< T >::empty() , 以及 libMesh::DenseSubVector< T >::size().

1091 {
1092  libmesh_assert(v.size() == dof_indices.size());
1093  if (!v.empty())
1094  this->insert(&v(0), dof_indices);
1095 }
virtual void insert(const T *v, const std::vector< numeric_index_type > &dof_indices)
将 v 的条目插入到 *this 中,位置由 dof_indices 指定。请注意,此方法的库实现是线程安全的。
template<typename T >
Real libMesh::LaspackVector< T >::l1_norm ( ) const
overridevirtual

返回向量的 L1 范数。

返回
L1 范数的值。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C54 行定义.

参考 libMesh::closed() , 以及 libMesh::Real.

55 {
56  libmesh_assert (this->closed());
57 
58  return static_cast<Real>(l1Norm_V(const_cast<QVector*>(&_vec)));
59 }
virtual bool closed() const
检查向量是否已经关闭并准备好进行计算。
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
template<typename T >
Real libMesh::LaspackVector< T >::l2_norm ( ) const
overridevirtual

返回向量的 L2 范数。

返回
L2 范数的值。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C64 行定义.

参考 libMesh::closed() , 以及 libMesh::Real.

65 {
66  libmesh_assert (this->closed());
67 
68  return static_cast<Real>(l2Norm_V(const_cast<QVector*>(&_vec)));
69 }
virtual bool closed() const
检查向量是否已经关闭并准备好进行计算。
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
template<class T >
Real libMesh::NumericVector< T >::l2_norm_diff ( const NumericVector< T > &  other_vec) const
inherited

获取 $ \ell_2 $-范数的向量差值 $ \vec{u} - \vec{v} $, 其中 $ \vec{u} $this。

参数
other_vec另一个数值向量。
返回
$ \ell_2 $-范数的向量差值。

在文件 numeric_vector.C363 行定义.

参考 std::norm(), libMesh::TensorTools::norm_sq(), libMesh::Real , 以及 std::sqrt().

364 {
365  libmesh_assert(this->compatible(v));
366 
367  Real norm = 0;
368  for (const auto i : make_range(this->first_local_index(), this->last_local_index()))
369  norm += TensorTools::norm_sq((*this)(i) - v(i));
370 
371  this->comm().sum(norm);
372 
373  return std::sqrt(norm);
374 }
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的平方根。
Definition: type_vector.h:88
T norm_sq(std::complex< T > a)
Definition: tensor_tools.h:74
virtual numeric_index_type first_local_index() const =0
获取实际存储在该处理器上的第一个向量元素的索引。
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ADRealEigenVector< T, D, asd > norm(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的范数。
Definition: type_vector.h:64
virtual numeric_index_type last_local_index() const =0
获取实际存储在该处理器上的最后一个向量元素的索引+1。
bool compatible(const NumericVector< T > &v) const
检查该向量和向量 v 是否能够一起用于全局操作。
template<typename T >
numeric_index_type libMesh::LaspackVector< T >::last_local_index ( ) const
inlineoverridevirtual

返回向量的最后一个局部索引。

返回
向量的最后一个局部索引。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h804 行定义.

参考 libMesh::initialized().

805 {
806  libmesh_assert (this->initialized());
807 
808  return this->size();
809 }
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual bool initialized() const
检查向量是否已经初始化。
template<typename T >
Real libMesh::LaspackVector< T >::linfty_norm ( ) const
overridevirtual

返回向量的 Linfinity 范数。

返回
Linfinity 范数的值。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C74 行定义.

参考 libMesh::closed() , 以及 libMesh::Real.

75 {
76  libmesh_assert (this->closed());
77 
78  return static_cast<Real>(MaxNorm_V(const_cast<QVector*>(&_vec)));
79 }
virtual bool closed() const
检查向量是否已经关闭并准备好进行计算。
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
template<typename T >
int libMesh::NumericVector< T >::local_relative_compare ( const NumericVector< T > &  other_vector,
const Real  threshold = TOLERANCE 
) const
virtualinherited

比较该向量与另一个向量的局部相对差异。

如果两个向量在给定的局部相对阈值 abs(a[i]-b[i])/max(a[i],b[i]) 下等效,则返回-1,否则返回首个不等效的索引。

参数
other_vector要比较的另一个向量。
threshold允许的局部相对差异阈值(可选,默认值为 TOLERANCE)。
返回
-1 表示等效,否则返回不等效的索引。

在文件 numeric_vector.C137 行定义.

参考 std::abs().

139 {
140  libmesh_assert(this->compatible(other_vector));
141 
142  int first_different_i = std::numeric_limits<int>::max();
144 
145  do
146  {
147  if (std::abs((*this)(i) - other_vector(i)) > threshold *
148  std::max(std::abs((*this)(i)), std::abs(other_vector(i))))
149  first_different_i = i;
150  else
151  i++;
152  }
153  while (first_different_i==std::numeric_limits<int>::max()
154  && i<last_local_index());
155 
156  // Find the correct first differing index in parallel
157  this->comm().min(first_different_i);
158 
159  if (first_different_i == std::numeric_limits<int>::max())
160  return -1;
161 
162  return first_different_i;
163 }
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的绝对值。
Definition: type_vector.h:112
dof_id_type numeric_index_type
Definition: id_types.h:99
virtual numeric_index_type first_local_index() const =0
获取实际存储在该处理器上的第一个向量元素的索引。
virtual numeric_index_type last_local_index() const =0
获取实际存储在该处理器上的最后一个向量元素的索引+1。
bool compatible(const NumericVector< T > &v) const
检查该向量和向量 v 是否能够一起用于全局操作。
template<typename T >
numeric_index_type libMesh::LaspackVector< T >::local_size ( ) const
inlineoverridevirtual

返回向量的局部大小(局部维度)。

返回
向量的局部大小。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h782 行定义.

参考 libMesh::initialized().

783 {
784  libmesh_assert (this->initialized());
785 
786  return this->size();
787 }
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual bool initialized() const
检查向量是否已经初始化。
template<typename T >
void libMesh::LaspackVector< T >::localize ( std::vector< T > &  v_local) const
overridevirtual

将向量的元素本地化,以便在不同处理器之间交换。

参数
v_local存储本地化后的元素的向量。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C456 行定义.

458 {
459  v_local.resize(this->size());
460 
461  for (auto i : index_range(v_local))
462  v_local[i] = (*this)(i);
463 }
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
template<typename T >
void libMesh::LaspackVector< T >::localize ( NumericVector< T > &  v_local) const
overridevirtual

将向量的元素本地化,以便在不同处理器之间交换。

参数
v_local存储本地化后的元素的向量。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C396 行定义.

397 {
398  // Make sure the NumericVector passed in is really a LaspackVector
399  LaspackVector<T> * v_local =
400  cast_ptr<LaspackVector<T> *>(&v_local_in);
401 
402  libmesh_assert(v_local);
403 
404  *v_local = *this;
405 }
template<typename T>
virtual void libMesh::LaspackVector< T >::localize ( NumericVector< T > &  v_local,
const std::vector< numeric_index_type > &  send_list 
) const
overridevirtual

将向量的元素本地化,以便在不同处理器之间交换,但仅发送指定的索引。

参数
v_local存储本地化后的元素的向量。
send_list要发送的索引列表。

实现了 libMesh::NumericVector< T >.

template<typename T >
void libMesh::LaspackVector< T >::localize ( std::vector< T > &  v_local,
const std::vector< numeric_index_type > &  indices 
) const
overridevirtual

将向量的元素本地化,以便在不同处理器之间交换,但仅发送指定的索引。

参数
v_local存储本地化后的元素的向量。
indices要发送的索引。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C426 行定义.

428 {
429  // LaspackVectors are serial, so we can just copy values
430  v_local.resize(indices.size());
431 
432  for (auto i : index_range(v_local))
433  v_local[i] = (*this)(indices[i]);
434 }
template<typename T>
virtual void libMesh::LaspackVector< T >::localize ( const numeric_index_type  first_local_idx,
const numeric_index_type  last_local_idx,
const std::vector< numeric_index_type > &  send_list 
)
overridevirtual

本地化向量的一部分,以便在不同处理器之间交换,但仅发送指定的索引。

参数
first_local_idx本地索引范围的起始索引。
last_local_idx本地索引范围的结束索引。
send_list要发送的索引列表。

实现了 libMesh::NumericVector< T >.

template<typename T>
void libMesh::LaspackVector< T >::localize_to_one ( std::vector< T > &  v_local,
const processor_id_type  proc_id = 0 
) const
overridevirtual

将向量本地化到指定处理器。

参数
v_local存储本地化后的元素的向量。
proc_id目标处理器的ID。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C468 行定义.

470 {
471  libmesh_assert_equal_to (pid, 0);
472 
473  this->localize (v_local);
474 }
virtual void localize(std::vector< T > &v_local) const override
将向量的元素本地化,以便在不同处理器之间交换。
template<typename T >
Real libMesh::LaspackVector< T >::max ( ) const
overridevirtual

返回向量的最大元素。

返回
最大元素的值。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C493 行定义.

参考 libMesh::initialized(), libMesh::libmesh_real() , 以及 libMesh::Real.

494 {
495  libmesh_assert (this->initialized());
496  if (!this->size())
497  return -std::numeric_limits<Real>::max();
498 
499  Real the_max = libmesh_real((*this)(0));
500 
501  const numeric_index_type n = this->size();
502 
503  for (numeric_index_type i=1; i<n; i++)
504  the_max = std::max (the_max, libmesh_real((*this)(i)));
505 
506  return the_max;
507 }
T libmesh_real(T a)
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual bool initialized() const
检查向量是否已经初始化。
dof_id_type numeric_index_type
Definition: id_types.h:99
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
template<typename T >
std::size_t libMesh::LaspackVector< T >::max_allowed_id ( ) const
inlineoverridevirtual

获取允许的最大ID(索引)。

返回
最大允许的ID。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h886 行定义.

887 {
888  // The QVector type declares a "size_t Dim;"
889  return std::numeric_limits<std::size_t>::max();
890 }
template<typename T >
Real libMesh::LaspackVector< T >::min ( ) const
overridevirtual

返回向量的最小元素。

返回
最小元素的值。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C512 行定义.

参考 libMesh::initialized(), libMesh::libmesh_real() , 以及 libMesh::Real.

513 {
514  libmesh_assert (this->initialized());
515  if (!this->size())
516  return std::numeric_limits<Real>::max();
517 
518  Real the_min = libmesh_real((*this)(0));
519 
520  const numeric_index_type n = this->size();
521 
522  for (numeric_index_type i=1; i<n; i++)
523  the_min = std::min (the_min, libmesh_real((*this)(i)));
524 
525  return the_min;
526 }
T libmesh_real(T a)
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual bool initialized() const
检查向量是否已经初始化。
dof_id_type numeric_index_type
Definition: id_types.h:99
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static unsigned int libMesh::ReferenceCounter::n_objects ( )
inlinestaticinherited

Prints the number of outstanding (created, but not yet destroyed) objects.

在文件 reference_counter.h85 行定义.

参考 libMesh::ReferenceCounter::_n_objects.

参考自 libMesh::LibMeshInit::~LibMeshInit().

86  { return _n_objects; }
static Threads::atomic< unsigned int > _n_objects
The number of objects.
template<typename T >
T libMesh::LaspackVector< T >::operator() ( const numeric_index_type  i) const
inlineoverridevirtual

返回指定索引处向量的值。

参数
i索引值。
返回
指定索引处的向量元素的值。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h849 行定义.

参考 libMesh::initialized().

850 {
851  libmesh_assert (this->initialized());
852  libmesh_assert ( ((i >= this->first_local_index()) &&
853  (i < this->last_local_index())) );
854 
855 
856  return static_cast<T>(V_GetCmp(const_cast<QVector*>(&_vec), i+1));
857 }
virtual bool initialized() const
检查向量是否已经初始化。
virtual numeric_index_type last_local_index() const override
返回向量的最后一个局部索引。
virtual numeric_index_type first_local_index() const override
返回向量的第一个局部索引。
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
template<typename T >
NumericVector< T > & libMesh::LaspackVector< T >::operator*= ( const NumericVector< T > &  v)
overridevirtual

将该向量的元素按元素与另一个向量的元素相乘。

参数
v用于相乘的向量。
返回
指向 *this 的引用作为派生类型。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C109 行定义.

参考 libMesh::NumericVector< T >::size().

110 {
111  libmesh_assert_equal_to(size(), v.size());
112 
113 #ifndef NDEBUG
114  const bool was_closed = this->_is_closed;
115 #endif
116 
117  const numeric_index_type n = this->size();
118 
119  for (numeric_index_type i=0; i<n; i++)
120  this->set(i, (*this)(i) * v(i));
121 
122  // This is an embarrassingly parallel method, but set() isn't in
123  // general so set() overzealously marked us as non-closed
124 #ifndef NDEBUG
125  this->_is_closed = was_closed;
126 #endif
127 
128  return *this;
129 }
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual void set(const numeric_index_type i, const T value) override
设置指定索引处的元素值。
dof_id_type numeric_index_type
Definition: id_types.h:99
bool _is_closed
用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。
template<typename T>
NumericVector<T>& libMesh::NumericVector< T >::operator*= ( const T  a)
inlineinherited

将向量缩放为 a$ \vec{u} \leftarrow a\vec{u} $。等价于 u.scale(a)。

参数
a缩放因子。
返回
对 *this 的引用。

在文件 numeric_vector.h463 行定义.

参考 libMesh::NumericVector< T >::scale().

463 { this->scale(a); return *this; }
virtual void scale(const T factor)=0
缩放向量的每个元素。
template<typename T >
NumericVector< T > & libMesh::LaspackVector< T >::operator+= ( const NumericVector< T > &  v)
overridevirtual

将另一个向量的元素按元素加到该向量。

参数
v要相加的向量。
返回
指向 *this 的引用作为派生类型。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C84 行定义.

参考 libMesh::closed().

85 {
86  libmesh_assert (this->closed());
87 
88  this->add(1., v);
89 
90  return *this;
91 }
virtual bool closed() const
检查向量是否已经关闭并准备好进行计算。
virtual void add(const numeric_index_type i, const T value) override
将指定值添加到指定索引处的元素。
template<typename T >
NumericVector< T > & libMesh::LaspackVector< T >::operator-= ( const NumericVector< T > &  v)
overridevirtual

将另一个向量的元素按元素从该向量中减去。

参数
v要相减的向量。
返回
指向 *this 的引用作为派生类型。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C97 行定义.

参考 libMesh::closed().

98 {
99  libmesh_assert (this->closed());
100 
101  this->add(-1., v);
102 
103  return *this;
104 }
virtual bool closed() const
检查向量是否已经关闭并准备好进行计算。
virtual void add(const numeric_index_type i, const T value) override
将指定值添加到指定索引处的元素。
template<typename T >
NumericVector< T > & libMesh::LaspackVector< T >::operator/= ( const NumericVector< T > &  v)
overridevirtual

将该向量的元素按元素除以另一个向量的元素。

参数
v用于相除的向量。
返回
指向 *this 的引用作为派生类型。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C134 行定义.

参考 libMesh::NumericVector< T >::size().

135 {
136  libmesh_assert_equal_to(size(), v.size());
137 
138 #ifndef NDEBUG
139  const bool was_closed = this->_is_closed;
140 #endif
141 
142  const numeric_index_type n = this->size();
143 
144  for (numeric_index_type i=0; i<n; i++)
145  this->set(i, (*this)(i) / v(i));
146 
147  // This is an embarrassingly parallel method, but set() isn't in
148  // general so set() overzealously marked us as non-closed
149 #ifndef NDEBUG
150  this->_is_closed = was_closed;
151 #endif
152 
153  return *this;
154 }
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual void set(const numeric_index_type i, const T value) override
设置指定索引处的元素值。
dof_id_type numeric_index_type
Definition: id_types.h:99
bool _is_closed
用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。
template<typename T>
NumericVector<T>& libMesh::NumericVector< T >::operator/= ( const T  a)
inlineinherited

将向量缩放为 1/a$ \vec{u} \leftarrow \frac{1}{a}\vec{u} $。等价于 u.scale(1.

/a)。

参数
a缩放因子。
返回
对 *this 的引用。

在文件 numeric_vector.h481 行定义.

参考 libMesh::NumericVector< T >::scale().

481 { this->scale(1./a); return *this; }
virtual void scale(const T factor)=0
缩放向量的每个元素。
template<typename T >
LaspackVector< T > & libMesh::LaspackVector< T >::operator= ( const LaspackVector< T > &  v)

Copy assignment operator.

Calls Asgn_VV() to assign the contents of one vector to another. 赋值运算符,用于将一个向量的内容赋值给另一个向量。

参数
v要赋值的向量。
返回
指向 *this 的引用作为派生类型。

在文件 laspack_vector.C356 行定义.

参考 libMesh::LaspackVector< T >::_vec, libMesh::NumericVector< T >::closed(), libMesh::initialized() , 以及 libMesh::LaspackVector< T >::size().

357 {
358  libmesh_assert (this->initialized());
359  libmesh_assert (v.closed());
360  libmesh_assert_equal_to (this->size(), v.size());
361 
362  if (v.size() != 0)
363  Asgn_VV (const_cast<QVector*>(&_vec),
364  const_cast<QVector*>(&v._vec)
365  );
366 
367 #ifndef NDEBUG
368  this->_is_closed = true;
369 #endif
370 
371  return *this;
372 }
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual bool initialized() const
检查向量是否已经初始化。
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
bool _is_closed
用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。
template<typename T>
LaspackVector& libMesh::LaspackVector< T >::operator= ( LaspackVector< T > &&  )
delete
template<typename T >
NumericVector< T > & libMesh::LaspackVector< T >::operator= ( const T  s)
overridevirtual

将标量值赋给向量的所有元素。

参数
s要赋值的标量。
返回
指向 *this 的引用作为派生类型。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C325 行定义.

参考 libMesh::closed() , 以及 libMesh::initialized().

326 {
327  libmesh_assert (this->initialized());
328  libmesh_assert (this->closed());
329 
330  V_SetAllCmp (&_vec, s);
331 
332  return *this;
333 }
virtual bool closed() const
检查向量是否已经关闭并准备好进行计算。
virtual bool initialized() const
检查向量是否已经初始化。
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
template<typename T >
NumericVector< T > & libMesh::LaspackVector< T >::operator= ( const NumericVector< T > &  v)
overridevirtual

将一个向量的内容赋值给另一个向量。

参数
v要赋值的向量。
返回
指向 *this 的引用作为派生类型。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C339 行定义.

340 {
341  // Make sure the NumericVector passed in is really a LaspackVector
342  const LaspackVector<T> * v =
343  cast_ptr<const LaspackVector<T> *>(&v_in);
344 
345  libmesh_assert(v);
346 
347  *this = *v;
348 
349  return *this;
350 }
template<typename T >
NumericVector< T > & libMesh::LaspackVector< T >::operator= ( const std::vector< T > &  v)
overridevirtual

将一个 std::vector 的内容赋给向量。

参数
v要赋值的 std::vector。
返回
指向 *this 的引用作为派生类型。

Case 1: The vector is the same size of The global vector. Only add the local components.

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C378 行定义.

379 {
384  if (this->size() == v.size())
385  for (auto i : index_range(v))
386  this->set (i, v[i]);
387 
388  else
389  libmesh_error_msg("this->size() = " << this->size() << " must be equal to v.size() = " << v.size());
390 
391  return *this;
392 }
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual void set(const numeric_index_type i, const T value) override
设置指定索引处的元素值。
template<typename T >
void libMesh::LaspackVector< T >::pointwise_divide ( const NumericVector< T > &  vec1,
const NumericVector< T > &  vec2 
)
overridevirtual

对向量的每个元素执行逐元素除法。

参数
vec1用于逐元素除法的第一个向量。
vec2用于逐元素除法的第二个向量。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C486 行定义.

488 {
489  libmesh_not_implemented();
490 }
template<typename T >
void libMesh::LaspackVector< T >::pointwise_mult ( const NumericVector< T > &  vec1,
const NumericVector< T > &  vec2 
)
overridevirtual

对向量的每个元素执行逐元素乘法。

参数
vec1用于逐元素乘法的第一个向量。
vec2用于逐元素乘法的第二个向量。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C479 行定义.

481 {
482  libmesh_not_implemented();
483 }
template<typename T >
void libMesh::NumericVector< T >::print ( std::ostream &  os = libMesh::out) const
inlinevirtualinherited

打印本地向量的内容,默认输出到 libMesh::out 流。

参数
os输出流,用于指定输出位置(可选,默认为 libMesh::out)。

在文件 numeric_vector.h1121 行定义.

参考 libMesh::initialized().

1122 {
1123  libmesh_assert (this->initialized());
1124  os << "Size\tglobal = " << this->size()
1125  << "\t\tlocal = " << this->local_size() << std::endl;
1126 
1127  os << "#\tValue" << std::endl;
1128  for (auto i : index_range(*this))
1129  os << i << "\t" << (*this)(i) << std::endl;
1130 }
virtual numeric_index_type size() const =0
获取向量的大小。
virtual bool initialized() const
检查向量是否已经初始化。
virtual numeric_index_type local_size() const =0
获取向量的本地大小,即 index_stop - index_start。
template<>
void libMesh::NumericVector< Complex >::print ( std::ostream &  os) const
inlineinherited

在文件 numeric_vector.h1103 行定义.

参考 std::imag(), libMesh::initialized() , 以及 std::real().

1104 {
1105  libmesh_assert (this->initialized());
1106  os << "Size\tglobal = " << this->size()
1107  << "\t\tlocal = " << this->local_size() << std::endl;
1108 
1109  // std::complex<>::operator<<() is defined, but use this form
1110  os << "#\tReal part\t\tImaginary part" << std::endl;
1111  for (auto i : index_range(*this))
1112  os << i << "\t"
1113  << (*this)(i).real() << "\t\t"
1114  << (*this)(i).imag() << std::endl;
1115 }
boost::multiprecision::float128 real(const boost::multiprecision::float128 in)
virtual numeric_index_type size() const =0
获取向量的大小。
virtual bool initialized() const
检查向量是否已经初始化。
virtual numeric_index_type local_size() const =0
获取向量的本地大小,即 index_stop - index_start。
boost::multiprecision::float128 imag(const boost::multiprecision::float128)
template<typename T >
void libMesh::NumericVector< T >::print_global ( std::ostream &  os = libMesh::out) const
inlinevirtualinherited

打印全局向量的内容,默认输出到 libMesh::out 流。

参数
os输出流,用于指定输出位置(可选,默认为 libMesh::out)。

在文件 numeric_vector.h1158 行定义.

参考 libMesh::initialized().

1159 {
1160  libmesh_assert (this->initialized());
1161 
1162  std::vector<T> v(this->size());
1163  this->localize(v);
1164 
1165  // 现在我们只需要输出的一个副本
1166  if (this->processor_id())
1167  return;
1168 
1169  os << "Size\tglobal = " << this->size() << std::endl;
1170  os << "#\tValue" << std::endl;
1171  for (auto i : make_range(v.size()))
1172  os << i << "\t" << v[i] << std::endl;
1173 }
virtual numeric_index_type size() const =0
获取向量的大小。
virtual bool initialized() const
检查向量是否已经初始化。
virtual void localize(std::vector< T > &v_local) const =0
创建全局向量的副本并存储在本地向量 v_local 中。
template<>
void libMesh::NumericVector< Complex >::print_global ( std::ostream &  os) const
inlineinherited

在文件 numeric_vector.h1136 行定义.

参考 libMesh::initialized().

1137 {
1138  libmesh_assert (this->initialized());
1139 
1140  std::vector<Complex> v(this->size());
1141  this->localize(v);
1142 
1143  // 现在我们只需要输出的一个副本
1144  if (this->processor_id())
1145  return;
1146 
1147  os << "Size\tglobal = " << this->size() << std::endl;
1148  os << "#\tReal part\t\tImaginary part" << std::endl;
1149  for (auto i : make_range(v.size()))
1150  os << i << "\t"
1151  << v[i].real() << "\t\t"
1152  << v[i].imag() << std::endl;
1153 }
virtual numeric_index_type size() const =0
获取向量的大小。
virtual bool initialized() const
检查向量是否已经初始化。
virtual void localize(std::vector< T > &v_local) const =0
创建全局向量的副本并存储在本地向量 v_local 中。
void libMesh::ReferenceCounter::print_info ( std::ostream &  out_stream = libMesh::out)
staticinherited

Prints the reference information, by default to libMesh::out.

在文件 reference_counter.C81 行定义.

参考 libMesh::ReferenceCounter::_enable_print_counter , 以及 libMesh::ReferenceCounter::get_info().

参考自 libMesh::LibMeshInit::~LibMeshInit().

82 {
84  out_stream << ReferenceCounter::get_info();
85 }
static std::string get_info()
Gets a string containing the reference information.
static bool _enable_print_counter
Flag to control whether reference count information is printed when print_info is called...
template<typename T>
virtual void libMesh::NumericVector< T >::print_matlab ( const std::string &  = "") const
inlinevirtualinherited

以Matlab的稀疏矩阵格式打印向量内容。可选择将向量打印到名为 name 的文件中。 如果未指定 name,则内容将被打印到屏幕上。

参数
name用于指定输出文件名的可选参数(默认为空)。

libMesh::PetscVector< T > 重载.

在文件 numeric_vector.h859 行定义.

860  {
861  libmesh_not_implemented();
862  }
template<typename T >
bool libMesh::NumericVector< T >::readable ( ) const
inherited

检查该向量是否能够用于全局操作。

返回
如果向量可以用于全局操作,则返回 true,否则返回 false。

在文件 numeric_vector.C416 行定义.

参考 libMesh::closed() , 以及 libMesh::initialized().

参考自 libMesh::NumericVector< T >::add_vector(), libMesh::NumericVector< T >::compatible() , 以及 libMesh::NumericVector< T >::insert().

417 {
418  return this->initialized() && this->closed();
419 }
virtual bool closed() const
检查向量是否已经关闭并准备好进行计算。
virtual bool initialized() const
检查向量是否已经初始化。
template<typename T >
void libMesh::LaspackVector< T >::reciprocal ( )
overridevirtual

计算向量中所有元素的倒数(1/x)。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C159 行定义.

160 {
161  const numeric_index_type n = this->size();
162 
163 #ifndef NDEBUG
164  const bool was_closed = this->_is_closed;
165 #endif
166 
167  for (numeric_index_type i=0; i<n; i++)
168  {
169  T v = (*this)(i);
170 
171  // Don't divide by zero!
172  libmesh_assert_not_equal_to (v, T(0));
173 
174  this->set(i, 1. / v);
175  }
176 
177  // This is an embarrassingly parallel method, but set() isn't in
178  // general so set() overzealously marked us as non-closed
179 #ifndef NDEBUG
180  this->_is_closed = was_closed;
181 #endif
182 }
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual void set(const numeric_index_type i, const T value) override
设置指定索引处的元素值。
dof_id_type numeric_index_type
Definition: id_types.h:99
bool _is_closed
用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。
template<typename T >
void libMesh::LaspackVector< T >::scale ( const T  factor)
overridevirtual

缩放向量的所有元素,将它们乘以指定的标量因子。

参数
factor用于缩放的标量因子。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C290 行定义.

参考 libMesh::initialized().

291 {
292  libmesh_assert (this->initialized());
293 
294  Asgn_VV(&_vec, Mul_SV (factor, &_vec));
295 }
virtual bool initialized() const
检查向量是否已经初始化。
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
template<typename T >
void libMesh::LaspackVector< T >::set ( const numeric_index_type  i,
const T  value 
)
inlineoverridevirtual

设置指定索引处的元素值。

参数
i索引值。
value要设置的值。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h815 行定义.

参考 libMesh::initialized().

816 {
817  libmesh_assert (this->initialized());
818  libmesh_assert_less (i, this->size());
819 
820  std::scoped_lock lock(this->_numeric_vector_mutex);
821  V_SetCmp (&_vec, i+1, value);
822 
823 #ifndef NDEBUG
824  this->_is_closed = false;
825 #endif
826 }
std::mutex _numeric_vector_mutex
用于执行线程安全操作的互斥锁。
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
virtual bool initialized() const
检查向量是否已经初始化。
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
bool _is_closed
用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。
template<typename T >
numeric_index_type libMesh::LaspackVector< T >::size ( ) const
inlineoverridevirtual

返回向量的大小(全局维度)。

返回
向量的大小。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h771 行定义.

参考 libMesh::initialized().

参考自 libMesh::LaspackVector< T >::add() , 以及 libMesh::LaspackVector< T >::operator=().

772 {
773  libmesh_assert (this->initialized());
774 
775  return static_cast<numeric_index_type>(V_GetDim(const_cast<QVector*>(&_vec)));
776 }
virtual bool initialized() const
检查向量是否已经初始化。
dof_id_type numeric_index_type
Definition: id_types.h:99
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
template<class T >
Real libMesh::NumericVector< T >::subset_l1_norm ( const std::set< numeric_index_type > &  indices) const
virtualinherited

获取指定条目的向量的 $ \ell_1 $-范数,即指定条目的绝对值之和。

参数
indices指定的索引集合。
返回
指定条目的向量的 $ \ell_1 $-范数。
注解
索引必须位于此处理器上。

在文件 numeric_vector.C306 行定义.

参考 std::abs(), std::norm() , 以及 libMesh::Real.

307 {
308  libmesh_assert (this->readable());
309 
310  const NumericVector<T> & v = *this;
311 
312  Real norm = 0;
313 
314  for (const auto & index : indices)
315  norm += std::abs(v(index));
316 
317  this->comm().sum(norm);
318 
319  return norm;
320 }
bool readable() const
检查该向量是否能够用于全局操作。
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的绝对值。
Definition: type_vector.h:112
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ADRealEigenVector< T, D, asd > norm(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的范数。
Definition: type_vector.h:64
template<class T >
Real libMesh::NumericVector< T >::subset_l2_norm ( const std::set< numeric_index_type > &  indices) const
virtualinherited

获取指定条目的向量的 $ \ell_2 $-范数,即指定条目平方和的平方根。

参数
indices指定的索引集合。
返回
指定条目的向量的 $ \ell_2 $-范数。
注解
索引必须位于此处理器上。

在文件 numeric_vector.C323 行定义.

参考 std::norm(), libMesh::TensorTools::norm_sq(), libMesh::Real , 以及 std::sqrt().

324 {
325  libmesh_assert (this->readable());
326 
327  const NumericVector<T> & v = *this;
328 
329  Real norm = 0;
330 
331  for (const auto & index : indices)
332  norm += TensorTools::norm_sq(v(index));
333 
334  this->comm().sum(norm);
335 
336  return std::sqrt(norm);
337 }
bool readable() const
检查该向量是否能够用于全局操作。
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的平方根。
Definition: type_vector.h:88
T norm_sq(std::complex< T > a)
Definition: tensor_tools.h:74
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ADRealEigenVector< T, D, asd > norm(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的范数。
Definition: type_vector.h:64
template<class T >
Real libMesh::NumericVector< T >::subset_linfty_norm ( const std::set< numeric_index_type > &  indices) const
virtualinherited

获取指定条目的向量的最大绝对值,即指定条目的 $ \ell_{\infty} $-范数。

参数
indices指定的索引集合。
返回
指定条目的向量的最大绝对值。
注解
索引必须位于此处理器上。

在文件 numeric_vector.C340 行定义.

参考 std::abs(), std::norm() , 以及 libMesh::Real.

341 {
342  libmesh_assert (this->readable());
343 
344  const NumericVector<T> & v = *this;
345 
346  Real norm = 0;
347 
348  for (const auto & index : indices)
349  {
350  Real value = std::abs(v(index));
351  if (value > norm)
352  norm = value;
353  }
354 
355  this->comm().max(norm);
356 
357  return norm;
358 }
bool readable() const
检查该向量是否能够用于全局操作。
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的绝对值。
Definition: type_vector.h:112
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ADRealEigenVector< T, D, asd > norm(const ADRealEigenVector< T, D, asd > &)
计算自动微分实数向量的范数。
Definition: type_vector.h:64
template<typename T >
T libMesh::LaspackVector< T >::sum ( ) const
overridevirtual

返回向量的所有元素之和。

返回
所有元素之和的值。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.C37 行定义.

参考 libMesh::closed().

38 {
39  libmesh_assert (this->closed());
40 
41  T _sum = 0;
42 
43  const numeric_index_type n = this->size();
44 
45  for (numeric_index_type i=0; i!=n; ++i)
46  _sum += (*this)(i);
47 
48  return _sum;
49 }
virtual bool closed() const
检查向量是否已经关闭并准备好进行计算。
virtual numeric_index_type size() const override
返回向量的大小(全局维度)。
dof_id_type numeric_index_type
Definition: id_types.h:99
template<typename T >
void libMesh::LaspackVector< T >::swap ( NumericVector< T > &  v)
inlineoverridevirtual

交换两个向量的内容。

参数
v要交换内容的另一个向量。

重载 libMesh::NumericVector< T > .

在文件 laspack_vector.h863 行定义.

864 {
865  LaspackVector<T> & v = cast_ref<LaspackVector<T> &>(other);
866 
867  // This is all grossly dependent on Laspack version...
868 
869  std::swap(_vec.Name, v._vec.Name);
870  std::swap(_vec.Dim, v._vec.Dim);
871  std::swap(_vec.Instance, v._vec.Instance);
872  std::swap(_vec.LockLevel, v._vec.LockLevel);
873  std::swap(_vec.Multipl, v._vec.Multipl);
874  std::swap(_vec.OwnData, v._vec.OwnData);
875 
876  // This should still be O(1), since _vec.Cmp is just a pointer to
877  // data on the heap
878 
879  std::swap(_vec.Cmp, v._vec.Cmp);
880 }
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
template<typename T>
ParallelType libMesh::NumericVector< T >::type ( ) const
inlineinherited
template<typename T>
ParallelType& libMesh::NumericVector< T >::type ( )
inlineinherited

获取向量的类型。

返回
向量的类型(SERIAL、PARALLEL、GHOSTED)。

在文件 numeric_vector.h173 行定义.

参考 libMesh::NumericVector< T >::_type.

173 { return _type; }
ParallelType _type
向量的类型。
template<typename T >
void libMesh::LaspackVector< T >::zero ( )
inlineoverridevirtual

Set all elements of the vector to zero.

将向量的所有元素置零。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h731 行定义.

参考 libMesh::closed() , 以及 libMesh::initialized().

732 {
733  libmesh_assert (this->initialized());
734  libmesh_assert (this->closed());
735 
736  V_SetAllCmp (&_vec, 0.);
737 }
virtual bool closed() const
检查向量是否已经关闭并准备好进行计算。
virtual bool initialized() const
检查向量是否已经初始化。
QVector _vec
用于保存向量条目的实际 Laspack 向量数据类型。
template<typename T >
std::unique_ptr< NumericVector< T > > libMesh::LaspackVector< T >::zero_clone ( ) const
inlineoverridevirtual

创建并返回一个指向该对象的零克隆的 unique_ptr。

实现了 libMesh::NumericVector< T >.

在文件 laspack_vector.h743 行定义.

参考 libMesh::NumericVector< T >::init().

744 {
745  NumericVector<T> * cloned_vector = new LaspackVector<T>(this->comm());
746 
747  cloned_vector->init(*this);
748 
749  return std::unique_ptr<NumericVector<T>>(cloned_vector);
750 }

友元及相关函数文档

template<typename T>
friend class LaspackLinearSolver< T >
friend

使其他 Laspack 数据类型成为友元类,以便它们可以访问私有成员。

在文件 laspack_vector.h540 行定义.

类成员变量说明

ReferenceCounter::Counts libMesh::ReferenceCounter::_counts
staticprotectedinherited

Actually holds the data.

在文件 reference_counter.h124 行定义.

参考自 libMesh::ReferenceCounter::get_info().

bool libMesh::ReferenceCounter::_enable_print_counter = true
staticprotectedinherited

Flag to control whether reference count information is printed when print_info is called.

在文件 reference_counter.h143 行定义.

参考自 libMesh::ReferenceCounter::disable_print_counter_info(), libMesh::ReferenceCounter::enable_print_counter_info() , 以及 libMesh::ReferenceCounter::print_info().

template<typename T>
bool libMesh::NumericVector< T >::_is_closed
protectedinherited

用于跟踪向量的值在在一些或全部处理器上进行插入或添加值操作后是否在所有处理器上保持一致的标志。

在文件 numeric_vector.h913 行定义.

参考自 libMesh::NumericVector< T >::closed(), libMesh::EpetraVector< T >::EpetraVector(), libMesh::DistributedVector< T >::localize(), libMesh::DistributedVector< T >::operator=() , 以及 libMesh::PetscVector< T >::PetscVector().

template<typename T>
bool libMesh::NumericVector< T >::_is_initialized
protectedinherited
Threads::spin_mutex libMesh::ReferenceCounter::_mutex
staticprotectedinherited

Mutual exclusion object to enable thread-safe reference counting.

在文件 reference_counter.h137 行定义.

Threads::atomic< unsigned int > libMesh::ReferenceCounter::_n_objects
staticprotectedinherited

The number of objects.

Print the reference count information when the number returns to 0.

在文件 reference_counter.h132 行定义.

参考自 libMesh::ReferenceCounter::n_objects(), libMesh::ReferenceCounter::ReferenceCounter() , 以及 libMesh::ReferenceCounter::~ReferenceCounter().

template<typename T>
std::mutex libMesh::NumericVector< T >::_numeric_vector_mutex
protectedinherited

用于执行线程安全操作的互斥锁。

在文件 numeric_vector.h928 行定义.

template<typename T>
ParallelType libMesh::NumericVector< T >::_type
protectedinherited
template<typename T>
QVector libMesh::LaspackVector< T >::_vec
private

用于保存向量条目的实际 Laspack 向量数据类型。

在文件 laspack_vector.h535 行定义.

参考自 libMesh::LaspackVector< T >::add_vector(), libMesh::LaspackVector< T >::dot() , 以及 libMesh::LaspackVector< T >::operator=().


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