libmesh_base.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 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_BASE_H
21 #define LIBMESH_LIBMESH_BASE_H
22 
23 #include "libmesh/id_types.h"
24 
25 namespace libMesh {
26 
31 
36 
40  unsigned int n_threads();
41 
49  namespace libMeshPrivateData {
50 #ifdef LIBMESH_HAVE_MPI
51 
55 
60 #endif
61 
65  extern int _n_threads;
66  }
67 }
68 
69 
70 
71 // ------------------------------------------------------------
72 // libMesh inline member functions
73 inline
75 {
76 #ifdef LIBMESH_HAVE_MPI
78 #else
79  return 1;
80 #endif
81 }
82 
83 
84 
85 inline
87 {
88 #ifdef LIBMESH_HAVE_MPI
90 #else
91  return 0;
92 #endif
93 }
94 
95 
96 
97 
98 inline
99 unsigned int libMesh::n_threads()
100 {
101  return static_cast<unsigned int>(libMeshPrivateData::_n_threads);
102 }
103 
104 
105 // We now put everything we can into a separate libMesh namespace;
106 // code which forward declares libMesh classes or which specializes
107 // libMesh templates may want to know whether it is compiling under
108 // such conditions, to be backward compatible with older libMesh
109 // versions:
110 #define LIBMESH_USE_SEPARATE_NAMESPACE 1
111 
112 
113 // Unless configured otherwise, we import all of namespace libMesh,
114 // for backwards compatibility with pre-namespaced codes.
115 
116 #ifndef LIBMESH_REQUIRE_SEPARATE_NAMESPACE
117 using namespace libMesh;
118 #endif
119 
120 
121 #endif // LIBMESH_LIBMESH_BASE_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:05 UTC

Hosted By:
SourceForge.net Logo