Gyoto
GyotoDefs.h
Go to the documentation of this file.
1 
5 /*
6  Copyright 2011 Thibaut Paumard
7 
8  This file is part of Gyoto.
9 
10  Gyoto is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  Gyoto is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef __GyotoDefs_H_
25 #define __GyotoDefs_H_
26 
27 #include "GyotoConfig.h"
28 
38 #if !HAVE_SINCOS
39 #define sincos(t, s, c) *s=sin(t); *c=cos(t)
40 #else
41 # ifdef DOXYGEN_RUN
42 # define sincos(t, s, c) (undefined)
43 # endif
44 #endif
45 
46 /* Typedef for various Gyoto data types */
47 namespace Gyoto {
48  //\{
71  typedef unsigned int Quantity_t;
73 
74  /* Generic */
75 
77 #define GYOTO_QUANTITY_INTENSITY 1
78 #define GYOTO_QUANTITY_EMISSIONTIME 2
80 
84 #define GYOTO_QUANTITY_MIN_DISTANCE 4
85 #define GYOTO_QUANTITY_FIRST_DMIN 8
87 #define GYOTO_QUANTITY_REDSHIFT 16
89 
93 #define GYOTO_QUANTITY_IMPACTCOORDS 32
94 #define GYOTO_QUANTITY_SPECTRUM 512
96 #define GYOTO_QUANTITY_BINSPECTRUM 1024
98  /* Astrobj-specific */
100 #define GYOTO_QUANTITY_USER1 32768
101 #define GYOTO_QUANTITY_USER2 16384
103 #define GYOTO_QUANTITY_USER3 8192
105 #define GYOTO_QUANTITY_USER4 4096
107 #define GYOTO_QUANTITY_USER5 2048
109  //\}
110 
124  //\{
126  typedef unsigned int Verbosity_t;
127 
129 #define GYOTO_DEFAULT_DEBUG_MODE 0
130 
132 
137 #define GYOTO_QUIET_VERBOSITY 1
138 
140 
146 #define GYOTO_SEVERE_VERBOSITY 3
147 
149 
155 #define GYOTO_WARNING_VERBOSITY GYOTO_SEVERE_VERBOSITY
156 
158 
164 #define GYOTO_DEFAULT_VERBOSITY 5
165 
167 
173 #define GYOTO_INFO_VERBOSITY 10
174 
176 
183 #define GYOTO_DEBUG_VERBOSITY 3000
184 
186 
195 #define GYOTO_QUIET if (Gyoto::verbose() >= GYOTO_QUIET_VERBOSITY) std::cout
196 
198 
203 #define GYOTO_SEVERE if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY) std::cerr<<"SEVERE: "
204 
206 
211 #define GYOTO_WARNING if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY) std::cerr<<"WARNING: "
212 
214 
222 #define GYOTO_MSG if (Gyoto::verbose() >= GYOTO_DEFAULT_VERBOSITY) std::cout
223 
225 
233 #define GYOTO_INFO if (Gyoto::verbose() >= GYOTO_INFO_VERBOSITY) std::cerr<<"INFO: "
234 
236 
243 #define GYOTO_WARNING_UDUNITS(from, to) \
244  GYOTO_WARNING << "unit ignored (trying to convert from \"" << from \
245  << "\" to " \
246  << to \
247  << "\"), you may have more chance recompiling Gyoto with --with-udunits\n"
248 
250 
262 #define GYOTO_DEBUG_EXPR(a) GYOTO_DEBUG << #a << "=" << a << std::endl
263 
265 
281 #define GYOTO_DEBUG_ARRAY(a,n) if (GYOTO_DEBUG_MODE) { \
282  std::cerr << "DEBUG: " << __PRETTY_FUNCTION__ << ": " \
283  << #a << "=[" << a[0] ; \
284  for (size_t _gyoto_debug_array_i=1; _gyoto_debug_array_i < n; ++_gyoto_debug_array_i) \
285  std::cerr << "," << a[_gyoto_debug_array_i] ; \
286  std::cerr << "]" << std::endl ;}
287 
289 
298 #define GYOTO_DEBUG if (GYOTO_DEBUG_MODE) std::cerr << "DEBUG: " << __PRETTY_FUNCTION__ << ": "
299 
301 
305 #define GYOTO_IF_DEBUG if (GYOTO_DEBUG_MODE) {
306 
308 
312 #define GYOTO_ENDIF_DEBUG }
313 
315 #define GYOTO_DEBUG_MODE Gyoto::debug()
316 
317  //\}
318  //\{
331  typedef unsigned int CoordKind_t;
332 #define GYOTO_COORDKIND_UNSPECIFIED 0
333 #define GYOTO_COORDKIND_CARTESIAN 1
334 #define GYOTO_COORDKIND_SPHERICAL 2
335  //\}
336 }
337 
338 //{
343 #define GYOTO_DEFAULT_X_SIZE 1024
344 
345 
352 #define GYOTO_DEFAULT_DELTA 0.01
353 
357 #define GYOTO_DEFAULT_MAXITER 100000
358 
364 #define GYOTO_T_TOL 1e-4
365 
366 
368 #define GYOTO_SCREEN_DMAX 1e7
369 
370 //For displays with setw and setprecision
372 #define GYOTO_PREC 15
373 #define GYOTO_WIDTH 25
375 
376 /* Plugins Stuff */
378 #ifndef GYOTO_DEFAULT_PLUGINS
379 #define GYOTO_DEFAULT_PLUGINS "stdplug,nofail:lorene"
380 #endif
381 
382 #ifndef GYOTO_PLUGIN_SFX
383 #define GYOTO_PLUGIN_SFX "so"
384 #endif
385 
386 //\}
387 
388 //\{
392 #define GYOTO_C 299792458.
394 #define GYOTO_C_CGS 2.99792458e10
396 #define GYOTO_G 6.67428e-11
398 #define GYOTO_G_CGS 6.67428e-8
400 #define GYOTO_G_OVER_C_SQUARE 7.426138e-28
402 #define GYOTO_PLANCK 6.62606896e-34
404 #define GYOTO_PLANCK_CGS 6.62606896e-27
406 #define GYOTO_PLANCK_OVER_C_SQUARE 7.372496e-51
408 #define GYOTO_BOLTZMANN 1.3806504e-23
410 #define GYOTO_BOLTZMANN_CGS 1.3806504e-16
412 #define GYOTO_PLANCK_OVER_BOLTZMANN 4.7992373e-11
414 #define GYOTO_GAS_CST 8.3144621
416 #define GYOTO_GAS_CST_CGS 8.3144621e7
418 #define GYOTO_AVOGADRO 6.0221413e23
420 #define GYOTO_THOMSON_CGS 6.6524e-25
422 #define GYOTO_ALPHA_F 0.00729927
424 #define GYOTO_PROTON_MASS_CGS 1.67262158e-24
426 #define GYOTO_ELECTRON_MASS_CGS 9.10938188e-28
428 #define GYOTO_ELECTRON_CLASSICAL_RADIUS_CGS 2.8179e-13
430 #define GYOTO_ELEMENTARY_CHARGE_CGS 4.80320427e-10
432 #define GYOTO_EULER_MASCHERONI 0.577216
434 #define GYOTO_ATOMIC_MASS_UNIT_CGS 1.660537781e-24
436 #define GYOTO_INU_CGS_TO_SI 0.001
438 
440 #define GYOTO_SUN_MASS 1.98843e30
441 #define GYOTO_SUN_MASS_CGS 1.98843e33
443 #define GYOTO_SUN_RADIUS 6.955e8
445 #define GYOTO_KPC 3.08568025e19
447 #define GYOTO_ASTRONOMICAL_UNIT 1.49597870700e11
449 #define GYOTO_LIGHT_YEAR 9.4607304725808e15
451 
453 #define GYOTO_RADEG 57.2957795130823
454 #define GYOTO_DEGRAD 0.0174532925199433
456 #define GYOTO_MINRAD 2.908882086657216e-04
458 #define GYOTO_SECRAD 4.848136811095360e-06
460 #define GYOTO_MASRAD 4.848136811095360e-09
462 #define GYOTO_MUASRAD 4.848136811095360e-12
464 
466 #define GYOTO_eV2Hz 2.417989348e+14
467 
468 //\}
469 
470 #endif
unsigned int Verbosity_t
Type for verbosity levels.
Definition: GyotoDefs.h:126
Compile-time configuration.
unsigned int CoordKind_t
Type for coordinate system kinds.
Definition: GyotoDefs.h:331
unsigned int Quantity_t
Type for observabke quantities.
Definition: GyotoDefs.h:72