From 2aef6385e4e5b989e1bce0e4a6c8c0603ff12f56 Mon Sep 17 00:00:00 2001 From: schnetter Date: Thu, 1 Jun 2006 19:56:15 +0000 Subject: Add the capability to initialise spherical surfaces to a certain coordinate radius. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/SphericalSurface/trunk@20 40f6ab95-0e4f-0410-8daa-ee8d7420be1d --- param.ccl | 53 +++++++++++++++++++ schedule.ccl | 10 +++- src/make.code.defn | 2 +- src/radius.c | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/setup.c | 2 +- 5 files changed, 213 insertions(+), 3 deletions(-) create mode 100644 src/radius.c diff --git a/param.ccl b/param.ccl index 35efc0d..4967f9c 100644 --- a/param.ccl +++ b/param.ccl @@ -67,3 +67,56 @@ BOOLEAN symmetric_y[42] "Reflection symmetry in the y direction" BOOLEAN symmetric_z[42] "Reflection symmetry in the z direction" { } no + + + +PRIVATE: + +# Place a surfaces at a certain location + +CCTK_REAL origin_x[42] "Origin for surface" +{ + * :: "origin" +} 0.0 + +CCTK_REAL origin_y[42] "Origin for surface" +{ + * :: "origin" +} 0.0 + +CCTK_REAL origin_z[42] "Origin for surface" +{ + * :: "origin" +} 0.0 + + + +BOOLEAN set_spherical[42] "Place surface at a certain radius" +{ +} no + +CCTK_REAL radius[42] "Radius for surface" +{ + * :: "radius" +} 0.0 + + + +BOOLEAN set_elliptic[42] "Place surface at a certain radius" +{ +} no + +CCTK_REAL radius_x[42] "Radius for surface" +{ + * :: "radius" +} 0.0 + +CCTK_REAL radius_y[42] "Radius for surface" +{ + * :: "radius" +} 0.0 + +CCTK_REAL radius_z[42] "Radius for surface" +{ + * :: "radius" +} 0.0 diff --git a/schedule.ccl b/schedule.ccl index b7feabc..ad7de7b 100644 --- a/schedule.ccl +++ b/schedule.ccl @@ -9,7 +9,7 @@ STORAGE: sf_shape_descriptors -SCHEDULE SphericalSurfaceInfo_Setup AT basegrid +SCHEDULE SphericalSurface_Setup AT basegrid { LANG: C } "Calculate surface coordinate descriptors" @@ -19,3 +19,11 @@ SCHEDULE SphericalSurfaceInfo_Setup AT basegrid SCHEDULE GROUP SphericalSurface_HasBeenSet AT poststep { } "Set the spherical surfaces before this group, and use it afterwards" + + + +SCHEDULE SphericalSurface_Set AT poststep BEFORE SphericalSurface_HasBeenSet +{ + LANG: C + OPTIONS: global +} "Set surface radii" diff --git a/src/make.code.defn b/src/make.code.defn index af99905..d394b7c 100644 --- a/src/make.code.defn +++ b/src/make.code.defn @@ -2,7 +2,7 @@ # $Header$ # Source files in this directory -SRCS = setup.c +SRCS = radius.c setup.c # Subdirectories containing source files SUBDIRS = diff --git a/src/radius.c b/src/radius.c new file mode 100644 index 0000000..a670a48 --- /dev/null +++ b/src/radius.c @@ -0,0 +1,149 @@ +/* $Header$ */ + +#include +#include +#include + +#include "cctk.h" +#include "cctk_Arguments.h" +#include "cctk_Parameters.h" + + + +static +CCTK_REAL min (CCTK_REAL const x, CCTK_REAL const y) +{ + return x < y ? x : y; +} + +static +CCTK_REAL max (CCTK_REAL const x, CCTK_REAL const y) +{ + return x > y ? x : y; +} + + + +void SphericalSurface_Set (CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS; + DECLARE_CCTK_PARAMETERS; + + CCTK_REAL const pi = 3.1415926535897932384626433832795028841971693993751; + + int n; + int i, j; + + + + for (n=0; n