libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
sum_shell_matrix.h
浏览该文件的文档.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2023 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_SUM_SHELL_MATRIX_H
21 #define LIBMESH_SUM_SHELL_MATRIX_H
22 
23 // Local includes
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/reference_counted_object.h"
26 #include "libmesh/libmesh.h"
27 #include "libmesh/shell_matrix.h"
28 
29 // C++ includes
30 #include <vector>
31 
32 namespace libMesh
33 {
34 
40 template <typename T>
41 class SumShellMatrix : public ShellMatrix<T>
42 {
43 public:
51  SumShellMatrix (const Parallel::Communicator & comm_in);
52 
59  explicit
60  SumShellMatrix (const std::vector<ShellMatrix<T> *> & mat,
61  const Parallel::Communicator & comm_in);
62 
66  virtual ~SumShellMatrix ();
67 
73  virtual numeric_index_type m () const override;
74 
80  virtual numeric_index_type n () const override;
81 
88  virtual void vector_mult (NumericVector<T> & dest,
89  const NumericVector<T> & arg) const override;
90 
97  virtual void vector_mult_add (NumericVector<T> & dest,
98  const NumericVector<T> & arg) const override;
99 
105  virtual void get_diagonal (NumericVector<T> & dest) const override;
106 
110  std::vector<ShellMatrix<T> *> matrices;
111 };
112 
113 
114 
115 //-----------------------------------------------------------------------
116 // SumShellMatrix inline members
117 template <typename T>
118 inline
119 SumShellMatrix<T>::SumShellMatrix (const Parallel::Communicator & comm_in):
120  ShellMatrix<T>(comm_in),
121  matrices()
122 {}
123 
124 
125 
126 template <typename T>
127 inline
129  const Parallel::Communicator & comm_in):
130  ShellMatrix<T>(comm_in),
131  matrices(mat)
132 {}
133 
134 
135 
136 template <typename T>
137 inline
139 {}
140 
141 
142 } // namespace libMesh
143 
144 
145 #endif // LIBMESH_SUM_SHELL_MATRIX_H
SumShellMatrix(const Parallel::Communicator &comm_in)
Constructor; 初始化一个空的和(sum)。
提供了不同线性代数库的向量存储方案的统一接口。
Definition: dof_map.h:67
将任意数量的壳矩阵组合成一个单独的壳矩阵,通过将它们相加在一起的类。
virtual numeric_index_type n() const override
获取矩阵的列维度。
virtual numeric_index_type m() const override
获取矩阵的行维度。
virtual void vector_mult_add(NumericVector< T > &dest, const NumericVector< T > &arg) const override
将矩阵与参数arg相乘,然后将结果添加到dest中。
dof_id_type numeric_index_type
Definition: id_types.h:99
std::vector< ShellMatrix< T > * > matrices
指向被相加的壳矩阵的指针的向量。
virtual ~SumShellMatrix()
Destructor(析构函数)。
通用的Shell矩阵,即一个仅定义其对向量的作用的矩阵。此类包含必须在派生类中重写的纯虚拟成员。
virtual void vector_mult(NumericVector< T > &dest, const NumericVector< T > &arg) const override
将矩阵与参数arg相乘,并将结果存储在dest中。
virtual void get_diagonal(NumericVector< T > &dest) const override
将矩阵的对角部分复制到dest中。