aboutsummaryrefslogtreecommitdiff
path: root/brill_data.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-12-01 12:57:45 +0100
committerAnton Khirnov <anton@khirnov.net>2014-12-01 12:57:45 +0100
commite7917b740e8907476d9fb440ba1c9cafb7bafcaa (patch)
tree57c8e7259706962454ddf2d77056ef18e79589a8 /brill_data.h
parent7c6e3b743508159bef41a3d2f503809acad1c2e6 (diff)
Add a function for evaluating the metric.
Diffstat (limited to 'brill_data.h')
-rw-r--r--brill_data.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/brill_data.h b/brill_data.h
index 85e1aac..a3f897b 100644
--- a/brill_data.h
+++ b/brill_data.h
@@ -161,3 +161,28 @@ 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);
+
+/**
+ * Evaluate the 3-metric γ_ij 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 comp the component of the metric to evaluate.
+ * @param diff_order the order of the derivatives of the metric to evaluate. The first element
+ * specifies the derivative wrt ρ, the second wrt z. I.e. diff_order = { 0, 0 }
+ * evaluates the metric itself, diff_order = { 0, 1 } evaluates ∂γ/∂z etc.
+ * @param out the array into which the values of the metric will be written. The metric
+ * 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_metric(BDContext *bd, const double *rho, int nb_coords_rho,
+ const double *z, int nb_coords_z,
+ const unsigned int comp[2], const unsigned int diff_order[2],
+ double *out);