Skip to content

Commit

Permalink
New spline object for functions with known second derivative. Updated…
Browse files Browse the repository at this point in the history
… nc_multiplicity_func_tinker to use interpolation objects, added option to use linear interpolation. Removed old notebook NC_CCL_Bocquet_Test2.ipynb. Updated NC_CCL_mass_function.ipynb (fixed bugs).
  • Loading branch information
vitenti committed Dec 19, 2021
1 parent 8b7dbbb commit 358b3b6
Show file tree
Hide file tree
Showing 17 changed files with 568 additions and 676 deletions.
2 changes: 1 addition & 1 deletion aminclude_static.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# aminclude_static.am generated automatically by Autoconf
# from AX_AM_MACROS_STATIC on Mon Oct 11 20:01:54 -03 2021
# from AX_AM_MACROS_STATIC on Fri Dec 17 16:04:07 -03 2021


# Code coverage
Expand Down
1 change: 1 addition & 0 deletions docs/numcosmo-docs.sgml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<xi:include href="xml/ncm_spline_gsl.xml"/>
<xi:include href="xml/ncm_spline_cubic.xml"/>
<xi:include href="xml/ncm_spline_cubic_notaknot.xml"/>
<xi:include href="xml/ncm_spline_cubic_d2.xml"/>
<xi:include href="xml/ncm_spline_rbf.xml"/>
<xi:include href="xml/ncm_spline_func.xml"/>
<xi:include href="xml/ncm_spline_func_test.xml"/>
Expand Down
423 changes: 0 additions & 423 deletions notebooks/NC_CCL_Bocquet_Test2.ipynb

This file was deleted.

242 changes: 133 additions & 109 deletions notebooks/NC_CCL_mass_function.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions numcosmo/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ ncm_sources = \
math/ncm_spline_gsl.c \
math/ncm_spline_cubic.c \
math/ncm_spline_cubic_notaknot.c \
math/ncm_spline_cubic_d2.c \
math/ncm_spline_rbf.c \
math/ncm_spline_func.c \
math/ncm_spline_func_test.c \
Expand Down Expand Up @@ -245,6 +246,7 @@ ncm_headers = \
math/ncm_spline_gsl.h \
math/ncm_spline_cubic.h \
math/ncm_spline_cubic_notaknot.h \
math/ncm_spline_cubic_d2.h \
math/ncm_spline_rbf.h \
math/ncm_spline_func.h \
math/ncm_spline_func_test.h \
Expand Down
8 changes: 4 additions & 4 deletions numcosmo/lss/nc_halo_mass_function.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ nc_halo_mass_function_prepare (NcHaloMassFunction *mfp, NcHICosmo *cosmo)

nc_distance_prepare_if_needed (self->dist, cosmo);
ncm_powspec_filter_prepare_if_needed (self->psf, NCM_MODEL (cosmo));

if (mfp->d2NdzdlnM == NULL)
_nc_halo_mass_function_generate_2Dspline_knots (mfp, cosmo, self->prec);

Expand All @@ -723,7 +723,7 @@ nc_halo_mass_function_prepare (NcHaloMassFunction *mfp, NcHICosmo *cosmo)
ncm_matrix_set (D2NDZDLNM_VAL (mfp), i, j, d2NdzdlnM_ij);
}
}

ncm_spline2d_prepare (mfp->d2NdzdlnM);

ncm_model_ctrl_update (self->ctrl_cosmo, NCM_MODEL (cosmo));
Expand Down Expand Up @@ -812,7 +812,7 @@ _encapsulated_z (gdouble z, gpointer p)
nc_halo_mass_function_dv_dzdomega (args->mfp, args->cosmo, z) *
nc_halo_mass_function_dn_dlnM (args->mfp, args->cosmo, args->lnM, z);

/*printf ("z % 22.15g % 22.15g\n", z, A);*/
/*printf ("z % 22.15g % 22.15g\n", z, A);fflush(stdout);*/
return A;
}

Expand All @@ -823,7 +823,7 @@ _encapsulated_lnM (gdouble lnM, gpointer p)

gdouble A = args->dVdz * nc_halo_mass_function_dn_dlnM (args->mfp, args->cosmo, lnM, args->z);

/*printf ("lnM % 22.15g % 22.15g\n", lnM, A);*/
/*printf ("lnM % 22.15g % 22.15g\n", lnM, A);fflush (stdout);*/
return A;
}

Expand Down
2 changes: 2 additions & 0 deletions numcosmo/lss/nc_multiplicity_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ gdouble nc_multiplicity_func_eval (NcMultiplicityFunc *mulf, NcHICosmo *cosmo, g
gboolean nc_multiplicity_func_has_correction_factor (NcMultiplicityFunc *mulf);
gdouble nc_multiplicity_func_correction_factor (NcMultiplicityFunc *mulf, NcHICosmo *cosmo, gdouble sigma, gdouble z, gdouble lnM);

#define NC_MULTIPLICITY_FUNC_DELTA_C0 (1.6864701998411454502)

G_END_DECLS

#endif /* _NC_MULTIPLICITY_FUNC_H_ */
2 changes: 1 addition & 1 deletion numcosmo/lss/nc_multiplicity_func_ps.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ nc_multiplicity_func_ps_class_init (NcMultiplicityFuncPSClass *klass)
g_param_spec_double ("critical-delta",
NULL,
"Critical delta",
-G_MAXDOUBLE, G_MAXDOUBLE, 1.6864701998411454502,
-G_MAXDOUBLE, G_MAXDOUBLE, NC_MULTIPLICITY_FUNC_DELTA_C0,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB));

parent_class->set_mdef = &_nc_multiplicity_func_ps_set_mdef;
Expand Down
2 changes: 1 addition & 1 deletion numcosmo/lss/nc_multiplicity_func_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ nc_multiplicity_func_st_class_init (NcMultiplicityFuncSTClass *klass)
g_param_spec_double ("critical-delta",
NULL,
"Critical delta",
-G_MAXDOUBLE, G_MAXDOUBLE, 1.686,
-G_MAXDOUBLE, G_MAXDOUBLE, NC_MULTIPLICITY_FUNC_DELTA_C0,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB));
parent_class->set_mdef = &_nc_multiplicity_func_st_set_mdef;
parent_class->get_mdef = &_nc_multiplicity_func_st_get_mdef;
Expand Down

0 comments on commit 358b3b6

Please sign in to comment.