aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--param.ccl69
-rw-r--r--src/CartGrid3D.c355
-rw-r--r--src/DecodeSymParameters.c93
-rw-r--r--src/SetSymmetry.c131
-rw-r--r--src/make.code.defn2
5 files changed, 358 insertions, 292 deletions
diff --git a/param.ccl b/param.ccl
index 645108e..6cce281 100644
--- a/param.ccl
+++ b/param.ccl
@@ -3,26 +3,47 @@
private:
-BOOLEAN no_origin "Don't place grid points on the coordinate origin/axes"
+BOOLEAN no_origin "DEPRECATED: Don't place grid points on the coordinate origin/axes"
{
: ::
} "yes"
-BOOLEAN no_originx "Don't place grid points on the x-coordinate origin/axes"
+BOOLEAN no_originx "DEPRECATED: Don't place grid points on the x-coordinate origin/axes"
{
: ::
} "yes"
-BOOLEAN no_originy "Don't place grid points on the y-coordinate origin/axes"
+BOOLEAN no_originy "DEPRECATED: Don't place grid points on the y-coordinate origin/axes"
{
: ::
} "yes"
-BOOLEAN no_originz "Don't place grid points on the z-coordinate origin/axes"
+BOOLEAN no_originz "DEPRECATED: Don't place grid points on the z-coordinate origin/axes"
{
: ::
} "yes"
+BOOLEAN avoid_originx "Don't place grid points on the x-coordinate origin/axes"
+{
+ : ::
+} "yes"
+
+BOOLEAN avoid_originy "Don't place grid points on the y-coordinate origin/axes"
+{
+ : ::
+} "yes"
+
+BOOLEAN avoid_originz "Don't place grid points on the z-coordinate origin/axes"
+{
+ : ::
+} "yes"
+
+BOOLEAN avoid_origin "Don't place grid points on the coordinate origin/axes"
+{
+ : ::
+} "yes"
+
+
restricted:
@@ -43,6 +64,7 @@ REAL dxyz "Coarse grid spacing in x,y,z-directions"
0:* :: ""
} 0.0
+
REAL xmin "Coordinate minimum in x-direction"
{
: ::
@@ -60,6 +82,7 @@ REAL xyzmin "Coordinate minimum in x,y,z-directions"
: ::
} -424242
+
REAL xmax "Coordinate maximum in x-direction"
{
: ::
@@ -77,6 +100,7 @@ REAL xyzmax "Coordinate maximum in xyz-directions"
: ::
} -424242
+
KEYWORD type "Grid type"
{
"box" :: "Box grid from -0.5 to 0.5"
@@ -98,3 +122,40 @@ KEYWORD bitant_plane "Plane defining bitant domain"
"xz" :: "xz-plane"
"yz" :: "yz-plane"
} "xy"
+
+KEYWORD quadrant_direction "Direction defining quadrant domain"
+{
+ "x" :: "x-direction"
+ "y" :: "y-direction"
+ "z" :: "z-direction"
+} "z"
+
+BOOLEAN symmetry_xmin "Symmetry boundary condition on lower x boundary"
+{
+ : ::
+} "no"
+
+BOOLEAN symmetry_ymin "Symmetry boundary condition on lower y boundary"
+{
+ : ::
+} "no"
+
+BOOLEAN symmetry_zmin "Symmetry boundary condition on lower z boundary"
+{
+ : ::
+} "no"
+
+BOOLEAN symmetry_xmax "Symmetry boundary condition on upper x boundary"
+{
+ : ::
+} "no"
+
+BOOLEAN symmetry_ymax "Symmetry boundary condition on upper y boundary"
+{
+ : ::
+} "no"
+
+BOOLEAN symmetry_zmax "Symmetry boundary condition on upper z boundary"
+{
+ : ::
+} "no"
diff --git a/src/CartGrid3D.c b/src/CartGrid3D.c
index 5e0e7bb..3d2fd5c 100644
--- a/src/CartGrid3D.c
+++ b/src/CartGrid3D.c
@@ -10,6 +10,7 @@
/*#define CCTK_DEBUG*/
+#include <assert.h>
#include <stdio.h>
#include <math.h>
@@ -17,18 +18,11 @@
#include "cctk_Arguments.h"
#include "cctk_Parameters.h"
-static char *rcsid = "$Header$";
+static const char *rcsid = "$Header$";
CCTK_FILEVERSION(CactusBase_CartGrid3D_CartGrid3D_c)
-void bitant_byspacing(CCTK_ARGUMENTS,
- CCTK_REAL this_dx,
- CCTK_REAL this_dy,
- CCTK_REAL this_dz,
- CCTK_REAL *x_origin,
- CCTK_REAL *y_origin,
- CCTK_REAL *z_origin);
-
+void DecodeSymParameters3D(int sym[6]);
#define max(a,b) ((a) > (b) ? (a) : (b))
#define SQR(a) ((a)*(a))
@@ -46,29 +40,21 @@ void CartGrid3D(CCTK_ARGUMENTS)
CCTK_REAL lowerx,upperx,lowery,uppery,lowerz,upperz;
char infoline[120];
+ int domainsym[6];
int cntstag[3];
- /* default: not staggered */
- cntstag[0]=0;
- cntstag[1]=0;
- cntstag[2]=0;
-
- /* stagger around origin, if... */
- if (no_origin)
- {
- cntstag[0]=1;
- cntstag[1]=1;
- cntstag[2]=1;
- }
- else
- {
- if (no_originx) cntstag[0] = 1;
- if (no_originy) cntstag[1] = 1;
- if (no_originz) cntstag[2] = 1;
- }
-
- iconv = pow(2, cctk_convlevel);
+ int dir;
+ /* Avoid origin? Default is yes */
+ cntstag[0] = no_origin && no_originx && avoid_origin && avoid_originx;
+ cntstag[1] = no_origin && no_originy && avoid_origin && avoid_originy;
+ cntstag[2] = no_origin && no_originz && avoid_origin && avoid_originz;
+
+ iconv = rint(pow(2, cctk_convlevel));
+
+ /* Determine symmetries of domain */
+ DecodeSymParameters3D(domainsym);
+
/****************************************************************
*
* BYRANGE
@@ -77,103 +63,109 @@ void CartGrid3D(CCTK_ARGUMENTS)
* the number of gridpoints on the coarse grid
*
***************************************************************/
+ /**************************************************************
+ *
+ * BOX (-0.5 to 0.5)
+ *
+ * User gives: number of gridpoints on the coarse grid
+ *
+ **************************************************************/
- if (CCTK_Equals(type,"byrange"))
- {
-
- if (xyzmax != -424242)
- {
- xmax1 = xyzmax;
- ymax1 = xyzmax;
- zmax1 = xyzmax;
- }
- else
- {
- xmax1 = xmax;
- ymax1 = ymax;
- zmax1 = zmax;
- }
-
- if (xyzmin != -424242)
+ if (CCTK_Equals(type,"byrange") || CCTK_Equals(type,"box"))
+ {
+
+ if (CCTK_Equals(type,"box"))
{
- xmin1 = xyzmin;
- ymin1 = xyzmin;
- zmin1 = xyzmin;
+
+ /* Coordinates are all -0.5 to 0.5 */
+ xmax1 = 0.5;
+ ymax1 = 0.5;
+ zmax1 = 0.5;
+
+ xmin1 = -0.5;
+ ymin1 = -0.5;
+ zmin1 = -0.5;
+
}
else
{
- xmin1 = xmin;
- ymin1 = ymin;
- zmin1 = zmin;
- }
-
-
-
- if (CCTK_Equals(domain,"octant"))
- {
-
- /* Grid spacing on coarsest grid */
- if (cntstag[0]==1)
- *coarse_dx = xmax1/(cctk_gsh[0]-1.5);
- else
- *coarse_dx = xmax1/(cctk_gsh[0]-cctk_nghostzones[0]-1.0);
-
- if (cntstag[1]==1)
- *coarse_dy = ymax1/(cctk_gsh[1]-1.5);
- else
- *coarse_dy = ymax1/(cctk_gsh[1]-cctk_nghostzones[1]-1.0);
-
- if (cntstag[2]==1)
- *coarse_dz = zmax1/(cctk_gsh[2]-1.5);
- else
- *coarse_dz = zmax1/(cctk_gsh[2]-cctk_nghostzones[2]-1.0);
-
- /* Grid spacing on this grid */
- this_dx = *coarse_dx;
- this_dy = *coarse_dy;
- this_dz = *coarse_dz;
- /* Minimum coordinate values on this grid */
- if (cntstag[0]==1)
- x_origin = (0.5-cctk_nghostzones[0])*this_dx;
+ if (xyzmax != -424242)
+ {
+ xmax1 = xyzmax;
+ ymax1 = xyzmax;
+ zmax1 = xyzmax;
+ }
else
- x_origin = (-cctk_nghostzones[0])*this_dx;
- if (cntstag[1]==1)
- y_origin = (0.5-cctk_nghostzones[1])*this_dy;
- else
- y_origin = (-cctk_nghostzones[1])*this_dy;
- if (cntstag[2]==1)
- z_origin = (0.5-cctk_nghostzones[2])*this_dz;
+ {
+ xmax1 = xmax;
+ ymax1 = ymax;
+ zmax1 = zmax;
+ }
+
+ if (xyzmin != -424242)
+ {
+ xmin1 = xyzmin;
+ ymin1 = xyzmin;
+ zmin1 = xyzmin;
+ }
else
- z_origin = (-cctk_nghostzones[2])*this_dz;
+ {
+ xmin1 = xmin;
+ ymin1 = ymin;
+ zmin1 = zmin;
+ }
}
- else if (CCTK_Equals(domain,"quadrant"))
- {
- fprintf(stderr, "FIXME");
- }
- else if (CCTK_Equals(domain,"bitant"))
- {
- fprintf(stderr, "FIXME");
- }
- else if (CCTK_Equals(domain,"full"))
- {
- /* Set minimum values of coordinates */
+
+
+ /* Grid spacing on coarsest grid */
+ /* TODO: Put the coordinates into arrays, and loop over the
+ dimensions. That gets ride of all the triplicated code. */
+ if (domainsym[0]) {
+ if (cntstag[0]) {
+ *coarse_dx = xmax1 / (cctk_gsh[0] - cctk_nghostzones[0] - 0.5);
+ x_origin = - (cctk_nghostzones[0] - 0.5) * *coarse_dx * iconv;
+ } else {
+ *coarse_dx = xmax1 / (cctk_gsh[0] - cctk_nghostzones[0] - 1);
+ x_origin = - cctk_nghostzones[0] * *coarse_dx * iconv;
+ }
+ } else {
+ *coarse_dx = (xmax1 - xmin1) / max(cctk_gsh[0] - 1, 1);
x_origin = xmin1;
+ }
+
+ if (domainsym[2]) {
+ if (cntstag[1]) {
+ *coarse_dy = ymax1 / (cctk_gsh[1] - cctk_nghostzones[1] - 0.5);
+ y_origin = - (cctk_nghostzones[1] - 0.5) * *coarse_dy * iconv;
+ } else {
+ *coarse_dy = ymax1 / (cctk_gsh[1] - cctk_nghostzones[1] - 1);
+ y_origin = - cctk_nghostzones[1] * *coarse_dy * iconv;
+ }
+ } else {
+ *coarse_dy = (ymax1 - ymin1) / max(cctk_gsh[1] - 1, 1);
y_origin = ymin1;
+ }
+
+ if (domainsym[4]) {
+ if (cntstag[2]) {
+ *coarse_dz = zmax1 / (cctk_gsh[2] - cctk_nghostzones[2] - 0.5);
+ z_origin = - (cctk_nghostzones[2] - 0.5) * *coarse_dz * iconv;
+ } else {
+ *coarse_dz = zmax1 / (cctk_gsh[2] - cctk_nghostzones[2] - 1);
+ z_origin = - cctk_nghostzones[2] * *coarse_dz * iconv;
+ }
+ } else {
+ *coarse_dz = (zmax1 - zmin1) / max(cctk_gsh[2] - 1, 1);
z_origin = zmin1;
-
- /* dx,dy,dz on the coarsest grid of each GH */
- *coarse_dx = (xmax1-xmin1)/max(cctk_gsh[0]-1,1);
- *coarse_dy = (ymax1-ymin1)/max(cctk_gsh[1]-1,1);
- *coarse_dz = (zmax1-zmin1)/max(cctk_gsh[2]-1,1);
}
-
+
/* dx,dy,dz on the grid we are on */
- this_dx = *coarse_dx*iconv;
- this_dy = *coarse_dy*iconv;
- this_dz = *coarse_dz*iconv;
+ this_dx = *coarse_dx * iconv;
+ this_dy = *coarse_dy * iconv;
+ this_dz = *coarse_dz * iconv;
}
@@ -204,112 +196,43 @@ void CartGrid3D(CCTK_ARGUMENTS)
}
/* dx, dy, dz on the grid we are on */
- this_dx = *coarse_dx*iconv;
- this_dy = *coarse_dy*iconv;
- this_dz = *coarse_dz*iconv;
-
- if (CCTK_Equals(domain,"bitant"))
- {
- bitant_byspacing(CCTK_PASS_CTOC,
- this_dx,
- this_dy,
- this_dz,
- &x_origin,
- &y_origin,
- &z_origin);
- }
- else if (CCTK_Equals(domain,"quadrant"))
- {
-
- if (cntstag[0]==1)
- x_origin = (- cctk_nghostzones[0] + 0.5)*this_dx;
- else
- x_origin = (- cctk_nghostzones[0])*this_dx;
- if (cntstag[1]==1)
- y_origin = (- cctk_nghostzones[1] + 0.5)*this_dy;
- else
- y_origin = (- cctk_nghostzones[1])*this_dy;
- if (cntstag[2]==1)
- z_origin = (0.5 - cctk_gsh[2]/2)*this_dz;
- else
- z_origin = (- cctk_gsh[2]/2)*this_dz;
+ this_dx = *coarse_dx * iconv;
+ this_dy = *coarse_dy * iconv;
+ this_dz = *coarse_dz * iconv;
+
+
+
+ /* Set minimum values of coordinates */
+ if (domainsym[0]) {
+ if (cntstag[0]) {
+ x_origin = (- cctk_nghostzones[0] + 0.5) * this_dx;
+ } else {
+ x_origin = (- cctk_nghostzones[0] ) * this_dx;
+ }
+ } else {
+ x_origin = -0.5 * (cctk_gsh[0] - 1) * this_dx;
}
- else if (CCTK_Equals(domain,"octant"))
- {
- if (cntstag[0]==1)
- x_origin = (- cctk_nghostzones[0]+0.5)*this_dx;
- else
- x_origin = (- cctk_nghostzones[0])*this_dx;
- if (cntstag[1]==1)
- y_origin = (- cctk_nghostzones[1]+0.5)*this_dy;
- else
- y_origin = (- cctk_nghostzones[1])*this_dy;
- if (cntstag[2]==1)
- z_origin = (- cctk_nghostzones[2]+0.5)*this_dz;
- else
- z_origin = (- cctk_nghostzones[2])*this_dz;
-
+
+ if (domainsym[2]) {
+ if (cntstag[1]) {
+ y_origin = (- cctk_nghostzones[1] + 0.5) * this_dy;
+ } else {
+ y_origin = (- cctk_nghostzones[1] ) * this_dy;
+ }
+ } else {
+ y_origin = -0.5 * (cctk_gsh[1] - 1) * this_dy;
}
- else if (CCTK_Equals(domain,"full"))
- {
- if (cntstag[0]==1)
- x_origin = (0.5 - cctk_gsh[0]/2)*this_dx;
- else
- x_origin = (- cctk_gsh[0]/2)*this_dx;
- if (cntstag[1]==1)
- y_origin = (0.5 - cctk_gsh[1]/2)*this_dy;
- else
- y_origin = (- cctk_gsh[1]/2)*this_dy;
- if (cntstag[2]==1)
- z_origin = (0.5 - cctk_gsh[2]/2)*this_dz;
- else
- z_origin = (- cctk_gsh[2]/2)*this_dz;
-
-
+
+ if (domainsym[4]) {
+ if (cntstag[2]) {
+ z_origin = (- cctk_nghostzones[2] + 0.5) * this_dz;
+ } else {
+ z_origin = (- cctk_nghostzones[2] ) * this_dz;
+ }
+ } else {
+ z_origin = -0.5 * (cctk_gsh[2] - 1) * this_dz;
}
- }
-
-
- /**************************************************************
- *
- * BOX (-0.5 to 0.5)
- *
- * User gives: number of gridpoints on the coarse grid
- *
- **************************************************************/
-
- else if (CCTK_Equals(type,"box"))
- {
-
- /* Coordinates are all -0.5 to 0.5 */
- x_origin = -0.5;
- y_origin = -0.5;
- z_origin = -0.5;
-
- /* dx,dy,dz on the coarsest grid of each GH */
- *coarse_dx = 1.0/max(cctk_gsh[0]-1,1);
- *coarse_dy = 1.0/max(cctk_gsh[1]-1,1);
- *coarse_dz = 1.0/max(cctk_gsh[2]-1,1);
-
- /* dx,dy,dz on the grid we are on */
- this_dx = *coarse_dx*iconv;
- this_dy = *coarse_dy*iconv;
- this_dz = *coarse_dz*iconv;
-
- /* Special cases */
- if (cctk_gsh[0] == 1) x_origin = 0.0;
- if (cctk_gsh[1] == 1) y_origin = 0.0;
- if (cctk_gsh[2] == 1) z_origin = 0.0;
-
- }
- else
- {
- /* Put some sort of default here to stop
- * unitialised values being used later.
- */
- this_dx = 1;
- this_dy = 1;
- this_dz = 1;
+
}
/* Set spatial coordinates */
@@ -323,7 +246,9 @@ void CartGrid3D(CCTK_ARGUMENTS)
x[CCTK_GFINDEX3D(cctkGH,i,j,k)] = this_dx*(i+cctk_lbnd[0]) + x_origin;
y[CCTK_GFINDEX3D(cctkGH,i,j,k)] = this_dy*(j+cctk_lbnd[1]) + y_origin;
z[CCTK_GFINDEX3D(cctkGH,i,j,k)] = this_dz*(k+cctk_lbnd[2]) + z_origin;
- r[CCTK_GFINDEX3D(cctkGH,i,j,k)] = sqrt(SQR(x[CCTK_GFINDEX3D(cctkGH,i,j,k)])+SQR(y[CCTK_GFINDEX3D(cctkGH,i,j,k)])+SQR(z[CCTK_GFINDEX3D(cctkGH,i,j,k)]));
+ r[CCTK_GFINDEX3D(cctkGH,i,j,k)] = sqrt(SQR(x[CCTK_GFINDEX3D(cctkGH,i,j,k)])+
+ SQR(y[CCTK_GFINDEX3D(cctkGH,i,j,k)])+
+ SQR(z[CCTK_GFINDEX3D(cctkGH,i,j,k)]));
}
}
}
@@ -339,9 +264,11 @@ void CartGrid3D(CCTK_ARGUMENTS)
lowerx = x_origin;
upperx = x_origin+this_dx*(cctk_gsh[0]-1);
CCTK_CoordRegisterRange(cctkGH,lowerx,upperx,"x");
+
lowery = y_origin;
uppery = y_origin+this_dy*(cctk_gsh[1]-1);
CCTK_CoordRegisterRange(cctkGH,lowery,uppery,"y");
+
lowerz = z_origin;
upperz = z_origin+this_dz*(cctk_gsh[2]-1);
CCTK_CoordRegisterRange(cctkGH,lowerz,upperz,"z");
diff --git a/src/DecodeSymParameters.c b/src/DecodeSymParameters.c
new file mode 100644
index 0000000..c70cf52
--- /dev/null
+++ b/src/DecodeSymParameters.c
@@ -0,0 +1,93 @@
+ /*@@
+ @file DecodeSymParameters.c
+ @date Wed May 10 18:58:00 EST 2000
+ @author Erik Schnetter
+ @desc
+ Decode the symmetry parameters.
+ @enddesc
+ @@*/
+
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+
+static const char *rcsid = "$Header"; /*@@
+ @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
+
+@@*/
+
+
+CCTK_FILEVERSION(CactusBase_CartGrid3D_DecodeSymParameters_c)
+
+
+
+void DecodeSymParameters3D(int sym[6])
+{
+ DECLARE_CCTK_PARAMETERS
+
+ int i;
+
+ /* 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;
+ }
+}
diff --git a/src/SetSymmetry.c b/src/SetSymmetry.c
index f610221..050dc38 100644
--- a/src/SetSymmetry.c
+++ b/src/SetSymmetry.c
@@ -16,6 +16,12 @@
#include "cctk_FortranString.h"
#include "Symmetry.h"
+void DecodeSymParameters3D(int sym[6]);
+
+#define MAX_DIM 3
+#define MAX_FACE 6
+
+
/*@@
@routine SetCartSymmetry
@@ -30,7 +36,7 @@
@enddesc
@calls
@calledby
- @history
+ @history enhanced by E.Schnetter
@endhistory
@@ -41,7 +47,9 @@ int SetCartSymVI(cGH *GH, int *sym, int vi)
DECLARE_CCTK_PARAMETERS
- SymmetryGHex *sGHex;
+ int domainsym[MAX_FACE];
+ SymmetryGHex *sGHex;
+ int dir;
/* Pointer to the SymmetryGHextension */
sGHex = (SymmetryGHex *)GH->extensions[CCTK_GHExtensionHandle("Symmetry")];
@@ -56,41 +64,18 @@ int SetCartSymVI(cGH *GH, int *sym, int vi)
#ifdef SYM_DEBUG
printf("SetSymmetry: %s [%d,%d,%d]\n",CCTK_VarName(vi), sym[0],sym[1],sym[2]);
#endif
-
- if (CCTK_Equals(domain,"full"))
- {
- sGHex->GFSym[vi][0] = GFSYM_NOSYM;
- sGHex->GFSym[vi][2] = GFSYM_NOSYM;
- sGHex->GFSym[vi][4] = GFSYM_NOSYM;
-
- }
- else if (CCTK_Equals(domain,"octant"))
- {
- sGHex->GFSym[vi][0] = sym[0];
- sGHex->GFSym[vi][2] = sym[1];
- sGHex->GFSym[vi][4] = sym[2];
-
- }
- else if (CCTK_Equals(domain,"quadrant"))
- {
- sGHex->GFSym[vi][0] = sym[0];
- sGHex->GFSym[vi][2] = sym[1];
- sGHex->GFSym[vi][4] = GFSYM_NOSYM;
-
- }
- else if (CCTK_Equals(domain,"bitant"))
- {
- sGHex->GFSym[vi][0] = GFSYM_NOSYM;
- sGHex->GFSym[vi][2] = GFSYM_NOSYM;
- sGHex->GFSym[vi][4] = GFSYM_NOSYM;
- if (CCTK_Equals(bitant_plane,"xy")) sGHex->GFSym[vi][4]=sym[2];
- if (CCTK_Equals(bitant_plane,"xz")) sGHex->GFSym[vi][2]=sym[1];
- if (CCTK_Equals(bitant_plane,"yz")) sGHex->GFSym[vi][0]=sym[0];
- }
- else
+
+ DecodeSymParameters3D(domainsym);
+ for (dir=0; dir<MAX_FACE; ++dir)
{
- CCTK_WARN(1,"This kind of domain not supported for symmetries.");
- return(-1);
+ if (domainsym[dir])
+ {
+ sGHex->GFSym[vi][dir] = sym[dir/2];
+ }
+ else
+ {
+ sGHex->GFSym[vi][dir] = GFSYM_NOSYM;
+ }
}
#ifdef SYM_DEBUG
@@ -99,7 +84,7 @@ int SetCartSymVI(cGH *GH, int *sym, int vi)
sGHex->GFSym[vi][2],
sGHex->GFSym[vi][4]);
#endif
- return(0);
+ return 0;
}
void CCTK_FCALL CCTK_FNAME(SetCartSymVI)
@@ -108,6 +93,22 @@ void CCTK_FCALL CCTK_FNAME(SetCartSymVI)
*ierr = SetCartSymVI(GH, sym, *vi);
}
+ /*@@
+ @routine SetCartSymVN
+ @date Thu May 11 13:32:55 2000
+ @author Gerd Lanfermann
+ @desc
+ Applies symmetry boundary conditions from
+ variable index
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+
int SetCartSymVN(cGH *GH, int *sym, const char *vn) {
int vi;
vi = CCTK_VarIndex(vn);
@@ -135,11 +136,12 @@ void CCTK_FCALL CCTK_FNAME(SetCartSymVN)
/*@@
- @routine
+ @routine SetCartSymGI
@date
- @author
+ @author Gerd Lanfermann
@desc
-
+ Applies symmetry boundary conditions from
+ Group index
@enddesc
@calls
@calledby
@@ -154,9 +156,11 @@ int SetCartSymGI(cGH *GH, int *sym, int gi)
DECLARE_CCTK_PARAMETERS
+ int domainsym[MAX_FACE];
SymmetryGHex *sGHex;
int first_vari,numvars,vi;
-
+ int dir;
+
sGHex = (SymmetryGHex *)GH->extensions[CCTK_GHExtensionHandle("Symmetry")];
first_vari = CCTK_FirstVarIndexI(gi);
@@ -183,38 +187,18 @@ int SetCartSymGI(cGH *GH, int *sym, int gi)
printf("SetSymmetry: %s [%d,%d,%d]\n",CCTK_VarName(vi),
sym[0],sym[1],sym[2]);
#endif
-
- if (CCTK_Equals(domain,"full"))
- {
- sGHex->GFSym[vi][0] = GFSYM_NOSYM;
- sGHex->GFSym[vi][2] = GFSYM_NOSYM;
- sGHex->GFSym[vi][4] = GFSYM_NOSYM;
- }
- else if (CCTK_Equals(domain,"octant"))
- {
- sGHex->GFSym[vi][0] = sym[0];
- sGHex->GFSym[vi][2] = sym[1];
- sGHex->GFSym[vi][4] = sym[2];
- }
- else if (CCTK_Equals(domain,"quadrant"))
- {
- sGHex->GFSym[vi][0] = sym[0];
- sGHex->GFSym[vi][2] = sym[1];
- sGHex->GFSym[vi][4] = GFSYM_NOSYM;
- }
- else if (CCTK_Equals(domain,"bitant"))
- {
- sGHex->GFSym[vi][0] = GFSYM_NOSYM;
- sGHex->GFSym[vi][2] = GFSYM_NOSYM;
- sGHex->GFSym[vi][4] = GFSYM_NOSYM;
- if (CCTK_Equals(bitant_plane,"xy")) sGHex->GFSym[vi][4]=sym[2];
- if (CCTK_Equals(bitant_plane,"xz")) sGHex->GFSym[vi][2]=sym[1];
- if (CCTK_Equals(bitant_plane,"yz")) sGHex->GFSym[vi][0]=sym[0];
- }
- else
+
+ DecodeSymParameters3D (domainsym);
+ for (dir=0; dir<MAX_FACE; dir++)
{
- CCTK_WARN(1,"This kind of domain not supported for symmetries.");
- return(-1);
+ if (domainsym[dir])
+ {
+ sGHex->GFSym[vi][dir] = sym[dir/2];
+ }
+ else
+ {
+ sGHex->GFSym[vi][dir] = GFSYM_NOSYM;
+ }
}
#ifdef SYM_DEBUG
@@ -240,7 +224,8 @@ void CCTK_FCALL CCTK_FNAME(SetCartSymGI)
@date
@author
@desc
-
+ Applies symmetry boundary conditions from
+ "Implementation::Groupname"
@enddesc
@calls
@calledby
diff --git a/src/make.code.defn b/src/make.code.defn
index 4b009c9..0c6f9b4 100644
--- a/src/make.code.defn
+++ b/src/make.code.defn
@@ -2,7 +2,7 @@
# $Header$
# Source files in this directory
-SRCS = Bitant.c\
+SRCS = DecodeSymParameters.c\
CartGrid3D.c\
GHExtension.c\
ParamCheck.c\