1
0
Fork 0
mirror of https://github.com/cosmo-sims/monofonIC.git synced 2024-09-19 17:03:45 +02:00

Merged in develop (pull request #9)

Develop
This commit is contained in:
Oliver Hahn 2020-08-21 14:13:55 +00:00
commit fcb34d5412
4 changed files with 159 additions and 88 deletions

85
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,85 @@
# Contributing
We would love to have your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Submitting a new feature or plugin
- Proposing new features
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository. Codebase contributions should be made in the form of pull requests.
To discuss the state of the code or exchange with other users, consider joining the MUSIC user google group: https://groups.google.com/g/cosmo_music
Please note we have a code of conduct, please follow it in all your interactions with the project.
## Write bug reports with detail and background
A bug report needs
- A quick summary of what happened vs. what should have happened
- Steps to reproduce incl. the config file used, compile-time and run-time options and info on which compiler/libraries were used in the build.
- Detailed diagnostic output (copy of log file, error messages, ...)
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
## Contributed Code Changes Happen Through Pull Requests
Pull requests are the best way to propose changes to the codebase. We actively welcome your pull requests:
1. Fork the repo and create your branch from `master`.
2. [If you've added code that should be tested, add tests.] (Unit-testing is currently work in progress!)
3. If you've changed APIs, or added new config file options, update the documentation.
4. [Ensure the test suite passes.] (Unit-testing is currently work in progress!)
5. Make sure your code lints.
6. Issue the pull request!
## Any contributions you make will be under the GPL v3 license
In short, when you submit code changes, your submissions are understood to be under the same license that covers the project. Feel free to get in touch if that is a concern.
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
### Our Standards
Examples of behaviour that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behaviour by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behaviour and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behaviour.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviours that they deem inappropriate, threatening, offensive, or harmful.
### Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
### Enforcement
Instances of abusive, harassing, or otherwise unacceptable behaviour may be reported by contacting one of the maintainers. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
### Attribution
This Code of Conduct was adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
Parts of this document were adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)

View file

@ -1,69 +1,117 @@
#########################################################################################
# Example conf file for MUSIC2 - monofonIC single resolution simulation ICs
#########################################################################################
#########################################################################################
[setup]
# number of grid cells per linear dimension for calculations = particles for sc initial load
GridRes = 65536
GridRes = 128
# length of the box in Mpc/h
BoxLength = 4000
BoxLength = 300
# starting redshift
zstart = 49.0
zstart = 24.0
# order of the LPT to be used (1,2 or 3)
LPTorder = 1
LPTorder = 3
# also do baryon ICs?
DoBaryons = yes
DoBaryons = no
# do mode fixing à la Angulo&Pontzen
DoFixing = yes
# particle load, can be 'sc' (1x), 'bcc' (2x) or 'fcc' (4x) (increases number of particles by factor!)
# invert phases (for paired simulations)
DoInversion = no
# particle load, can be 'sc' (1x), 'bcc' (2x) or 'fcc' (4x) (increases number of particles by factor!) or 'glass'
ParticleLoad = sc
# Add a possible constraint field here:
#ConstraintFieldFile = initial_conditions.h5
#ConstraintFieldName = ic_white_noise
# if `ParticleLoad = glass' then specify here where to load the glass distribution from
#GlassFileName = glass128.hdf5
#GlassTiles = 1
#########################################################################################
[cosmology]
transfer = CLASS
ztarget = 2.5
# transfer = eisenstein
# transfer = file_CAMB
## transfer = ... specifies the Einstein-Boltzmann plugin module
# transfer = eisenstein # Eisenstein&Hu fitting formula
# transfer = file_CAMB # CAMB file to be specified as 'transfer_file = ...'
# transfer_file = wmap5_transfer_out_z0.dat
transfer = CLASS # CLASS module (if enabled in CMake file)
ztarget = 2.5 # target redshift for CLASS module, output at ztarget will be back-scaled to zstart
Omega_m = 0.302
Omega_b = 0.045
Omega_L = 0.698
H0 = 70.3
sigma_8 = 0.811
nspec = 0.961
sigma_8 = 0.811
# A_s = 2.148752e-09 # can use instead of sigma_8
ZeroRadiation = true # For Back-scaling: set to false if your simulation code can deal with Omega_r!=0
# Additional cosmological parameters (set by default to the given values)
# w0 = -1.0
# wa = 0.0
# Tcmb = 2.7255
# Neff = 3.046
# anisotropic large scale tidal field
# see Stuecker+2020
# LSS_aniso_lx = +0.1
# LSS_aniso_ly = +0.1
# LSS_aniso_lz = -0.2
#########################################################################################
[random]
## generator = ... specifies the random field generator plugin module
generator = NGENIC
seed = 9001
# generator = PANPHASIA
# descriptor = [Panph1,L10,(800,224,576),S9,CH1564365824,MXXL]
# Add a possible constraint field here:
# ConstraintFieldFile = initial_conditions.hdf5
# ConstraintFieldName = ic_white_noise
#########################################################################################
[testing]
# enables diagnostic output
# can be 'none' (default), 'potentials_and_densities', 'velocity_displacement_symmetries', or 'convergence'
test = none
#########################################################################################
[execution]
NumThreads = 8
#########################################################################################
[output]
## format = .... specifies the output plugin module
# format = grafic2
# filename = ics_ramses
# grafic_use_SPT = no # if no then uses PPT, otherwise linear SPT
# format = gadget2
# filename = ics_gadget.dat
# UseLongids = false
#format = gadget_hdf5
#filename = ics_gadget.hdf5
# format = gadget_hdf5
# filename = ics_gadget.hdf5
format = AREPO
filename = ics_arepo.hdf5
# format = AREPO
# filename = ics_arepo.hdf5
# format = generic
# filename = debug.hdf5
# generic_out_eulerian = yes
# format = grafic2
# filename = ics_ramses
# grafic_use_SPT = yes
# generic_out_eulerian = yes # if yes then uses PPT for output

View file

@ -1,62 +0,0 @@
[setup]
# number of grid cells per linear dimension for calculations = particles for sc initial load
GridRes = 128
# length of the box in Mpc/h
BoxLength = 200
# starting redshift
zstart = 24.0
# order of the LPT to be used (1,2 or 3)
LPTorder = 1
# also do baryon ICs?
DoBaryons = no
# do mode fixing à la Angulo&Pontzen
DoFixing = yes
# particle load, can be 'sc' (1x), 'bcc' (2x), 'fcc' (4x), or 'rsc' (8x)
ParticleLoad = sc
[testing]
# enables diagnostic output
# can be 'none' (default), 'potentials_and_densities', 'velocity_displacement_symmetries', or 'convergence'
#test = potentials_and_densities
#test = convergence
test = none
[execution]
NumThreads = 1
[output]
fname_hdf5 = output.hdf5
fbase_analysis = output
#format = gadget2
#filename = ics_gadget.dat
format = generic
filename = debug.hdf5
#generic_out_eulerian = yes
#format = grafic2
#filename = ics_ramses
#grafic_use_SPT = yes
[random]
generator = NGENIC
seed = 9001
[cosmology]
transfer = eisenstein
#transfer = CLASS
#transfer = eisenstein_wdm
#WDMmass = 0.1
Omega_m = 0.302
Omega_b = 0.045
Omega_L = 0.698
H0 = 70.3
sigma_8 = 0.811
nspec = 0.961
# anisotropic large scale tidal field
#LSS_aniso_lx = 0.1
#LSS_aniso_ly = 0.1
#LSS_aniso_lz = -0.2

View file

@ -88,7 +88,7 @@ int Run( config_file& the_config )
//--------------------------------------------------------------------------------------------------------
//! do constrained ICs?
const bool bAddConstrainedModes = the_config.contains_key("setup", "ConstraintFieldFile" );
const bool bAddConstrainedModes = the_config.contains_key("random", "ConstraintFieldFile" );
//--------------------------------------------------------------------------------------------------------
//! add beyond box tidal field modes following Schmidt et al. (2018) [https://arxiv.org/abs/1803.03274]
@ -195,8 +195,8 @@ int Run( config_file& the_config )
//--------------------------------------------------------------------
if( bAddConstrainedModes ){
Grid_FFT<real_t,false> cwnoise({8,8,8}, {boxlen,boxlen,boxlen});
cwnoise.Read_from_HDF5( the_config.get_value<std::string>("setup", "ConstraintFieldFile"),
the_config.get_value<std::string>("setup", "ConstraintFieldName") );
cwnoise.Read_from_HDF5( the_config.get_value<std::string>("random", "ConstraintFieldFile"),
the_config.get_value<std::string>("random", "ConstraintFieldName") );
cwnoise.FourierTransformForward();
size_t ngrid_c = cwnoise.size(0), ngrid_c_2 = ngrid_c/2;