diff options
author | Anton Khirnov <anton@khirnov.net> | 2014-11-01 15:00:30 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-11-01 15:00:30 +0100 |
commit | e421ae2d7df9bd6bae9e45e33fe76f31a8229a53 (patch) | |
tree | ba2d79eccc1c55fbd3d9e7f967a75f9ef8ec75c6 /brill_data.h | |
parent | 24499694116ff25a190e95533da09d0efaccffae (diff) |
Add a function for evaluating ψ.
Diffstat (limited to 'brill_data.h')
-rw-r--r-- | brill_data.h | 23 |
1 files changed, 23 insertions, 0 deletions
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); |