aboutsummaryrefslogtreecommitdiff
path: root/src/petsc_wrapper.c
blob: 15407c64cc64e704025f2656451e4deb725f43ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "cctk.h"
#include "cctk_parameters.h"
#include "cctk_Flesh.h"

/* The wrapper functions for the core PETSc solver, that performs the 
   actual solve. 
   One wrapper fucntion for each class, because these functions are registered 
   with a fixed set up arguments. Still, they all call petsc_confmetric_solver
   as the core solver. */


/* Wrapper function for the class of ellitpic equations that needs a metric */
void petsc_metric(cGH *GH, int *MetricI, int *FieldIndex, 
		  int *MIndex, int *NIndex, 
		  int *AbsTol, int *RelTol) {

  /* Arrays for the M/N size info */
  
  void petsc_confmetric_solver(cGH *GH, int *MetricI, int MetricISize, 
			       int *FieldIndex, int *MIndex, int *NIndex, 
			       int *AbsTol, int *RelTol);
  
  
  if (GH->cctk_dim>3) 
   CCTK_WARN(0,"This elliptic solver implementation does not do dimension>3!");

  petsc_confmetric_solver(GH, MetricI, 6, FieldIndex, 
			  MIndex, NIndex, 
			  AbsTol, RelTol);
}
  
/* wrapper function for the class of ellitpic equations, that needs a conf.
   factor */
void petsc_confmetric(cGH *GH, int *MetricPsiI, int *FieldIndex, 
		      int *MIndex, int *NIndex, 
		      int *AbsTol, int *RelTol) {
  
  void petsc_confmetric_solver(cGH *GH, int *MetricI, int MetricSize, 
			       int *FieldIndex, int *MIndex, int *NIndex, 
			       int *AbsTol, int *RelTol);

 /* petsc_confmetric_solver expects an metric array, in the case of this 
    equation class,  needs conf.factor as last entry -> size 7 */
  petsc_confmetric_solver(GH, MetricPsiI, 7,
			  FieldIndex, MIndex, NIndex, 
			  AbsTol, RelTol);
}