libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
shell_matrix.C
浏览该文件的文档.
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 // Local Includes
21 #include "libmesh/petsc_matrix.h"
22 #include "libmesh/shell_matrix.h"
23 #include "libmesh/petsc_shell_matrix.h"
24 #include "libmesh/enum_solver_package.h"
25 
26 namespace libMesh
27 {
28 
29  // Full specialization for Real datatypes
30  template <typename T>
31  std::unique_ptr<ShellMatrix<T>>
32  ShellMatrix<T>::build(const Parallel::Communicator & comm,
33  const SolverPackage solver_package)
34  {
35  // Avoid unused parameter warnings when no solver packages are enabled.
36  libmesh_ignore(comm);
37 
38  // Build the appropriate vector
39  switch (solver_package)
40  {
41  #ifdef LIBMESH_HAVE_PETSC
42  case PETSC_SOLVERS:
43  return std::make_unique<PetscShellMatrix<T>>(comm);
44  #endif
45 
46  default:
47  libmesh_error_msg("ERROR: Unrecognized solver package: " << solver_package);
48  }
49  }
50 
51 //------------------------------------------------------------------
52 // Explicit instantiations
53 template class LIBMESH_EXPORT ShellMatrix<Number>;
54 
55 } // namespace libMesh
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
void libmesh_ignore(const Args &...)
通用的Shell矩阵,即一个仅定义其对向量的作用的矩阵。此类包含必须在派生类中重写的纯虚拟成员。