From 0805d27e20e399a65ac72f0c712f07068b49b082 Mon Sep 17 00:00:00 2001 From: Ben Bose <45853389+nebblu@users.noreply.github.com> Date: Tue, 24 Jun 2025 17:04:52 +0200 Subject: [PATCH 1/4] Update SCOL.cpp Changed the initial guess if statement to give GR guess unless we're in f(R) (rather than f(R) guess unless we're in GR). --- reactions/src/SCOL.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reactions/src/SCOL.cpp b/reactions/src/SCOL.cpp index 0e2a225..1ba3e22 100755 --- a/reactions/src/SCOL.cpp +++ b/reactions/src/SCOL.cpp @@ -629,16 +629,16 @@ double SCOL::myscol(double myscolparams[], double acol, double omegacb, double o arrays_T3 xxyyzz = (arrays_T3)malloc( sizeof(struct arrays3D) ); double mydelta; - - if (model == 1 || model == 9) { - // take standard guess if GR collapse - mydelta = DELTA1/acol; - } - else{ + + if (model == 2) { // If modified gravity is active, set initial condition for SC to 10% higher than y_{env,initial} if we need to use y_env in spherical collapse as in f(R) // This guess allows us to solve for extreme cases (e.g. fr0=10^{-4}, m_nu>0.3eV). mydelta = m/d*1.1/acol; } + else{ + // take standard guess if GR collapse + mydelta = DELTA1/acol; + } UserData data; data = (UserData) malloc(sizeof(struct usdat)); /* Allocate data memory */ From 116e05fa35f96b8f32688cd2b8a84396bab54fc4 Mon Sep 17 00:00:00 2001 From: Ben Bose <45853389+nebblu@users.noreply.github.com> Date: Mon, 1 Sep 2025 12:16:07 +0100 Subject: [PATCH 2/4] Update SCOL.cpp Added in other models to the if statement on line 634 that use environmental screening (q2 or nPPF) --- reactions/src/SCOL.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reactions/src/SCOL.cpp b/reactions/src/SCOL.cpp index 1ba3e22..5611512 100755 --- a/reactions/src/SCOL.cpp +++ b/reactions/src/SCOL.cpp @@ -629,8 +629,9 @@ double SCOL::myscol(double myscolparams[], double acol, double omegacb, double o arrays_T3 xxyyzz = (arrays_T3)malloc( sizeof(struct arrays3D) ); double mydelta; - - if (model == 2) { + + // Add in model to this OR set if it uses environmental screening! + if (model == 2 || 7 || 10 || 12 || 13) { // If modified gravity is active, set initial condition for SC to 10% higher than y_{env,initial} if we need to use y_env in spherical collapse as in f(R) // This guess allows us to solve for extreme cases (e.g. fr0=10^{-4}, m_nu>0.3eV). mydelta = m/d*1.1/acol; From 2b32ff5988360e072d6667a160fb6ef825709837 Mon Sep 17 00:00:00 2001 From: Ben Bose <45853389+nebblu@users.noreply.github.com> Date: Mon, 1 Sep 2025 12:20:01 +0100 Subject: [PATCH 3/4] Update SCOL.cpp --- reactions/src/SCOL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactions/src/SCOL.cpp b/reactions/src/SCOL.cpp index 5611512..8c81e60 100755 --- a/reactions/src/SCOL.cpp +++ b/reactions/src/SCOL.cpp @@ -631,7 +631,7 @@ double SCOL::myscol(double myscolparams[], double acol, double omegacb, double o double mydelta; // Add in model to this OR set if it uses environmental screening! - if (model == 2 || 7 || 10 || 12 || 13) { + if (model == 2 || model == 7 || model == 10 || model == 12 || model == 13) { // If modified gravity is active, set initial condition for SC to 10% higher than y_{env,initial} if we need to use y_env in spherical collapse as in f(R) // This guess allows us to solve for extreme cases (e.g. fr0=10^{-4}, m_nu>0.3eV). mydelta = m/d*1.1/acol; From b052ac26f6bce44314ad5c29a7a92bd546786d70 Mon Sep 17 00:00:00 2001 From: Ben Bose <45853389+nebblu@users.noreply.github.com> Date: Thu, 4 Sep 2025 09:22:46 +0100 Subject: [PATCH 4/4] Update README.md Added note to include environment dependent models to the if statement in SCOL.cpp which gives the initial guess for the collapse density. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 915f1d7..403d282 100644 --- a/README.md +++ b/README.md @@ -337,6 +337,9 @@ ___ One can add in new models by going to the source code, `reactions/src/BeyondLCDM.cpp` and adding in a new `case n:` in the relevant functions. The array extpars stores the theory parameters. The default size of this array is 20 and can be increased by changing the maxpars parameter in `reactions/src/BeyondLCDM.h`. +**Note** For any models that want to include some sort of environmental screening or dependence in the spherical collapse, one also needs to add their model to the if statement at line ~634 of `reactions/src/SCOL.cpp` in the `myscol` function which gives the initial guess for the collapse density which can depend on the environment. Any model that makes use of the $p_2$ parameter (see model 13 above for example) will need to be added to this if statement for example. + + The functions one should consider when adding in a new models are as follows: ### A) Basic functions to edit for new models