diff options
author | allen <allen@c78560ca-4b45-4335-b268-5f3340f3cb52> | 1999-11-02 10:04:06 +0000 |
---|---|---|
committer | allen <allen@c78560ca-4b45-4335-b268-5f3340f3cb52> | 1999-11-02 10:04:06 +0000 |
commit | adcc184a3284cab075d3f5386763de9e05c03039 (patch) | |
tree | 4295da4ba885bec06cf654dba1f38cb03829bae6 | |
parent | 8a95f422744fd805afb1da4977b46593feb10655 (diff) |
Added options needed by Cartoon
bitant_plane = "xy" "xz" "yz" (default "xy")
no_originx = "yes" "no" (default "yes")
no_originy = "yes" "no" (default "yes")
no_originz = "yes" "no" (default "yes")
The logic is that if no_origin = "yes" *and* no_origin? = "yes"
then the coordinates will avoid the origin, so if you don't
want one particular coordinate to avoid the origin you put
e.g.
no_originx = "no"
At the moment this only works in bitant.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/CartGrid3D/trunk@77 c78560ca-4b45-4335-b268-5f3340f3cb52
-rw-r--r-- | param.ccl | 21 | ||||
-rw-r--r-- | src/Bitant.c | 122 | ||||
-rw-r--r-- | src/CartGrid3D.c | 30 | ||||
-rw-r--r-- | src/make.code.defn | 3 |
4 files changed, 162 insertions, 14 deletions
@@ -8,6 +8,21 @@ BOOLEAN no_origin "Don't place grid points on the coordinate origin/axes" : :: } "yes" +BOOLEAN no_originx "Don't place grid points on the x-coordinate origin/axes" +{ + : :: +} "yes" + +BOOLEAN no_originy "Don't place grid points on the y-coordinate origin/axes" +{ + : :: +} "yes" + +BOOLEAN no_originz "Don't place grid points on the z-coordinate origin/axes" +{ + : :: +} "yes" + restricted: @@ -77,3 +92,9 @@ KEYWORD domain "Domain type" "full" :: "Use the full domain" } "full" +KEYWORD bitant_plane "Plane defining bitant domain" +{ + "xy" :: "xy-plane" + "xz" :: "xz-plane" + "yz" :: "yz-plane" +} "xy"
\ No newline at end of file diff --git a/src/Bitant.c b/src/Bitant.c new file mode 100644 index 0000000..805faf1 --- /dev/null +++ b/src/Bitant.c @@ -0,0 +1,122 @@ + /*@@ + @file Bitant.c + @date Tue Nov 2 08:10:56 CET 1999 + @author Gabrielle + @desc + Set up origin for bitant plane + @enddesc + @@*/ + +static char *rcsid = "$Header$"; + +#include "cctk.h" +#include "cctk_arguments.h" +#include "cctk_parameters.h" + +void bitant_byrange(CCTK_CARGUMENTS, + CCTK_REAL this_dx, + CCTK_REAL this_dy, + CCTK_REAL this_dz, + CCTK_REAL *x_origin, + CCTK_REAL *y_origin, + CCTK_REAL *z_origin) +{ + + DECLARE_CCTK_CARGUMENTS + DECLARE_CCTK_PARAMETERS + + if (CCTK_EQUALS(bitant_plane,"xy")) + { + + if (no_origin && no_originx) + { + *x_origin = (0.5 - cctk_gsh[0]/2)*this_dx; + } + else + { + *x_origin = (- cctk_gsh[0]/2)*this_dx; + } + + if (no_origin && no_originy) + { + *y_origin = (0.5 - cctk_gsh[1]/2)*this_dy; + } + else + { + *y_origin = (- cctk_gsh[1]/2)*this_dy; + } + + if (no_origin && no_originz) + { + *z_origin = (- cctk_nghostzones[2]+0.5)*this_dz; + } + else + { + *z_origin = (- cctk_nghostzones[2])*this_dz; + } + + } + else if (CCTK_EQUALS(bitant_plane,"xz")) + { + + if (no_origin && no_originx) + { + *x_origin = (0.5 - cctk_gsh[0]/2)*this_dx; + } + else + { + *x_origin = (- cctk_gsh[0]/2)*this_dx; + } + + if (no_origin && no_originy) + { + *y_origin = (- cctk_nghostzones[1]+0.5)*this_dy; + } + else + { + *y_origin = (- cctk_nghostzones[1])*this_dy; + } + + if (no_origin && no_originz) + { + *z_origin = (0.5 - cctk_gsh[2]/2)*this_dz; + } + else + { + *z_origin = (- cctk_gsh[2]/2)*this_dz; + } + + } + else if (CCTK_EQUALS(bitant_plane,"yz")) + { + + if (no_origin && no_originx) + { + *x_origin = (- cctk_nghostzones[0]+0.5)*this_dx; + } + else + { + *x_origin = (- cctk_nghostzones[0])*this_dx; + } + + if (no_origin && no_originy) + { + *y_origin = (0.5 - cctk_gsh[1]/2)*this_dy; + } + else + { + *y_origin = (- cctk_gsh[1]/2)*this_dy; + } + + if (no_origin && no_originz) + { + *z_origin = (0.5 - cctk_gsh[2]/2)*this_dz; + } + else + { + *z_origin = (- cctk_gsh[2]/2)*this_dz; + } + + } + +} diff --git a/src/CartGrid3D.c b/src/CartGrid3D.c index b74332c..d6fe91f 100644 --- a/src/CartGrid3D.c +++ b/src/CartGrid3D.c @@ -18,9 +18,18 @@ static char *rcsid = "$Header$"; #include "cctk.h" #include "cctk_arguments.h" #include "cctk_parameters.h" - +/* +void bitant_byrange(CCTK_DECLARE_CARGUMENTS, + CCTK_REAL this_dx, + CCTK_REAL this_dy, + CCTK_REAL this_dz, + CCTK_REAL *x_origin, + CCTK_REAL *y_origin, + CCTK_REAL *z_origin); +*/ #define max(a,b) ((a) > (b) ? (a) : (b)) #define SQR(a) ((a)*(a)) + void CartGrid3D(CCTK_CARGUMENTS) { DECLARE_CCTK_CARGUMENTS @@ -175,18 +184,13 @@ void CartGrid3D(CCTK_CARGUMENTS) if (CCTK_Equals(domain,"bitant")) { - if (no_origin) - { - x_origin = (0.5 - cctk_gsh[0]/2)*this_dx; - y_origin = (0.5 - cctk_gsh[1]/2)*this_dy; - z_origin = (- cctk_nghostzones[2]+0.5)*this_dz; - } - else - { - x_origin = (- cctk_gsh[0]/2)*this_dx; - y_origin = (- cctk_gsh[1]/2)*this_dy; - z_origin = (- cctk_nghostzones[2])*this_dz; - } + bitant_byrange(CCTK_PASS_CTOC, + this_dx, + this_dy, + this_dz, + &x_origin, + &y_origin, + &z_origin); } else if (CCTK_Equals(domain,"quadrant")) { diff --git a/src/make.code.defn b/src/make.code.defn index eeb7346..719323f 100644 --- a/src/make.code.defn +++ b/src/make.code.defn @@ -2,7 +2,8 @@ # $Header$ # Source files in this directory -SRCS = CartGrid3D.c\ +SRCS = Bitant.c\ + CartGrid3D.c\ GHExtension.c\ ParamCheck.c\ Startup.c\ |