/*@@ @file Startup.c @date Mon Mar 15 15:48:42 1999 @author Gerd Lanfermann @desc Startup file to register the GHextension and coordinates @enddesc @version $Id$ @@*/ #include #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" #include "util_Table.h" #include "CoordBase.h" /* the rcs ID and its dummy function to use it */ static const char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusBase_CartGrid3D_Startup_c); /******************************************************************** ******************** External Prototypes ********************** ********************************************************************/ void RegisterCartGrid2DCoords (CCTK_ARGUMENTS); /******************************************************************** ******************** Internal Prototypes ********************** ********************************************************************/ static void *SetupGH (tFleshConfig *config, int convlevel, cGH *GH); /******************************************************************** ******************** External Routines ************************ ********************************************************************/ /*@@ @routine RegisterCartGrid3DCoords @date @author Gabrielle Allen @desc Routine registers the coordinates provided by CartGrid3D, using both the new and old APIs. The old CCTK_ API is deprecated. @enddesc @calls CCTK_CoordRegisterSystem CCTK_CoordRegisterData @returntype int @returndesc 0 for success, or negative in case of errors @endreturndesc @@*/ void RegisterCartGrid2DCoords (CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; int ierr, coord_system_handle; /* Register coordinate systems */ ierr = Coord_SystemRegister(cctkGH, 2, "cart2d"); if (ierr < 0) { CCTK_WARN(0, "Error registering cartnd coordinate systems"); } else { /* Register coordinates for cart2d */ coord_system_handle = Coord_SystemHandle(cctkGH, "cart2d"); if (coord_system_handle<0) { CCTK_VWarn(0,__LINE__,__FILE__,CCTK_THORNSTRING, "Error obtaining system handle for cart2d"); } ierr = Coord_CoordRegister(cctkGH, coord_system_handle, 1, "x"); ierr += Coord_CoordRegister(cctkGH, coord_system_handle, 2, "y"); if (ierr < 0) { CCTK_WARN(0, "Error registering cart2d coordinates"); } /* Fill out rest of coordinate system table for cart2d */ ierr = Util_TableSetString(coord_system_handle, "uniform", "TYPE"); if (ierr < 0) { CCTK_WARN(1, "Error registering cart2d type"); } /* Register cartnd as the default coordinate systems */ // if (register_default_coordinate_systems) { ierr = Coord_SetDefaultSystem(cctkGH, "cart2d"); if (ierr < 0) { CCTK_WARN(1, "Error registering cartnd as default coordinate systems"); } } } /* Register coordinates under the old API */ CCTK_CoordRegisterSystem(2,"cart2d"); if (CCTK_CoordRegisterData (1, "grid::x", "x", "cart2d") < 0) { CCTK_WARN (1, "Problem with registering coordinate x"); } if (CCTK_CoordRegisterData (2, "grid::y", "y", "cart2d") < 0) { CCTK_WARN (1, "Problem with registering coordinate y"); } }