GyotoDefs.h
Go to the documentation of this file.
/*
Copyright 2011-2015, 2017-2020 Thibaut Paumard & Frédéric Vincent
This file is part of Gyoto.
Gyoto is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gyoto is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GyotoDefs_H_
#define __GyotoDefs_H_
#include "GyotoConfig.h"
#include <float.h>
#include <vector>
#if !HAVE_SINCOS
#define sincos(t, s, c) *s=sin(t); *c=cos(t)
#else
# ifdef DOXYGEN_RUN
# define sincos(t, s, c) (undefined)
# endif
#endif
/* Typedef for various Gyoto data types */
namespace Gyoto {
typedef std::vector<double> state_t;
//\{
typedef unsigned int Quantity_t;
/* Generic */
#define GYOTO_QUANTITY_NONE 0
#define GYOTO_QUANTITY_INTENSITY 1<<0
#define GYOTO_QUANTITY_EMISSIONTIME 1<<1
#define GYOTO_QUANTITY_MIN_DISTANCE 1<<2
#define GYOTO_QUANTITY_FIRST_DMIN 1<<3
#define GYOTO_QUANTITY_REDSHIFT 1<<4
#define GYOTO_QUANTITY_IMPACTCOORDS 1<<5
#define GYOTO_QUANTITY_SPECTRUM 1<<6
#define GYOTO_QUANTITY_SPECTRUM_STOKES_Q 1<<7
#define GYOTO_QUANTITY_SPECTRUM_STOKES_U 1<<8
#define GYOTO_QUANTITY_SPECTRUM_STOKES_V 1<<9
#define GYOTO_QUANTITY_BINSPECTRUM 1<<10
#define GYOTO_QUANTITY_NBCROSSEQPLANE 1<<11
/* Astrobj-specific */
#define GYOTO_QUANTITY_USER1 1<<31
#define GYOTO_QUANTITY_USER2 1<<30
#define GYOTO_QUANTITY_USER3 1<<29
#define GYOTO_QUANTITY_USER4 1<<28
#define GYOTO_QUANTITY_USER5 1<<27
#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)
#define GYOTO_QUANTITY_SPECTRUM_STOKES (GYOTO_QUANTITY_SPECTRUM | GYOTO_QUANTITY_SPECTRUM_STOKES_Q | GYOTO_QUANTITY_SPECTRUM_STOKES_U | GYOTO_QUANTITY_SPECTRUM_STOKES_V)
//\}
//\{
typedef unsigned int Verbosity_t;
#define GYOTO_DEFAULT_DEBUG_MODE 0
#define GYOTO_QUIET_VERBOSITY 1
#define GYOTO_SEVERE_VERBOSITY 3
#define GYOTO_WARNING_VERBOSITY GYOTO_SEVERE_VERBOSITY
#define GYOTO_DEFAULT_VERBOSITY 5
#define GYOTO_INFO_VERBOSITY 10
#define GYOTO_DEBUG_VERBOSITY 3000
#define GYOTO_QUIET if (Gyoto::verbose() >= GYOTO_QUIET_VERBOSITY) std::cout
#define GYOTO_SEVERE if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY) std::cerr<<"SEVERE: "
#define GYOTO_WARNING if(Gyoto::verbose()>=GYOTO_SEVERE_VERBOSITY) std::cerr<<"WARNING: "
#define GYOTO_MSG if (Gyoto::verbose() >= GYOTO_DEFAULT_VERBOSITY) std::cout
#define GYOTO_INFO if (Gyoto::verbose() >= GYOTO_INFO_VERBOSITY) std::cerr<<"INFO: "
#define GYOTO_WARNING_UDUNITS(from, to) \
GYOTO_WARNING << "unit ignored (trying to convert from \"" << from \
<< "\" to " \
<< to \
<< "\"), you may have more chance recompiling Gyoto with --with-udunits\n"
#define GYOTO_DEBUG_EXPR(a) GYOTO_DEBUG << #a << "=" << a << std::endl
#define GYOTO_DEBUG_THIS_EXPR(a) GYOTO_DEBUG_THIS << #a << "=" << a << std::endl
#define GYOTO_DEBUG_ARRAY(a,n) if (GYOTO_DEBUG_MODE) { \
std::cerr << "DEBUG: " << __PRETTY_FUNCTION__ << ": " \
<< #a << "=[" << a[0] ; \
for (size_t _gyoto_debug_array_i=1; _gyoto_debug_array_i < n; ++_gyoto_debug_array_i) \
std::cerr << "," << a[_gyoto_debug_array_i] ; \
std::cerr << "]" << std::endl ;}
#define GYOTO_DEBUG_THIS std::cerr << "DEBUG: " << __PRETTY_FUNCTION__ << ": "
#define GYOTO_DEBUG if (GYOTO_DEBUG_MODE) GYOTO_DEBUG_THIS
#define GYOTO_IF_DEBUG if (GYOTO_DEBUG_MODE) {
#define GYOTO_ENDIF_DEBUG }
#define GYOTO_DEBUG_MODE Gyoto::debug()
//\}
//\{
typedef unsigned int CoordKind_t;
#define GYOTO_COORDKIND_UNSPECIFIED 0
#define GYOTO_COORDKIND_CARTESIAN 1
#define GYOTO_COORDKIND_SPHERICAL 2
//\}
}
//{
#define GYOTO_DEFAULT_X_SIZE 1024
#define GYOTO_DEFAULT_DELTA 0.01
#define GYOTO_DEFAULT_DELTA_MAX DBL_MAX
#define GYOTO_DEFAULT_DELTA_MIN DBL_MIN
#define GYOTO_DEFAULT_DELTA_MAX_OVER_R 1.
#define GYOTO_DEFAULT_ABSTOL 1e-6
#define GYOTO_DEFAULT_RELTOL 1e-6
#define GYOTO_DEFAULT_MAXITER 100000
#define GYOTO_T_TOL 1e-4 //1e-7 //1e-4
#define GYOTO_KERR_HORIZON_SECURITY 0.01
#define GYOTO_SCREEN_DMAX DBL_MAX
//For displays with setw and setprecision
#define GYOTO_PREC 15
#define GYOTO_WIDTH 25
/* Plugins Stuff */
#ifndef GYOTO_DEFAULT_PLUGINS
#define GYOTO_DEFAULT_PLUGINS "stdplug,nofail:lorene"
#endif
#ifndef GYOTO_PLUGIN_SFX
#define GYOTO_PLUGIN_SFX "so"
#endif
//\}
//\{
#define GYOTO_C 299792458.
#define GYOTO_C_CGS 2.99792458e10
#define GYOTO_C2_CGS 8.98755178736817668096e+20
#define GYOTO_C2_CGS_M1 1.1126500560536184087938986e-21
#define GYOTO_G 6.67428e-11
#define GYOTO_G_CGS 6.67428e-8
#define GYOTO_G_OVER_C_SQUARE 7.4261380161175445989e-28
#define GYOTO_G_OVER_C_SQUARE_CGS 7.4261380161175445989e-29
#define GYOTO_PLANCK 6.62606896e-34
#define GYOTO_PLANCK_CGS 6.62606896e-27
#define GYOTO_PLANCK_OVER_C_SQUARE 7.3724959997591407964e-51
#define GYOTO_BOLTZMANN 1.3806504e-23
#define GYOTO_BOLTZMANN_CGS 1.3806504e-16
#define GYOTO_STEFANBOLTZMANN_CGS 5.670373e-5
#define GYOTO_PLANCK_OVER_BOLTZMANN 4.7992373449498869688e-11
#define GYOTO_GAS_CST 8.3144621
#define GYOTO_GAS_CST_CGS 8.3144621e7
#define GYOTO_AVOGADRO 6.0221413e23
#define GYOTO_THOMSON_CGS 6.6524e-25
#define GYOTO_ALPHA_F 0.00729927
#define GYOTO_PROTON_MASS_CGS 1.67262158e-24
#define GYOTO_ELECTRON_MASS_CGS 9.10938188e-28
#define GYOTO_ELECTRON_CLASSICAL_RADIUS_CGS 2.8179e-13
#define GYOTO_ELEMENTARY_CHARGE_CGS 4.80320427e-10
#define GYOTO_EULER_MASCHERONI 0.577216
#define GYOTO_ATOMIC_MASS_UNIT_CGS 1.660537781e-24
#define GYOTO_INU_CGS_TO_SI 0.001
#define GYOTO_JNU_CGS_TO_SI (GYOTO_INU_CGS_TO_SI * 100.)
#define GYOTO_ANU_CGS_TO_SI 100.
#define GYOTO_SUN_MASS 1.98843e30
#define GYOTO_SUN_MASS_CGS 1.98843e33
#define GYOTO_SUN_RADIUS 6.955e8
#define GYOTO_KPC 3.08568025e19
#define GYOTO_ASTRONOMICAL_UNIT 1.49597870700e11
#define GYOTO_LIGHT_YEAR 9.4607304725808e15
#define GYOTO_RADEG 57.2957795130823
#define GYOTO_DEGRAD 0.0174532925199433
#define GYOTO_MINRAD 2.908882086657216e-04
#define GYOTO_SECRAD 4.848136811095360e-06
#define GYOTO_MASRAD 4.848136811095360e-09
#define GYOTO_MUASRAD 4.848136811095360e-12
#define GYOTO_eV2Hz 2.417989348e+14
//\}
//\{
#define obskind_t unsigned int
#define GYOTO_OBSKIND_ATINFINITY 0
#define GYOTO_OBSKIND_KEPLERIAN 1
#define GYOTO_OBSKIND_ZAMO 2
#define GYOTO_OBSKIND_VELOCITYSPECIFIED 3
#define GYOTO_OBSKIND_FULLYSPECIFIED 4
//\}
#define GYOTO_STRINGIFY(a) GYOTO_STRINGIFY_ARGUMENT(a)
#define GYOTO_STRINGIFY_ARGUMENT(a) #a
#ifndef GYOTO_NO_DEPRECATED
#warning Using deprecated method names.\
Define GYOTO_NO_DEPRECATED to disable.
//\{
# define getMetric metric
# define setMetric metric
# define setScreen screen
# define getScreen screen
# define getRmax rMax
# define setRmax rMax
# define getMass mass
# define setMass mass
# define getCoordKind coordKind
# define setCoordKind coordKind
# define getKind kind
# define setKind kind
# define getSpin spin
# define setSpin spin
# define getIntegKind integKind
# define setIntegKind integKind
# define getFileName fileName
# define setFileName fileName
# define getDistance distance
# define setDistance distance
# define getPALN PALN
# define setPALN PALN
# define getArgument argument
# define setArgument argument
# define getInclination inclination
# define setInclination inclination
# define getAstrobj astrobj
# define setAstrobj astrobj
# define getSpectrometer spectrometer
# define setSpectrometer spectrometer
# define getSpectrum spectrum
# define setSpectrum spectrum
# define getOpacity opacity
# define setOpacity opacity
# define setDelta delta
# define getDelta delta
# define setDelta delta
# define getDelta delta
# define setDangle2 dangle2
# define getDangle2 dangle2
# define setDangle1 dangle1
# define getDangle1 dangle1
# define setAnglekind anglekind
# define getTmin tMin
# define setTmin tMin
# define getTime time
# define setTime time
# define getFreqObs freqObs
# define setFreqObs freqObs
# define getFieldOfView fieldOfView
# define setFieldOfView fieldOfView
# define getRadius radius
# define setRadius radius
# define getLargeRadius largeRadius
# define setLargeRadius largeRadius
# define getSmallRadius smallRadius
# define setSmallRadius smallRadius
# define getCentralDensity centralDensity
# define setCentralDensity centralDensity
# define getDmax dMax
# define setDmax dMax
# define getTemperature temperature
# define setTemperature temperature
# define getScaling scaling
# define setScaling scaling
# define getPatternVelocity patternVelocity
# define setPatternVelocity patternVelocity
# define getLambda lambda
# define setLambda lambda
# define getCentralTempOverVirial centralTempOverVirial
# define setCentralTempOverVirial centralTempOverVirial
# define getBeta beta
# define setBeta beta
# define getConstant constant
# define setConstant constant
# define getExponent exponent
# define setExponent exponent
# define getFlag_radtransf opticallyThin
# define setFlag_radtransf opticallyThin
# define getNThreads nThreads
# define setNThreads nThreads
# define getResolution resolution
# define setResolution resolution
# define getNSamples nSamples
# define setNSamples nSamples
# define getSpectralOverSampling spectralOversampling
# define setSpectralOverSampling spectralOversampling
# define setBinSpectrumConverter binSpectrumConverter
# define setSpectrumConverter spectrumConverter
# define setIntensityConverter intensityConverter
# define getSafetyValue safetyValue;
# define setSafetyValue safetyValue;
# define setInnerRadius innerRadius;
# define getInnerRadius innerRadius;
# define setOuterRadius outerRadius;
# define getOuterRadius outerRadius;
# define setThickness thickness;
# define getThickness thickness;
# define setDir dir;
# define getDir dir;
# define setBand band;
# define setObserverKind observerKind;
# define getObserverKind observerKind;
//\}
#endif
#endif
GyotoConfig.h
Compile-time configuration.
Gyoto
Namespace for the Gyoto library.
Definition GyotoAstrobj.h:44
Gyoto::Quantity_t
unsigned int Quantity_t
Type for observabke quantities.
Definition GyotoDefs.h:76
Gyoto::CoordKind_t
unsigned int CoordKind_t
Type for coordinate system kinds.
Definition GyotoDefs.h:374
Gyoto::Verbosity_t
unsigned int Verbosity_t
Type for verbosity levels.
Definition GyotoDefs.h:144