aboutsummaryrefslogtreecommitdiff
path: root/src/DecodeSymParameters.c
blob: df8d5811188923468c10b4b31fc0ae96094e3ab2 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
 /*@@
   @file      DecodeSymParameters.c
   @date      Wed May 10 18:58:00 EST 2000
   @author    Erik Schnetter
   @desc
   Decode the symmetry parameters.
   @enddesc
   @version $Header$
 @@*/

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

static const char *rcsid = "$Header$"; 

CCTK_FILEVERSION(CactusBase_CartGrid3D_DecodeSymParameters_c)

void DecodeSymParameters3D(int sym[6]);

/*@@
   @routine    DecodeSymParameters3D
   @date       Thu May 11 11:49:08 2000
   @author     Erik Schnetter
   @desc 
      Decode the Symmetry parameters. 
      returns the symmetry flags (yes/no=1/0) 
      in the array sym
   @enddesc 
   @calls     
   @calledby   
   @history 
 
   @endhistory 

@@*/

void DecodeSymParameters3D(int sym[6])
{
  DECLARE_CCTK_PARAMETERS

  /* The default is as set by the explicit symmetry parameters */
  /* lower faces */
  sym[0] = symmetry_xmin;
  sym[2] = symmetry_ymin;
  sym[4] = symmetry_zmin;

  /* upper faces */
  sym[1] = symmetry_xmax;
  sym[3] = symmetry_ymax;
  sym[5] = symmetry_zmax;

  /* The default can be overridden by bitant, quadrant, and octant mode */
  if (CCTK_Equals(domain, "bitant")) 
  {
    if (CCTK_Equals(bitant_plane, "xy")) 
    {
      sym[4] = 1;
    } 
    else if (CCTK_Equals(bitant_plane, "xz")) 
    {
      sym[2] = 1;
    } 
    else if (CCTK_Equals(bitant_plane, "yz")) 
    {
      sym[0] = 1;
    }
  } 
  else if (CCTK_Equals(domain, "quadrant")) 
  {
    if (CCTK_Equals(quadrant_direction, "x")) 
    {
      sym[2] = 1;
      sym[4] = 1;
    } 
    else if (CCTK_Equals(quadrant_direction, "y")) 
    {
      sym[0] = 1;
      sym[4] = 1;
    } 
    else if (CCTK_Equals(quadrant_direction, "z")) 
    {
      sym[0] = 1;
      sym[2] = 1;
    }
  } 
  else if (CCTK_Equals(domain, "octant")) 
  {
    sym[0] = 1;
    sym[2] = 1;
    sym[4] = 1;
  }
}