libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
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_SHELL_MATRIX_H
21 #define LIBMESH_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/id_types.h"
29 #include "libmesh/parallel_object.h"
30 #include "libmesh/dof_map.h"
31 #include "libmesh/parallel.h"
32 
33 namespace libMesh
34 {
35 
36 // forward declarations
37 template <typename T> class NumericVector;
38 enum SolverPackage : int;
39 
46 template <typename T>
47 class ShellMatrix : public ReferenceCountedObject<ShellMatrix<T>>,
48  public ParallelObject
49 {
50 public:
56  ShellMatrix (const Parallel::Communicator & comm_in);
57 
65  static std::unique_ptr<ShellMatrix<T>>
66  build(const Parallel::Communicator & comm,
67  const SolverPackage solver_package = libMesh::default_solver_package());
68 
74  virtual ~ShellMatrix ();
75 
81  virtual numeric_index_type m () const = 0;
82 
88  virtual numeric_index_type n () const = 0;
89 
96  virtual void vector_mult (NumericVector<T> & dest,
97  const NumericVector<T> & arg) const = 0;
98 
105  virtual void vector_mult_add (NumericVector<T> & dest,
106  const NumericVector<T> & arg) const = 0;
107 
113  virtual void get_diagonal (NumericVector<T> & dest) const = 0;
114 
120  void attach_dof_map (const DofMap & dof_map)
121  { _dof_map = &dof_map; }
122 
128  virtual void clear () { libmesh_error_msg ("Not implemented yet"); }
129 
135  virtual void init () { libmesh_error_msg ("Not implemented yet"); }
136 
137 protected:
141  DofMap const * _dof_map;
142 };
143 
144 
145 //-----------------------------------------------------------------------
146 // ShellMatrix inline members
147 template <typename T>
148 inline
149 ShellMatrix<T>::ShellMatrix (const Parallel::Communicator & comm_in) :
150  ParallelObject(comm_in),
151  _dof_map(nullptr)
152 {}
153 
154 
155 template <typename T>
156 inline
158 {}
159 
160 
161 } // namespace libMesh
162 
163 
164 #endif // LIBMESH_SHELL_MATRIX_H
virtual ~ShellMatrix()
析构函数。
Definition: shell_matrix.h:157
void attach_dof_map(const DofMap &dof_map)
附加要使用的 DofMap 指针。
Definition: shell_matrix.h:120
static std::unique_ptr< ShellMatrix< T > > build(const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
使用指定的线性求解器包构建一个 ShellMatrix&lt;T&gt;。
Definition: shell_matrix.C:32
virtual numeric_index_type m() const =0
virtual void vector_mult_add(NumericVector< T > &dest, const NumericVector< T > &arg) const =0
将矩阵与 arg 相乘并将结果添加到 dest 中。
SolverPackage default_solver_package()
Definition: libmesh.C:967
This class handles the numbering of degrees of freedom on a mesh.
Definition: dof_map.h:169
dof_id_type numeric_index_type
Definition: id_types.h:99
ShellMatrix(const Parallel::Communicator &comm_in)
构造函数;
Definition: shell_matrix.h:149
virtual void init()
初始化对象。
Definition: shell_matrix.h:135
DofMap const * _dof_map
与此对象关联的 DofMap 对象。
Definition: shell_matrix.h:141
virtual void clear()
清除对象,释放内存。
Definition: shell_matrix.h:128
virtual numeric_index_type n() const =0
virtual void get_diagonal(NumericVector< T > &dest) const =0
将矩阵的对角线部分复制到 dest 中。
virtual void vector_mult(NumericVector< T > &dest, const NumericVector< T > &arg) const =0
将矩阵与 arg 相乘并将结果存储在 dest 中。