diff options
author | hawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2004-03-29 14:29:24 +0000 |
---|---|---|
committer | hawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b> | 2004-03-29 14:29:24 +0000 |
commit | 0638bbc4a769521ea342c506d8a8be111ad32fe7 (patch) | |
tree | c7192588b0cfc8122858793cad18b49b5fe56959 | |
parent | 928f1a034cfa51e386739381dc0877f376028f57 (diff) |
Use the aliased function to en/dis able prolongation instead of linking direct through the header file.
Add parameter to say if we want to use this function (by default we do, so nothing changes).
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@56 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
-rw-r--r-- | interface.ccl | 9 | ||||
-rw-r--r-- | param.ccl | 4 | ||||
-rw-r--r-- | src/Counter.c | 37 |
3 files changed, 43 insertions, 7 deletions
diff --git a/interface.ccl b/interface.ccl index 79e48a1..64f37bd 100644 --- a/interface.ccl +++ b/interface.ccl @@ -7,7 +7,14 @@ implements: MethodOfLines #INCLUDE HEADER: MoL.h IN MoL.h USES INCLUDE: NaNChecker.h -USES INCLUDE: carpet.h +#USES INCLUDE: carpet.h + +############################################## +### Functions from Carpet that may be used ### +############################################## + +SUBROUTINE EnableProlongating(CCTK_INT IN Status) +USES FUNCTION EnableProlongating ################################################################ ### Aliased registration and type changing functions for the ### @@ -125,3 +125,7 @@ STRING Generic_Method_Descriptor "A string used to create a table containing the BOOLEAN MoL_NaN_Check "Should the RHS GFs be checked for NaNs?" { } "no" + +BOOLEAN disable_prolongation "If Mesh refinement is enabled should we use buffer zones in intermediate steps?" +{ +} "yes" diff --git a/src/Counter.c b/src/Counter.c index 83ae330..3b4b483 100644 --- a/src/Counter.c +++ b/src/Counter.c @@ -72,13 +72,25 @@ int MoL_SetCounter(CCTK_ARGUMENTS) *MoL_Intermediate_Step = MoL_Intermediate_Steps; -#ifdef HAVE_CARPET +/* #ifdef HAVE_CARPET */ if ((*MoL_Intermediate_Step)) { /* Disable prolongating during the iterations */ - CarpetEnableProlongating (0); +/* CarpetEnableProlongating (0); */ + if (disable_prolongation) + { + if (CCTK_IsFunctionAliased("EnableProlongating")) + { + EnableProlongating(0); + } + else + { + CCTK_WARN(2, "Cannot disable prolongation as function" + " \"EnableProlongating\" is not provided by any thorn!"); + } + } } -#endif +/* #endif */ @@ -104,16 +116,29 @@ int MoL_DecrementCounter(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; + DECLARE_CCTK_PARAMETERS; (*MoL_Intermediate_Step) --; -#ifdef HAVE_CARPET +/* #ifdef HAVE_CARPET */ if (! (*MoL_Intermediate_Step)) { /* Re-enable prolongating before the final PostStep */ - CarpetEnableProlongating (1); +/* CarpetEnableProlongating (1); */ + if (disable_prolongation) + { + if (CCTK_IsFunctionAliased("EnableProlongating")) + { + EnableProlongating(1); + } + else + { + CCTK_WARN(2, "Cannot enable prolongation as function" + " \"EnableProlongating\" is not provided by any thorn!"); + } + } } -#endif +/* #endif */ return 0; } |