casa
$Rev:20696$
|
00001 //# QC.h: physical constants with units 00002 //# Copyright (C) 1994,1995,1996,1997,1998,1999 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 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 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id: QC.h 20551 2009-03-25 00:11:33Z Malte.Marquarding $ 00027 00028 #ifndef CASA_QC_H 00029 #define CASA_QC_H 00030 00031 00032 //# Includes 00033 #include <casa/aips.h> 00034 #include <casa/BasicSL/Constants.h> 00035 #include <casa/Quanta/Quantum.h> 00036 #include <casa/Quanta/UnitMap.h> 00037 00038 namespace casa { //# NAMESPACE CASA - BEGIN 00039 00040 //# Forward Declarations 00041 00042 //# Typedefs 00043 00044 // <summary> 00045 // Physical constants (i.e. dimensioned values) 00046 // </summary> 00047 00048 // <use visibility=export> 00049 00050 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tQuantum"> 00051 00052 // <prerequisite> 00053 // <li> <linkto class=Quantum>Quantum</linkto> 00054 // </prerequisite> 00055 00056 // <etymology> 00057 // A QC is based on the Quantum and C (constants) class 00058 // </etymology> 00059 00060 // <synopsis> 00061 // QC:name will produce a Quantity (Quantum<Double>) value consisting of 00062 // a value and a unit. See the <linkto class=Quantum>Quantum</linkto> class 00063 // for possibilities of manipulating quanta. 00064 // tQuantum will give a list of the currently available constants 00065 // </synopsis> 00066 00067 // <example> 00068 // To obtain the velocity of light in pc/a, use: 00069 // <srcblock> 00070 // #include <casa/Quanta.h> 00071 // Double vel_pcpy = (C::c).convert("pc/a").getValue(); 00072 // </srcblock> 00073 // </example> 00074 00075 //############################################################################ 00076 //# NOTE: Delete the following listing of the public data members when 00077 //# public data members are handled properly by the documentation 00078 //# extractor. 00079 //############################################################################ 00080 00081 // The following constants are defined as public data members of class QC. 00082 // 00083 // <note role=caution> 00084 // The following public data member documentation is currently extracted by 00085 // hand, and thus could be out of date if this documentation was not updated 00086 // when the class was modified. 00087 // </note> 00088 00089 // <srcblock> 00090 // 00091 // // vel of light 00092 // static Quantum<Double> c; 00093 // 00094 // // Gravitational constant 00095 // static Quantum<Double> G; 00096 // 00097 // // Planck 00098 // static Quantum<Double> h; 00099 // 00100 // // HI line 00101 // static Quantum<Double> HI; 00102 // 00103 // // Gas constant 00104 // static Quantum<Double> R; 00105 // 00106 // // Avogadro 00107 // static Quantum<Double> NA; 00108 // 00109 // // electron charge 00110 // static Quantum<Double> e; 00111 // 00112 // // proton mass 00113 // static Quantum<Double> mp; 00114 // 00115 // // mp/me 00116 // static Quantum<Double> mp_me; 00117 // 00118 // // permeability vacuum 00119 // static Quantum<Double> mu0; 00120 // 00121 // // permittivity vacuum 00122 // static Quantum<Double> epsilon0; 00123 // 00124 // // Boltzmann 00125 // static Quantum<Double> k; 00126 // 00127 // // Faraday 00128 // static Quantum<Double> F; 00129 // 00130 // // mass electron 00131 // static Quantum<Double> me; 00132 // 00133 // // radius electron 00134 // static Quantum<Double> re; 00135 // 00136 // // Bohr's radius 00137 // static Quantum<Double> a0; 00138 // 00139 // // Solar radius 00140 // static Quantum<Double> R0; 00141 // 00142 // // IAU Gaussian grav. const **2 00143 // static Quantum<Double> k2; 00144 // 00145 // </srcblock> 00146 00147 // <motivation> 00148 // Physical constants should be known with their proper dimensions 00149 // </motivation> 00150 // 00151 // <todo asof="941110"> 00152 // </todo> 00153 00154 class QC { 00155 friend class QC_init; 00156 public: 00157 00158 //# If you change any of the public data members, make the corresponding 00159 //# change above to the documentation of the public data members. 00160 00161 // vel of light 00162 static Quantum<Double> c; 00163 00164 // Gravitational constant 00165 static Quantum<Double> G; 00166 00167 // Planck 00168 static Quantum<Double> h; 00169 00170 // HI line 00171 static Quantum<Double> HI; 00172 00173 // Gas constant 00174 static Quantum<Double> R; 00175 00176 // Avogadro 00177 static Quantum<Double> NA; 00178 00179 // electron charge 00180 static Quantum<Double> e; 00181 00182 // proton mass 00183 static Quantum<Double> mp; 00184 00185 // mp/me 00186 static Quantum<Double> mp_me; 00187 00188 // permeability vacuum 00189 static Quantum<Double> mu0; 00190 00191 // permittivity vacuum 00192 static Quantum<Double> epsilon0; 00193 00194 // Boltzmann 00195 static Quantum<Double> k; 00196 00197 // Faraday 00198 static Quantum<Double> F; 00199 00200 // mass electron 00201 static Quantum<Double> me; 00202 00203 // radius electron 00204 static Quantum<Double> re; 00205 00206 // Bohr's radius 00207 static Quantum<Double> a0; 00208 00209 // Solar radius 00210 static Quantum<Double> R0; 00211 00212 // IAU Gaussian grav. const **2 00213 static Quantum<Double> k2; 00214 private: 00215 // This function is used, in conjunction with the 00216 // <linkto class=QC_init>QC_init</linkto> 00217 // class to force construction of statics (see ARM 3.4). 00218 static void init(); 00219 }; 00220 00221 00222 // <summary> 00223 // Class used to force construction of <linkto class=QC>QC</linkto>. 00224 // </summary> 00225 00226 // <synopsis> 00227 // A static object of this class is used to make sure that 00228 // <linkto class=QC>QC</linkto> 00229 // is constructed before it is needed, and therefore that its static data 00230 // members are defined. See Meyers, p. 47. 00231 // </synopsis> 00232 00233 // <use visibility=local> 00234 00235 // <linkfrom anchor="QC_init" classes="QC"> 00236 // <here>QC_init</here> -- 00237 // Class used to force construction of <linkto class=QC>QC</linkto>. 00238 // </linkfrom> 00239 00240 class QC_init { 00241 public: 00242 QC_init(); 00243 ~QC_init(); 00244 private: 00245 static uShort count; 00246 }; 00247 00248 // <summary> 00249 // Object used to force construction of <linkto class=QC>QC</linkto>. 00250 // </summary> 00251 00252 // <synopsis> 00253 // This static object of the <linkto class=QC_init>QC_init</linkto> 00254 // class is used to make sure that 00255 // <linkto class=QC>QC</linkto> 00256 // is constructed before it is needed, and therefore that its static data 00257 // members are defined. See Meyers, p. 47. 00258 // </synopsis> 00259 00260 // <use visibility=local> 00261 00262 // <linkfrom anchor="QC initialization object" classes="QC QC_init"> 00263 // <here>QC initialization object</here> -- 00264 // Object used to force construction of <linkto class=QC>QC</linkto>. 00265 // </linkfrom> 00266 00267 // <group name="QC initialization object"> 00268 00269 static QC_init qc_init; 00270 00271 // </group> 00272 00273 //# Inline Implementations 00274 00275 00276 } //# NAMESPACE CASA - END 00277 00278 #endif