$extrastylesheet
libmesh.h
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 
00020 #ifndef LIBMESH_LIBMESH_H
00021 #define LIBMESH_LIBMESH_H
00022 
00023 
00024 // Local includes
00025 #include "libmesh/libmesh_common.h"
00026 #include "libmesh/libmesh_base.h"
00027 #include "libmesh/enum_solver_package.h"
00028 #include "libmesh/parallel.h"
00029 
00030 // C++ includes
00031 #include <string>
00032 #include <vector>
00033 
00042 namespace libMesh
00043 {
00044 
00045 
00057 class LibMeshInit
00058 {
00059 public:
00060 #ifdef LIBMESH_HAVE_MPI
00061 
00068   LibMeshInit(int argc, const char* const* argv,
00069               MPI_Comm COMM_WORLD_IN=MPI_COMM_WORLD);
00070 #else
00071   LibMeshInit(int argc, const char* const* argv);
00072 #endif
00073 
00074   virtual ~LibMeshInit();
00075 
00076   const Parallel::Communicator& comm() const { return _comm; }
00077 
00078   Parallel::Communicator& comm() { return _comm; }
00079 
00080 private:
00081   Parallel::Communicator _comm;
00082 };
00083 
00090 bool initialized ();
00091 
00098 bool closed ();
00099 
00103 void enableFPE(bool on);
00104 
00108 void enableSEGV(bool on);
00109 
00114 bool on_command_line (const std::string& arg);
00115 
00121 template <typename T>
00122 T command_line_value (const std::string &, T);
00123 template <typename T>
00124 T command_line_value (const std::vector<std::string> &, T);
00125 
00130 template <typename T>
00131 T command_line_next (const std::string &, T);
00132 
00137 template <typename T>
00138 void command_line_vector (const std::string &, std::vector<T>&);
00139 
00143 #ifdef LIBMESH_USE_COMPLEX_NUMBERS
00144 extern const Number imaginary;
00145 #endif
00146 
00155 SolverPackage default_solver_package ();
00156 
00160 const Real pi =
00161   static_cast<Real>(3.1415926535897932384626433832795029L);
00162 
00166 const Number zero = 0.;
00167 
00172 const unsigned int invalid_uint = static_cast<unsigned int>(-1);
00173 
00174 } // namespace libMesh
00175 
00176 #endif // LIBMESH_LIBMESH_H