aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-06-07 16:11:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-06-07 16:11:00 +0000
commit22d5b658095b1bca8289254bef113f6ee231c3cf (patch)
tree7271755581fe175e9178f8573e288356b00a23c2 /Carpet
parentf05030a3f6a1470372ce29dba62cb2a167d1fd7a (diff)
Carpet: Use new transport operator op_copy
Use the new transport operator op_copy by default for grid functions with only one time level. This changes their behaviour; previously, they were not prolongated and restricted. darcs-hash:20050607161153-891bb-ad27977d3b6fe055647bda6189322ee6337a986e.gz
Diffstat (limited to 'Carpet')
-rw-r--r--Carpet/Carpet/src/SetupGH.cc8
-rw-r--r--Carpet/Carpet/src/Storage.cc24
2 files changed, 22 insertions, 10 deletions
diff --git a/Carpet/Carpet/src/SetupGH.cc b/Carpet/Carpet/src/SetupGH.cc
index 9ea25caa9..19538334c 100644
--- a/Carpet/Carpet/src/SetupGH.cc
+++ b/Carpet/Carpet/src/SetupGH.cc
@@ -239,14 +239,14 @@ namespace Carpet {
if (can_transfer) {
// Use the default
if (gp.numtimelevels == 1) {
- // Only one time level: do not prolongate
+ // Only one time level: copy instead of prolongating
char * const groupname = CCTK_GroupName (group);
CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING,
"Group \"%s\" has only one time level; therefore it "
- "will not be prolongated or restricted.",
+ "will be copied insted of prolongated.",
groupname);
free (groupname);
- return op_none;
+ return op_copy;
} else {
// Several time levels: use the default
return op_Lagrange;
@@ -270,6 +270,8 @@ namespace Carpet {
assert (have_prolong_string);
if (CCTK_Equals(prolong_string, "none")) {
return op_none;
+ } else if (CCTK_Equals(prolong_string, "copy")) {
+ return op_copy;
} else if (CCTK_Equals(prolong_string, "Lagrange")) {
return op_Lagrange;
} else if (CCTK_Equals(prolong_string, "TVD")) {
diff --git a/Carpet/Carpet/src/Storage.cc b/Carpet/Carpet/src/Storage.cc
index e445a9772..943b0a78e 100644
--- a/Carpet/Carpet/src/Storage.cc
+++ b/Carpet/Carpet/src/Storage.cc
@@ -174,17 +174,27 @@ namespace Carpet {
// Complain if there are not enough active time levels
if (gp.grouptype == CCTK_GF) {
if (max_refinement_levels > 1) {
- if (groupdata.at(group).transport_operator != op_none) {
+ if (groupdata.at(group).transport_operator != op_none
+ and groupdata.at(group).transport_operator != op_copy) {
if (groupdata.at(group).info.activetimelevels != 0
and (groupdata.at(group).info.activetimelevels
< prolongation_order_time+1))
{
- char * const groupname = CCTK_GroupName (group);
- CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
- "There are not enough time levels for the desired temporal prolongation order in the grid function group \"%s\". With Carpet::prolongation_order_time=%d, you need at least %d time levels.",
- groupname,
- prolongation_order_time, prolongation_order_time+1);
- free (groupname);
+ static vector<bool> didwarn;
+ int const numgroups = CCTK_NumGroups();
+ if (didwarn.size() < numgroups) {
+ didwarn.resize (numgroups, false);
+ }
+ if (! didwarn.at(group)) {
+ // Warn only once per group
+ didwarn.at(group) = true;
+ char * const groupname = CCTK_GroupName (group);
+ CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "There are not enough time levels for the desired temporal prolongation order in the grid function group \"%s\". With Carpet::prolongation_order_time=%d, you need at least %d time levels.",
+ groupname,
+ prolongation_order_time, prolongation_order_time+1);
+ free (groupname);
+ }
}
}
}