libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
libmesh.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_LIBMESH_H
21 #define LIBMESH_LIBMESH_H
22 
23 
24 // Local includes
25 #include "libmesh/libmesh_common.h"
26 #include "libmesh/libmesh_base.h"
27 
28 // C++ includes
29 #include <string>
30 #include <vector>
31 
32 // Forward declarations
33 // For dealing with MPI stuff in VTK.
34 #if defined(LIBMESH_HAVE_MPI) && defined(LIBMESH_HAVE_VTK)
35 class vtkMPIController;
36 #endif
37 
38 namespace TIMPI {
39  class TIMPIInit;
40 }
41 
51 namespace libMesh
52 {
53 
54 // Forward declarations
55 namespace Parallel {
56  class Communicator;
57 }
58 enum SolverPackage : int;
59 
81 {
82 public:
83 #ifdef LIBMESH_HAVE_MPI
84 
97  LibMeshInit(int argc, const char * const * argv,
98  MPI_Comm COMM_WORLD_IN=MPI_COMM_WORLD, int n_threads=-1);
99 #else
100  LibMeshInit(int argc, const char * const * argv,
101  int COMM_WORLD_IN=0, int n_threads=-1);
102 #endif
103 
112  virtual ~LibMeshInit();
113 
118  const Parallel::Communicator & comm() const { return *_comm; }
119 
120  Parallel::Communicator & comm() { return *_comm; }
121 
122 private:
123  // Should we just bite the bullet, use unique_ptr here, and bring an
124  // #include <memory> into everything?
125  TIMPI::TIMPIInit * _timpi_init;
126 
127  // Or should we keep this around so we can still inline its
128  // accessors despite forward declaring _timpi_init?
129  //
130  // This is constructed from the TIMPI::Communicator, for backwards
131  // compatibility.
132  Parallel::Communicator * _comm;
133 
134 #if defined(LIBMESH_HAVE_MPI) && defined(LIBMESH_HAVE_VTK)
135  // VTK object for dealing with MPI stuff in VTK.
136  // This can't be a std::unique_ptr because VTK makes the destructor
137  // protected and forces us to use a named destructor manually
138  vtkMPIController * _vtk_mpi_controller;
139 #endif
140 };
141 
148 bool initialized ();
149 
156 bool closed ();
157 
161 void enableFPE(bool on);
162 
166 void enableSEGV(bool on);
167 
181 bool on_command_line (std::string arg);
182 
191 template <typename T>
192 T command_line_value (const std::string &, T);
193 template <typename T>
194 T command_line_value (const std::vector<std::string> &, T);
195 
209 template <typename T>
210 T command_line_next (std::string name, T default_value);
211 
219 template <typename T>
220 void command_line_vector (const std::string &, std::vector<T> &);
221 
225 #ifdef LIBMESH_USE_COMPLEX_NUMBERS
226 extern const Number imaginary;
227 #endif
228 
237 SolverPackage default_solver_package ();
238 
242 const Real pi =
243  static_cast<Real>(3.1415926535897932384626433832795029L);
244 
248 const Number zero = 0.;
249 
254 const unsigned int invalid_uint = static_cast<unsigned int>(-1);
255 
260 const int invalid_int = std::numeric_limits<int>::max();
261 
262 } // namespace libMesh
263 
264 #endif // LIBMESH_LIBMESH_H
T command_line_next(std::string name, T value)
Use GetPot&#39;s search()/next() functions to get following arguments from the command line...
Definition: libmesh.C:937
bool closed()
Checks that the library has been closed.
Definition: libmesh.C:268
unsigned int n_threads()
Definition: libmesh_base.h:96
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
Definition: libmesh.h:254
LibMeshInit(int argc, const char *const *argv, MPI_Comm COMM_WORLD_IN=MPI_COMM_WORLD, int n_threads=-1)
Initialize the library for use, with the command line options provided.
void enableSEGV(bool on)
Toggle libMesh reporting of segmentation faults.
Definition: libmesh.C:842
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
Definition: libmesh.h:80
const Number zero
.
Definition: libmesh.h:248
vtkMPIController * _vtk_mpi_controller
Definition: libmesh.h:138
const Number imaginary
The imaginary unit, .
SolverPackage default_solver_package()
Definition: libmesh.C:967
T command_line_value(const std::string &name, T value)
Definition: libmesh.C:905
const int invalid_int
A number which is used quite often to represent an invalid or uninitialized value for an integer...
Definition: libmesh.h:260
virtual ~LibMeshInit()
Destructor.
Definition: libmesh.C:668
const Parallel::Communicator & comm() const
Returns a Communicator created from the TIMPIInit object we hold, which will be a compatibility shim ...
Definition: libmesh.h:118
TIMPI::TIMPIInit * _timpi_init
Definition: libmesh.h:125
void enableFPE(bool on)
Toggle floating point exceptions – courtesy of Cody Permann &amp; MOOSE team.
Definition: libmesh.C:800
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void command_line_vector(const std::string &name, std::vector< T > &vec)
Definition: libmesh.C:950
Parallel::Communicator & comm()
Definition: libmesh.h:120
bool initialized()
Checks that library initialization has been done.
Definition: libmesh.C:261
bool on_command_line(std::string arg)
Definition: libmesh.C:872
const Real pi
.
Definition: libmesh.h:242
Parallel::Communicator * _comm
Definition: libmesh.h:132