diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-01-15 13:47:15 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-01-15 13:47:15 +0000 |
commit | a6edf565c372b1ba0185881dfaa673d4dd470b2a (patch) | |
tree | bc2ba2aeec2081762cecdc6cfe4fa6e6efb54108 /src/main/ConfigData.c | |
parent | 98af5aae4a94d1fe40734593d036446689151d3f (diff) |
Various bits of tidying up etc.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@57 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/ConfigData.c')
-rw-r--r-- | src/main/ConfigData.c | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/main/ConfigData.c b/src/main/ConfigData.c new file mode 100644 index 00000000..f2bb948b --- /dev/null +++ b/src/main/ConfigData.c @@ -0,0 +1,71 @@ + /*@@ + @file ConfigData.c + @date Fri Jan 15 13:27:50 1999 + @author Tom Goodale + @desc + Miscellaneous routines to deal with configuration data + @enddesc + @@*/ + +#include <stdio.h> +#include <stdlib.h> + +#include "flesh.h" + +static char *rcsid = "$Id$"; + + /*@@ + @routine CCTK_AddGH + @date Fri Jan 15 13:43:11 1999 + @author Tom Goodale + @desc + Adds a GH to the config_data structure at a particular convergence level. + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ +int CCTK_AddGH(tFleshConfig *config, int convergence_level, cGH *GH) +{ + int retval; + + cGH **temp; + + int i; + + retval = 0; + + if(convergence_level > config->nGHs-1) + { + temp = (cGH **)realloc(config->GH, (convergence_level+1)*sizeof(cGH *)); + + if(temp) + { + config->GH = temp; + for(i=config->nGHs; i<convergence_level+1;i++) + { + config->GH[i] = NULL; + } + config->nGHs=convergence_level+1; + } + else + { + retval = 1; + } + } + + if(!retval && !config->GH[convergence_level]) + { + config->GH[convergence_level] = GH; + } + else + { + fprintf(stderr, "Tried to store two GHs at the same convergence level !\n"); + retval = 2; + } + + return retval; +} |