diff options
author | knarf <knarf@8e189c6b-2ab8-4400-aa02-70a9cfce18b9> | 2010-08-16 14:12:22 +0000 |
---|---|---|
committer | knarf <knarf@8e189c6b-2ab8-4400-aa02-70a9cfce18b9> | 2010-08-16 14:12:22 +0000 |
commit | f1d8d20ad83173ef94330315aa7dcbd76fb2011b (patch) | |
tree | 8c6b24b57eefc8507615a1663885344b55236625 | |
parent | ae464afbcaa2c4e23c2274fdc2d743bb0ad130b9 (diff) |
provide function to get EOS key/handle by string/name: EOS_Omni_GetHandle
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinEOS/EOS_Omni/EOS_Omni@5 8e189c6b-2ab8-4400-aa02-70a9cfce18b9
-rw-r--r-- | interface.ccl | 2 | ||||
-rw-r--r-- | src/EOS_Omni_Names.cpp | 15 | ||||
-rw-r--r-- | src/make.code.defn | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/interface.ccl b/interface.ccl index 3eb5752..2376137 100644 --- a/interface.ccl +++ b/interface.ccl @@ -4,6 +4,8 @@ implements: EOS_Omni inherits: +CCTK_INT FUNCTION EOS_Omni_GetHandle(CCTK_STRING IN name) + void FUNCTION EOS_Omni_press(CCTK_INT IN eoskey, \ CCTK_INT IN havetemp, \ CCTK_INT IN npoints, \ diff --git a/src/EOS_Omni_Names.cpp b/src/EOS_Omni_Names.cpp new file mode 100644 index 0000000..af910bb --- /dev/null +++ b/src/EOS_Omni_Names.cpp @@ -0,0 +1,15 @@ +#include <cctk.h> +#include <cctk_Arguments.h> +#include <cctk_Parameters.h> + +CCTK_INT EOS_Omni_GetHandle(CCTK_STRING name) +{ + if (CCTK_EQUALS(name, "2D_Polytrope")) + return 1; + if (CCTK_EQUALS(name, "Ideal_Fluid")) + return 2; + if (CCTK_EQUALS(name, "Hybrid")) + return 3; + return 0; +} + diff --git a/src/make.code.defn b/src/make.code.defn index 835441d..55fab54 100644 --- a/src/make.code.defn +++ b/src/make.code.defn @@ -1,7 +1,7 @@ # Main make.code.defn file for thorn EOS_Omni # Source files in this directory -SRCS = EOS_Omni_Module.F90 EOS_Omni_Startup.F90 EOS_Omni_SingleVarCalls.F90 +SRCS = EOS_Omni_Module.F90 EOS_Omni_Startup.F90 EOS_Omni_SingleVarCalls.F90 EOS_Omni_Names.cpp # Subdirectories containing source files SUBDIRS = |