From e421ae2d7df9bd6bae9e45e33fe76f31a8229a53 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 1 Nov 2014 15:00:30 +0100 Subject: Add a function for evaluating ψ. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- brill_data.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'brill_data.h') diff --git a/brill_data.h b/brill_data.h index b8b63e8..85e1aac 100644 --- a/brill_data.h +++ b/brill_data.h @@ -138,3 +138,26 @@ void bd_context_free(BDContext **bd); * @return >= 0 on success, a negative error code on failure */ int bd_solve(BDContext *bd); + +/** + * Evaluate the conformal factor ψ or its derivatives at the specified rectangular grid. + * + * @param bd the solver context + * @param rho the array of ρ coordinates. + * @param nb_coords_rho the number of elements in rho. + * @param z the array of z coordinates. + * @param nb_coords_z the number of elements in z. + * @param diff_order the order of the derivatives of ψ to evaluate. The first element specifies the + * derivative wrt ρ, the second wrt z. I.e. diff_order = { 0, 0 } evaluates ψ + * itself, diff_order = { 0, 1 } evaluates ∂ψ/∂z etc. + * @param psi the array into which the values of ψ will be written. ψ is evaluated on the grid + * formed by the outer product of the rho and z vectors. + * I.e. psi[j * nb_coords_rho + i] = ψ(rho[i], z[j]). The length of psi must be + * nb_coords_rho * nb_coords_z. + * + * @return >= 0 on success, a negative error code on failure. + */ +int bd_eval_psi(BDContext *bd, const double *rho, int nb_coords_rho, + const double *z, int nb_coords_z, + const unsigned int diff_order[2], + double *psi); -- cgit v1.2.3