next up previous contents
Next: Ell_LinMetric Up: Solving an elliptic equation Previous: Solving an elliptic equation   Contents

Ell_LinFlat

To call this interface from Fortran:
	 call Ell_LinFlatSolver(ierr, cctkGH, phi_gfi, M_gfi, N_gfi,
	.                       AbsTol, RelTol, "solvername")
To call this interface from C:
	 ierr = Ell_LinFlatSolver(GH, phi_gfi, M_gfi, N_gfi,
	                          AbsTol, RelTol, "solvername");
Argument List:
  • ierr: return value: ``0'' for success.
  • cctkGH: the Fortran ``pointer'' to the grid function hierachy.
  • GH: the C pointer to the grid hierarchy, type: pGH *GH.
  • phi_gif: the integer index of the grid function to solve for.
  • M_gfi: the integer index of the grid function which holds $M$.
  • N_gif: the integer index of the grid function which holds $N$.
  • AbsTol: array of size $3$: holding absolute tolerance values for the $L_1$, $L_2$, $L_\infty$ norm. Check if the solver side supports these norms. The interface side does not guarantee that these norms are actually implemenented by a solver. See the section on norms: E1.7.
  • RelTol: array of size $3$: holding relative tolerance factors for the $L_1$, $L_2$, $L_\infty$. Check if the solver side supports these norms. The interface side does not guarantee that these norms are actually implemenented by a solver. See the section on Norms: E1.7.
  • "solvername": the name of a solver, which is registered for a particular equation class. How does one find out the names? Either check the documentation of the elliptic solvers or check for registration infomation outputted by a cactus at runtime.
Example use in Fortran, as used in the WaveToy arrangement: CactusWave/IDScalarWave:
c     We derive the grid function indicies from the names of the 
c     grid functions:
      call CCTK_VarIndex (Mcoeff_gfi, "idscalarwaveelliptic::Mcoeff")
      call CCTK_VarIndex (Ncoeff_gfi, "idscalarwaveelliptic::Ncoeff")
      call CCTK_VarIndex (phi_gfi,    "wavetoy::phi")

c     Load the Absolute Tolerance Arrays
      AbsTol(1)=1.0d-5
      AbsTol(2)=1.0d-5
      AbsTol(3)=1.0d-5

c     Load the Relative Tolerance Arrays, they are not
c     used here: -1
      RelTol(1)=-1
      RelTol(2)=-1
      RelTol(3)=-1

c     Call to elliptic solver, named ``sor''
      call Ell_LinFlatSolver(ierr, cctkGH, 
     .     phi_gfi, Mcoeff_gfi, Ncoeff_gfi, AbsTol, RelTol,
     .     "sor")

c     Do some error checking, a call to another solver 
c     could be coded here
      if (ierr.ne.0) then
         call CCTK_WARN(0,"Requested solver not found / solve failed");
      endif


next up previous contents
Next: Ell_LinMetric Up: Solving an elliptic equation Previous: Solving an elliptic equation   Contents