aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetInterp
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-08-10 17:00:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-08-10 17:00:00 +0000
commit078139bd951ee1f6a09777933edc1ae2b4e169f2 (patch)
tree7a72b128fbca96f9d241518148619b55fc1f9b77 /Carpet/CarpetInterp
parent2dad70903d529788a9192c6316f9849a9fd521ba (diff)
CarpetInterp: Use explicit source map specifications even in single map mode
darcs-hash:20050810170009-891bb-168facf88ab10cc5c1732d037527a66bc134453c.gz
Diffstat (limited to 'Carpet/CarpetInterp')
-rw-r--r--Carpet/CarpetInterp/src/interp.cc52
1 files changed, 27 insertions, 25 deletions
diff --git a/Carpet/CarpetInterp/src/interp.cc b/Carpet/CarpetInterp/src/interp.cc
index e336f655f..bddcec4d4 100644
--- a/Carpet/CarpetInterp/src/interp.cc
+++ b/Carpet/CarpetInterp/src/interp.cc
@@ -326,34 +326,36 @@ namespace CarpetInterp {
// Find source maps
vector<CCTK_INT> source_map (N_interp_points);
- if (Carpet::map != -1) {
- // Interpolate from the current map
- for (int n=0; n<N_interp_points; ++n) {
- source_map.at(n) = Carpet::map;
- }
- } else if (maps == 1) {
- // Interpolate from map 0 if this is the only one
- // (for backwards compatibility)
- for (int n=0; n<N_interp_points; ++n) {
- source_map.at(n) = 0;
- }
- } else {
- int const iret = Util_TableGetIntArray
- (param_table_handle, N_interp_points,
- &source_map.front(), "source_map");
- if (iret == UTIL_ERROR_TABLE_NO_SUCH_KEY) {
+ int const iret = Util_TableGetIntArray
+ (param_table_handle, N_interp_points, &source_map.front(), "source_map");
+ if (iret == UTIL_ERROR_TABLE_NO_SUCH_KEY) {
+ // No explicit source map specified
+ if (Carpet::map != -1) {
+ // Interpolate from the current map
+ for (int n=0; n<N_interp_points; ++n) {
+ source_map.at(n) = Carpet::map;
+ }
+ } else if (maps == 1) {
+ // Interpolate from map 0 if this is the only one
+ // (for backwards compatibility)
+ for (int n=0; n<N_interp_points; ++n) {
+ source_map.at(n) = 0;
+ }
+ } else {
CCTK_WARN (1, "No source map specified");
return -1;
- } else if (iret < 0) {
- CCTK_WARN (1, "internal error");
- return -1;
- } else if (iret != N_interp_points) {
- CCTK_WARN (1, "Source map array has wrong size");
- return -1;
- }
- for (int n=0; n<N_interp_points; ++n) {
- assert (source_map.at(n) >=0 and source_map.at(n) < maps);
}
+ } else if (iret < 0) {
+ CCTK_WARN (1, "internal error");
+ return -1;
+ } else if (iret != N_interp_points) {
+ CCTK_WARN (1, "Source map array has wrong size");
+ return -1;
+ }
+
+ // Check source maps
+ for (int n=0; n<N_interp_points; ++n) {
+ assert (source_map.at(n) >=0 and source_map.at(n) < maps);
}
int maxncomps = 0;