aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallen <allen@fa3da13c-9f13-4301-a575-cf5b8c5e1907>1999-09-16 09:11:19 +0000
committerallen <allen@fa3da13c-9f13-4301-a575-cf5b8c5e1907>1999-09-16 09:11:19 +0000
commitb287b9f74ce346e9973f0e98be258e766080fdaf (patch)
treeb4ed0bc288d866df26b7f023a1d112ab238c1043
parent74a407420624d1e0c0c08c1ee7ad60c7a4361b3c (diff)
Small pointer and declaration fixes
git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllSOR/trunk@11 fa3da13c-9f13-4301-a575-cf5b8c5e1907
-rw-r--r--src/Startup.c7
-rw-r--r--src/sor_wrapper.c16
2 files changed, 13 insertions, 10 deletions
diff --git a/src/Startup.c b/src/Startup.c
index b8f92a8..f252a60 100644
--- a/src/Startup.c
+++ b/src/Startup.c
@@ -5,15 +5,16 @@
#include "cctk.h"
#include "cctk_parameters.h"
+#include "cctk_WarnLevel.h"
/* 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 *AbsTol, int *RelTol);
- void sor_flat(cGH *GH, int *MI, int *NI, int *AbsTol, int *RelTol);
+ void sor_confmetric(cGH *GH, int *MetricPsiI, int FieldI, int MI,
+ int NI, CCTK_REAL *AbsTol, CCTK_REAL *RelTol);
+ void sor_flat(cGH *GH, int MI, int NI, CCTK_REAL *AbsTol, CCTK_REAL *RelTol);
DECLARE_CCTK_PARAMETERS
diff --git a/src/sor_wrapper.c b/src/sor_wrapper.c
index d9f39df..d494a2a 100644
--- a/src/sor_wrapper.c
+++ b/src/sor_wrapper.c
@@ -21,12 +21,14 @@
#include "cctk.h"
#include "cctk_parameters.h"
#include "cctk_FortranString.h"
+#include "cctk_WarnLevel.h"
+#include "cctk_Groups.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) {
+void sor_confmetric(cGH *GH, int *MetricPsiI, int FieldIndex,
+ int MIndex, int NIndex, CCTK_REAL *AbsTol,CCTK_REAL *RelTol) {
CCTK_REAL *gxx=NULL, *gxy=NULL, *gxz=NULL;
CCTK_REAL *gyy=NULL, *gyz=NULL, *gzz=NULL;
@@ -52,7 +54,7 @@ void sor_confmetric(cGH *GH, int *MetricPsiI, int *FieldIndex,
gyz = (CCTK_REAL*) CCTK_VarDataPtrI(GH, 0, MetricPsiI[4]);
gzz = (CCTK_REAL*) CCTK_VarDataPtrI(GH, 0, MetricPsiI[5]);
psi = (CCTK_REAL*) CCTK_VarDataPtrI(GH, 0, MetricPsiI[6]);
- var = (CCTK_REAL*) CCTK_VarDataPtrI(GH,0,*FieldIndex);
+ var = (CCTK_REAL*) CCTK_VarDataPtrI(GH,0,FieldIndex);
if ((!gxx)||(!gxy)||(!gxz)||(!gyy)||(!gyz)||(!gzz)||(!psi)||(!var))
CCTK_WARN(0,"SOR_WRAPPER: One of the metric data fields, or the GF to solve could not be found!");
@@ -60,8 +62,8 @@ void sor_confmetric(cGH *GH, int *MetricPsiI, int *FieldIndex,
/* derive the data pointer for the fields. the M/N fields are not
allocated (better: are of size 1), if the passed index is negative,
or we get back an empty GF of size 1 */
- if (*MIndex>0) Mlinear = (CCTK_REAL*) CCTK_VarDataPtrI(GH,0,*MIndex);
- if (*NIndex>0) Nsources = (CCTK_REAL*) CCTK_VarDataPtrI(GH,0,*NIndex);
+ if (MIndex>=0) Mlinear = (CCTK_REAL*) CCTK_VarDataPtrI(GH,0,MIndex);
+ if (NIndex>=0) Nsources = (CCTK_REAL*) CCTK_VarDataPtrI(GH,0,NIndex);
/* we pass the size of M/N through to fortran, so F can
@@ -71,9 +73,9 @@ void sor_confmetric(cGH *GH, int *MetricPsiI, int *FieldIndex,
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;
+ if((MIndex<0)) Mlinear_lsh[i]=1;
else Mlinear_lsh[i]=GH->cctk_lsh[i];
- if((*NIndex<0)) Nsource_lsh[i]=1;
+ 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]);
}