diff options
Diffstat (limited to 'init.c')
-rw-r--r-- | init.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -583,3 +583,30 @@ int td_eval_kpp(const TDContext *td, { return eval_var(td, 2, nb_coords, r, theta, diff_order, out); } + +int td_eval_krt(const TDContext *td, + size_t nb_coords, const double *r, const double *theta, + const unsigned int diff_order[2], + double *out) +{ + TDConstraintEvalContext *ce; + int ret; + + if (diff_order[0] || diff_order[1]) + return -ENOSYS; + + ret = constraint_eval_alloc(td, td->amplitude, &ce); + if (ret < 0) + return ret; + + for (int i = 0; i < nb_coords; i++) { + double theta_val = theta[i]; + double r_val = r[i]; + + out[i] = tdi_constraint_eval_k_rtheta(ce, r_val, theta_val); + } + + tdi_constraint_eval_free(&ce); + + return 0; +} |