aboutsummaryrefslogtreecommitdiff
path: root/src/RegisterSymmetries.c
blob: d7a69a6b39d202ee386846a4a5fb8b054bc078c8 (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
/* $Header$ */

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

#include "Symmetry.h"

void DecodeSymParameters3D(int sym[6]);
void RegisterSymmetryBoundaries (CCTK_ARGUMENTS);

void RegisterSymmetryBoundaries (CCTK_ARGUMENTS)
{
  DECLARE_CCTK_ARGUMENTS;
  DECLARE_CCTK_PARAMETERS;

  int sym[6];
  int n;
  CCTK_INT faces[6];
  CCTK_INT width[6];
  CCTK_INT handle;

  DecodeSymParameters3D (sym);

  for (n=0; n<6; ++n)
  {
    faces[n] = sym[n];
    width[n] = cctk_nghostzones[n/2];
  }

  handle = SymmetryRegister ("reflection_symmetry");
  if (handle < 0)
  {
    CCTK_WARN (0, "Could not register symmetry boundary condition");
  }

  if (SymmetryRegisterGrid (cctkGH, handle, faces, width) < 0)
  {
    CCTK_WARN (0, "Could not register the symmetry boundaries -- probably some other thorn has already registered the same boundary faces for a different symmetry");
  }
}