aboutsummaryrefslogtreecommitdiff
path: root/src/Counter.c
diff options
context:
space:
mode:
authorhawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2003-04-23 14:59:00 +0000
committerhawke <hawke@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2003-04-23 14:59:00 +0000
commitfd1b7d175f18cb5f1d168c8a9e95508b41ae39e9 (patch)
tree438f83a13ed6c0dcd80b495222d57b5ee59c898c /src/Counter.c
parent1100eb9f3017973b6cfa5b6bff3306773ff3e532 (diff)
The Method of Lines thorn (version 2 - see below).
MoL provides generic integration methods for multiple thorns simultaneously. By providing a layer between the driver and evolution thorns, this should mean that some technical issues to do with mesh refinement can be ignored. It also allows you to choose different evolution methods (in time, at least). But the primary purpose is to unambiguously evolve models in different thorns at the same time. This is version 2 - the one that will work with mesh refinement. It's a straight copy of HawkeCVS/Public/CactusMoL2/MoL2 and I haven't checked that it will work "as is" with the new name (one of the reasons it goes into Alpha). At the moment the only evolution method guaranteed to work with mesh refinement is ICN, although RK2 should. The generic RK methods will do something that will be subtly wrong... Note that the "old" way of registering variables (through the functions declared in header files) is still there. As soon as function aliasing settles down, this will be removed. Also to be done: Better documentation Tidy up the code (especially the debugging statements) Optimize Add various useful time evolution methods. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@2 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
Diffstat (limited to 'src/Counter.c')
-rw-r--r--src/Counter.c110
1 files changed, 110 insertions, 0 deletions
diff --git a/src/Counter.c b/src/Counter.c
new file mode 100644
index 0000000..9483e94
--- /dev/null
+++ b/src/Counter.c
@@ -0,0 +1,110 @@
+ /*@@
+ @file Counter.c
+ @date Mon May 20 09:52:33 2002
+ @author Ian Hawke
+ @desc
+ Routines setting and altering the loop counter.
+ @enddesc
+ @version $Header$
+ @@*/
+
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+
+static const char *rcsid = "$Header$";
+
+CCTK_FILEVERSION(CactusMoL2_MoL2_Counter_c);
+
+/********************************************************************
+ ********************* Local Data Types ***********************
+ ********************************************************************/
+
+/********************************************************************
+ ********************* Local Routine Prototypes *********************
+ ********************************************************************/
+
+/********************************************************************
+ ***************** Scheduled Routine Prototypes *********************
+ ********************************************************************/
+
+int MoL_SetCounter(CCTK_ARGUMENTS);
+
+int MoL_DecrementCounter(CCTK_ARGUMENTS);
+
+/********************************************************************
+ ********************* Other Routine Prototypes *********************
+ ********************************************************************/
+
+/********************************************************************
+ ********************* Local Data *****************************
+ ********************************************************************/
+
+/********************************************************************
+ ********************* External Routines **********************
+ ********************************************************************/
+
+ /*@@
+ @routine MoL_SetCounter
+ @date Mon May 20 09:54:39 2002
+ @author Ian Hawke
+ @desc
+ Initially set the counter to the number of intermediate steps.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+int MoL_SetCounter(CCTK_ARGUMENTS)
+{
+
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ CCTK_REAL *Var;
+
+ /*
+ // Var = CCTK_VarDataPtr(cctkGH,0,"adm_bssn::ADM_BS_gxx");
+ Var = CCTK_VarDataPtr(cctkGH,0,"wavetoymol::phi");
+ printf("MoL:Counter. Level %d. Variable %g\n",cctk_levfac[0],Var[0]);
+ // Var = CCTK_VarDataPtr(cctkGH,1,"adm_bssn::ADM_BS_gxx");
+ Var = CCTK_VarDataPtr(cctkGH,1,"wavetoymol::phi");
+ printf("\n\nMoL:Counter. Level %d. Variable %g\n\n",cctk_levfac[0],Var[0]);
+ */
+ *MoL_Intermediate_Step = MoL_Intermediate_Steps;
+
+ return 0;
+}
+
+ /*@@
+ @routine MoL_DecrementCounter
+ @date Mon May 20 09:55:13 2002
+ @author Ian Hawke
+ @desc
+ During the loop decrement the counter
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
+int MoL_DecrementCounter(CCTK_ARGUMENTS)
+{
+
+ DECLARE_CCTK_ARGUMENTS;
+
+ (*MoL_Intermediate_Step) --;
+
+ return 0;
+}
+
+/********************************************************************
+ ********************* Local Routines *************************
+ ********************************************************************/