From 2c9f54d6bb72faf464c7a5b3a91afba5d8d34574 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 2 Dec 2014 19:49:45 +0100 Subject: Add a function for evaluating q. --- 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 cd26270..37b338a 100644 --- a/brill_data.h +++ b/brill_data.h @@ -190,4 +190,27 @@ int bd_eval_metric(BDContext *bd, const double *rho, int nb_coords_rho, const unsigned int comp[2], const unsigned int diff_order[2], double *out); +/** + * Evaluate the q function at the specified rectangular grid (in cylindrical + * coordinates { ρ, z, φ }). + * + * @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 the q function to evaluate. The first element + * specifies the derivative wrt ρ, the second wrt z. I.e. diff_order = { 0, 0 } + * evaluates the q function itself, diff_order = { 0, 1 } evaluates ∂q/∂z etc. + * @param out the array into which the values of the q function will be written. The q function + * is evaluated on the grid formed by the outer product of the rho + * and z vectors. I.e. out[j * nb_coords_rho + i] = γ_comp[0]comp[1](rho[i], z[j]). + * The length of out must be nb_coords_rho * nb_coords_z. + * + * @return >= 0 on success, a negative error code on failure. + */ +int bd_eval_q(BDContext *bd, const double *rho, int nb_coords_rho, + const double *z, int nb_coords_z, const unsigned int diff_order[2], + double *out); + #endif /* BRILL_DATA_H */ -- cgit v1.2.3