aboutsummaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-08-26 12:38:01 +0200
committerAnton Khirnov <anton@khirnov.net>2023-01-19 15:48:59 +0100
commit1af479757c3874330348432aeb91100ae0575064 (patch)
treedd1be021c7c08b4e9866e8727ea5f75b84b3ef6b /init.c
parentf9746f8e22ee33525abde628dfb37ed94f536b9e (diff)
TD_FAMILY_STRETCH WIP
controlled by env variables: - TD_PARAM - param 'b' - TD_A_MAX - max converging a value
Diffstat (limited to 'init.c')
-rw-r--r--init.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/init.c b/init.c
index 07a00d8..992feff 100644
--- a/init.c
+++ b/init.c
@@ -192,6 +192,7 @@ int td_solve(TDContext *td, double *coeffs_init[3])
TDPriv *s = td->priv;
NLSolveContext *nl;
TDConstraintEvalContext *ce;
+ const char *env_a_max = getenv("TD_A_MAX");
double a0;
int ret;
@@ -206,14 +207,19 @@ int td_solve(TDContext *td, double *coeffs_init[3])
ret = tdi_ce_alloc(td, td->nb_coeffs, nl->colloc_grid[0], 0.0, &ce);
if (ret < 0)
goto fail;
- if (fabs(td->amplitude) >= ce->a_diverge) {
+ if (!env_a_max && fabs(td->amplitude) >= ce->a_diverge) {
tdi_log(&s->logger, 0,
"Amplitude A=%16.16g is above the point A_{max}=%g, no solutions "
"are known to exist there. Set solution_branch=1 to get to the "
"second branch where mass increases with decreasing amplitude\n",
td->amplitude, ce->a_converge);
}
- a0 = SGN(td->amplitude) * ce->a_converge;
+
+ a0 = ce->a_converge;
+ if (env_a_max)
+ a0 = strtod(env_a_max, NULL);
+ a0 *= SGN(td->amplitude);
+
tdi_constraint_eval_free(&ce);
if (coeffs_init) {