Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2218b07
Removed new e- sampling routine
Nov 1, 2017
e885eae
New files.
Nov 4, 2017
c738abb
Python script
Nov 13, 2017
cdc8d26
Add files via upload
Nov 13, 2017
50f3b6f
Delete intp.py
Nov 16, 2017
1d45ea8
Delete it.py
Nov 16, 2017
d967ffa
Add files via upload
Nov 16, 2017
5ceac3f
Add files via upload
Nov 16, 2017
8ad7ae9
Add files via upload
Nov 17, 2017
6d9b968
New scripts
Nov 20, 2017
07cfe77
test
Feb 4, 2018
c675923
Syncing with master branch
Feb 6, 2018
b01b2f5
Changed to accept accretion rate in terms of Eddington's
Feb 7, 2018
3212569
Bug fix
Feb 7, 2018
82a1bba
Bug fix
Feb 7, 2018
95af0a1
Bug fix
Feb 7, 2018
0b2203a
Bug fix
Feb 7, 2018
2252c4e
Bug fix
Feb 7, 2018
c13b543
a
Feb 7, 2018
1478a9c
a
Feb 7, 2018
5931bc6
a
Feb 7, 2018
d02343b
a
Feb 7, 2018
8bf7711
a
Feb 7, 2018
9d6a445
a
Feb 7, 2018
bbb2f03
a
Feb 7, 2018
4daaa99
a
Feb 7, 2018
4ee2265
a
Feb 8, 2018
9eca205
Delete Plot1000.png
Feb 9, 2018
1057287
Delete Plot1001.png
Feb 9, 2018
2ed28b2
Delete Plot1002.png
Feb 9, 2018
a2508a7
Delete Plot1003.png
Feb 9, 2018
10c9bba
Delete grmonty
Feb 9, 2018
f9d6f62
Delete model.c
Feb 9, 2018
a4c3e58
Delete model.h
Feb 9, 2018
87d7361
Delete hotcross.dat
Feb 9, 2018
95a7e24
Delete points.npy
Feb 9, 2018
f8ab462
Delete spectrum.dat
Feb 9, 2018
d93f9b7
Delete values.npy
Feb 9, 2018
80f4216
Delete spec.png
Feb 9, 2018
1f270d8
Changed frequency range in scripts.
Feb 9, 2018
87d2636
a
Feb 9, 2018
a47954d
a
Feb 9, 2018
5314049
a
Feb 9, 2018
875e317
a
Mar 6, 2018
6603843
Delete interpolate.py
Mar 6, 2018
816983c
Update .gitignore
Mar 6, 2018
a2da519
Update .gitignore
Mar 6, 2018
59494bd
Delete iterate.py
Mar 6, 2018
9452313
rm
Mar 6, 2018
d3623e2
rm
Mar 6, 2018
f24bb1d
hehe
Mar 6, 2018
5411c34
rm
Mar 6, 2018
78ba1a7
rm
Mar 6, 2018
51e83cd
Testing masking
May 17, 2018
38aa67d
Merge branch 'ricardo' of https://github.com/brryan/grmonty into ricardo
May 17, 2018
9c420fd
Masking test
May 21, 2018
649bce4
Changed one line
May 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
model.c
model.h
*.p
*.png
*.dat
*.pyc
grmonty
interpolate.py
iterate.py
iterror.py
plot2.py
plot3.py
11 changes: 11 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,16 @@ def print_config(key, var):

sys.exit()

if len(sys.argv) != 2:
print 'ERROR: Format is'
print ' python build.py [model]'
sys.exit()
if (not os.path.isfile('model/' + sys.argv[1] + '.c')):
print 'ERROR Model %s does not exist' % sys.argv[1]
sys.exit()

import shutil
shutil.copyfile('model/' + sys.argv[1] + '.c', 'model.c')
shutil.copyfile('model/' + sys.argv[1] + '.h', 'model.h')
build()

16 changes: 12 additions & 4 deletions compton.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Canfield, Howard, and Liang, 1987, ApJ 323, 565.

*/

#define OLD_E_SAMP (0)
#define OLD_E_SAMP (1)

void sample_scattered_photon(double k[4], double p[4], double kp[4])
{
Expand All @@ -43,9 +43,17 @@ void sample_scattered_photon(double k[4], double p[4], double kp[4])

/* unit vector 1 for scattering coordinate system is
oriented along initial photon wavevector */
v0x = ke[1] / ke[0];
v0y = ke[2] / ke[0];
v0z = ke[3] / ke[0];
//v0x = ke[1] / ke[0];
//v0y = ke[2] / ke[0];
//v0z = ke[3] / ke[0];

// Explicitly compute kemag instead of using ke[0] to ensure that photon
// is created normalized and doesn't inherit light cone errors from the
// original superphoton
double kemag = sqrt(ke[1]*ke[1] + ke[2]*ke[2] + ke[3]*ke[3]);
v0x = ke[1]/kemag;
v0y = ke[2]/kemag;
v0z = ke[3]/kemag;

/* randomly pick zero-angle for scattering coordinate system.
There's undoubtedly a better way to do this. */
Expand Down
45 changes: 27 additions & 18 deletions decs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <math.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
Expand All @@ -14,30 +15,32 @@
#include <omp.h>
#include <time.h>
#include "constants.h"
#include "model.h"

#define NDIM 4
#define NPRIM 8
//#define NDIM 4
//#define NPRIM 8

/* Range of initial superphoton frequencies */
#define NUMIN 1.e9
#define NUMAX 1.e20
/*#define NUMIN 1.e9
#define NUMAX 1.e28
#define LNUMIN log(NUMIN)
#define LNUMAX log(NUMAX)
#define DLNU ((LNUMAX-LNUMIN)/N_ESAMP)
#define DLNU ((LNUMAX-LNUMIN)/N_ESAMP)*/

#define THETAE_MAX 1000.
/*#define THETAE_MAX 1000.
#define THETAE_MIN 0.3
//#define TP_OVER_TE (3.)
#define WEIGHT_MIN (1.e28)

#define SYNCHROTRON (1)
#define BREMSSTRAHLUNG (1)
#define COMPTON (1)
#define BREMSSTRAHLUNG (0)
#define COMPTON (0)
#define KAPPA (5.)
#define DIST_KAPPA (1)
<<<<<<< HEAD
#define DIST_KAPPA (0)*/

/* mnemonics for primitive vars; conserved vars */
#define KRHO 0
/*#define KRHO 0
#define UU 1
#define U1 2
#define U2 3
Expand All @@ -46,13 +49,13 @@
#define B2 6
#define B3 7
#define KEL 8
#define KTOT 9
#define KTOT 9*/

/* numerical convenience */
#define SMALL 1.e-40
//#define SMALL 1.e-40

/* physical parameters */
#define MMW 0.5 /* mean molecular weight, in units of mp */
//#define MMW 0.5 /* mean molecular weight, in units of mp */

/** data structures **/
struct of_photon {
Expand Down Expand Up @@ -96,9 +99,9 @@ struct of_spectrum {
double E0;
};

#define N_ESAMP 200
#define N_EBINS 200
#define N_THBINS 6
//#define N_ESAMP 200
//#define N_EBINS 200
//#define N_THBINS 6

extern struct of_spectrum spect[N_THBINS][N_EBINS];

Expand Down Expand Up @@ -142,6 +145,11 @@ extern double gam;
extern double dMsim;

extern double M_unit;

extern double Mdot;
extern double mdot;
extern double MdotEdd;

extern double L_unit;
extern double T_unit;
extern double RHO_unit;
Expand Down Expand Up @@ -172,7 +180,7 @@ void scatter_super_photon(struct of_photon *ph, struct of_photon *php,
double Ne, double Thetae, double B, double Ucon[NDIM], double Bcon[NDIM],
double Gcov[NDIM][NDIM]);

void report_bad_input();
void report_bad_input(int argc);

/* OpenMP specific functions */
void omp_reduce_spect(void);
Expand Down Expand Up @@ -274,7 +282,8 @@ void init_geometry(void);
void init_data(int argc, char *argv[]);
void init_nint_table(void);
void init_storage(void);
double dOmega_func(double Xi[NDIM], double Xf[NDIM]);
//double dOmega_func(double Xi[NDIM], double Xf[NDIM]);
double dOmega_func(int j);

double linear_interp_weight(double nu);

Expand Down
Loading