aboutsummaryrefslogtreecommitdiff
path: root/brill_data.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-12-02 19:49:45 +0100
committerAnton Khirnov <anton@khirnov.net>2014-12-02 19:49:45 +0100
commit2c9f54d6bb72faf464c7a5b3a91afba5d8d34574 (patch)
tree26ee97048b03c957be87fb4130fffbe0530cd4b5 /brill_data.h
parent8893103105296f8d798e560483b74f3bd91f2549 (diff)
Add a function for evaluating q.
Diffstat (limited to 'brill_data.h')
-rw-r--r--brill_data.h23
1 files changed, 23 insertions, 0 deletions
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 */