aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlanfer <lanfer@fa3da13c-9f13-4301-a575-cf5b8c5e1907>1999-09-15 14:17:47 +0000
committerlanfer <lanfer@fa3da13c-9f13-4301-a575-cf5b8c5e1907>1999-09-15 14:17:47 +0000
commit9d35527c4203d1e70695011e181fbcf57eabdeef (patch)
treedfcc9f08a3f749808ad4d0bf0876937aef503756
parent45ca223e454f4d0bc4939a2edaf6f3f7f98db894 (diff)
added the sor_flat wrapper
git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllSOR/trunk@9 fa3da13c-9f13-4301-a575-cf5b8c5e1907
-rw-r--r--src/sor_wrapper.c45
1 files changed, 40 insertions, 5 deletions
diff --git a/src/sor_wrapper.c b/src/sor_wrapper.c
index c8b2673..d9f39df 100644
--- a/src/sor_wrapper.c
+++ b/src/sor_wrapper.c
@@ -64,11 +64,10 @@ void sor_confmetric(cGH *GH, int *MetricPsiI, int *FieldIndex,
if (*NIndex>0) Nsources = (CCTK_REAL*) CCTK_VarDataPtrI(GH,0,*NIndex);
- /* we pass the size of M/N through to frotran, so F can
- tell the difference between an allocated GF (Mlinear_lsh=cctk_lsh) or
- unallocated GF (Mlinear_lsh=1) maximal dimension is three. */
- /* FIXME: for testing we should make sure that storage is allocated
- for the GF M/N */
+ /* we pass the size of M/N through to fortran, so F can
+ tell the difference between an allocated GF (Mlinear_lsh.eq.cctk_lsh) or
+ unallocated GF (Mlinear_lsh=1). maximal dimension is three. */
+
if (GH->cctk_dim>3)
CCTK_WARN(0,"This elliptic solver implementation does not do dimension>3!");
for (i=0;i<GH->cctk_dim;i++) {
@@ -89,3 +88,39 @@ void sor_confmetric(cGH *GH, int *MetricPsiI, int *FieldIndex,
}
+
+void sor_flat(cGH *GH, int *FieldIndex, int *MIndex,
+ int *NIndex, int *AbsTol, int *RelTol) {
+
+ CCTK_REAL *Mlinear=NULL, *Nsources=NULL;
+ CCTK_REAL *var=NULL; CCTK_REAL tolerance;
+ int i;
+
+ int toltype;
+
+ int Mlinear_lsh[3], Nsource_lsh[3];
+
+ int retcode;
+
+ var = (CCTK_REAL*) CCTK_VarDataPtrI(GH,0,*FieldIndex);
+ if (*MIndex>0) Mlinear = (CCTK_REAL*) CCTK_VarDataPtrI(GH,0,*MIndex);
+ if (*NIndex>0) Nsources = (CCTK_REAL*) CCTK_VarDataPtrI(GH,0,*NIndex);
+
+ if (GH->cctk_dim>3)
+ CCTK_WARN(0,"This elliptic solver implementation does not do dimension>3!");
+
+ for (i=0;i<GH->cctk_dim;i++) {
+ if((*MIndex<0)) Mlinear_lsh[i]=1;
+ else Mlinear_lsh[i]=GH->cctk_lsh[i];
+ if((*NIndex<0)) Nsource_lsh[i]=1;
+ else Nsource_lsh[i]=GH->cctk_lsh[i];
+ }
+
+ /* call the fortran routine */
+ FORTRAN_NAME(sor_flat_core3d)(_PASS_CCTK_C2F(GH),
+ Mlinear_lsh, Mlinear,
+ Nsource_lsh, Nsources,
+ var, AbsTol, RelTol);
+
+}
+