aboutsummaryrefslogtreecommitdiff
path: root/src/macro/DXDG_guts.h
blob: c95ffc9575e580ee02636433b8c411ee10c34abb (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
/*@@
  @header   DXDG_guts.h
  @date     Jun 98
  @author   Gabrielle Allen
  @desc
  Macro to calculate the first derivatives of the 
  physical metric with respect to x

  The macro is defined in terms of standard variables in
  @seefile DXDG_declare.h
  @enddesc
@@*/

#ifndef DXDG_GUTS
#define DXDG_GUTS

#include "DXDCG_guts.h"

#ifdef FCODE 

      IF (conformal_state .eq. 0) THEN
        DXDG_PSI4 = 1
        DXDG_FAC  = 0
      ELSE
        DXDG_PSI4 = DXDG_PSI**4
        DXDG_FAC  = 4*DXDG_PSI4*DXDG_DXDPSI_O_PSI
      ENDIF

      DXDG_DXDGXX = DXDCG_DXDCGXX*DXDG_PSI4 + DXDG_FAC*DXDG_GXX
      DXDG_DXDGXY = DXDCG_DXDCGXY*DXDG_PSI4 + DXDG_FAC*DXDG_GXY
      DXDG_DXDGXZ = DXDCG_DXDCGXZ*DXDG_PSI4 + DXDG_FAC*DXDG_GXZ
      DXDG_DXDGYY = DXDCG_DXDCGYY*DXDG_PSI4 + DXDG_FAC*DXDG_GYY
      DXDG_DXDGYZ = DXDCG_DXDCGYZ*DXDG_PSI4 + DXDG_FAC*DXDG_GYZ
      DXDG_DXDGZZ = DXDCG_DXDCGZZ*DXDG_PSI4 + DXDG_FAC*DXDG_GZZ
   
#endif

#ifdef CCODE

      DXDG_PSI4 = ((*conformal_state == 0)?1:DXDG_PSI*DXDG_PSI*DXDG_PSI*DXDG_PSI);

      DXDG_FAC  = ((*conformal_state == 0)?0:4*DXDG_PSI4*DXDG_DXDPSI_O_PSI);

      DXDG_DXDGXX = DXDCG_DXDCGXX*DXDG_PSI4 + DXDG_FAC*DXDG_GXX;
      DXDG_DXDGXY = DXDCG_DXDCGXY*DXDG_PSI4 + DXDG_FAC*DXDG_GXY;
      DXDG_DXDGXZ = DXDCG_DXDCGXZ*DXDG_PSI4 + DXDG_FAC*DXDG_GXZ;
      DXDG_DXDGYY = DXDCG_DXDCGYY*DXDG_PSI4 + DXDG_FAC*DXDG_GYY;
      DXDG_DXDGYZ = DXDCG_DXDCGYZ*DXDG_PSI4 + DXDG_FAC*DXDG_GYZ;
      DXDG_DXDGZZ = DXDCG_DXDCGZZ*DXDG_PSI4 + DXDG_FAC*DXDG_GZZ;

#endif

#endif