aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetInterp2
diff options
context:
space:
mode:
authorroland haas <roland.haas@physics.gatech.edu>2012-02-04 18:14:56 -0800
committerBarry Wardell <barry.wardell@gmail.com>2012-09-11 18:17:59 +0100
commit2c8534d5165ed80a7861da82fcb9bb34277f9918 (patch)
tree318cff581cfd750e23840e9b52651f332fb2fd33 /Carpet/CarpetInterp2
parent5aaf2d6a6b363ed4b167a4dc0904f5ecdc90c4b2 (diff)
CarpetInterp2: provide function to check if fasterp_setup is out of date
CarpetInterp2 tests if a fasterp_setup_t object is out of date (older than the current regridding epoch) before it uses it. This patch exports this test to user code so that they can check each time they want to interpolate if they have to re-create the setup object. It has the advantage of hiding the internal decision criterion from the user.
Diffstat (limited to 'Carpet/CarpetInterp2')
-rw-r--r--Carpet/CarpetInterp2/src/fasterp.cc4
-rw-r--r--Carpet/CarpetInterp2/src/fasterp.hh10
2 files changed, 11 insertions, 3 deletions
diff --git a/Carpet/CarpetInterp2/src/fasterp.cc b/Carpet/CarpetInterp2/src/fasterp.cc
index 54848d6dc..9b8fd956b 100644
--- a/Carpet/CarpetInterp2/src/fasterp.cc
+++ b/Carpet/CarpetInterp2/src/fasterp.cc
@@ -1071,9 +1071,7 @@ namespace CarpetInterp2 {
DECLARE_CCTK_PARAMETERS;
// Check regridding epoch
- if (regridding_epoch != (reflevel == -1 ?
- Carpet::regridding_epoch :
- Carpet::level_regridding_epochs.AT(reflevel)))
+ if (outofdate())
{
if (reflevel == -1) {
CCTK_VWarn (CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING,
diff --git a/Carpet/CarpetInterp2/src/fasterp.hh b/Carpet/CarpetInterp2/src/fasterp.hh
index f02a93c02..138084d1d 100644
--- a/Carpet/CarpetInterp2/src/fasterp.hh
+++ b/Carpet/CarpetInterp2/src/fasterp.hh
@@ -317,6 +317,16 @@ namespace CarpetInterp2 {
{
return recv_descr.npoints;
}
+
+ bool
+ outofdate ()
+ const
+ {
+ return
+ regridding_epoch != (reflevel == -1 ?
+ Carpet::regridding_epoch :
+ Carpet::level_regridding_epochs.AT(reflevel));
+ }
};