aboutsummaryrefslogtreecommitdiff
path: root/src/Symmetry.c
diff options
context:
space:
mode:
authorallen <allen@c78560ca-4b45-4335-b268-5f3340f3cb52>1999-07-26 12:06:42 +0000
committerallen <allen@c78560ca-4b45-4335-b268-5f3340f3cb52>1999-07-26 12:06:42 +0000
commit4f3c1c295f3509bc6364bc478f012a65e2515126 (patch)
tree6b9926c6131462e71d5221ac7b9f056ddd6bbd08 /src/Symmetry.c
parentf00078afdd65ccbbdb338982839288e2fc7f5c4b (diff)
Two changes to CartGrid3D:
1) Changed fortran files to Fortran 77 . Unfortunately doesn't compile with g77 which complains about the way that 3D arrays are passed, although it is standard f77. Sometime the F77 routines will be comnverted to C 2) Started to make CartGrid3D independent of dimension. Now the calls to set and apply symmetries are independent of dimension. This means that instead of SetSymmetry(...,sx,sy,sz,....) we now have the call sym(1) = sx sym(2) = sy sym(3) = sz SetCartSymmetry(...,sym,....) (note the name change too). git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/CartGrid3D/trunk@39 c78560ca-4b45-4335-b268-5f3340f3cb52
Diffstat (limited to 'src/Symmetry.c')
-rw-r--r--src/Symmetry.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/Symmetry.c b/src/Symmetry.c
index df132ee..923a984 100644
--- a/src/Symmetry.c
+++ b/src/Symmetry.c
@@ -24,7 +24,7 @@
/*#define DEBUG_BOUND*/
/*@@
- @routine SetSymmetry
+ @routine SetCartSymmetry
@date Mon Mar 15 15:10:58 1999
@author Gerd Lanfermann
@desc
@@ -42,7 +42,7 @@
@@*/
-void SetSymmetry(cGH *GH, int sx, int sy, int sz, const char *imp_gf) {
+void SetCartSymmetry(cGH *GH, int *sym, const char *imp_gf) {
DECLARE_CCTK_PARAMETERS
@@ -72,7 +72,7 @@ void SetSymmetry(cGH *GH, int sx, int sy, int sz, const char *imp_gf) {
if (CCTK_Equals(symmetry,"full")) {
#ifdef DEBUG_BOUND
- printf(" Registered full grid symmetries for -%s- in SetSymmetry\n",imp_gf);
+ printf(" Registered full grid symmetries for -%s- in SetCartSymmetry\n",imp_gf);
#endif
sGHex->GFSym[index][0] = GFSYM_NOSYM;
@@ -82,30 +82,30 @@ void SetSymmetry(cGH *GH, int sx, int sy, int sz, const char *imp_gf) {
} else if (CCTK_Equals(symmetry,"octant")) {
#ifdef DEBUG_BOUND
- printf(" Registered octant symmetries for -%s- in SetSymmetry\n",imp_gf);
+ printf(" Registered octant symmetries for -%s- in SetCartSymmetry\n",imp_gf);
#endif
- sGHex->GFSym[index][0] = sx;
- sGHex->GFSym[index][1] = sy;
- sGHex->GFSym[index][2] = sz;
+ sGHex->GFSym[index][0] = sym[0];
+ sGHex->GFSym[index][1] = sym[1];
+ sGHex->GFSym[index][2] = sym[2];
} else if (CCTK_Equals(symmetry,"quadrant")) {
#ifdef DEBUG_BOUND
- printf("Registered quadrant symmetries for -%s- in SetSymmetry\n",imp_gf);
+ printf("Registered quadrant symmetries for -%s- in SetCartSymmetry\n",imp_gf);
#endif
- sGHex->GFSym[index][0] = sx;
- sGHex->GFSym[index][1] = sy;
+ sGHex->GFSym[index][0] = sym[0];
+ sGHex->GFSym[index][1] = sym[1];
sGHex->GFSym[index][2] = GFSYM_NOSYM;
} else if (CCTK_Equals(symmetry,"bitant")) {
#ifdef DEBUG_BOUND
- printf("Registered bitant symmetries for -%s- in SetSymmetry\n",imp_gf);
+ printf("Registered bitant symmetries for -%s- in SetCartSymmetry\n",imp_gf);
#endif
- sGHex->GFSym[index][2] = sz;
+ sGHex->GFSym[index][2] = sym[2];
sGHex->GFSym[index][0] = GFSYM_NOSYM;
sGHex->GFSym[index][1] = GFSYM_NOSYM;
}
@@ -114,11 +114,11 @@ void SetSymmetry(cGH *GH, int sx, int sy, int sz, const char *imp_gf) {
}
-void FMODIFIER FORTRAN_NAME(SetSymmetry)(cGH *GH, int *sx, int *sy, int *sz, ONE_FORTSTRING_ARG) {
+void FMODIFIER FORTRAN_NAME(SetCartSymmetry)(cGH *GH, int *sym, ONE_FORTSTRING_ARG) {
ONE_FORTSTRING_CREATE(imp_gf)
- SetSymmetry(GH, *sx, *sy, *sz, imp_gf);
+ SetCartSymmetry(GH, sym, imp_gf);
free(imp_gf);
}
@@ -144,7 +144,7 @@ void FMODIFIER FORTRAN_NAME(SetSymmetry)(cGH *GH, int *sx, int *sy, int *sz, ON
@@*/
-void ApplySymmetry(cGH *GH, char *imp_group) {
+void ApplySymmetry(cGH *GH, char *name) {
void FORTRAN_NAME(SymmetryCondition)(int *, CCTK_REAL *, int *, int *, int *);
@@ -163,16 +163,16 @@ void ApplySymmetry(cGH *GH, char *imp_group) {
#ifdef DEBUG_BOUND
printf("\n In ApplySymmetry\n -----------\n");
- printf(" Applying boundary conditions to -%s-\n",imp_group);
+ printf(" Applying boundary conditions to -%s-\n",name);
#endif
/* Get the group number */
- groupnum = CCTK_GroupIndex(imp_group);
+ groupnum = CCTK_GroupIndex(name);
if (groupnum < 0)
{
char *message=NULL;
- message = (char *)malloc(300*sizeof(char)+sizeof(imp_group));
- sprintf(message,"Invalid group number decomposing %s",imp_group);
+ message = (char *)malloc(300*sizeof(char)+sizeof(name));
+ sprintf(message,"Invalid group number decomposing %s",name);
CCTK_WARN(0,message);
free(message);
}
@@ -193,8 +193,8 @@ void ApplySymmetry(cGH *GH, char *imp_group) {
(sGHex->GFSym[index][1]==GFSYM_UNSET)||
(sGHex->GFSym[index][2]==GFSYM_UNSET)) {
char *message=NULL;
- message = (char *)malloc(300*sizeof(char)+sizeof(imp_group));
- sprintf(message,"Cannot apply symmetry to -%s- without registered symmetries",imp_group);
+ message = (char *)malloc(300*sizeof(char)+sizeof(name));
+ sprintf(message,"Cannot apply symmetry to -%s- without registered symmetries",name);
CCTK_WARN(1,message);
free(message);
}
@@ -229,11 +229,11 @@ void ApplySymmetry(cGH *GH, char *imp_group) {
void FMODIFIER FORTRAN_NAME(ApplySymmetry)(cGH *GH, ONE_FORTSTRING_ARG) {
- ONE_FORTSTRING_CREATE(imp_group)
+ ONE_FORTSTRING_CREATE(name)
- ApplySymmetry(GH,imp_group);
+ ApplySymmetry(GH,name);
- free(imp_group);
+ free(name);
}