aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorreisswig <reisswig@40f6ab95-0e4f-0410-8daa-ee8d7420be1d>2007-11-02 11:27:19 +0000
committerreisswig <reisswig@40f6ab95-0e4f-0410-8daa-ee8d7420be1d>2007-11-02 11:27:19 +0000
commit2f2deabf0520a66da257ba83fb599ddfb872ef5e (patch)
tree5f338c2b3ea8443601ea1265c30935aaadc5ffc1
parent921333dfb7a1a886159e648a75aef070cbe8497c (diff)
- introduced auto-res feature
- introduced two new attributes that store with which reflevel a surface will intersect or is fully contained git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/SphericalSurface/trunk@28 40f6ab95-0e4f-0410-8daa-ee8d7420be1d
-rw-r--r--interface.ccl23
-rw-r--r--param.ccl34
-rw-r--r--schedule.ccl21
-rw-r--r--src/make.code.defn2
-rw-r--r--src/radius.c8
5 files changed, 77 insertions, 11 deletions
diff --git a/interface.ccl b/interface.ccl
index 833b7e3..c9dd373 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -2,11 +2,13 @@
# $Header$
IMPLEMENTS: SphericalSurface
+inherits: grid
-
+USES INCLUDE HEADER: carpet.hh
PUBLIC:
+
# To be defined by the setting thorn.
# Suggested meanings:
# zero: The surface data are invalid (garbage)
@@ -22,6 +24,8 @@ CCTK_INT sf_valid[nsurfaces] TYPE=scalar
+
+
CCTK_REAL sf_info[nsurfaces] TYPE=scalar
{
# The following are covariant quantities:
@@ -59,6 +63,13 @@ CCTK_REAL sf_info[nsurfaces] TYPE=scalar
+# the finest reflevel each surface is intersecting
+CCTK_INT sf_minreflevel[nsurfaces] TYPE=scalar
+
+# the finest reflevel that contains the entire surface
+CCTK_INT sf_maxreflevel[nsurfaces] TYPE=scalar
+
+
CCTK_REAL sf_radius[nsurfaces] TYPE=array DIM=2 SIZE=maxntheta,maxnphi DISTRIB=constant #TAGS='convergence_power=1'
CCTK_REAL sf_origin[nsurfaces] TYPE=scalar
@@ -83,3 +94,13 @@ CCTK_INT sf_shape_descriptors[nsurfaces] TYPE=scalar
sf_ntheta sf_nphi
sf_nghoststheta sf_nghostsphi
} "Surface shape descriptors"
+
+
+private:
+
+
+CCTK_REAL sf_coordinate_estimators[nsurfaces] TYPE=scalar
+{
+ sf_delta_theta_estimate sf_delta_phi_estimate
+} "Surface coordinate estimators"
+
diff --git a/param.ccl b/param.ccl
index b978863..a24a1a7 100644
--- a/param.ccl
+++ b/param.ccl
@@ -14,6 +14,31 @@ CCTK_INT nsurfaces "Number of surfaces" STEERABLE=recover
+BOOLEAN auto_res[42] "Automatically determine resolution according to radius and Cartesian resolution"
+{
+} no
+
+
+CCTK_REAL auto_res_ratio[42] "Multiplicative factor by which we want to scale the resolution with respect to Cartesian resolution"
+{
+ 0:* :: ""
+} 2.0
+
+
+KEYWORD auto_res_grid[42] "Choose resolution according to how grids overlap"
+{
+ "fully contained" :: "SF must be fully contained in Cartesian grid"
+ "overlap" :: "SF overlaps with grid"
+ "multipatch" :: "SF potentially overlaps with a spherical mutipatch grid"
+} "fully contained"
+
+
+
+BOOLEAN verbose "Shall I be verbose?"
+{
+} no
+
+
# Default parameter values do not trigger accumulator expressions.
# Therefore the default values here must be large enough for the default
# surface shape.
@@ -31,7 +56,6 @@ CCTK_INT maxnphi "Maximum number of grid points in the phi direction"
} 38
-
CCTK_INT ntheta[42] "Number of grid points in the theta direction" STEERABLE=always #ACCUMULATOR-BASE maxntheta
{
0:* :: "must be at least 3*nghoststheta"
@@ -47,12 +71,12 @@ CCTK_INT nphi[42] "Number of grid points in the phi direction" STEERABLE=always
CCTK_INT nghoststheta[42] "Number of ghost zones in the theta direction" STEERABLE=always #ACCUMULATOR-BASE maxnghoststheta
{
0:* :: ""
-} 1
+} 2
CCTK_INT nghostsphi[42] "Number of ghost zones in the phi direction" STEERABLE=always #ACCUMULATOR-BASE maxnghostsphi
{
0:* :: ""
-} 1
+} 2
@@ -72,6 +96,10 @@ BOOLEAN symmetric_z[42] "Reflection symmetry in the z direction" STEERABLE=alway
PRIVATE:
+
+
+
+
# Place a surfaces at a certain location
CCTK_REAL origin_x[42] "Origin for surface" STEERABLE=always
diff --git a/schedule.ccl b/schedule.ccl
index b3f5386..034bdd9 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -6,14 +6,17 @@ STORAGE: sf_valid
STORAGE: sf_info
STORAGE: sf_radius sf_origin
STORAGE: sf_coordinate_descriptors
+STORAGE: sf_coordinate_estimators
STORAGE: sf_shape_descriptors
-
+STORAGE: sf_minreflevel
+STORAGE: sf_maxreflevel
SCHEDULE SphericalSurface_Setup AT basegrid
{
LANG: C
- OPTIONS: global
+ #OPTIONS: global
+ OPTIONS: local
} "Calculate surface coordinate descriptors"
@@ -35,3 +38,17 @@ SCHEDULE SphericalSurface_Set AT poststep BEFORE SphericalSurface_HasBeenSet
LANG: C
OPTIONS: global
} "Set surface radii"
+
+
+SCHEDULE SphericalSurface_Set AT basegrid AFTER SphericalSurface_Setup
+{
+ LANG: C
+ OPTIONS: local
+} "Set surface radii to be used for initial setup in other thorns"
+
+
+SCHEDULE SphericalSurface_SetupRes AT basegrid BEFORE SphericalSurface_Setup AFTER CartGrid3D_SetCoordinates
+{
+ LANG: C
+ OPTIONS: local
+} "Set surface resolution automatically"
diff --git a/src/make.code.defn b/src/make.code.defn
index e1cb6e1..e11e8b2 100644
--- a/src/make.code.defn
+++ b/src/make.code.defn
@@ -2,7 +2,7 @@
# $Header$
# Source files in this directory
-SRCS = check.c radius.c setup.c
+SRCS = check.c radius.c setup.cc
# Subdirectories containing source files
SUBDIRS =
diff --git a/src/radius.c b/src/radius.c
index 0958b4c..9fc1b50 100644
--- a/src/radius.c
+++ b/src/radius.c
@@ -68,8 +68,8 @@ void SphericalSurface_Set (CCTK_ARGUMENTS)
sf_max_y[n] = origin_y[n] + radius[n];
sf_max_z[n] = origin_z[n] + radius[n];
- for (j=0; j<nphi[n]; ++j) {
- for (i=0; i<ntheta[n]; ++i) {
+ for (j=0; j<sf_nphi[n]; ++j) {
+ for (i=0; i<sf_ntheta[n]; ++i) {
int const ind = i + maxntheta * (j + maxnphi * n);
sf_radius[ind] = radius[n];
}
@@ -132,8 +132,8 @@ void SphericalSurface_Set (CCTK_ARGUMENTS)
sf_max_y[n] = origin_y[n] + radius_y[n];
sf_max_z[n] = origin_z[n] + radius_z[n];
- for (j=0; j<nphi[n]; ++j) {
- for (i=0; i<ntheta[n]; ++i) {
+ for (j=0; j<sf_nphi[n]; ++j) {
+ for (i=0; i<sf_ntheta[n]; ++i) {
int const ind = i + maxntheta * (j + maxnphi * n);
CCTK_REAL const theta = sf_origin_theta[n] + i * sf_delta_theta[n];
CCTK_REAL const phi = sf_origin_phi[n] + j * sf_delta_phi[n];