Skip to content

Commit

Permalink
Merge pull request #4 from YuriOku/gamer_plugin
Browse files Browse the repository at this point in the history
added gamer plugin
  • Loading branch information
ohahn authored Oct 19, 2024
2 parents 1fed023 + 7fa94c4 commit 70da747
Show file tree
Hide file tree
Showing 4 changed files with 573 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To learn how to use MUSIC, please [read the Wiki](https://github.com/cosmo-sims/

Current MUSIC key features include:

- Supports output for RAMSES, ENZO, Arepo, Swift, Gadget-2/3, ART, Pkdgrav/Gasoline and NyX via plugins. New codes can be added.
- Supports output for RAMSES, ENZO, Arepo, Swift, Gadget-2/3, ART, Pkdgrav/Gasoline, NyX, and GAMER-2 via plugins. New codes can be added.
- Support for first (1LPT) and second order (2LPT) Lagrangian perturbation theory.
- Full integration of the [PANPHASIA](https://arxiv.org/abs/1306.5968) hierarchical Gaussian random fields
- Pluggable transfer functions, currently CAMB, Eisenstein&Hu, BBKS, Warm Dark Matter variants. Distinct baryon+CDM fields.
Expand Down
4 changes: 4 additions & 0 deletions ics_example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,8 @@ seed[12] = 67890
#format = gadget2
#filename = ics_gadget.dat

## GAMER-2 compatible output format
#format = gamer2
#filename = UM_IC
#parfilename = PAR_IC

25 changes: 25 additions & 0 deletions src/mesh.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,18 @@ public:
kr = ((kr % gridding_unit_) != 0) ? (kr / gridding_unit_ + 1) * gridding_unit_ : kr;
}

// require alighment with coarser block
if (blocking_factor_)
{
unsigned coarse_block = 2 * blocking_factor_;
il -= il % coarse_block;
jl -= jl % coarse_block;
kl -= kl % coarse_block;
ir += (nresmax - ir) % coarse_block;
jr += (nresmax - jr) % coarse_block;
kr += (nresmax - kr) % coarse_block;
}

// if doing unigrid, set region to whole box
if (levelmin_ == levelmax_)
{
Expand Down Expand Up @@ -1634,6 +1646,19 @@ public:
kr = ((kr % gridding_unit_) != 0) ? (kr / gridding_unit_ + 1) * gridding_unit_ : kr;
}

// require alighment with coarser block
if (blocking_factor_)
{
unsigned coarse_block = 2 * blocking_factor_;
int nres = 1 << ilevel;
il -= il % coarse_block;
jl -= jl % coarse_block;
kl -= kl % coarse_block;
ir += (nres - ir) % coarse_block;
jr += (nres - jr) % coarse_block;
kr += (nres - kr) % coarse_block;
}

if (il >= ir || jl >= jr || kl >= kr || il < 0 || jl < 0 || kl < 0)
{
music::elog.Print("Internal refinement bounding box error: [%d,%d]x[%d,%d]x[%d,%d], level=%d", il, ir, jl, jr, kl, kr, ilevel);
Expand Down
Loading

0 comments on commit 70da747

Please sign in to comment.