Gyoto
GyotoDefs.h
Go to the documentation of this file.
1
5/*
6 Copyright 2011, 2018 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#include <vector>
30
40#if !HAVE_SINCOS
41#define sincos(t, s, c) *s=sin(t); *c=cos(t)
42#else
43# ifdef DOXYGEN_RUN
44# define sincos(t, s, c) (undefined)
45# endif
46#endif
47
48/* Typedef for various Gyoto data types */
49namespace Gyoto {
50 typedef std::vector<double> state_t;
51
52 //\{
75
76 typedef unsigned int Quantity_t;
77
78 /* Generic */
79
80#define GYOTO_QUANTITY_NONE 0
81
83#define GYOTO_QUANTITY_INTENSITY 1
85#define GYOTO_QUANTITY_EMISSIONTIME 2
87
90#define GYOTO_QUANTITY_MIN_DISTANCE 4
92#define GYOTO_QUANTITY_FIRST_DMIN 8
94#define GYOTO_QUANTITY_REDSHIFT 16
96
99#define GYOTO_QUANTITY_IMPACTCOORDS 32
101#define GYOTO_QUANTITY_SPECTRUM 64
103#define GYOTO_QUANTITY_SPECTRUM_STOKES_Q 128
105#define GYOTO_QUANTITY_SPECTRUM_STOKES_U 256
107#define GYOTO_QUANTITY_SPECTRUM_STOKES_V 512
109#define GYOTO_QUANTITY_BINSPECTRUM 1024
110 /* Astrobj-specific */
112#define GYOTO_QUANTITY_USER1 32768
114#define GYOTO_QUANTITY_USER2 16384
116#define GYOTO_QUANTITY_USER3 8192
118#define GYOTO_QUANTITY_USER4 4096
120#define GYOTO_QUANTITY_USER5 2048
122#define GYOTO_QUANTITY_SPECTRAL (GYOTO_QUANTITY_SPECTRUM | GYOTO_QUANTITY_SPECTRUM_STOKES_Q | GYOTO_QUANTITY_SPECTRUM_STOKES_U | GYOTO_QUANTITY_SPECTRUM_STOKES_V | GYOTO_QUANTITY_BINSPECTRUM)
124#define GYOTO_QUANTITY_SPECTRUM_STOKES (GYOTO_QUANTITY_SPECTRUM | GYOTO_QUANTITY_SPECTRUM_STOKES_Q | GYOTO_QUANTITY_SPECTRUM_STOKES_U | GYOTO_QUANTITY_SPECTRUM_STOKES_V)
125 //\}
126
140 //\{
142 typedef unsigned int Verbosity_t;
143
145#define GYOTO_DEFAULT_DEBUG_MODE 0
146
148
153#define GYOTO_QUIET_VERBOSITY 1
154
156
162#define GYOTO_SEVERE_VERBOSITY 3
163
165
171#define GYOTO_WARNING_VERBOSITY GYOTO_SEVERE_VERBOSITY
172
174
180#define GYOTO_DEFAULT_VERBOSITY 5
181
183
189#define GYOTO_INFO_VERBOSITY 10
190
192
199#define GYOTO_DEBUG_VERBOSITY 3000
200
202
211#define GYOTO_QUIET if (Gyoto::verbose() >= GYOTO_QUIET_VERBOSITY) std::cout
212
214
219#define GYOTO_SEVERE if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY) std::cerr<<"SEVERE: "
220
222
227#define GYOTO_WARNING if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY) std::cerr<<"WARNING: "
228
230
238#define GYOTO_MSG if (Gyoto::verbose() >= GYOTO_DEFAULT_VERBOSITY) std::cout
239
241
249#define GYOTO_INFO if (Gyoto::verbose() >= GYOTO_INFO_VERBOSITY) std::cerr<<"INFO: "
250
252
259#define GYOTO_WARNING_UDUNITS(from, to) \
260 GYOTO_WARNING << "unit ignored (trying to convert from \"" << from \
261 << "\" to " \
262 << to \
263 << "\"), you may have more chance recompiling Gyoto with --with-udunits\n"
264
266
278#define GYOTO_DEBUG_EXPR(a) GYOTO_DEBUG << #a << "=" << a << std::endl
279
281
292#define GYOTO_DEBUG_THIS_EXPR(a) GYOTO_DEBUG_THIS << #a << "=" << a << std::endl
293
295
311#define GYOTO_DEBUG_ARRAY(a,n) if (GYOTO_DEBUG_MODE) { \
312 std::cerr << "DEBUG: " << __PRETTY_FUNCTION__ << ": " \
313 << #a << "=[" << a[0] ; \
314 for (size_t _gyoto_debug_array_i=1; _gyoto_debug_array_i < n; ++_gyoto_debug_array_i) \
315 std::cerr << "," << a[_gyoto_debug_array_i] ; \
316 std::cerr << "]" << std::endl ;}
317
319
327#define GYOTO_DEBUG_THIS std::cerr << "DEBUG: " << __PRETTY_FUNCTION__ << ": "
328
330
339#define GYOTO_DEBUG if (GYOTO_DEBUG_MODE) GYOTO_DEBUG_THIS
340
342
346#define GYOTO_IF_DEBUG if (GYOTO_DEBUG_MODE) {
347
349
353#define GYOTO_ENDIF_DEBUG }
354
356#define GYOTO_DEBUG_MODE Gyoto::debug()
357
358 //\}
359 //\{
372 typedef unsigned int CoordKind_t;
373#define GYOTO_COORDKIND_UNSPECIFIED 0
374#define GYOTO_COORDKIND_CARTESIAN 1
375#define GYOTO_COORDKIND_SPHERICAL 2
376 //\}
377}
378
379//{
384#define GYOTO_DEFAULT_X_SIZE 1024
385
393#define GYOTO_DEFAULT_DELTA 0.01
394
398#define GYOTO_DEFAULT_DELTA_MAX DBL_MAX
399
403#define GYOTO_DEFAULT_DELTA_MIN DBL_MIN
404
413#define GYOTO_DEFAULT_DELTA_MAX_OVER_R 1.
414
415#define GYOTO_DEFAULT_ABSTOL 1e-6
416#define GYOTO_DEFAULT_RELTOL 1e-6
417
421#define GYOTO_DEFAULT_MAXITER 100000
422
428#define GYOTO_T_TOL 1e-4 //1e-7 //1e-4
429
430#define GYOTO_KERR_HORIZON_SECURITY 0.01
431
433#define GYOTO_SCREEN_DMAX DBL_MAX
434
435//For displays with setw and setprecision
437#define GYOTO_PREC 15
439#define GYOTO_WIDTH 25
440
441/* Plugins Stuff */
443#ifndef GYOTO_DEFAULT_PLUGINS
444#define GYOTO_DEFAULT_PLUGINS "stdplug,nofail:lorene"
445#endif
446
447#ifndef GYOTO_PLUGIN_SFX
448#define GYOTO_PLUGIN_SFX "so"
449#endif
450
451//\}
452
453//\{
457
458#define GYOTO_C 299792458.
460#define GYOTO_C_CGS 2.99792458e10
462#define GYOTO_C2_CGS 8.98755178736817668096e+20
464#define GYOTO_C2_CGS_M1 1.1126500560536184087938986e-21
466#define GYOTO_G 6.67428e-11
468#define GYOTO_G_CGS 6.67428e-8
470#define GYOTO_G_OVER_C_SQUARE 7.4261380161175445989e-28
472#define GYOTO_G_OVER_C_SQUARE_CGS 7.4261380161175445989e-29
474#define GYOTO_PLANCK 6.62606896e-34
476#define GYOTO_PLANCK_CGS 6.62606896e-27
478#define GYOTO_PLANCK_OVER_C_SQUARE 7.3724959997591407964e-51
480#define GYOTO_BOLTZMANN 1.3806504e-23
482#define GYOTO_BOLTZMANN_CGS 1.3806504e-16
484#define GYOTO_STEFANBOLTZMANN_CGS 5.670373e-5
486#define GYOTO_PLANCK_OVER_BOLTZMANN 4.7992373449498869688e-11
488#define GYOTO_GAS_CST 8.3144621
490#define GYOTO_GAS_CST_CGS 8.3144621e7
492#define GYOTO_AVOGADRO 6.0221413e23
494#define GYOTO_THOMSON_CGS 6.6524e-25
496#define GYOTO_ALPHA_F 0.00729927
498#define GYOTO_PROTON_MASS_CGS 1.67262158e-24
500#define GYOTO_ELECTRON_MASS_CGS 9.10938188e-28
502#define GYOTO_ELECTRON_CLASSICAL_RADIUS_CGS 2.8179e-13
504#define GYOTO_ELEMENTARY_CHARGE_CGS 4.80320427e-10
506#define GYOTO_EULER_MASCHERONI 0.577216
508#define GYOTO_ATOMIC_MASS_UNIT_CGS 1.660537781e-24
510#define GYOTO_INU_CGS_TO_SI 0.001
512#define GYOTO_JNU_CGS_TO_SI (GYOTO_INU_CGS_TO_SI * 100.)
514#define GYOTO_ANU_CGS_TO_SI 100.
515
517#define GYOTO_SUN_MASS 1.98843e30
519#define GYOTO_SUN_MASS_CGS 1.98843e33
521#define GYOTO_SUN_RADIUS 6.955e8
523#define GYOTO_KPC 3.08568025e19
525#define GYOTO_ASTRONOMICAL_UNIT 1.49597870700e11
527#define GYOTO_LIGHT_YEAR 9.4607304725808e15
528
530#define GYOTO_RADEG 57.2957795130823
532#define GYOTO_DEGRAD 0.0174532925199433
534#define GYOTO_MINRAD 2.908882086657216e-04
536#define GYOTO_SECRAD 4.848136811095360e-06
538#define GYOTO_MASRAD 4.848136811095360e-09
540#define GYOTO_MUASRAD 4.848136811095360e-12
541
543#define GYOTO_eV2Hz 2.417989348e+14
544
545//\}
546
547//\{
551
552#define obskind_t unsigned int
554#define GYOTO_OBSKIND_ATINFINITY 0
556#define GYOTO_OBSKIND_KEPLERIAN 1
558#define GYOTO_OBSKIND_ZAMO 2
560#define GYOTO_OBSKIND_VELOCITYSPECIFIED 3
562#define GYOTO_OBSKIND_FULLYSPECIFIED 4
563//\}
564
566#define GYOTO_STRINGIFY(a) GYOTO_STRINGIFY_ARGUMENT(a)
567
569#define GYOTO_STRINGIFY_ARGUMENT(a) #a
570
571#ifndef GYOTO_NO_DEPRECATED
572#warning Using deprecated method names.\
573 Define GYOTO_NO_DEPRECATED to disable.
574//\{
583# define getMetric metric
584# define setMetric metric
585# define setScreen screen
586# define getScreen screen
587# define getRmax rMax
588# define setRmax rMax
589# define getMass mass
590# define setMass mass
591# define getCoordKind coordKind
592# define setCoordKind coordKind
593# define getKind kind
594# define setKind kind
595# define getSpin spin
596# define setSpin spin
597# define getIntegKind integKind
598# define setIntegKind integKind
599# define getFileName fileName
600# define setFileName fileName
601# define getDistance distance
602# define setDistance distance
603# define getPALN PALN
604# define setPALN PALN
605# define getArgument argument
606# define setArgument argument
607# define getInclination inclination
608# define setInclination inclination
609# define getAstrobj astrobj
610# define setAstrobj astrobj
611# define getSpectrometer spectrometer
612# define setSpectrometer spectrometer
613# define getSpectrum spectrum
614# define setSpectrum spectrum
615# define getOpacity opacity
616# define setOpacity opacity
617# define setDelta delta
618# define getDelta delta
619# define setDelta delta
620# define getDelta delta
621# define setDangle2 dangle2
622# define getDangle2 dangle2
623# define setDangle1 dangle1
624# define getDangle1 dangle1
625# define setAnglekind anglekind
626# define getTmin tMin
627# define setTmin tMin
628# define getTime time
629# define setTime time
630# define getFreqObs freqObs
631# define setFreqObs freqObs
632# define getFieldOfView fieldOfView
633# define setFieldOfView fieldOfView
634# define getRadius radius
635# define setRadius radius
636# define getLargeRadius largeRadius
637# define setLargeRadius largeRadius
638# define getSmallRadius smallRadius
639# define setSmallRadius smallRadius
640# define getCentralDensity centralDensity
641# define setCentralDensity centralDensity
642# define getDmax dMax
643# define setDmax dMax
644# define getTemperature temperature
645# define setTemperature temperature
646# define getScaling scaling
647# define setScaling scaling
648# define getPatternVelocity patternVelocity
649# define setPatternVelocity patternVelocity
650# define getLambda lambda
651# define setLambda lambda
652# define getCentralTempOverVirial centralTempOverVirial
653# define setCentralTempOverVirial centralTempOverVirial
654# define getBeta beta
655# define setBeta beta
656# define getConstant constant
657# define setConstant constant
658# define getExponent exponent
659# define setExponent exponent
660# define getFlag_radtransf opticallyThin
661# define setFlag_radtransf opticallyThin
662# define getNThreads nThreads
663# define setNThreads nThreads
664# define getResolution resolution
665# define setResolution resolution
666# define getNSamples nSamples
667# define setNSamples nSamples
668# define getSpectralOverSampling spectralOversampling
669# define setSpectralOverSampling spectralOversampling
670# define setBinSpectrumConverter binSpectrumConverter
671# define setSpectrumConverter spectrumConverter
672# define setIntensityConverter intensityConverter
673# define getSafetyValue safetyValue;
674# define setSafetyValue safetyValue;
675# define setInnerRadius innerRadius;
676# define getInnerRadius innerRadius;
677# define setOuterRadius outerRadius;
678# define getOuterRadius outerRadius;
679# define setThickness thickness;
680# define getThickness thickness;
681# define setDir dir;
682# define getDir dir;
683# define setBand band;
684# define setObserverKind observerKind;
685# define getObserverKind observerKind;
686//\}
687#endif
688
689#endif
Compile-time configuration.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
unsigned int Quantity_t
Type for observabke quantities.
Definition: GyotoDefs.h:76
unsigned int CoordKind_t
Type for coordinate system kinds.
Definition: GyotoDefs.h:372
unsigned int Verbosity_t
Type for verbosity levels.
Definition: GyotoDefs.h:142