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

added customization to particle masking

This commit is contained in:
Oliver Hahn 2022-03-25 18:17:10 +01:00
parent 819be9d48d
commit 8281f0bed6
2 changed files with 25 additions and 8 deletions

View file

@ -23,6 +23,9 @@ ParticleLoad = sc # particle load, can be 'sc' (1x), 'bcc' (2x) or 'fcc
# (increases number of particles by given factor!),
# or 'glass' or 'masked'
## if `ParticleLoad = masked' then you can specify here how masking should take place
# ParticleMaskType = 3 # bit mask for particle mask (0=center,1=center+edges,2=center+faces,3=center+edges+faces)
## if `ParticleLoad = glass' then specify here where to load the glass distribution from
# GlassFileName = glass128.hdf5
# GlassTiles = 1

View file

@ -38,11 +38,11 @@ namespace particle
lattice_rsc = 3, // RSC: refined simple cubic
};
const std::vector<std::vector<bool>> lattice_masks =
{
// mask from Richings et al. https://arxiv.org/pdf/2005.14495.pdf
{true,true,true,true,true,true,true,false},
};
// const std::vector<std::vector<bool>> lattice_masks =
// {
// // mask from Richings et al. https://arxiv.org/pdf/2005.14495.pdf
// {true,true,true,true,true,true,true,false},
// };
const std::vector<std::vector<vec3_t<real_t>>> lattice_shifts =
{
@ -266,11 +266,25 @@ namespace particle
// set the particle mask
if( cf.get_value_safe("setup","DoBaryons",false) )
{
unsigned mask_type = cf.get_value_safe("setup","ParticleMaskType",3);
// mask everywehere 0, except the last element
for( auto& m : particle_type_mask_) m = 0;
particle_type_mask_[7] = 1;
for( auto& m : particle_type_mask_) m = -1;
particle_type_mask_[0] = 0; // CDM at corner of unit cube
if( mask_type & 1<<0 ) {
// edge centers
particle_type_mask_[1] = 0; // CDM
particle_type_mask_[2] = 0; // CDM
particle_type_mask_[4] = 0; // CDM
}
if( mask_type & 1<<1 ){
// face centers
particle_type_mask_[3] = 0; // CDM
particle_type_mask_[5] = 0; // CDM
particle_type_mask_[6] = 0; // CDM
}
particle_type_mask_[7] = 1; // baryon at cell center (aka opposite corner)
}else{
// mask everywehere 0
// mask everywhere 0, all particle locations are occupied by CDM
for( auto& m : particle_type_mask_) m = 0;
}