id_types.h
Go to the documentation of this file.00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2012 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_ID_TYPES_H 00021 #define LIBMESH_ID_TYPES_H 00022 00023 #include <limits> 00024 #include <stdint.h> 00025 00026 #include "libmesh/libmesh_config.h" 00027 00028 namespace libMesh 00029 { 00030 00031 // A useful way to debug: 00032 #if 0 00033 class TestClass { 00034 //int _c; 00035 unsigned int _c; 00036 public: 00037 TestClass() : _c(0) {} 00038 TestClass(unsigned int c) : _c(c) {} 00039 TestClass& operator=(unsigned int c) { _c = c; return *this; } 00040 bool operator<(const TestClass &l) const { return _c < l._c; } 00041 operator int() const { return _c; } 00042 }; 00043 typedef TestClass subdomain_id_type; 00044 #endif 00045 00046 #if LIBMESH_BOUNDARY_ID_BYTES == 1 00047 typedef int8_t boundary_id_type; 00048 #elif LIBMESH_BOUNDARY_ID_BYTES == 4 00049 typedef int32_t boundary_id_type; 00050 #elif LIBMESH_BOUNDARY_ID_BYTES == 8 00051 typedef int64_t boundary_id_type; 00052 #else // LIBMESH_BOUNDARY_ID_BYTES = 2 (default) 00053 typedef int16_t boundary_id_type; 00054 #endif 00055 00056 00057 #if LIBMESH_DOF_ID_BYTES == 1 00058 typedef uint8_t dof_id_type; 00059 #elif LIBMESH_DOF_ID_BYTES == 2 00060 typedef uint16_t dof_id_type; 00061 #elif LIBMESH_DOF_ID_BYTES == 8 00062 typedef uint64_t dof_id_type; 00063 #else // LIBMESH_DOF_ID_BYTES = 4 (default) 00064 typedef uint32_t dof_id_type; 00065 #endif 00066 00067 00068 // We may want to specialize this later, but for now we'll assume 00069 // numeric vector indices are the same as dof indices 00070 typedef dof_id_type numeric_index_type; 00071 00072 00073 // Define processor id storage type. We default to short to save 00074 // space, but expanding to support more than 2^16-2 procs should work 00075 // too. 00076 #if LIBMESH_PROCESSOR_ID_BYTES == 1 00077 typedef uint8_t processor_id_type; 00078 #elif LIBMESH_PROCESSOR_ID_BYTES == 4 00079 typedef uint32_t processor_id_type; 00080 #elif LIBMESH_PROCESSOR_ID_BYTES == 8 00081 typedef uint64_t processor_id_type; 00082 #else // LIBMESH_PROCESSOR_ID_BYTES = 2 (default) 00083 typedef uint16_t processor_id_type; 00084 #endif 00085 00086 00087 #if LIBMESH_SUBDOMAIN_ID_BYTES == 1 00088 typedef uint8_t subdomain_id_type; 00089 #elif LIBMESH_SUBDOMAIN_ID_BYTES == 4 00090 00095 typedef int32_t subdomain_id_type; 00096 #elif LIBMESH_SUBDOMAIN_ID_BYTES == 8 00097 00101 typedef int64_t subdomain_id_type; 00102 #else // LIBMESH_SUBDOMAIN_ID_BYTES = 2 (default) 00103 typedef uint16_t subdomain_id_type; 00104 #endif 00105 00106 } // namespace libMesh 00107 00108 #endif // LIBMESH_ID_TYPES_H
Site Created By: libMesh Developers
Last modified: February 05 2013 19:54:47 UTC
Hosted By: