libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
tensor_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_TENSOR_SHELL_MATRIX_H
21 #define LIBMESH_TENSOR_SHELL_MATRIX_H
22 
23 
24 // Local includes
25 #include "libmesh/libmesh_common.h"
26 #include "libmesh/reference_counted_object.h"
27 #include "libmesh/libmesh.h"
28 #include "libmesh/shell_matrix.h"
29 #include "libmesh/numeric_vector.h"
30 
31 namespace libMesh
32 {
33 
39 template <typename T>
40 class TensorShellMatrix : public ShellMatrix<T>
41 {
42 public:
50  const NumericVector<T> & w);
51 
55  virtual ~TensorShellMatrix ();
56 
62  virtual numeric_index_type m () const override;
63 
69  virtual numeric_index_type n () const override;
70 
77  virtual void vector_mult (NumericVector<T> & dest,
78  const NumericVector<T> & arg) const override;
79 
86  virtual void vector_mult_add (NumericVector<T> & dest,
87  const NumericVector<T> & arg) const override;
88 
94  virtual void get_diagonal (NumericVector<T> & dest) const override;
95 
96 protected:
101 
106 };
107 
108 
109 //-----------------------------------------------------------------------
110 // TensorShellMatrix inline members
111 template <typename T>
112 inline
114  const NumericVector<T> & w):
115  ShellMatrix<T>(v.comm()),
116  _v(v),
117  _w(w)
118 {}
119 
120 
121 
122 template <typename T>
123 inline
125 {}
126 
127 
128 
129 template <typename T>
130 inline
132 {
133  return _v.size();
134 }
135 
136 
137 
138 template <typename T>
139 inline
141 {
142  return _w.size();
143 }
144 
145 
146 } // namespace libMesh
147 
148 
149 #endif // LIBMESH_TENSOR_SHELL_MATRIX_H
virtual numeric_index_type m() const override
获取矩阵的行维度。
const NumericVector< T > & _w
行向量。
virtual void vector_mult_add(NumericVector< T > &dest, const NumericVector< T > &arg) const override
将矩阵与参数arg相乘,然后将结果添加到dest中。
提供了不同线性代数库的向量存储方案的统一接口。
Definition: dof_map.h:67
virtual void get_diagonal(NumericVector< T > &dest) const override
将矩阵的对角部分复制到dest中。
virtual ~TensorShellMatrix()
Destructor(析构函数)。
由两个向量的张量积构成的壳矩阵,即A = v*w^T。
dof_id_type numeric_index_type
Definition: id_types.h:99
TensorShellMatrix(const NumericVector< T > &v, const NumericVector< T > &w)
Constructor; 以两个向量的引用作为参数进行初始化。向量本身必须存储在其他地方。
virtual void vector_mult(NumericVector< T > &dest, const NumericVector< T > &arg) const override
将矩阵与参数arg相乘,并将结果存储在dest中。
virtual numeric_index_type n() const override
获取矩阵的列维度。
const NumericVector< T > & _v
列向量。
通用的Shell矩阵,即一个仅定义其对向量的作用的矩阵。此类包含必须在派生类中重写的纯虚拟成员。