mirror of
https://github.com/cosmo-sims/monofonIC.git
synced 2024-09-19 17:03:45 +02:00
fixed units when using output plugins
This commit is contained in:
parent
34002ddb9f
commit
4ccd149d94
2 changed files with 9 additions and 8 deletions
2
external/class
vendored
2
external/class
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 3cf3687dd30b3cb4b2d39eca8115f16c7f76665c
|
||||
Subproject commit b34d7f6c2b72eab3a347c28e62298d62ca9dd69b
|
15
src/main.cc
15
src/main.cc
|
@ -240,7 +240,7 @@ int main( int argc, char** argv )
|
|||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// we store the densities here if we compute them
|
||||
const bool compute_densities = true;
|
||||
const bool compute_densities = false;
|
||||
if( compute_densities ){
|
||||
Grid_FFT<real_t> delta({ngrid, ngrid, ngrid}, {boxlen, boxlen, boxlen});
|
||||
Grid_FFT<real_t> delta2({ngrid, ngrid, ngrid}, {boxlen, boxlen, boxlen});
|
||||
|
@ -350,13 +350,14 @@ int main( int argc, char** argv )
|
|||
auto phitot = phi.kelem(idx) + ((LPTorder>1)?phi2.kelem(idx):0.0) + ((LPTorder>2)? phi3a.kelem(idx) + phi3b.kelem(idx) : 0.0);
|
||||
auto phitot_v = vfac1 * phi.kelem(idx) + ((LPTorder>1)? vfac2 * phi2.kelem(idx) : 0.0) + ((LPTorder>2)? vfac3 * (phi3a.kelem(idx) + phi3b.kelem(idx)) : 0.0);
|
||||
|
||||
Psix.kelem(idx) = ccomplex_t(0.0,1.0) * kk[0]* boxlen * ( phitot );
|
||||
Psiy.kelem(idx) = ccomplex_t(0.0,1.0) * kk[1]* boxlen * ( phitot );
|
||||
Psiz.kelem(idx) = ccomplex_t(0.0,1.0) * kk[2]* boxlen * ( phitot );
|
||||
// divide by Lbox, because displacement is in box units for output plugin
|
||||
Psix.kelem(idx) = ccomplex_t(0.0,1.0) * kk[0]/ boxlen * ( phitot );
|
||||
Psiy.kelem(idx) = ccomplex_t(0.0,1.0) * kk[1]/ boxlen * ( phitot );
|
||||
Psiz.kelem(idx) = ccomplex_t(0.0,1.0) * kk[2]/ boxlen * ( phitot );
|
||||
|
||||
Vx.kelem(idx) = ccomplex_t(0.0,1.0) * kk[0]* boxlen * ( phitot_v );
|
||||
Vy.kelem(idx) = ccomplex_t(0.0,1.0) * kk[1]* boxlen * ( phitot_v );
|
||||
Vz.kelem(idx) = ccomplex_t(0.0,1.0) * kk[2]* boxlen * ( phitot_v );
|
||||
Vx.kelem(idx) = ccomplex_t(0.0,1.0) * kk[0]/ boxlen * ( phitot_v );
|
||||
Vy.kelem(idx) = ccomplex_t(0.0,1.0) * kk[1]/ boxlen * ( phitot_v );
|
||||
Vz.kelem(idx) = ccomplex_t(0.0,1.0) * kk[2]/ boxlen * ( phitot_v );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue