GLAMERDOC++
Gravitational Lensing Code Library
Loading...
Searching...
No Matches
standard.h
Go to the documentation of this file.
1
4#ifndef _STANDARD_DECLARE_
5#define _STANDARD_DECLARE_
6
7//#define NDEBUG // Un-commenting this line will remove all assert() statements in the executable.
8
9#include <iostream>
10#include <cstdio>
11#include <cstdlib>
12#include <fstream>
13#include <cfloat>
14#include <stdexcept>
15#ifdef _OPENMP
16#include <omp.h>
17#endif
18//#include <pthread.h>
19
20#include <list>
21#include <math.h>
22#include <assert.h>
23#include <time.h>
24#include <limits>
25#include <cstring>
26#include <string>
27#include <sstream>
28#include <vector>
29#include <valarray>
30
31#include <nr.h>
32#include <nrD.h>
33//#include <utilities.h>
34
35#include <cosmo.h>
36#include <halo.h>
37
38#ifndef PI
39#define PI M_PI
40#endif
41
42#ifndef Grav
43#define Grav 4.7788e-20 // G/c^2 in Mpc
44#endif
45
46#ifndef arcsecTOradians
47#define arcminTOradians 0.0002908882086657216 // convert arcesconds to radians
48#endif
49
50#ifndef arcsecTOradians
51#define arcsecTOradians 0.000004848136811 // convert arcesconds to radians
52#endif
53
54#ifndef degreesTOradians
55#define degreesTOradians 0.01745329251994 // convert degrees to radians
56#endif
57
58#ifndef hplanck
59#define hplanck 6.626068e-27 // in erg*sec
60#endif
61
62#ifndef inv_hplanck
63#define inv_hplanck 1.50919e26 // in 1/(erg*sec)
64#endif
65
66#ifndef kmpersecTOmpcperday
67#define kmpersecTOmpcperday 2.80003e-15
68#endif
69
70#ifndef error_message
71#define error_message
72#define ERROR_MESSAGE() std::cout << "ERROR: file: " << __FILE__ << " line: " << __LINE__ << std::endl;
73#endif
74
75#ifndef line_message
76#define line_message
77#define PRINT_LINE() std::cout << "file: " << __FILE__ << " line: " << __LINE__ << std::endl;
78#endif
79
80#ifndef boo_declare
81#define boo_declare
82typedef enum {NO, YES, MAYBE} Boo;
83#endif
84
85#ifndef lensquant_declare
86#define lensquant_declare
87
89enum class LensingVariable {
90 DELAYT
91 ,ALPHA
92 ,ALPHA1
93 ,ALPHA2
94 ,KAPPA
95 ,GAMMA
96 ,GAMMA1
97 ,GAMMA2
98 ,GAMMA3
99 ,INVMAG
100 ,PHI
102} ;
103#endif
104
105#ifndef PosType_declare
106#define PosType_declare
107typedef double PosType;
108#endif
109
110#ifndef IndexType_declare
111#define IndexType_declare
112typedef size_t IndexType;
113#endif
114
115#ifndef swap_declare
116#define swap_declare
117#define SWAP(a,b) temp=(a);(a)=(b);(b)=temp;
118#endif
119
120#ifndef treeNBdim
121#define treeNBdim 2 // dimension of boxes in tree
122#endif
123
124//#ifdef DOUBLE_PRECISION
125typedef double KappaType;
126//#else
127//typedef float KappaType;
128//#endif
129
130// unit test definitions
131// GlamerTest overrides these as necessary
132#ifndef GLAMER_TEST
133#define GLAMER_TEST_USES(t)
134#define GLAMER_TEST_FRIEND(t)
135#endif
136
137#ifndef MpcToSeconds
138#define MpcToSeconds (3.085677e22 / 2.99792458e8)
139// Computed as MpcToMeter(m) / SpeedOfLight(m.s^{-1})
140#endif
141
142#ifndef SecondToDays
143#define SecondToDays (1. / 86400.)
144#endif
145
146#ifndef SecondToYears
147#define SecondToYears (1. / 86400. / 365.25)
148// Taking 365.25 days per year.
149#endif
150
151#endif
152
153
154
155
LensingVariable
output lensing variables
Definition standard.h:89
@ ALPHA
magnitude of deflection in radians
@ GAMMA2
second component of shear
@ DELAYT
time delay
@ GAMMA3
third component of shear
@ ALPHA2
y component of deflection
@ SurfBrightness
Surface brightness.
@ GAMMA1
first component of shear
@ GAMMA
magnitude of shear
@ KAPPA
convergence
@ ALPHA1
x component of deflection
@ PHI
lensing potential
@ INVMAG
inverse of magnification