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

small optimizations

This commit is contained in:
Oliver Hahn 2019-12-19 13:54:24 +01:00
parent 6178b2f215
commit 2ef654f22a
8 changed files with 1514 additions and 11 deletions

View file

@ -5,7 +5,7 @@ project(monofonIC)
# include class submodule
include(${CMAKE_CURRENT_SOURCE_DIR}/external/class.cmake)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -march=native -Wall -fno-omit-frame-pointer -g -fsanitize=address")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -march=native -Wall -fno-omit-frame-pointer -g -fsanitize=address")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native -Wall -pedantic")
find_package(PkgConfig REQUIRED)

View file

@ -4,13 +4,13 @@ GridRes = 128
# length of the box in Mpc/h
BoxLength = 250
# starting redshift
zstart = 49.0
zstart = 24.0
# order of the LPT to be used (1,2 or 3)
LPTorder = 3
LPTorder = 1
# also do baryon ICs?
DoBaryons = no
# do mode fixing à la Angulo&Pontzen
DoFixing = no
DoFixing = yes
# particle load, can be 'sc' (1x), 'bcc' (2x) or 'fcc' (4x) (increases number of particles by factor!)
ParticleLoad = sc
@ -36,7 +36,8 @@ seed = 9001
[testing]
# enables diagnostic output
# can be 'none' (default), 'potentials_and_densities', 'velocity_displacement_symmetries', or 'convergence'
test = convergence
#test = convergence
test = none
[execution]
NumThreads = 4

33
example_testing.conf Normal file
View file

@ -0,0 +1,33 @@
[setup]
GridRes = 256
BoxLength = 6.28318530718
zstart = 0.0
LPTorder = 1
SymplecticPT = no
DoFixing = no
[execution]
NumThreads = 4
[output]
fname_hdf5 = output.hdf5
fbase_analysis = output
#format = gadget2
#filename = ics_gadget.dat
format = generic
filename = debug.hdf5
generic_out_eulerian = yes
[random]
generator = NGENIC
seed = 9001
[cosmology]
#transfer = CLASS
transfer = eisenstein
Omega_m = 1.0
Omega_b = 0.045
Omega_L = 0.0
H0 = 70.3
sigma_8 = 0.811
nspec = 0.961

2
external/class vendored

@ -1 +1 @@
Subproject commit b34d7f6c2b72eab3a347c28e62298d62ca9dd69b
Subproject commit 6f3abbab2608712029d740d6c69aad0ba853e507

1
external/fftwpp vendored Submodule

@ -0,0 +1 @@
Subproject commit ec6b82cc1122ba029a7a7142cf836014e992e68c

62
ics.conf Normal file
View file

@ -0,0 +1,62 @@
[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

@ -176,14 +176,12 @@ private:
//! checks if 'vec' is in the FBZ with FBZ normal vectors given in 'normals'
auto check_FBZ = []( const auto& normals, const auto& vec ) -> bool {
bool btest = true;
for( const auto& n : normals ){
if( n.dot( vec ) > 1.0001 * n.dot(n) ){
btest = false;
break;
return false;
}
}
return btest;
return true;
};
constexpr ptrdiff_t lnumber = 3, knumber = 3;
@ -340,7 +338,7 @@ private:
for( int l3=-numb; l3<=numb; ++l3 ){
// need both halfs of Fourier space since we use real transforms
for( int isign=0; isign<=1; ++isign ){
real_t sign = (isign==0)? +1.0 : -1.0;
const real_t sign = 2.0*real_t(isign)-1.0;
const vec3<real_t> vshift({real_t(l1),real_t(l2),real_t(l3)});
vec3<real_t> vectk = sign * a + mat_reciprocal * vshift;

File diff suppressed because it is too large Load diff