summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-04-07 21:37:20 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-04-07 21:37:20 +0000
commit28e3d4bb6fb45cee8f58ea97f8884475ef1e5e80 (patch)
tree936c54732c499b295881a50959dec712fd584016 /src/main
parent1bed791b4c1161564037745ab3a61e7c988eefb2 (diff)
File name change, and added some GH group functions.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@452 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main')
-rw-r--r--src/main/Groups.c72
-rw-r--r--src/main/GroupsOnGH.c (renamed from src/main/Groups_on_GH.c)9
-rw-r--r--src/main/make.code.defn1
3 files changed, 32 insertions, 50 deletions
diff --git a/src/main/Groups.c b/src/main/Groups.c
index 58928491..11416aed 100644
--- a/src/main/Groups.c
+++ b/src/main/Groups.c
@@ -295,9 +295,25 @@ int CCTK_GetVarNum(const char *implementation,
int retval;
int gnum,group_num;
int variable;
+ int fullname = 0;
+ char *impname;
+ char *varname;
retval = -1;
+ if (group_name == NULL && implementation == NULL)
+ {
+ fullname = 1;
+ /* variable_name must be of the form <implementation>::<variable> */
+ /* FIXME : Error checking */
+ CCTK_DecomposeName(variable_name,&impname,&varname);
+ }
+ else
+ {
+ impname = implementation;
+ varname = variable_name;
+ }
+
if (group_name == NULL)
{
for (gnum = 0; gnum < n_groups; gnum++)
@@ -305,8 +321,8 @@ int CCTK_GetVarNum(const char *implementation,
for(variable=0; variable<groups[gnum].n_variables;variable++)
{
- if(CCTK_Equals(variable_name, groups[gnum].variables[variable].name)
- && CCTK_Equals(implementation,groups[gnum].implementation))
+ if(CCTK_Equals(varname, groups[gnum].variables[variable].name)
+ && CCTK_Equals(impname,groups[gnum].implementation))
{
retval = groups[gnum].variables[variable].number;
break;
@@ -317,13 +333,13 @@ int CCTK_GetVarNum(const char *implementation,
else
{
- group_num = CCTK_GetGroupNum(implementation, group_name);
+ group_num = CCTK_GetGroupNum(impname, group_name);
if(group_num > -1)
{
for(variable=0; variable<groups[group_num].n_variables;variable++)
{
- if(CCTK_Equals(variable_name, groups[group_num].variables[variable].name))
+ if(CCTK_Equals(varname, groups[group_num].variables[variable].name))
{
retval = groups[group_num].variables[variable].number;
break;
@@ -336,6 +352,12 @@ int CCTK_GetVarNum(const char *implementation,
}
}
+ if (fullname)
+ {
+ free(impname);
+ free(varname);
+ }
+
return retval;
}
@@ -503,48 +525,6 @@ char *CCTK_GetFullName(int var)
/*@@
- @routine CCTK_ArrayGroupSize
- @date Mon Feb 8 12:05:50 1999
- @author Tom Goodale
- @desc
- Gets the size of a array in a specific direction.
- @enddesc
- @calls
- @calledby
- @history
-
- @endhistory
-
-@@*/
-int *CCTK_ArrayGroupSize(cGH *GH, const char *group, int dir)
-{
- /* Quick fudge */
- return &(GH->local_shape[dir]);
-}
-
- /*@@
- @routine CCTK_QueryGroupStorage
- @date
- @author Tom Goodale
- @desc
-
- @enddesc
- @calls
- @calledby
- @history
-
- @endhistory
-
-@@*/
-int CCTK_QueryGroupStorage(cGH *GH, const char *group)
-{
- /* Quick fudge */
- return 1;
-}
-
-
-
- /*@@
@routine CCTK_GTypeNumber
@date Mon Feb 8 14:44:45 1999
@author Tom Goodale
diff --git a/src/main/Groups_on_GH.c b/src/main/GroupsOnGH.c
index 804c18b4..72fd649e 100644
--- a/src/main/Groups_on_GH.c
+++ b/src/main/GroupsOnGH.c
@@ -1,5 +1,5 @@
/*@@
- @file Groups_on_GH.c
+ @file GroupsOnGH.c
@date Tues April 6
@author Gabrielle Allen
@desc
@@ -15,6 +15,7 @@
#include "flesh.h"
#include "Misc.h"
#include "Groups.h"
+#include "GroupsOnGH.h"
/*#define GROUPSDEBUG*/
@@ -36,7 +37,7 @@ static char *rcsid = "$Header$";
@@*/
void *CCTK_GetVarDataPtr_ByName(cGH *GH, char *fullvarname, int timelevel)
{
- return GH->data[CCTK_VarIndex(fullvarname)][timelevel];
+ return (GH->data[CCTK_VarIndex(fullvarname)][timelevel]);
}
/*@@
@@ -75,11 +76,11 @@ void *CCTK_GetVarDataPtr(cGH *GH, int varindex, char *fullvarname, int timelevel
{
if (fullvarname)
{
- return CCTK_GetVarDataPtr_ByName(cGH *GH, char *fullvarname, int timelevel);
+ return CCTK_GetVarDataPtr_ByName(GH, fullvarname, timelevel);
}
else
{
- return CCTK_GetVarDataPtr_ByIndex(cGH *GH, int varindex, int timelevel);
+ return CCTK_GetVarDataPtr_ByIndex(GH, varindex, timelevel);
}
}
diff --git a/src/main/make.code.defn b/src/main/make.code.defn
index 022fe889..8df8f877 100644
--- a/src/main/make.code.defn
+++ b/src/main/make.code.defn
@@ -19,6 +19,7 @@ SetParams.c\
ShutdownCactus.c\
flesh.cc\
Groups.c\
+GroupsOnGH.c\
Dummies.c\
rfrInterface.c\
Overload.c\