aboutsummaryrefslogtreecommitdiff
path: root/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src
diff options
context:
space:
mode:
authorianhin <ianhin>2006-09-07 21:58:55 +0000
committerianhin <ianhin>2006-09-07 21:58:55 +0000
commitabe2347758636f4926d108d34ba016f18e98977a (patch)
tree33f76bff6fa4591facfb7d809de297315eeb9479 /Auxiliary/Cactus/KrancNumericalTools/GenericFD/src
parentcc022cf040e82b98b5e108c20451251d65dcde14 (diff)
A code fragment for summation by parts. Experimental.
Diffstat (limited to 'Auxiliary/Cactus/KrancNumericalTools/GenericFD/src')
-rw-r--r--Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/sbp_calc_coeffs.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/sbp_calc_coeffs.h b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/sbp_calc_coeffs.h
new file mode 100644
index 0000000..092d36f
--- /dev/null
+++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/sbp_calc_coeffs.h
@@ -0,0 +1,25 @@
+int const deriv_options = -1;
+
+/* (drho/dx)^i = D^i_j rho^j, with D^i_j = q(i,j) */
+/* imin and imax contain the first and last non-zero entry of the
+ two-dimensional array q */
+/* All indexing is according to Fortran conventions */
+
+int const ni = cctk_lsh[0];
+int const nj = cctk_lsh[1];
+int const nk = cctk_lsh[2];
+
+CCTK_INT * restrict const sbp_imin = malloc (ni * sizeof *sbp_imin);
+CCTK_INT * restrict const sbp_imax = malloc (ni * sizeof *sbp_imax);
+CCTK_REAL * restrict const qx = malloc (ni * ni * sizeof *qx);
+Diff_coeff (cctkGH, 0, ni, sbp_imin, sbp_imax, qx, deriv_options);
+
+CCTK_INT * restrict const sbp_jmin = malloc (nj * sizeof *sbp_jmin);
+CCTK_INT * restrict const sbp_jmax = malloc (nj * sizeof *sbp_jmax);
+CCTK_REAL * restrict const qy = malloc (nj * nj * sizeof *qy);
+Diff_coeff (cctkGH, 1, nj, sbp_jmin, sbp_jmax, qy, deriv_options);
+
+CCTK_INT * restrict const sbp_kmin = malloc (nk * sizeof *sbp_kmin);
+CCTK_INT * restrict const sbp_kmax = malloc (nk * sizeof *sbp_kmax);
+CCTK_REAL * restrict const qz = malloc (nk * nk * sizeof *qz);
+Diff_coeff (cctkGH, 2, nk, sbp_kmin, sbp_kmax, qz, deriv_options);