aboutsummaryrefslogtreecommitdiff
path: root/src/Simple.c
blob: e09ad6ab7f1512c35aa0ef2096b99a6bb0263882 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 /*@@
   @file      Simple.c
   @date      September 4 1999
   @author    Gabrielle Allen
   @desc 
   Standard specification of timestep
   @enddesc 
 @@*/

#include <malloc.h>

#include "cctk.h"
#include "cctk_arguments.h"
#include "cctk_parameters.h"

void Time_Simple(CCTK_CARGUMENTS)
{
  DECLARE_CCTK_PARAMETERS
  DECLARE_CCTK_CARGUMENTS

  CCTK_REAL min_spacing;
  char *message;

  /* Calculate the minimum grid spacing */
  if (cctk_dim>=1)
  {
    min_spacing = cctk_delta_space[0];
  }

  if (cctk_dim>=2)
  {
    min_spacing = (min_spacing<cctk_delta_space[1] ?
	min_spacing : cctk_delta_space[1]);
  }
  
  if (cctk_dim>=3)
  {
    min_spacing = (min_spacing<cctk_delta_space[2] ?
	min_spacing : cctk_delta_space[2]);
  }

  if (cctk_dim>=4)
  {
    CCTK_WARN(0,"Time Step not defined for greater than 4 dimensions");
  }

  /* Calculate the timestep */
  cctkGH->cctk_delta_time = dtfac*min_spacing;

}