aboutsummaryrefslogtreecommitdiff
path: root/src/GHExtension.c
diff options
context:
space:
mode:
authorallen <allen@c78560ca-4b45-4335-b268-5f3340f3cb52>1999-07-27 21:20:45 +0000
committerallen <allen@c78560ca-4b45-4335-b268-5f3340f3cb52>1999-07-27 21:20:45 +0000
commit3721707a26f1c1d807396c358089cf441fdec09f (patch)
tree4fd256e92bc73e62be1547f2379b820886276de2 /src/GHExtension.c
parente1f81b6d2b66628d8ea266f4b6157ece250a105d (diff)
Bug fixes and enhancements, mainly to do with moving to 6 element
arrays for deciding about the BCs git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/CartGrid3D/trunk@41 c78560ca-4b45-4335-b268-5f3340f3cb52
Diffstat (limited to 'src/GHExtension.c')
-rw-r--r--src/GHExtension.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/GHExtension.c b/src/GHExtension.c
index 865f831..0fb295a 100644
--- a/src/GHExtension.c
+++ b/src/GHExtension.c
@@ -1,3 +1,12 @@
+ /*@@
+ @file GHExtension.c
+ @date Mon Mar 15 15:48:42 1999
+ @author Gerd Lanfermann
+ @desc
+ Set up the symmetry GH extension. This should really be done
+ with StoredData
+ @enddesc
+ @@*/
#include <stdlib.h>
@@ -9,10 +18,11 @@
#include "GHExtensions.h"
-void *Symmetry_AllocGHex(tFleshConfig *config, int convlevel, cGH *GH) {
+void *Symmetry_AllocGHex(tFleshConfig *config, int convlevel, cGH *GH)
+{
int gf,grid_dim,NumVars; /* Number of dimensions, grid functions */
- SymmetryGHex *newGHex; /* Type of GHextension is EinsteinBoundGHex */
+ SymmetryGHex *newGHex; /* Type of GHextension is EinsteinBoundGHex */
NumVars = CCTK_NumVars(); /* Get number of grid functions */
grid_dim = CCTK_MaxDim(); /* Get maximal dimension of the grid */
@@ -24,12 +34,13 @@ void *Symmetry_AllocGHex(tFleshConfig *config, int convlevel, cGH *GH) {
newGHex->GFSym = (int **)malloc(NumVars*sizeof(int *));
/* allocation for the number of dimensions*/
- for (gf=0;gf<NumVars;gf++) {
- newGHex->GFSym[gf] = (int *)malloc(grid_dim*sizeof(int));
+ for (gf=0;gf<NumVars;gf++)
+ {
+ newGHex->GFSym[gf] = (int *)malloc(2*grid_dim*sizeof(int));
}
/* Now we have something, that looks like [0..NumVars-1][0..grid_dim-1]
- and we return that. For the progammer (that's me): This will be merged into
+ and we return that: This will be merged into
the GH and can be referenced in the following manner:
int handle = CCTK_GHExtensionHandle("Symmetry");
..... which returns a pointer the GHextension
@@ -42,7 +53,8 @@ void *Symmetry_AllocGHex(tFleshConfig *config, int convlevel, cGH *GH) {
}
-void Symmetry_InitGHex(cGH *GH) {
+void Symmetry_InitGHex(cGH *GH)
+{
SymmetryGHex *newGHex;
int handle;
int gf,d;
@@ -54,8 +66,10 @@ void Symmetry_InitGHex(cGH *GH) {
newGHex = (SymmetryGHex*) GH->extensions[handle];
/* ... and initialize them: */
- for (gf=0;gf<NumVars;gf++) {
- for(d=0;d<grid_dim;d++) {
+ for (gf=0;gf<NumVars;gf++)
+ {
+ for(d=0;d<2*grid_dim;d++)
+ {
newGHex->GFSym[gf][d] = GFSYM_UNSET; /* not set */
}
}