aboutsummaryrefslogtreecommitdiff
path: root/src/Static.c
blob: 59ea2231cf41270ec7f0b4a105c4097c6da79327 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <string.h>

#include "cctk.h"
#include "cctk_Arguments.h"

void ADMBase_LapseStatic (CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  int npoints;

  if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::lapse") > 1)
  {
    npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2];
    memcpy (alp, alp_p, npoints * sizeof *alp);
  }

  if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::dtlapse") > 1)
  {
    npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2];
    memcpy (dtalp, dtalp_p, npoints * sizeof *dtalp);
  }
}

void ADMBase_ShiftStatic (CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  int npoints;
  
  if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::shift") > 1)
  {
    npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2];
    memcpy (betax, betax_p, npoints * sizeof *betax);
    memcpy (betay, betay_p, npoints * sizeof *betay);
    memcpy (betaz, betaz_p, npoints * sizeof *betaz);
  }
  
  if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::dtshift") > 1)
  {
    npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2];
    memcpy (dtbetax, dtbetax_p, npoints * sizeof *dtbetax);
    memcpy (dtbetay, dtbetay_p, npoints * sizeof *dtbetay);
    memcpy (dtbetaz, dtbetaz_p, npoints * sizeof *dtbetaz);
  }
}

void ADMBase_Static (CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  int npoints;
  
  if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::metric") > 1)
  {
    npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2];
    memcpy (gxx, gxx_p, npoints * sizeof *gxx);
    memcpy (gxy, gxy_p, npoints * sizeof *gxy);
    memcpy (gxz, gxz_p, npoints * sizeof *gxz);
    memcpy (gyy, gyy_p, npoints * sizeof *gyy);
    memcpy (gyz, gyz_p, npoints * sizeof *gyz);
    memcpy (gzz, gzz_p, npoints * sizeof *gzz);
  }
  
  if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::curv") > 1)
  {
    npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2];
    memcpy (kxx, kxx_p, npoints * sizeof *kxx);
    memcpy (kxy, kxy_p, npoints * sizeof *kxy);
    memcpy (kxz, kxz_p, npoints * sizeof *kxz);
    memcpy (kyy, kyy_p, npoints * sizeof *kyy);
    memcpy (kyz, kyz_p, npoints * sizeof *kyz);
    memcpy (kzz, kzz_p, npoints * sizeof *kzz);
  }
}