aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2007-08-21 18:56:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2007-08-21 18:56:00 +0000
commite50cfcf1f992d896e2f60980a747fcf7cdad892f (patch)
treefa3849c1031f55379f51bb0bc54444711785fe4f
parent28eaf1591b3673641eaa3c7046e8b937edfb221b (diff)
Carpet: Add parameters to select the aspect ratio for domain decomposition
darcs-hash:20070821185613-dae7b-266178bfd568cef54a4f31df0bf0a04170f93d00.gz
-rw-r--r--Carpet/Carpet/param.ccl15
-rw-r--r--Carpet/Carpet/src/Recompose.cc11
2 files changed, 25 insertions, 1 deletions
diff --git a/Carpet/Carpet/param.ccl b/Carpet/Carpet/param.ccl
index f74bdb048..3f5b49163 100644
--- a/Carpet/Carpet/param.ccl
+++ b/Carpet/Carpet/param.ccl
@@ -400,6 +400,21 @@ BOOLEAN constant_load_per_processor "Keep the load per processor constant -- thi
{
} "no"
+CCTK_REAL aspect_ratio_x "Desired aspect ratio for each processor's domain" STEERABLE=always
+{
+ (0:* :: ""
+} 1.0
+
+CCTK_REAL aspect_ratio_y "Desired aspect ratio for each processor's domain" STEERABLE=always
+{
+ (0:* :: ""
+} 1.0
+
+CCTK_REAL aspect_ratio_z "Desired aspect ratio for each processor's domain" STEERABLE=always
+{
+ (0:* :: ""
+} 1.0
+
STRING grid_structure_filename "File name to output grid structure to (empty = no output)" STEERABLE=recover
diff --git a/Carpet/Carpet/src/Recompose.cc b/Carpet/Carpet/src/Recompose.cc
index b1301dded..f1d4014a4 100644
--- a/Carpet/Carpet/src/Recompose.cc
+++ b/Carpet/Carpet/src/Recompose.cc
@@ -43,8 +43,17 @@ namespace Carpet {
static rvect
cost (region_t const & reg)
{
+ DECLARE_CCTK_PARAMETERS;
+ static rvect costfactor;
+ static bool initialised = false;
+ if (not initialised) {
+ costfactor = rvect(1.0);
+ if (dim > 0) costfactor[0] = 1.0 / aspect_ratio_x;
+ if (dim > 1) costfactor[1] = 1.0 / aspect_ratio_y;
+ if (dim > 2) costfactor[2] = 1.0 / aspect_ratio_z;
+ }
if (reg.extent.empty()) return rvect(0);
- return rvect (reg.extent.shape() / reg.extent.stride());
+ return rvect (reg.extent.shape() / reg.extent.stride()) * costfactor;
}