00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2011 by the OpenStructure authors 00005 // 00006 // This library is free software; you can redistribute it and/or modify it under 00007 // the terms of the GNU Lesser General Public License as published by the Free 00008 // Software Foundation; either version 3.0 of the License, or (at your option) 00009 // any later version. 00010 // This library is distributed in the hope that it will be useful, but WITHOUT 00011 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00013 // details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with this library; if not, write to the Free Software Foundation, Inc., 00017 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 //------------------------------------------------------------------------------ 00019 #ifndef OST_UNITS_HH 00020 #define OST_UNITS_HH 00021 00022 #include <ost/module_config.hh> 00023 00024 /* 00025 convenience struct for units 00026 00027 Author: Ansgar Philippsen 00028 */ 00029 00030 namespace ost { 00031 00043 #ifdef _MSC_VER 00044 namespace Units { 00045 const Real m=1.0e10; 00046 const Real cm=1.0e8; 00047 const Real mm=1.0e7; 00048 const Real um=1.0e4; 00049 const Real nm=1.0e1; 00050 const Real pm=1.0e-2; 00051 const Real A=1.0; 00052 00053 const Real in=2.54e8; 00054 const Real ft=3.048e9; 00055 const Real yd=9.144e9; 00056 00057 // standard angular unit is radians 00058 const Real deg=0.0174532925199; 00059 const Real rad=1.0; 00060 const Real mrad=1.0e-3; 00061 00062 // energy units converted according to metric units 00063 const Real J=1.0e20; 00064 const Real eV=16.0217653; 00065 00066 00067 // converted according to metric units 00068 const Real V=1.0e20; 00069 const Real kV=1.0e23; 00070 00071 // time units 00072 const Real s=1.0; 00073 const Real min=60.0; 00074 const Real h=3600.0; 00075 00076 //mass units 00077 const Real kg=1.0; 00078 const Real g=1.0e-3; 00079 const Real mg=1.0e-6; 00080 const Real kDa=1.6605655e-24; 00081 const Real Da=1.6605655e-27; 00082 00083 //charge 00084 const Real C=1.0; 00085 00086 } // Units 00087 00088 #else 00089 00090 struct DLLEXPORT_OST_BASE Units { 00091 static const Real m; 00092 static const Real cm; 00093 static const Real mm; 00094 static const Real um; 00095 static const Real nm; 00096 static const Real pm; 00097 static const Real A; 00098 00099 static const Real in; 00100 static const Real ft; 00101 static const Real yd; 00102 00103 static const Real deg; 00104 static const Real rad; 00105 static const Real mrad; 00106 00107 static const Real J; 00108 static const Real eV; 00109 00110 static const Real V; 00111 static const Real kV; 00112 00113 static const Real s; 00114 static const Real min; 00115 static const Real h; 00116 00117 static const Real kg; 00118 static const Real g; 00119 static const Real mg; 00120 static const Real kDa; 00121 static const Real Da; 00122 00123 static const Real C; 00124 }; 00125 00126 #endif 00127 00128 } // ns 00129 00130 00131 00132 00133 00134 00135 00136 #endif // OST_UNITS_HH