diff options
author | allen <allen@41e88fdd-2190-4c69-9c84-4659c8cf322e> | 2000-01-05 14:10:21 +0000 |
---|---|---|
committer | allen <allen@41e88fdd-2190-4c69-9c84-4659c8cf322e> | 2000-01-05 14:10:21 +0000 |
commit | ac675226b1f8063813c47fd66eefbe36eff4ecc4 (patch) | |
tree | 660244432a07906ed87552db2cb12973219648b8 | |
parent | ab3f132874ff06c101d9832ebded16fc06354624 (diff) |
Tidying and looking at error codes.
Also, added a new private parameter "solver" which contains the name
of the elliptic solver to use, and so now SourceData.F77 demonstrates
the jiggery-pokery needed to pass string parameter into the elliptic
interface !
git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/IDScalarWaveElliptic/trunk@20 41e88fdd-2190-4c69-9c84-4659c8cf322e
-rw-r--r-- | par/charge.par | 1 | ||||
-rw-r--r-- | param.ccl | 6 | ||||
-rw-r--r-- | src/SourceData.F77 | 27 |
3 files changed, 29 insertions, 5 deletions
diff --git a/par/charge.par b/par/charge.par index 1224cff..8b2e48c 100644 --- a/par/charge.par +++ b/par/charge.par @@ -18,6 +18,7 @@ idscalarwave::initial_data = "charge" idscalarwaveelliptic::output_tmp = "yes" idscalarwaveelliptic::radius = 5.5 idscalarwaveelliptic::charge = 1 +idscalarwaveelliptic::solver = "sor" wavetoyf90::bound = "radiation" @@ -25,3 +25,9 @@ BOOLEAN output_tmp "Output intermediate variables" { } "no" +STRING solver "Name of elliptic solver" +{ +.* +} "sor" + + diff --git a/src/SourceData.F77 b/src/SourceData.F77 index 5ab3157..496ffb7 100644 --- a/src/SourceData.F77 +++ b/src/SourceData.F77 @@ -11,6 +11,8 @@ #include "cctk_arguments.h" #include "cctk_parameters.h" +#include "CactusElliptic/EllBase/src/EllBase.h" + subroutine UniformCharge(CCTK_FARGUMENTS) c Find static field for a uniformly charge sphere @@ -30,8 +32,10 @@ c where Q is the total charge and R is the sphere radius integer iphi,iMcoeff,iNcoeff integer i,j,k,ierr + integer length - + character*30 fsolver + c Get variable indices for all grid functions call CCTK_VarIndex (iMcoeff, "idscalarwaveelliptic::Mcoeff") @@ -95,16 +99,29 @@ c write (*,*) "SourceData: SetString ",ierr c Call elliptic solver to fill out phi - write (*,*) "charge: Going into elliptic solver" +c Fill a fortran string with the name of the solver + call CCTK_FortranString(length,solver,fsolver) + + call CCTK_INFO("Going into elliptic solver") + print *,"Solver:",fsolver(1:length),"." + call Ell_LinFlatSolver( & ierr, & cctkGH, & iphi, & iMcoeff, iNcoeff, & AbsTol, RelTol, - & "sor") - write (*,*) "charge: Exit elliptic solver ierr =",ierr - + & fsolver(1:length)) + + if (ierr .eq. ELL_SUCCESS) then + call CCTK_INFO("Leaving elliptic solver: solve successful") + else if (ierr .eq. ELL_NOCONVERGENCE) then + call CCTK_INFO("Leaving elliptic solver: solver failed to converge") + else if (ierr .eq. ELL_NOSOLVER) then + call CCTK_INFO("Elliptic solver not found") + else + call CCTK_INFO("Leaving elliptic solver: solve failed") + end if c Set up last timestep ... assume time symmetry |