aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlanfer <lanfer@fa3da13c-9f13-4301-a575-cf5b8c5e1907>1999-09-08 13:07:28 +0000
committerlanfer <lanfer@fa3da13c-9f13-4301-a575-cf5b8c5e1907>1999-09-08 13:07:28 +0000
commit6795251f9e29692cb2f3d8401e5f6eb93acf3629 (patch)
tree287a35e060d58cede1883ba546e87d60f77386a0
parentc6a3e51eaf5fcad2a4fa870d476c9af1a8341c24 (diff)
on the way to elliptic with SOR
git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllSOR/trunk@4 fa3da13c-9f13-4301-a575-cf5b8c5e1907
-rw-r--r--src/Startup.c8
-rw-r--r--src/sor_wrapper.c43
2 files changed, 29 insertions, 22 deletions
diff --git a/src/Startup.c b/src/Startup.c
index a7d3c22..b32d032 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -6,9 +6,13 @@
#include "cctk.h"
#include "cctk_parameters.h"
-int EllSOR_Register(cGH *GH) {
+/* routine registers the SOR solver "sor_confmetric" under the name "sor"
+ with the Elliptic Class "LinConfMetric".
+*/
+
+void EllSOR_Register(cGH *GH) {
void sor_confmetric(cGH *GH, int *MetricPsiI, int *FieldI, int *MI,
- int *NI, int *TolArray);
+ int *NI, int *AbsTol, int *RelTol);
printf("SOR: registering sor...");
Ell_RegisterSolver(sor_confmetric,"sor","Ell_LinConfMetric");
diff --git a/src/sor_wrapper.c b/src/sor_wrapper.c
index 989229a..c8b2673 100644
--- a/src/sor_wrapper.c
+++ b/src/sor_wrapper.c
@@ -3,11 +3,14 @@
@date Tue Aug 24 12:50:07 1999
@author Gerd Lanfermann
@desc
- Provides the C wrapper to the different elliptic FORTRAN routines in this thorn
- * These C routines are registered in the Startup routine.
- * The LINELL_*_ARGS macro used here is provided by LinearElliptic.h
- This cannot be modified, since this argument structure is the same
- across all solves which will be registered as *_hhgr3d. See LinearElliptic.c
+ The C wrapper, which calles the core Fortran routine, which
+ performs the actual solve.
+ We cannot derive the pointers to the GF data from the indeces in
+ Fortran. So we do this here in C and then pass the everything
+ over to the Fortran routine.
+
+ This wrapper is registers with the Elliptic solver registry
+ (not the Fortran file) , as coded up in ./CactusElliptic/EllBase
@enddesc
@@*/
@@ -19,9 +22,9 @@
#include "cctk_parameters.h"
#include "cctk_FortranString.h"
-#include "CactusElliptic/LinearElliptic/src/LinearElliptic.h"
-
-
+/* We pass in the arguments that are neccessary for this class of elliptic eq.
+ this solver is intended to solve. See ./CactusElliptic/EllBase/src/ for the
+ classes of elliptic eq. */
void sor_confmetric(cGH *GH, int *MetricPsiI, int *FieldIndex,
int *MIndex, int *NIndex, int *AbsTol,int *RelTol) {
@@ -39,7 +42,9 @@ void sor_confmetric(cGH *GH, int *MetricPsiI, int *FieldIndex,
int retcode;
- /* derive the metric data pointer from the index array. Note the ordering. */
+ /* derive the metric data pointer from the index array. Note the ordering.
+ Also get datapointers to the field to solve for.
+ All of these are mandatory */
gxx = (CCTK_REAL*) CCTK_VarDataPtrI(GH, 0, MetricPsiI[0]);
gxy = (CCTK_REAL*) CCTK_VarDataPtrI(GH, 0, MetricPsiI[1]);
gxz = (CCTK_REAL*) CCTK_VarDataPtrI(GH, 0, MetricPsiI[2]);
@@ -59,20 +64,18 @@ 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: We need to get the group index first!
- printf("XXXX %d \n",CCTK_QueryGroupStorage(GH,*MIndex,NULL));$*/
+ /* 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 */
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)) /*$|| (CCTK_QueryGroupStorage(GH,*MIndex,NULL)==0))$*/
- Mlinear_lsh[i]=1;
- else Mlinear_lsh[i]=GH->cctk_lsh[i];
- if((*NIndex<0)) /*$|| (CCTK_QueryGroupStorage(GH,*NIndex,NULL)==0))$*/
- Nsource_lsh[i]=1;
- else Nsource_lsh[i]=GH->cctk_lsh[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];
printf("%d %d \n",Nsource_lsh[i],Mlinear_lsh[i]);
}