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 #include <float.h>
29 
39 #if !HAVE_SINCOS
40 #define sincos(t, s, c) *s=sin(t); *c=cos(t)
41 #else
42 # ifdef DOXYGEN_RUN
43 # define sincos(t, s, c) (undefined)
44 # endif
45 #endif
46 
47 /* Typedef for various Gyoto data types */
48 namespace Gyoto {
49  //\{
72  typedef unsigned int Quantity_t;
74 
75  /* Generic */
76 
78 #define GYOTO_QUANTITY_INTENSITY 1
79 #define GYOTO_QUANTITY_EMISSIONTIME 2
81 
85 #define GYOTO_QUANTITY_MIN_DISTANCE 4
86 #define GYOTO_QUANTITY_FIRST_DMIN 8
88 #define GYOTO_QUANTITY_REDSHIFT 16
90 
94 #define GYOTO_QUANTITY_IMPACTCOORDS 32
95 #define GYOTO_QUANTITY_SPECTRUM 512
97 #define GYOTO_QUANTITY_BINSPECTRUM 1024
99  /* Astrobj-specific */
101 #define GYOTO_QUANTITY_USER1 32768
102 #define GYOTO_QUANTITY_USER2 16384
104 #define GYOTO_QUANTITY_USER3 8192
106 #define GYOTO_QUANTITY_USER4 4096
108 #define GYOTO_QUANTITY_USER5 2048
110  //\}
111 
125  //\{
127  typedef unsigned int Verbosity_t;
128 
130 #define GYOTO_DEFAULT_DEBUG_MODE 0
131 
133 
138 #define GYOTO_QUIET_VERBOSITY 1
139 
141 
147 #define GYOTO_SEVERE_VERBOSITY 3
148 
150 
156 #define GYOTO_WARNING_VERBOSITY GYOTO_SEVERE_VERBOSITY
157 
159 
165 #define GYOTO_DEFAULT_VERBOSITY 5
166 
168 
174 #define GYOTO_INFO_VERBOSITY 10
175 
177 
184 #define GYOTO_DEBUG_VERBOSITY 3000
185 
187 
196 #define GYOTO_QUIET if (Gyoto::verbose() >= GYOTO_QUIET_VERBOSITY) std::cout
197 
199 
204 #define GYOTO_SEVERE if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY) std::cerr<<"SEVERE: "
205 
207 
212 #define GYOTO_WARNING if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY) std::cerr<<"WARNING: "
213 
215 
223 #define GYOTO_MSG if (Gyoto::verbose() >= GYOTO_DEFAULT_VERBOSITY) std::cout
224 
226 
234 #define GYOTO_INFO if (Gyoto::verbose() >= GYOTO_INFO_VERBOSITY) std::cerr<<"INFO: "
235 
237 
244 #define GYOTO_WARNING_UDUNITS(from, to) \
245  GYOTO_WARNING << "unit ignored (trying to convert from \"" << from \
246  << "\" to " \
247  << to \
248  << "\"), you may have more chance recompiling Gyoto with --with-udunits\n"
249 
251 
263 #define GYOTO_DEBUG_EXPR(a) GYOTO_DEBUG << #a << "=" << a << std::endl
264 
266 
282 #define GYOTO_DEBUG_ARRAY(a,n) if (GYOTO_DEBUG_MODE) { \
283  std::cerr << "DEBUG: " << __PRETTY_FUNCTION__ << ": " \
284  << #a << "=[" << a[0] ; \
285  for (size_t _gyoto_debug_array_i=1; _gyoto_debug_array_i < n; ++_gyoto_debug_array_i) \
286  std::cerr << "," << a[_gyoto_debug_array_i] ; \
287  std::cerr << "]" << std::endl ;}
288 
290 
299 #define GYOTO_DEBUG if (GYOTO_DEBUG_MODE) std::cerr << "DEBUG: " << __PRETTY_FUNCTION__ << ": "
300 
302 
306 #define GYOTO_IF_DEBUG if (GYOTO_DEBUG_MODE) {
307 
309 
313 #define GYOTO_ENDIF_DEBUG }
314 
316 #define GYOTO_DEBUG_MODE Gyoto::debug()
317 
318  //\}
319  //\{
332  typedef unsigned int CoordKind_t;
333 #define GYOTO_COORDKIND_UNSPECIFIED 0
334 #define GYOTO_COORDKIND_CARTESIAN 1
335 #define GYOTO_COORDKIND_SPHERICAL 2
336  //\}
337 }
338 
339 //{
344 #define GYOTO_DEFAULT_X_SIZE 1024
345 
346 
353 #define GYOTO_DEFAULT_DELTA 0.01
354 
358 #define GYOTO_DEFAULT_DELTA_MAX DBL_MAX
359 
363 #define GYOTO_DEFAULT_DELTA_MIN DBL_MIN
364 
373 #define GYOTO_DEFAULT_DELTA_MAX_OVER_R 1.
374 
375 #define GYOTO_DEFAULT_ABSTOL 1e-6
376 #define GYOTO_DEFAULT_RELTOL 1e-6
377 
381 #define GYOTO_DEFAULT_MAXITER 100000
382 
388 #define GYOTO_T_TOL 1e-4
389 
390 #define GYOTO_KERR_HORIZON_SECURITY 0.01
391 
393 #define GYOTO_SCREEN_DMAX DBL_MAX
394 
395 //For displays with setw and setprecision
397 #define GYOTO_PREC 15
398 #define GYOTO_WIDTH 25
400 
401 /* Plugins Stuff */
403 #ifndef GYOTO_DEFAULT_PLUGINS
404 #define GYOTO_DEFAULT_PLUGINS "stdplug,nofail:lorene"
405 #endif
406 
407 #ifndef GYOTO_PLUGIN_SFX
408 #define GYOTO_PLUGIN_SFX "so"
409 #endif
410 
411 //\}
412 
413 //\{
417 #define GYOTO_C 299792458.
419 #define GYOTO_C_CGS 2.99792458e10
421 #define GYOTO_G 6.67428e-11
423 #define GYOTO_G_CGS 6.67428e-8
425 #define GYOTO_G_OVER_C_SQUARE 7.426138e-28
427 #define GYOTO_PLANCK 6.62606896e-34
429 #define GYOTO_PLANCK_CGS 6.62606896e-27
431 #define GYOTO_PLANCK_OVER_C_SQUARE 7.372496e-51
433 #define GYOTO_BOLTZMANN 1.3806504e-23
435 #define GYOTO_BOLTZMANN_CGS 1.3806504e-16
437 #define GYOTO_STEFANBOLTZMANN_CGS 5.670373e-5
439 #define GYOTO_PLANCK_OVER_BOLTZMANN 4.7992373e-11
441 #define GYOTO_GAS_CST 8.3144621
443 #define GYOTO_GAS_CST_CGS 8.3144621e7
445 #define GYOTO_AVOGADRO 6.0221413e23
447 #define GYOTO_THOMSON_CGS 6.6524e-25
449 #define GYOTO_ALPHA_F 0.00729927
451 #define GYOTO_PROTON_MASS_CGS 1.67262158e-24
453 #define GYOTO_ELECTRON_MASS_CGS 9.10938188e-28
455 #define GYOTO_ELECTRON_CLASSICAL_RADIUS_CGS 2.8179e-13
457 #define GYOTO_ELEMENTARY_CHARGE_CGS 4.80320427e-10
459 #define GYOTO_EULER_MASCHERONI 0.577216
461 #define GYOTO_ATOMIC_MASS_UNIT_CGS 1.660537781e-24
463 #define GYOTO_INU_CGS_TO_SI 0.001
465 
467 #define GYOTO_SUN_MASS 1.98843e30
468 #define GYOTO_SUN_MASS_CGS 1.98843e33
470 #define GYOTO_SUN_RADIUS 6.955e8
472 #define GYOTO_KPC 3.08568025e19
474 #define GYOTO_ASTRONOMICAL_UNIT 1.49597870700e11
476 #define GYOTO_LIGHT_YEAR 9.4607304725808e15
478 
480 #define GYOTO_RADEG 57.2957795130823
481 #define GYOTO_DEGRAD 0.0174532925199433
483 #define GYOTO_MINRAD 2.908882086657216e-04
485 #define GYOTO_SECRAD 4.848136811095360e-06
487 #define GYOTO_MASRAD 4.848136811095360e-09
489 #define GYOTO_MUASRAD 4.848136811095360e-12
491 
493 #define GYOTO_eV2Hz 2.417989348e+14
494 
495 //\}
496 
497 #ifndef GYOTO_NO_DEPRECATED
498 #warning Using deprecated method names.\
499  Define GYOTO_NO_DEPRECATED to disable.
500 //\{
509 # define getMetric metric
510 # define setMetric metric
511 # define setScreen screen
512 # define getScreen screen
513 # define getRmax rMax
514 # define setRmax rMax
515 # define getMass mass
516 # define setMass mass
517 # define getCoordKind coordKind
518 # define setCoordKind coordKind
519 # define getKind kind
520 # define setKind kind
521 # define getSpin spin
522 # define setSpin spin
523 # define getIntegKind integKind
524 # define setIntegKind integKind
525 # define getFileName fileName
526 # define setFileName fileName
527 # define getDistance distance
528 # define setDistance distance
529 # define getPALN PALN
530 # define setPALN PALN
531 # define getArgument argument
532 # define setArgument argument
533 # define getInclination inclination
534 # define setInclination inclination
535 # define getAstrobj astrobj
536 # define setAstrobj astrobj
537 # define getSpectrometer spectrometer
538 # define setSpectrometer spectrometer
539 # define getSpectrum spectrum
540 # define setSpectrum spectrum
541 # define getOpacity opacity
542 # define setOpacity opacity
543 # define setDelta delta
544 # define getDelta delta
545 # define setDelta delta
546 # define getDelta delta
547 # define setDelta0 delta0
548 # define getDelta0 delta0
549 # define setAlpha0 alpha0
550 # define getAlpha0 alpha0
551 # define getTmin tMin
552 # define setTmin tMin
553 # define getTime time
554 # define setTime time
555 # define getFreqObs freqObs
556 # define setFreqObs freqObs
557 # define getFieldOfView fieldOfView
558 # define setFieldOfView fieldOfView
559 # define getRadius radius
560 # define setRadius radius
561 # define getLargeRadius largeRadius
562 # define setLargeRadius largeRadius
563 # define getSmallRadius smallRadius
564 # define setSmallRadius smallRadius
565 # define getCentralDensity centralDensity
566 # define setCentralDensity centralDensity
567 # define getDmax dMax
568 # define setDmax dMax
569 # define getTemperature temperature
570 # define setTemperature temperature
571 # define getScaling scaling
572 # define setScaling scaling
573 # define getPatternVelocity patternVelocity
574 # define setPatternVelocity patternVelocity
575 # define getLambda lambda
576 # define setLambda lambda
577 # define getCentralTempOverVirial centralTempOverVirial
578 # define setCentralTempOverVirial centralTempOverVirial
579 # define getBeta beta
580 # define setBeta beta
581 # define getConstant constant
582 # define setConstant constant
583 # define getExponent exponent
584 # define setExponent exponent
585 # define getFlag_radtransf opticallyThin
586 # define setFlag_radtransf opticallyThin
587 # define getNThreads nThreads
588 # define setNThreads nThreads
589 # define getResolution resolution
590 # define setResolution resolution
591 # define getNSamples nSamples
592 # define setNSamples nSamples
593 # define getSpectralOverSampling spectralOversampling
594 # define setSpectralOverSampling spectralOversampling
595 # define setBinSpectrumConverter binSpectrumConverter
596 # define setSpectrumConverter spectrumConverter
597 # define setIntensityConverter intensityConverter
598 //\}
599 #endif
600 
601 #endif
unsigned int Verbosity_t
Type for verbosity levels.
Definition: GyotoDefs.h:127
Compile-time configuration.
unsigned int CoordKind_t
Type for coordinate system kinds.
Definition: GyotoDefs.h:332
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:42
unsigned int Quantity_t
Type for observabke quantities.
Definition: GyotoDefs.h:73