diff options
author | allen <allen@41e88fdd-2190-4c69-9c84-4659c8cf322e> | 1999-09-11 14:50:08 +0000 |
---|---|---|
committer | allen <allen@41e88fdd-2190-4c69-9c84-4659c8cf322e> | 1999-09-11 14:50:08 +0000 |
commit | 47b0340c7d540e4bac64f3c4d46d9fe408a6d48c (patch) | |
tree | bbc1aa85b920d632f6c58d5c23afce3fa12daf9f /src | |
parent | 121aa9416503f022b5251feef06ab1f82debf3f5 (diff) |
This commit was generated by cvs2svn to compensate for changes in r2, which
included commits to RCS files with non-trunk default branches.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/IDScalarWaveElliptic/trunk@3 41e88fdd-2190-4c69-9c84-4659c8cf322e
Diffstat (limited to 'src')
-rw-r--r-- | src/SourceData.F | 91 | ||||
-rw-r--r-- | src/make.code.defn | 9 |
2 files changed, 100 insertions, 0 deletions
diff --git a/src/SourceData.F b/src/SourceData.F new file mode 100644 index 0000000..d16c0de --- /dev/null +++ b/src/SourceData.F @@ -0,0 +1,91 @@ + +#include "cctk.h" +#include "cctk_arguments.h" +#include "cctk_parameters.h" + + subroutine UniformCharge(CCTK_FARGUMENTS) + +c Find static field for a uniformly charge sphere +c +c That is, solve Nabla^2 phi = - 4 pi rho +c where rho = Q/(4/3 * Pi * R^3) +c where Q is the total charge and R is the sphere radius + + implicit none + + DECLARE_CCTK_FARGUMENTS + DECLARE_CCTK_PARAMETERS + + CCTK_REAL tolerance,pi + CCTK_REAL AbsTol(3), RelTol(3) + + integer iphi,iMcoeff,iNcoeff + integer i,j,k + CCTK_REAL charge_factor + + pi = 4.0*atan(1.0) + + charge_factor = 4.0d0*pi*charge*3.0d0/(4.0d0*pi*radius**3) + + tolerance = 1.0d-5 + + do k=1, cctk_lsh(3) + do j=1, cctk_lsh(2) + do i=1, cctk_lsh(1) + + Mcoeff(i,j,k) = 0.0d0 + + if (r(i,j,k) <= radius) then + Ncoeff(i,j,k) = charge_factor + else + Ncoeff(i,j,k) = 0d0 + end if + + end do + end do + end do + + phi(i,j,k) = 0.0d0 + + call CCTK_VarIndex (iMcoeff, "idscalarwaveelliptic::Mcoeff") + call CCTK_VarIndex (iNcoeff, "idscalarwaveelliptic::Ncoeff") + call CCTK_VarIndex (iphi,"wavetoy::phi") + + write (*,*) iMcoeff, iNcoeff, iphi + + AbsTol(1)=1.0d-5 + AbsTol(2)=1.0d-5 + AbsTol(3)=1.0d-5 + + RelTol(1)=-1 + RelTol(2)=-1 + RelTol(3)=-1 + +c Call to elliptic solver will go here +c call Ell_LinConfMetricSolver(cctkGH, +c $ metpsi_index, afield_index, Mlin_index, Nsrc_index, AbsTol, RelTol, +c $ "petsc") + +c Cheat, and use exact solution + do k=1, cctk_lsh(3) + do j=1, cctk_lsh(2) + do i=1, cctk_lsh(1) + + if (r(i,j,k) >= radius) then + phi(i,j,k) = charge/r(i,j,k) + else + phi(i,j,k) = charge/(2.0d0*radius**3)* + & (3.0d0*radius**2-r(i,j,k)**2) + end if + +c Should put in an option for time symmetric first step + phi_old(i,j,k) = phi(i,j,k) + + end do + end do + end do + + + + return + end diff --git a/src/make.code.defn b/src/make.code.defn new file mode 100644 index 0000000..0f9d963 --- /dev/null +++ b/src/make.code.defn @@ -0,0 +1,9 @@ +# Main make.code.defn file for thorn IDScalarWaveElliptic +# $Header$ + +# Source files in this directory +SRCS = SourceData.F + +# Subdirectories containing source files +SUBDIRS = + |