diff options
Diffstat (limited to 'init.c')
-rw-r--r-- | init.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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) { |