FML
Loading...
Searching...
No Matches
DisplacementFields.h File Reference

Go to the source code of this file.

Namespaces

namespace  FML
 
namespace  FML::COSMOLOGY
 This namespace deals with various cosmology specific things: background evolution, perturbation theory, recombination history etc.
 
namespace  FML::COSMOLOGY::LPT
 This namespace contains things related to Lagrangian Perturbation Theory (displacement fields, reconstruction, initial conditions etc.)
 

Typedefs

template<int N>
using FML::COSMOLOGY::LPT::FFTWGrid = FML::GRID::FFTWGrid<N>
 
template<class T >
using FML::COSMOLOGY::LPT::MPIParticles = FML::PARTICLE::MPIParticles<T>
 

Functions

template<int N>
void FML::COSMOLOGY::LPT::from_LPT_potential_to_displacement_vector (const FFTWGrid< N > &phi, std::array< FFTWGrid< N >, N > &psi, double DoverDini)
 Generate the displaceement field \( \Psi = \nabla \phi \) from the LPT potential \( \phi \).
 
template<int N>
void FML::COSMOLOGY::LPT::compute_1LPT_potential_fourier (const FFTWGrid< N > &delta_fourier, FFTWGrid< N > &phi_1LPT_fourier)
 Generate the 1LPT potential defined as \( \Psi^{\rm 1LPT} = \nabla \phi^{\rm 1LPT} \) and \( \nabla^2 \phi^{\rm 1LPT} = -\delta \).
 
template<int N>
void FML::COSMOLOGY::LPT::compute_2LPT_potential_fourier (const FFTWGrid< N > &delta_fourier, FFTWGrid< N > &phi_2LPT_fourier, Dealiasing dealiasing=Dealiasing::None)
 Optional Padding uses a >=3N/2 work mesh for the quadratic source.
 
template<int N>
void FML::COSMOLOGY::LPT::compute_3LPT_potential_fourier (const FFTWGrid< N > &delta_fourier, FFTWGrid< N > &phi_1LPT_fourier, FFTWGrid< N > &phi_2LPT_fourier, FFTWGrid< N > &phi_3LPT_a_fourier, FFTWGrid< N > &phi_3LPT_b_fourier, std::array< FFTWGrid< N >, N > &phi_3LPT_Avec_fourier, bool ignore_curl_term, Dealiasing dealiasing=Dealiasing::None)
 Optional Padding uses a >=2N work mesh for all nonlinear sources, retaining the full intermediate second-order bandwidth until cropping.
 
template<int N>
void FML::COSMOLOGY::LPT::compute_ALPT_potential_fourier (const FFTWGrid< N > &delta_fourier, const FFTWGrid< N > &phi_2LPT_fourier, FFTWGrid< N > &phi_ALPT_fourier, double smoothing_scale, std::string smoothing_method, double DoverDini_1LPT, double DoverDini_2LPT)
 Generate the APT potential defined as \( \Psi = \Psi^L + \Psi^S \) where the long range is just a smoothed 1LPT+2LPT and the short range is the spherical collapse approximation.
 
template<int N>
void FML::COSMOLOGY::LPT::compute_spherical_collapse_potential (const FFTWGrid< N > &delta_fourier, FFTWGrid< N > &phi_sc_fourier, double DoverDini_1LPT)
 Take in an initial density field (generated at a redshift zini) and the corresponding ratio of growth factors D(z)/D(zini) produces the approximate spherical collapse potential defined via \( \nabla^2 \phi_{\rm SC} = 3(\sqrt{\max(1 - \frac{2}{3}\delta(x,z), 0)} - 1) \) at the redshift z with \( \delta(x,z) = \frac{D(z)}{D(z_{\rm ini})}\delta_{\rm ini}(x) \).
 
template<int N>
void FML::COSMOLOGY::LPT::from_LPT_potential_to_displacement_vector_scaledependent (const FFTWGrid< N > &phi, std::array< FFTWGrid< N >, N > &psi, std::function< double(double)> DoverDini_of_k)
 Function is the ratio of the scale-dependent growth-factor at the time we want to generate particles to the time where phi was generated at as function of k.
 
template<int N>
void FML::COSMOLOGY::LPT::compute_3LPT_displacement_field (const FFTWGrid< N > &delta_fourier, std::array< FFTWGrid< N >, N > &Psi, std::array< FFTWGrid< N >, N > &dPsidt, double dlogDdt, bool ignore_curl_term, Dealiasing dealiasing)
 The potential construction retains the first-order Hessian and streams the second-order Hessian in two batches through N work grids.
 
template<int N, class T >
void FML::COSMOLOGY::LPT::assign_displacement_fields_scaledependent (MPIParticles< T > &part, FFTWGrid< N > &LPT_potential_fourier, std::function< double(double)> DoverDini_of_k, std::string LPT_potential_order)
 This method assigns the displacement fields to particles for the case where we have scaledependent growth.
 
void FML::COSMOLOGY::LPT::compute_LPT_growth_factors_GeffGLCDM (double OmegaM, double zini, std::function< double(double)> HoverH0_of_a, std::function< double(double)> GeffOverG_of_a, FML::INTERPOLATION::SPLINE::Spline &D_1LPT_of_loga, FML::INTERPOLATION::SPLINE::Spline &D_2LPT_of_loga, FML::INTERPOLATION::SPLINE::Spline &D_3LPTa_of_loga, FML::INTERPOLATION::SPLINE::Spline &D_3LPTb_of_loga)
 Compute 1,2,3LPT growth-factors in simple modified gravity models that have a GeffG(a) and spline them The growth factors are normalized such that D1LPT = 1 at zini We assume initial conditions as in EdS: D1LPT=1, D2LPT = -3/7, D3LPTa = -1/3 and D3LPTb = 5/21 NB: There should be a modified 2LPT+ kernel factor in general which we don't include here (model dependent)
 
void FML::COSMOLOGY::LPT::compute_LPT_growth_factors_LCDM (double OmegaM, double zini, std::function< double(double)> HoverH0_of_a, FML::INTERPOLATION::SPLINE::Spline &D_1LPT_of_loga, FML::INTERPOLATION::SPLINE::Spline &D_2LPT_of_loga, FML::INTERPOLATION::SPLINE::Spline &D_3LPTa_of_loga, FML::INTERPOLATION::SPLINE::Spline &D_3LPTb_of_loga)
 Compute 1,2,3LPT growth-factors in LCDM and spline them The growth factors are normalized such that D1LPT = 1 at zini We assume initial conditions as in EdS: D1LPT=1, D2LPT = -3/7, D3LPTa = -1/3 and D3LPTb = 5/21.