Skip to content

black-hole-group/grmonty

 
 

Repository files navigation

GRMONTY: A relativistic Monte Carlo code

Based on Dolence et al. 2009 ApJ. Originally downloaded from Astrophysical Code Library @ UI.

GRMONTY is parallelized using OpenMP. This version is configured to use input from harm2d.

quick start

unpack the tarball:

tar -xzvf grmonty.tgz

make (requires openmp enabled gcc):

make

set number of threads for csh and 8 threads:

setenv OMP_NUM_THREADS 8

if using bash:

export OMP_NUM_THREADS=8

run the code on the supplied harm output file:

./grmonty 5000000 dump019 4.e19 

Arguments are:

  • estimate of photon number (actual number is probabilistic due to scattering)
  • harm dump file for model
  • mass unit (few x 10^19 is appropriate for Sgr A*)

This will output spectrum to grmonty.spec which should be identical to grmonty_spec_verify.

Plotting

Use python and the nmmn module:

import nmmn.sed
s=nmmn.sed.SED()
s.grmonty('grmonty.spec')
plot(s.lognu, s.ll)

Old-fashioned way: Use the SM script plspec.m to plot up broad-band spectral energy distribution.

Calculate spectra from other sources

Replace harm_model.c with your own source model. Begin by modifying harm_model.c. You must supply

init_model 
make_super_photon
bias_func
get_fluid_params
report_spectrum
stop_criterion
record_criterion

gcon_func 
gcov_func 
get_connection

in the model file.

TODO

  • make it work with HARMPI
  • GPU support: OpenCL
  • parallelize with MPI
  • add bremsstrahlung
  • nonthermal electron distribution
  • dynamic metrics as input
  • add LICENSE

References

LICENSE

grmonty 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.

This program 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 LICENSE file or the GNU General Public License for more details.

Releases

No releases published

Packages

No packages published

Languages

  • C 96.5%
  • Makefile 2.1%
  • Other 1.4%