| { |
| "thorn_name": "CactusBase/CoordBase", |
| "url": "https://bitbucket.org/cactuscode/cactusbase.git", |
| "configuration": "# Configuration definitions for thorn CoordBase\n# $Header$\n\n# This will disappear once we have a requires for function aliasing\n\nPROVIDES CoordBase\n{\n SCRIPT\n LANG\n}\n", |
| "interface": "# Interface definition for thorn CoordBase\n# $Header$\n\nimplements: CoordBase\n\n# Old header file - should use aliased functions\n\ninclude header: CoordBase.h in CoordBase.h\n\n\n\n# Exported functions\n\nCCTK_INT FUNCTION Coord_SystemRegister \\\n (CCTK_POINTER_TO_CONST IN GH, \\\n CCTK_INT IN dim, \\\n CCTK_STRING IN systemname)\nPROVIDES FUNCTION Coord_SystemRegister \\\n WITH CoordBase_SystemRegister \\\n LANGUAGE C\n\nCCTK_INT FUNCTION Coord_SystemHandle \\\n (CCTK_POINTER_TO_CONST IN GH, \\\n CCTK_STRING IN systemname)\nPROVIDES FUNCTION Coord_SystemHandle \\\n WITH CoordBase_SystemHandle \\\n LANGUAGE C\n\nCCTK_INT FUNCTION Coord_CoordRegister \\\n (CCTK_POINTER_TO_CONST IN GH, \\\n CCTK_INT IN systemhandle, \\\n CCTK_INT IN direction, \\\n CCTK_STRING IN coordname)\nPROVIDES FUNCTION Coord_CoordRegister \\\n WITH CoordBase_CoordRegister \\\n LANGUAGE C\n\nCCTK_INT FUNCTION Coord_CoordHandle \\\n (CCTK_POINTER_TO_CONST IN GH, \\\n CCTK_STRING IN coordname, \\\n CCTK_STRING IN systemname)\nPROVIDES FUNCTION Coord_CoordHandle \\\n WITH CoordBase_CoordHandle \\\n LANGUAGE C\n\nCCTK_INT FUNCTION Coord_GroupSystem \\\n (CCTK_POINTER_TO_CONST IN GH, \\\n CCTK_STRING IN groupname)\nPROVIDES FUNCTION Coord_GroupSystem \\\n WITH CoordBase_GroupSystem \\\n LANGUAGE C\n\nCCTK_INT FUNCTION Coord_SetDefaultSystem \\\n (CCTK_POINTER_TO_CONST IN GH, \\\n CCTK_STRING IN systemname)\nPROVIDES FUNCTION Coord_SetDefaultSystem \\\n WITH CoordBase_SetDefaultSystem \\\n LANGUAGE C\n\nCCTK_INT FUNCTION Coord_GetDefaultSystem \\\n (CCTK_POINTER_TO_CONST IN GH, \\\n CCTK_INT IN systemdim)\nPROVIDES FUNCTION Coord_GetDefaultSystem \\\n WITH CoordBase_GetDefaultSystem \\\n LANGUAGE C\n\n\n\n# The location of the boundary points\n\nCCTK_INT FUNCTION GetBoundarySpecification \\\n (CCTK_INT IN size, \\\n CCTK_INT OUT ARRAY nboundaryzones, \\\n CCTK_INT OUT ARRAY is_internal, \\\n CCTK_INT OUT ARRAY is_staggered, \\\n CCTK_INT OUT ARRAY shiftout)\nPROVIDES FUNCTION GetBoundarySpecification \\\n WITH CoordBase_GetBoundarySpecification \\\n LANGUAGE C\n\n\n\n# The overall extent of the domain\n\nCCTK_INT FUNCTION GetDomainSpecification \\\n (CCTK_INT IN size, \\\n CCTK_REAL OUT ARRAY physical_min, \\\n CCTK_REAL OUT ARRAY physical_max, \\\n CCTK_REAL OUT ARRAY interior_min, \\\n CCTK_REAL OUT ARRAY interior_max, \\\n CCTK_REAL OUT ARRAY exterior_min, \\\n CCTK_REAL OUT ARRAY exterior_max, \\\n CCTK_REAL OUT ARRAY spacing)\nPROVIDES FUNCTION GetDomainSpecification \\\n WITH CoordBase_GetDomainSpecification \\\n LANGUAGE C\n\n\n\n# Convert between boundaries types\n\nCCTK_INT FUNCTION ConvertFromPhysicalBoundary \\\n (CCTK_INT IN size, \\\n CCTK_REAL IN ARRAY physical_min, \\\n CCTK_REAL IN ARRAY physical_max, \\\n CCTK_REAL OUT ARRAY interior_min, \\\n CCTK_REAL OUT ARRAY interior_max, \\\n CCTK_REAL OUT ARRAY exterior_min, \\\n CCTK_REAL OUT ARRAY exterior_max, \\\n CCTK_REAL IN ARRAY spacing)\nPROVIDES FUNCTION ConvertFromPhysicalBoundary \\\n WITH CoordBase_ConvertFromPhysicalBoundary \\\n LANGUAGE C\n\nCCTK_INT FUNCTION ConvertFromInteriorBoundary \\\n (CCTK_INT IN size, \\\n CCTK_REAL OUT ARRAY physical_min, \\\n CCTK_REAL OUT ARRAY physical_max, \\\n CCTK_REAL IN ARRAY interior_min, \\\n CCTK_REAL IN ARRAY interior_max, \\\n CCTK_REAL OUT ARRAY exterior_min, \\\n CCTK_REAL OUT ARRAY exterior_max, \\\n CCTK_REAL IN ARRAY spacing)\nPROVIDES FUNCTION ConvertFromInteriorBoundary \\\n WITH CoordBase_ConvertFromInteriorBoundary \\\n LANGUAGE C\n\nCCTK_INT FUNCTION ConvertFromExteriorBoundary \\\n (CCTK_INT IN size, \\\n CCTK_REAL OUT ARRAY physical_min, \\\n CCTK_REAL OUT ARRAY physical_max, \\\n CCTK_REAL OUT ARRAY interior_min, \\\n CCTK_REAL OUT ARRAY interior_max, \\\n CCTK_REAL IN ARRAY exterior_min, \\\n CCTK_REAL IN ARRAY exterior_max, \\\n CCTK_REAL IN ARRAY spacing)\nPROVIDES FUNCTION ConvertFromExteriorBoundary \\\n WITH CoordBase_ConvertFromExteriorBoundary \\\n LANGUAGE C\n\n\n\n# Convenient way to determine boundary sizes\nCCTK_INT FUNCTION GetBoundarySizesAndTypes \\\n (CCTK_POINTER_TO_CONST IN cctkGH, \\\n CCTK_INT IN size, \\\n CCTK_INT OUT ARRAY bndsize, \\\n CCTK_INT OUT ARRAY is_ghostbnd, \\\n CCTK_INT OUT ARRAY is_symbnd, \\\n CCTK_INT OUT ARRAY is_physbnd)\nPROVIDES FUNCTION GetBoundarySizesAndTypes \\\n WITH CoordBase_GetBoundarySizesAndTypes \\\n LANGUAGE C\n\n\n\nCCTK_INT FUNCTION SymmetryTableHandleForGrid \\\n (CCTK_POINTER_TO_CONST IN cctkGH)\nUSES FUNCTION SymmetryTableHandleForGrid\n\n# Current map\nCCTK_INT FUNCTION MultiPatch_GetMap \\\n (CCTK_POINTER_TO_CONST IN cctkGH)\nUSES FUNCTION MultiPatch_GetMap\n\n# Multi-patch bbox, specifying outer boundaries\nCCTK_INT FUNCTION MultiPatch_GetBbox \\\n (CCTK_POINTER_TO_CONST IN cctkGH, \\\n CCTK_INT IN size, \\\n CCTK_INT OUT ARRAY bbox)\nUSES FUNCTION MultiPatch_GetBbox\n\n# The location of the boundary points\nCCTK_INT FUNCTION MultiPatch_GetBoundarySpecification \\\n (CCTK_INT IN map, \\\n CCTK_INT IN size, \\\n CCTK_INT OUT ARRAY nboundaryzones, \\\n CCTK_INT OUT ARRAY is_internal, \\\n CCTK_INT OUT ARRAY is_staggered, \\\n CCTK_INT OUT ARRAY shiftout)\nUSES FUNCTION MultiPatch_GetBoundarySpecification\n", |
| "param": "# Parameter definitions for thorn CoordBase\n# $Header$\n\n\n\n###############################################################################\n### Domain specification ###\n###############################################################################\n\nKEYWORD domainsize \"Domain size specification\"\n{\n \"minmax\" :: \"lower and upper boundary locations\"\n \"extent\" :: \"coordinate extent\"\n \"spacing\" :: \"grid spacing and number of grid cells\"\n} \"minmax\"\n\nKEYWORD spacing \"Grid spacing specification\"\n{\n \"gridspacing\" :: \"grid spacing\"\n \"numcells\" :: \"number of grid cells\"\n} \"gridspacing\"\n\n\n\n# Domain description in the x direction.\n# The other domain descriptions are equivalent.\n\nBOOLEAN zero_origin_x \"Is the lower boundary located at x=0?\"\n{\n} \"no\"\n\nCCTK_REAL xmin \"Location of lower x boundary\"\n{\n (*:*) :: \"\"\n} 0.0\n\nCCTK_REAL xmax \"Location of upper x boundary\"\n{\n (*:*) :: \"\"\n} 1.0\n\nCCTK_REAL xextent \"Domain extent in x direction\"\n{\n (0:*) :: \"\"\n} 1.0\n\nCCTK_REAL dx \"Grid spacing in x direction\"\n{\n (0:*) :: \"\"\n} 1.0\n\nCCTK_INT ncells_x \"Number of grid cells in x direction\"\n{\n 0:* :: \"\"\n} 1\n\n# Domain description in the y direction.\n# The other domain descriptions are equivalent.\n\nBOOLEAN zero_origin_y \"Is the lower boundary located at y=0?\"\n{\n} \"no\"\n\nCCTK_REAL ymin \"Location of lower y boundary\"\n{\n (*:*) :: \"\"\n} 0.0\n\nCCTK_REAL ymax \"Location of upper y boundary\"\n{\n (*:*) :: \"\"\n} 1.0\n\nCCTK_REAL yextent \"Domain extent in y direction\"\n{\n (0:*) :: \"\"\n} 1.0\n\nCCTK_REAL dy \"Grid spacing in y direction\"\n{\n (0:*) :: \"\"\n} 1.0\n\nCCTK_INT ncells_y \"Number of grid cells in y direction\"\n{\n 0:* :: \"\"\n} 1\n\n# Domain description in the z direction.\n# The other domain descriptions are equivalent.\n\nBOOLEAN zero_origin_z \"Is the lower boundary located at z=0?\"\n{\n} \"no\"\n\nCCTK_REAL zmin \"Location of lower z boundary\"\n{\n (*:*) :: \"\"\n} 0.0\n\nCCTK_REAL zmax \"Location of upper z boundary\"\n{\n (*:*) :: \"\"\n} 1.0\n\nCCTK_REAL zextent \"Domain extent in z direction\"\n{\n (0:*) :: \"\"\n} 1.0\n\nCCTK_REAL dz \"Grid spacing in z direction\"\n{\n (0:*) :: \"\"\n} 1.0\n\nCCTK_INT ncells_z \"Number of grid cells in z direction\"\n{\n 0:* :: \"\"\n} 1\n\n\n\n###############################################################################\n### Boundary specification ###\n###############################################################################\n\n# Boundary description for the lower x face.\n# The other boundary descriptions are equivalent.\n\nCCTK_INT boundary_size_x_lower \"Boundary zones at the lower x face\"\n{\n 0:* :: \"\"\n} 1\n\nBOOLEAN boundary_internal_x_lower \"Do the boundary points extend inwards at the lower x face?\"\n{\n} \"no\"\n\nBOOLEAN boundary_staggered_x_lower \"Is the boundary is staggered about the grid points at the lower x face?\"\n{\n} \"no\"\n\nCCTK_INT boundary_shiftout_x_lower \"Offset between the boundary location and the first boundary point at the lower x face\"\n{\n *:* :: \"when not staggered: use 0 for an open, 1 for a closed manifold\"\n} 0\n\n# Boundary description for the upper x face.\n# The other boundary descriptions are equivalent.\n\nCCTK_INT boundary_size_x_upper \"Boundary zones at the upper x face\"\n{\n 0:* :: \"\"\n} 1\n\nBOOLEAN boundary_internal_x_upper \"Do the boundary points extend inwards at the upper x face?\"\n{\n} \"no\"\n\nBOOLEAN boundary_staggered_x_upper \"Is the boundary is staggered about the grid points at the upper x face?\"\n{\n} \"no\"\n\nCCTK_INT boundary_shiftout_x_upper \"Offset between the boundary location and the first boundary point at the upper x face\"\n{\n *:* :: \"when not staggered: use 0 for an open, 1 for a closed manifold\"\n} 0\n\n# Boundary description for the lower y face.\n# The other boundary descriptions are equivalent.\n\nCCTK_INT boundary_size_y_lower \"Boundary zones at the lower y face\"\n{\n 0:* :: \"\"\n} 1\n\nBOOLEAN boundary_internal_y_lower \"Do the boundary points extend inwards at the lower y face?\"\n{\n} \"no\"\n\nBOOLEAN boundary_staggered_y_lower \"Is the boundary is staggered about the grid points at the lower y face?\"\n{\n} \"no\"\n\nCCTK_INT boundary_shiftout_y_lower \"Offset between the boundary location and the first boundary point at the lower y face\"\n{\n *:* :: \"when not staggered: use 0 for an open, 1 for a closed manifold\"\n} 0\n\n# Boundary description for the upper y face.\n# The other boundary descriptions are equivalent.\n\nCCTK_INT boundary_size_y_upper \"Boundary zones at the upper y face\"\n{\n 0:* :: \"\"\n} 1\n\nBOOLEAN boundary_internal_y_upper \"Do the boundary points extend inwards at the upper y face?\"\n{\n} \"no\"\n\nBOOLEAN boundary_staggered_y_upper \"Is the boundary is staggered about the grid points at the upper y face?\"\n{\n} \"no\"\n\nCCTK_INT boundary_shiftout_y_upper \"Offset between the boundary location and the first boundary point at the upper y face\"\n{\n *:* :: \"when not staggered: use 0 for an open, 1 for a closed manifold\"\n} 0\n\n# Boundary description for the lower z face.\n# The other boundary descriptions are equivalent.\n\nCCTK_INT boundary_size_z_lower \"Boundary zones at the lower z face\"\n{\n 0:* :: \"\"\n} 1\n\nBOOLEAN boundary_internal_z_lower \"Do the boundary points extend inwards at the lower z face?\"\n{\n} \"no\"\n\nBOOLEAN boundary_staggered_z_lower \"Is the boundary is staggered about the grid points at the lower z face?\"\n{\n} \"no\"\n\nCCTK_INT boundary_shiftout_z_lower \"Offset between the boundary location and the first boundary point at the lower z face\"\n{\n *:* :: \"when not staggered: use 0 for an open, 1 for a closed manifold\"\n} 0\n\n# Boundary description for the upper z face.\n# The other boundary descriptions are equivalent.\n\nCCTK_INT boundary_size_z_upper \"Boundary zones at the upper z face\"\n{\n 0:* :: \"\"\n} 1\n\nBOOLEAN boundary_internal_z_upper \"Do the boundary points extend inwards at the upper z face?\"\n{\n} \"no\"\n\nBOOLEAN boundary_staggered_z_upper \"Is the boundary is staggered about the grid points at the upper z face?\"\n{\n} \"no\"\n\nCCTK_INT boundary_shiftout_z_upper \"Offset between the boundary location and the first boundary point at the upper z face\"\n{\n *:* :: \"when not staggered: use 0 for an open, 1 for a closed manifold\"\n} 0\n", |
| "schedule": "# Schedule definitions for thorn CoordBase\n# $Header$\n\nschedule CoordBase_Startup at CCTK_STARTUP\n{\n LANG: C\n} \"Register a GH extension to store the coordinate system handles\"\n", |
| "src": { |
| "make.code.defn": "# Main make.code.defn file for thorn CoordBase\n# $Header$\n\n# Source files in this directory\nSRCS = Domain.c CoordBase.c GHExtension.c\n\n# Subdirectories containing source files\nSUBDIRS = \n", |
| "CoordBase.c": "/*@@\n @file CoordBase.c\n @date 23 July 2003\n @author Gabrielle Allen and David Rideout\n @desc\n Functions which implement the coordinate API.\n @enddesc\n @version $Id$\n@@*/\n\n#include <string.h>\n#include <stdlib.h>\n\n#include \"cctk.h\"\n#include \"util_Table.h\"\n#include \"util_Hash.h\"\n#include \"util_String.h\"\n\n#define COORD_IN_COORDBASE 1\n#include \"CoordBase.h\"\n#undef COORD_IN_COORDBASE\n\n#include \"coordbaseGH.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusBase_CoordBase_CoordBase_c);\n\n/********************************************************************\n ********************* Aliased Routine Prototypes *****************\n ********************************************************************/\n\n/********************************************************************\n ********************* Local Data *********************************\n ********************************************************************/\n\nstatic unsigned int longest_coordname = 0;\nstatic int longest_systemname = 0;\n\n/********************************************************************\n ********************* (to be Aliased?) Routines ******************\n ********************************************************************/\n\n/*@@\n @routine CoordBase_SystemRegister\n @date 24 July 2003\n @author Gabrielle Allen and David Rideout\n @desc\n Registers a coordinate system.\n @enddesc\n @calls CCTK_GHExtension, Util_HashData, CCTK_VWarn, Util_TableCreate,\n Util_TableSetString, Util_TableSetInt, Util_HashAdd\n\n @var GH\n @vdesc cctkGH *\n @vtype CCTK_POINTER_TO_CONST\n @vio in\n @endvar\n @var dim\n @vdesc coordinate system dimension\n @vtype CCTK_INT\n @vio in\n @endvar\n @var systemname\n @vdesc coordinate system name\n @vtype CCTK_STRING\n @vio in\n @endvar\n\n @returntype int\n @returndesc\n coordinate system handle, or:\n COORDERROR_INVALIDDIM invalid dimension passed in\n COORDERROR_INVALIDNAME invalid name passed in\n COORDERROR_TABLEERROR error from key-value or hash tables in flesh\n COORDERROR_SYSTEMEXISTS coordinate system of this name already exists\n @endreturndesc\n@@*/\n\nCCTK_INT CoordBase_SystemRegister(CCTK_POINTER_TO_CONST GH, CCTK_INT dim,\n CCTK_STRING systemname) {\n int len, retval;\n int *ptr;\n const coordbaseGH *GHex;\n uHash *hash;\n\n /* Initialize variables */\n len = retval = 0;\n hash = NULL;\n\n /* Check input arguments */\n if (dim <= 0) {\n retval = COORDERROR_INVALIDDIM;\n } else if (!systemname) {\n retval = COORDERROR_INVALIDNAME;\n } else {\n /* Get coordinate system name / handle hash table from GH Extension */\n GHex = CCTK_GHExtension(GH, \"CoordBase\");\n hash = GHex->coordsystems;\n\n /* Has a coordinate system of this name already been registered? */\n len = strlen(systemname);\n if (len > longest_systemname) {\n longest_systemname = len + 1;\n }\n if (Util_HashData(hash, len, systemname, 0)) {\n CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,\n \"Coordinate system %s already registered\", systemname);\n retval = COORDERROR_SYSTEMEXISTS;\n }\n }\n\n if (retval == 0) {\n /* Now make a table for this system */\n ptr = malloc(sizeof(int));\n retval = *ptr = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);\n if (retval < 0) {\n CCTK_WARN(0, \"Could not create table\");\n retval = COORDERROR_TABLEERROR;\n }\n\n /* Add coordinate system information */\n if (Util_TableSetString(*ptr, systemname, \"NAME\") < 0 ||\n Util_TableSetInt(*ptr, dim, \"DIMENSION\") < 0) {\n CCTK_WARN(0, \"Internal error when adding key/value table entries\");\n retval = COORDERROR_TABLEERROR;\n }\n\n /* Register the system with the Coordinate GH Extension */\n if (Util_HashAdd(hash, len, systemname, 0, ptr) < 0) {\n CCTK_WARN(0, \"Internal error when storing coordinate system handle\");\n retval = COORDERROR_TABLEERROR;\n }\n }\n\n return retval;\n}\n\n/*@@\n @routine CoordBase_SystemHandle\n @date 24 July 2003\n @author Gabrielle Allen and David Rideout\n @desc\n Returns the coordinate system handle for a given name.\n @enddesc\n @calls CCTK_GHExtension, Util_HashData\n\n @var GH\n @vdesc cctkGH *\n @vtype CCTK_POINTER_TO_CONST\n @vio in\n @endvar\n @var systemname\n @vdesc coordinate system name\n @vtype CCTK_STRING\n @vio in\n @endvar\n\n @returntype int\n @returndesc\n coordinate system handle, or:\n COORDERROR_TABLEERROR error from hash table\n COORDERROR_NOSYSTEM no coordinate system of this name is registered\n @endreturndesc\n@@*/\n\nCCTK_INT CoordBase_SystemHandle(CCTK_POINTER_TO_CONST GH,\n CCTK_STRING systemname) {\n int *handle_ptr, retval;\n const coordbaseGH *GHex;\n uHash *hash;\n\n /* Get coordinate system name / handle hash table from GH Extension */\n GHex = CCTK_GHExtension(GH, \"CoordBase\");\n hash = GHex->coordsystems;\n\n /* Get coordinate handle from hash table */\n handle_ptr = Util_HashData(hash, strlen(systemname), systemname, 0);\n if (!handle_ptr) {\n retval = COORDERROR_NOSYSTEM;\n } else {\n retval = *handle_ptr >= 0 ? *handle_ptr : COORDERROR_TABLEERROR;\n }\n\n return retval;\n}\n\n/*@@\n @routine CoordBase_CoordRegister\n @date 24 July 2003\n @author Gabrielle Allen and David Rideout\n @desc\n Registers a coordinate within a coordinate system.\n @enddesc\n @calls Util_TableGetInt, CCTK_VWarn, Util_TableGetIntArray,\n Util_TableSetIntArray, Util_TableGetString, Util_StrCmpi,\n Util_TableCreate, Util_TableSetInt, Util_TableSetString\n\n @var GH\n @vdesc cctkGH *\n @vtype CCTK_POINTER_TO_CONST\n @vio in\n @endvar\n @var systemhandle\n @vdesc coordinate system handle\n @vtype CCTK_INT\n @vio in\n @endvar\n @var direction\n @vdesc index within coodinate basis\n @vtype CCTK_INT\n @vio in\n @vcomment ranges from 1 to the dimension of the coordinate system\n @endvar\n @var coordname\n @vdesc coordinate system name\n @vtype CCTK_STRING\n @vio in\n @endvar\n\n @returntype int\n @returndesc\n coordinate handle, or:\n COORDERROR_INVALIDDIM invalid 'direction'\n COORDERROR_INVALIDHANDLE invalid handle passed in / coordinate system\n does not exist\n COORDERROR_TABLEERROR error from hash or key-value tables in flesh\n COORDERROR_COORDINATEEXISTS coordinate already exists for this 'direction'\n COORDERROR_DUPLICATENAME coordinate of this name already exists in\n this system\n @endreturndesc\n@@*/\n\nCCTK_INT CoordBase_CoordRegister(CCTK_POINTER_TO_CONST GH,\n CCTK_INT systemhandle, CCTK_INT direction,\n CCTK_STRING coordname) {\n int coordinate_handle;\n CCTK_INT system_dimension;\n CCTK_INT *coordinate_tables;\n CCTK_INT i;\n char *coordname_buffer;\n\n (void)(&GH + 0);\n\n coordinate_handle = 0;\n\n /* Check input arguments */\n /* Get coordinate system dimension, and check for valid systemhandle */\n if (Util_TableGetInt(systemhandle, &system_dimension, \"DIMENSION\") < 0) {\n CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING, \"Invalid system handle \"\n \"%d\",\n (int)systemhandle);\n coordinate_handle = COORDERROR_INVALIDHANDLE;\n }\n\n /* Check for valid 'direction' */\n if (direction < 1 || direction > system_dimension) {\n CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,\n \"Invalid 'direction'. \"\n \"It must be an integer from 1 to the coordinate system \"\n \"dimension %d.\",\n (int)system_dimension);\n coordinate_handle = COORDERROR_INVALIDDIM;\n }\n\n /* Get coordinate tables from system table */\n coordinate_tables = malloc(system_dimension * sizeof(CCTK_INT));\n if (Util_TableGetIntArray(systemhandle, system_dimension, coordinate_tables,\n \"COORDINATES\") < 0) {\n /* The only possibility is that this is a bad key, so add this entry */\n for (i = 0; i < system_dimension; ++i) {\n coordinate_tables[i] = -1;\n }\n if (Util_TableSetIntArray(systemhandle, system_dimension, coordinate_tables,\n \"COORDINATES\") < 0) {\n CCTK_WARN(0, \"Error adding coordinate tables to system table\");\n coordinate_handle = COORDERROR_TABLEERROR;\n }\n }\n\n /* Has a coordinate been registered for this 'direction'? */\n if (coordinate_tables[direction - 1] >= 0) {\n CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,\n \"Coordinate already \"\n \"registered for direction %d\",\n (int)direction);\n coordinate_handle = COORDERROR_COORDINATEEXISTS;\n }\n\n /* Has this coordinate name been used already in this system? */\n coordname_buffer = malloc(longest_coordname * sizeof(char));\n for (i = 0; i < system_dimension; ++i) {\n if (coordinate_tables[i] >= 0) {\n if (Util_TableGetString(coordinate_tables[i], longest_coordname,\n coordname_buffer, \"NAME\") < 0) {\n CCTK_WARN(0, \"Error reading coordinate name from its table\");\n coordinate_handle = COORDERROR_TABLEERROR;\n } else if (Util_StrCmpi(coordname_buffer, coordname) == 0) {\n CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,\n \"Coordinate '%s' \"\n \"is already registered for this system\",\n coordname_buffer);\n coordinate_handle = COORDERROR_DUPLICATENAME;\n break;\n }\n }\n }\n\n /* Everything checks out */\n if (coordinate_handle == 0) {\n /* Is this coordinate name the longest yet? */\n if (strlen(coordname) + 1 > longest_coordname) {\n longest_coordname = strlen(coordname) + 1;\n }\n\n /* Create coordinate table */\n coordinate_handle = Util_TableCreate(UTIL_TABLE_FLAGS_CASE_INSENSITIVE);\n if (coordinate_handle < 0) {\n CCTK_WARN(0, \"Could not create coordinate table\");\n coordinate_handle = COORDERROR_TABLEERROR;\n }\n if (Util_TableSetInt(coordinate_handle, systemhandle, \"SYSTEM\") < 0 ||\n Util_TableSetString(coordinate_handle, coordname, \"NAME\") < 0 ||\n Util_TableSetInt(coordinate_handle, direction, \"DIRECTION\") < 0) {\n CCTK_WARN(0, \"Error writing to coordinate table\");\n coordinate_handle = COORDERROR_TABLEERROR;\n }\n\n /* Register coordinate table with system table */\n coordinate_tables[direction - 1] = coordinate_handle;\n if (Util_TableSetIntArray(systemhandle, system_dimension, coordinate_tables,\n \"COORDINATES\") < 0) {\n CCTK_WARN(0, \"Error writing coordinate table to system table\");\n coordinate_handle = COORDERROR_TABLEERROR;\n }\n }\n\n free(coordinate_tables);\n free(coordname_buffer);\n return coordinate_handle;\n}\n\n/*@@\n @routine CoordBase_CoordHandle\n @date 25 July 2003\n @author Gabrielle Allen and David Rideout\n @desc\n Returns the coordinate handle for a given coordinate name and\n system name\n @enddesc\n @calls CCTK_GHExtension, Util_HashData, CCTK_WARN, Util_TableGetInt,\n Util_TableGetIntArray, Util_TableGetString, Util_StrCmpi\n\n @var GH\n @vdesc cctkGH *\n @vtype CCTK_POINTER_TO_CONST\n @vio in\n @endvar\n @var coordname\n @vdesc coordinate name\n @vtype CCTK_STRING\n @vio in\n @endvar\n @var systemname\n @vdesc coordinate system name\n @vtype CCTK_STRING\n @vio in\n @endvar\n\n @returntype int\n @returndesc\n coordinate table handle, or:\n COORDERROR_NOSYSTEM no coordinate system of this name is registered\n COORDERROR_TABLEERROR error from hash table\n COORDERROR_NOSUCHCOORD no coordinate of the name is registered for this\n system\n @endreturndesc\n@@*/\n\nCCTK_INT CoordBase_CoordHandle(CCTK_POINTER_TO_CONST GH, CCTK_STRING coordname,\n CCTK_STRING systemname) {\n int coord_handle;\n int *system_handle_ptr;\n CCTK_INT system_dimension;\n CCTK_INT *coordinate_table_handles;\n int coordname_length;\n int i;\n const coordbaseGH *GHex;\n uHash *hash;\n char *coordname_buffer;\n\n /* Get coordinate system name / handle hash table from GH Extension */\n GHex = CCTK_GHExtension(GH, \"CoordBase\");\n hash = GHex->coordsystems;\n\n coord_handle = COORDERROR_NOSYSTEM;\n\n /* Get system table handle */\n system_handle_ptr = Util_HashData(hash, strlen(systemname), systemname, 0);\n if (!system_handle_ptr) {\n CCTK_WARN(1, \"No such coordinate system registered\");\n } else {\n /* Get system dimension */\n if (Util_TableGetInt(*system_handle_ptr, &system_dimension, \"DIMENSION\") <\n 0) {\n CCTK_WARN(0, \"Error reading dimension from system table\");\n coord_handle = COORDERROR_TABLEERROR;\n }\n\n /* Get coordinate table handle */\n coordinate_table_handles = malloc(system_dimension * sizeof(CCTK_INT));\n if (Util_TableGetIntArray(*system_handle_ptr, system_dimension,\n coordinate_table_handles, \"COORDINATES\") < 0) {\n CCTK_WARN(0, \"Error reading coordinate tables from system table\");\n coord_handle = COORDERROR_TABLEERROR;\n }\n\n /* Search for coordname */\n coordname_length = strlen(coordname) + 1;\n coordname_buffer = malloc(coordname_length * sizeof(char));\n for (i = 0; i < system_dimension; ++i) {\n if (coordinate_table_handles[i] >= 0) {\n if (Util_TableGetString(coordinate_table_handles[i], coordname_length,\n coordname_buffer, \"NAME\") < 0) {\n CCTK_WARN(0, \"Error reading coordinate name\");\n coord_handle = COORDERROR_TABLEERROR;\n } else if (Util_StrCmpi(coordname_buffer, coordname) == 0) {\n coord_handle = coordinate_table_handles[i];\n break;\n }\n }\n if (i == system_dimension - 1) {\n coord_handle = COORDERROR_NOSUCHCOORD;\n }\n }\n\n free(coordinate_table_handles);\n free(coordname_buffer);\n }\n return coord_handle;\n}\n\n/*@@\n @routine CoordBase_GroupSystem\n @date 28 July 2003\n @author David Rideout\n @desc\n Returns the coordinate system handle associated with a group of\n grid variables\n @enddesc\n @calls CCTK_GroupTagsTable, CCTK_VWarn, Util_TableGetString,\n CoordBase_SystemHandle, CCTK_GHExtension, CCTK_GroupIndex,\n CCTK_GroupDimI\n\n @var GH\n @vdesc cctkGH *\n @vtype CCTK_POINTER_TO_CONST\n @vio in\n @endvar\n @var groupname\n @vdesc variable group name\n @vtype CCTK_STRING\n @vio in\n @endvar\n\n @returntype int\n @returndesc\n coordinate system handle, or:\n COORDERROR_INVALIDGROUPNAME no such group exists\n COORDERROR_NOCOORDSYS no coordinate system is associated with the\n group\n @endreturndesc\n@@*/\n\nCCTK_INT CoordBase_GroupSystem(CCTK_POINTER_TO_CONST GH,\n CCTK_STRING groupname) {\n int system_handle;\n int group_tags_table;\n int gindex; /* group index */\n int gdim; /* group dimension */\n const coordbaseGH *GHex;\n char *system_name;\n\n system_handle = -9999;\n\n /* Get tags table associated with this group */\n group_tags_table = CCTK_GroupTagsTable(groupname);\n if (group_tags_table < 0) {\n CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,\n \"Invalid group name '%s'\", groupname);\n system_handle = COORDERROR_INVALIDGROUPNAME;\n } else {\n /* Get associated coordinate system */\n system_name = malloc(longest_systemname * sizeof(char));\n if (Util_TableGetString(group_tags_table, longest_systemname, system_name,\n \"COORDSYSTEM\") >= 0) {\n system_handle = CoordBase_SystemHandle(GH, system_name);\n if (system_handle < 0) {\n CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,\n \"Coordinate system \"\n \"'%s' associated with group '%s' does not exist\",\n system_name, groupname);\n system_handle = COORDERROR_INVALIDNAME;\n }\n }\n\n /* Check for a default for all GF variables of this dimension */\n gindex = CCTK_GroupIndex(groupname);\n if (gindex < 0)\n CCTK_VWarn(0, __LINE__, __FILE__, \"CoordBase\",\n \"group index is out of bounds\");\n if (system_handle == -9999 && CCTK_GroupTypeI(gindex) == CCTK_GF) {\n GHex = CCTK_GHExtension(GH, \"CoordBase\");\n gdim = CCTK_GroupDimI(gindex);\n system_handle = GHex->default_coord_systems[gdim - 1];\n if (system_handle < 0) {\n CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,\n \"No coordinate \"\n \"system is associated with group '%s'\",\n groupname);\n system_handle = COORDERROR_NOCOORDSYS;\n }\n }\n free(system_name);\n }\n\n return system_handle;\n}\n\n/*@@\n @routine CoordBase_SetDefaultSystem\n @date 28 July 2003\n @author David Rideout\n @desc\n Set this coordinate system to be the default for grid functions\n of the same dimension\n @enddesc\n @calls CCTK_GHExtension, CoordBase_SystemHandle, CCTK_VWarn,\n Util_TableGetInt\n\n @var GH\n @vdesc cctkGH *\n @vtype CCTK_POINTER_TO_CONST\n @vio in\n @endvar\n @var systemname\n @vdesc coordinate system name\n @vtype CCTK_STRING\n @vio in\n @endvar\n\n @returntype int\n @returndesc\n coordinate system handle, or\n COORDERROR_INVALIDNAME no coordinate system of this name has been\n registered\n COORDERROR_NODIMENSION coordinate system does not have a valid dimension\n COORDERROR_DEFAULTEXISTS grid variables of this dimension already have a\n default coordinate system registered\n @endreturndesc\n@@*/\n\nCCTK_INT CoordBase_SetDefaultSystem(CCTK_POINTER_TO_CONST GH,\n CCTK_STRING systemname) {\n int system_handle;\n CCTK_INT system_dimension;\n int retval;\n const coordbaseGH *GHex;\n#ifdef DEBUG\n int i;\n#endif\n\n /* Retrieve array from GH extension */\n GHex = CCTK_GHExtension(GH, \"CoordBase\");\n\n /* Get coordinate system handle */\n system_handle = CoordBase_SystemHandle(GH, systemname);\n if (system_handle < 0) {\n CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING, \"Invalid system name \"\n \"'%s'\",\n systemname);\n retval = COORDERROR_INVALIDNAME;\n } else {\n /* Get system dimension */\n if (Util_TableGetInt(system_handle, &system_dimension, \"DIMENSION\") < 0) {\n CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,\n \"System '%s' does not \"\n \"have a registered dimension\",\n systemname);\n retval = COORDERROR_NODIMENSION;\n } else {\n /* Set the default for this dimension */\n if (GHex->default_coord_systems[system_dimension - 1] >= 0) {\n CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,\n \"Default coordinate \"\n \"system for %d dimensional grid variables is already set. \"\n \"Overwriting to '%s'.\",\n (int)system_dimension, systemname);\n retval = COORDERROR_DEFAULTEXISTS;\n } else {\n retval = system_handle;\n }\n GHex->default_coord_systems[system_dimension - 1] = system_handle;\n }\n }\n\n#ifdef DEBUG\n for (i = 0; i < system_dimension; ++i) {\n printf(\"def_coord_sys[%d] = %d\\n\", i, GHex->default_coord_systems[i]);\n }\n#endif\n\n return retval;\n}\n\n/*@@\n @routine CoordBase_GetDefaultSystem\n @date 9 May 2004\n @author Thomas Radke\n @desc\n Get the default coordinate system for grid variables\n of a given dimension\n @enddesc\n\n @var GH\n @vdesc cctkGH *\n @vtype CCTK_POINTER_TO_CONST\n @vio in\n @endvar\n @var systemdim\n @vdesc dimension of coordinate system to query\n @vtype CCTK_INT\n @vio in\n @vcomment ranges from 1 to the maximum number of dimensions\n @endvar\n\n @returntype int\n @returndesc\n coordinate system handle, or\n COORDERROR_INVALIDDIM given dimension is invalid\n COORDERROR_NOSYSTEM given dimension does not have a default coordinate\n system associated\n @endreturndesc\n@@*/\n\nCCTK_INT CoordBase_GetDefaultSystem(CCTK_POINTER_TO_CONST GH,\n CCTK_INT systemdim) {\n CCTK_INT retval;\n const coordbaseGH *myGH;\n\n myGH = CCTK_GHExtension(GH, \"CoordBase\");\n\n retval = COORDERROR_INVALIDDIM;\n if (systemdim >= 1 && systemdim <= CCTK_MaxDim()) {\n retval = myGH->default_coord_systems[systemdim - 1];\n }\n\n return (retval);\n}\n", |
| "CoordBase.h": "/*@@\n @header CoordBase.h\n @date Wed June 26 2002\n @author Gabrielle Allen\n @desc\n Defines and prototypes for the coordinate base thorn\n @enddesc\n @version $Header$\n @@*/\n\n#ifndef _COORDBASE_H_\n#define _COORDBASE_H_\n\n#ifndef COORD_IN_COORDBASE\n\n/* Since some people may still be including this header file\n * rather than using the function aliasing, we need to\n * allow them access to the internal functions.\n */\n\n#define Coord_SystemRegister CoordBase_SystemRegister\n#define Coord_SystemHandle CoordBase_SystemHandle\n#define Coord_CoordRegister CoordBase_CoordRegister\n#define Coord_CoordHandle CoordBase_CoordHandle\n#define Coord_GroupSystem CoordBase_GroupSystem\n#define Coord_SetDefaultSystem CoordBase_SetDefaultSystem\n#define Coord_GetDefaultSystem CoordBase_GetDefaultSystem\n\n#endif /* COORD_IN_COORDBASE */\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nCCTK_INT CoordBase_SystemRegister(CCTK_POINTER_TO_CONST GH, CCTK_INT dim,\n CCTK_STRING systemname);\n\nCCTK_INT CoordBase_SystemHandle(CCTK_POINTER_TO_CONST GH,\n CCTK_STRING systemname);\n\nCCTK_INT CoordBase_CoordRegister(CCTK_POINTER_TO_CONST GH,\n CCTK_INT systemhandle, CCTK_INT direction,\n CCTK_STRING coordname);\n\nCCTK_INT CoordBase_CoordHandle(CCTK_POINTER_TO_CONST GH, CCTK_STRING coordname,\n CCTK_STRING systemname);\n\nCCTK_INT CoordBase_GroupSystem(CCTK_POINTER_TO_CONST GH, CCTK_STRING groupname);\n\nCCTK_INT CoordBase_SetDefaultSystem(CCTK_POINTER_TO_CONST GH,\n CCTK_STRING systemname);\n\nCCTK_INT CoordBase_GetDefaultSystem(CCTK_POINTER_TO_CONST GH,\n CCTK_INT systemdim);\n\n#ifdef __cplusplus\n}\n#endif\n\n#define COORDERROR_SYSTEMEXISTS -1\n#define COORDERROR_INVALIDDIM -2\n#define COORDERROR_INVALIDNAME -3\n#define COORDERROR_TABLEERROR -4\n#define COORDERROR_NOSYSTEM -5\n#define COORDERROR_INVALIDHANDLE -6\n#define COORDERROR_COORDINATEEXISTS -7\n#define COORDERROR_DUPLICATENAME -8\n#define COORDERROR_NOSUCHCOORD -9\n#define COORDERROR_INVALIDGROUPNAME -10\n#define COORDERROR_NOCOORDSYS -11\n#define COORDERROR_NODIMENSION -12\n#define COORDERROR_DEFAULTEXISTS -13\n\n#endif /* _COORDBASE_H_ */\n", |
| "coordbaseGH.h": "/*@@\n @header coordbaseGH.h\n @date Sun Sept 22 2002\n @author Gabrielle Allen\n @desc\n The extensions to the GH structure from CoordBase\n @version $Header$\n@@*/\n\n#ifndef _COORDBASE_COORDBASEGH_H_\n#define _COORDBASE_COORDBASEGH_H_ 1\n\n#include \"util_Hash.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct COORDBASEGH {\n uHash *coordsystems; /* Hash table mapping coord systems to tables */\n int *default_coord_systems; /* Default coord system for each dimension */\n /* int max_dimension; Allocated size of default_coord_system\n array (not used currently) */\n} coordbaseGH;\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n\n#endif /* _COORDBASE_COORDBASEGH_H_ */\n", |
| "GHExtension.c": "/*@@\n @file GHExtension.c\n @date Sun Sept 22 2002\n @author Gabrielle Allen and David Rideout\n @desc\n CoordBase GHExtension setup\n @enddesc\n @version $Id$\n@@*/\n\n#include <stdlib.h>\n\n#include \"cctk.h\"\n#include \"CoordBase.h\"\n#include \"coordbaseGH.h\"\n#include \"util_Hash.h\"\n\nstatic const char *rcsid = \"$Header$\";\n\nCCTK_FILEVERSION(CactusBase_CoordBase_GHExtension_c);\n\n/********************************************************************\n ********************* Scheduled Routine Prototypes ***************\n ********************************************************************/\n\nint CoordBase_Startup(void);\n\n/********************************************************************\n ********************* Local Routine Prototypes *********************\n ********************************************************************/\n\nstatic void *CoordBase_SetupGH(tFleshConfig *config, int conv_level, cGH *GH);\n\n/********************************************************************\n ********************* External Routines **********************\n ********************************************************************/\n\n/*@@\n @routine CoordBase_Startup\n @date Sunday Sept 22 2002\n @author Gabrielle Allen\n @desc\n The startup registration routine for CoordBase.\n Registers the GH extension needed for CoordBase.\n @enddesc\n @calls CCTK_RegisterGHExtension\n CCTK_RegisterGHExtensionSetupGH\n@@*/\nint CoordBase_Startup(void) {\n int GHex_handle;\n\n GHex_handle = CCTK_RegisterGHExtension(\"CoordBase\");\n CCTK_RegisterGHExtensionSetupGH(GHex_handle, CoordBase_SetupGH);\n\n return 0;\n}\n\n/********************************************************************\n ******************** Internal Routines ************************\n ********************************************************************/\n\n/*@@\n @routine CoordBase_SetupGH\n @date Sun Sept 22 2002\n @author Gabrielle Allen\n @desc\n Allocates CoordBase's GH extension structure\n @enddesc\n\n @calls Util_HashCreate\n\n @var config\n @vdesc the CCTK configuration as provided by the flesh\n @vtype tFleshConfig *\n @vio unused\n @endvar\n @var conv_level\n @vdesc the convergence level\n @vtype int\n @vio unused\n @endvar\n @var GH\n @vdesc Pointer to CCTK grid hierarchy\n @vtype cGH *\n @vio in\n @endvar\n\n @returntype void *\n @returndesc\n pointer to the allocated GH extension structure\n @endreturndesc\n@@*/\n\nstatic void *CoordBase_SetupGH(tFleshConfig *config, int conv_level, cGH *GH) {\n int maxdim;\n int *default_coord_systems;\n coordbaseGH *myGH;\n\n /* suppress compiler warnings about unused variables */\n (void)(config + 0);\n (void)(conv_level + 0);\n (void)(GH + 0);\n\n maxdim = CCTK_MaxDim();\n\n /* allocate the GH extension and its components */\n myGH = malloc(sizeof(coordbaseGH));\n default_coord_systems = malloc(maxdim * sizeof(int));\n if (myGH && default_coord_systems) {\n myGH->default_coord_systems = default_coord_systems;\n while (--maxdim >= 0) {\n myGH->default_coord_systems[maxdim] = COORDERROR_NOSYSTEM;\n }\n\n myGH->coordsystems = Util_HashCreate(8);\n } else {\n CCTK_WARN(0, \"CoordBase_SetupGH: Unable to allocate memory for GH \"\n \"extension\");\n free(default_coord_systems);\n myGH = NULL;\n }\n\n return (myGH);\n}\n", |
| "Domain.c": "#include <cctk.h>\n#include <cctk_Parameters.h>\n#include <util_Table.h>\n\nCCTK_INT CoordBase_GetBoundarySpecification(CCTK_INT const size,\n CCTK_INT *const nboundaryzones,\n CCTK_INT *const is_internal,\n CCTK_INT *const is_staggered,\n CCTK_INT *const shiftout) {\n DECLARE_CCTK_PARAMETERS;\n\n if (!(size >= 0))\n CCTK_ERROR(\"size is less than zero\");\n if (!(nboundaryzones))\n CCTK_ERROR(\"nboundaryzones is out of bounds\");\n if (!(is_internal))\n CCTK_ERROR(\"is_internal is out of bounds\");\n if (!(is_staggered))\n CCTK_ERROR(\"is_staggered is out of bounds\");\n if (!(shiftout))\n CCTK_ERROR(\"shiftout is out of bounds\");\n\n if (!(size == 6))\n CCTK_ERROR(\"size is out of bounds\");\n\n nboundaryzones[0] = boundary_size_x_lower;\n nboundaryzones[1] = boundary_size_x_upper;\n nboundaryzones[2] = boundary_size_y_lower;\n nboundaryzones[3] = boundary_size_y_upper;\n nboundaryzones[4] = boundary_size_z_lower;\n nboundaryzones[5] = boundary_size_z_upper;\n\n is_internal[0] = boundary_internal_x_lower;\n is_internal[1] = boundary_internal_x_upper;\n is_internal[2] = boundary_internal_y_lower;\n is_internal[3] = boundary_internal_y_upper;\n is_internal[4] = boundary_internal_z_lower;\n is_internal[5] = boundary_internal_z_upper;\n\n is_staggered[0] = boundary_staggered_x_lower;\n is_staggered[1] = boundary_staggered_x_upper;\n is_staggered[2] = boundary_staggered_y_lower;\n is_staggered[3] = boundary_staggered_y_upper;\n is_staggered[4] = boundary_staggered_z_lower;\n is_staggered[5] = boundary_staggered_z_upper;\n\n shiftout[0] = boundary_shiftout_x_lower;\n shiftout[1] = boundary_shiftout_x_upper;\n shiftout[2] = boundary_shiftout_y_lower;\n shiftout[3] = boundary_shiftout_y_upper;\n shiftout[4] = boundary_shiftout_z_lower;\n shiftout[5] = boundary_shiftout_z_upper;\n\n return 0;\n}\n\nCCTK_INT CoordBase_GetDomainSpecification(\n CCTK_INT const size, CCTK_REAL *const physical_min,\n CCTK_REAL *const physical_max, CCTK_REAL *const interior_min,\n CCTK_REAL *const interior_max, CCTK_REAL *const exterior_min,\n CCTK_REAL *const exterior_max, CCTK_REAL *const thespacing) {\n DECLARE_CCTK_PARAMETERS;\n\n int ierr;\n\n if (!(size >= 0))\n CCTK_ERROR(\"size is out of bounds\");\n if (!(physical_min))\n CCTK_ERROR(\"physical_min is out of bounds\");\n if (!(physical_max))\n CCTK_ERROR(\"physical_max is out of bounds\");\n if (!(interior_min))\n CCTK_ERROR(\"interior_min is out of bounds\");\n if (!(interior_max))\n CCTK_ERROR(\"interior_max is out of bounds\");\n if (!(exterior_min))\n CCTK_ERROR(\"exterior_min is out of bounds\");\n if (!(exterior_max))\n CCTK_ERROR(\"exterior_max is out of bounds\");\n if (!(thespacing))\n CCTK_ERROR(\"thespacing is out of bounds\");\n\n if (!(size == 3))\n CCTK_ERROR(\"size is out of bounds\");\n\n if (CCTK_EQUALS(domainsize, \"minmax\")) {\n\n physical_min[0] = xmin;\n physical_min[1] = ymin;\n physical_min[2] = zmin;\n physical_max[0] = xmax;\n physical_max[1] = ymax;\n physical_max[2] = zmax;\n if (CCTK_EQUALS(spacing, \"gridspacing\")) {\n thespacing[0] = dx;\n thespacing[1] = dy;\n thespacing[2] = dz;\n } else if (CCTK_EQUALS(spacing, \"numcells\")) {\n thespacing[0] = (physical_max[0] - physical_min[0]) / ncells_x;\n thespacing[1] = (physical_max[1] - physical_min[1]) / ncells_y;\n thespacing[2] = (physical_max[2] - physical_min[2]) / ncells_z;\n }\n\n } else if (CCTK_EQUALS(domainsize, \"extent\")) {\n\n if (zero_origin_x) {\n physical_min[0] = xmin;\n physical_max[0] = xmin + xextent;\n } else {\n physical_min[0] = -xextent / 2;\n physical_max[0] = +xextent / 2;\n }\n if (zero_origin_y) {\n physical_min[1] = ymin;\n physical_max[1] = ymin + yextent;\n } else {\n physical_min[1] = -yextent / 2;\n physical_max[1] = +yextent / 2;\n }\n if (zero_origin_z) {\n physical_min[2] = zmin;\n physical_max[2] = zmin + zextent;\n } else {\n physical_min[2] = -zextent / 2;\n physical_max[2] = +zextent / 2;\n }\n if (CCTK_EQUALS(spacing, \"gridspacing\")) {\n thespacing[0] = dx;\n thespacing[1] = dy;\n thespacing[2] = dz;\n } else if (CCTK_EQUALS(spacing, \"numcells\")) {\n thespacing[0] = (physical_max[0] - physical_min[0]) / ncells_x;\n thespacing[1] = (physical_max[1] - physical_min[1]) / ncells_y;\n thespacing[2] = (physical_max[2] - physical_min[2]) / ncells_z;\n }\n\n } else if (CCTK_EQUALS(domainsize, \"spacing\")) {\n\n if (zero_origin_x) {\n physical_min[0] = xmin;\n physical_max[0] = xmin + dx * ncells_x;\n } else {\n physical_min[0] = -dx * ncells_x / 2;\n physical_max[0] = +dx * ncells_x / 2;\n }\n if (zero_origin_y) {\n physical_min[1] = ymin;\n physical_max[1] = ymin + dy * ncells_y;\n } else {\n physical_min[1] = -dy * ncells_y / 2;\n physical_max[1] = +dy * ncells_y / 2;\n }\n if (zero_origin_z) {\n physical_min[2] = zmin;\n physical_max[2] = zmin + dz * ncells_z;\n } else {\n physical_min[2] = -dz * ncells_z / 2;\n physical_max[2] = +dz * ncells_z / 2;\n }\n thespacing[0] = dx;\n thespacing[1] = dy;\n thespacing[2] = dz;\n\n } else {\n CCTK_ERROR(\"domainsize is out of bounds\");\n }\n\n ierr = ConvertFromPhysicalBoundary(size, physical_min, physical_max,\n interior_min, interior_max, exterior_min,\n exterior_max, thespacing);\n if (ierr)\n CCTK_ERROR(\"Error returned from ConvertFromPhysicalBoundary\");\n\n return 0;\n}\n\nCCTK_INT CoordBase_ConvertFromPhysicalBoundary(\n CCTK_INT const size, CCTK_REAL const *const physical_min,\n CCTK_REAL const *const physical_max, CCTK_REAL *const interior_min,\n CCTK_REAL *const interior_max, CCTK_REAL *const exterior_min,\n CCTK_REAL *const exterior_max, CCTK_REAL const *const thespacing) {\n CCTK_INT nboundaryzones[6];\n CCTK_INT is_internal[6];\n CCTK_INT is_staggered[6];\n CCTK_INT shiftout[6];\n\n int d;\n int ierr;\n\n if (!(size >= 0))\n CCTK_ERROR(\"size is out of bounds\");\n if (!(physical_min))\n CCTK_ERROR(\"physical_min is out of bounds\");\n if (!(physical_max))\n CCTK_ERROR(\"physical_max is out of bounds\");\n if (!(interior_min))\n CCTK_ERROR(\"interior_min is out of bounds\");\n if (!(interior_max))\n CCTK_ERROR(\"interior_max is out of bounds\");\n if (!(exterior_min))\n CCTK_ERROR(\"exterior_min is out of bounds\");\n if (!(exterior_max))\n CCTK_ERROR(\"exterior_max is out of bounds\");\n if (!(thespacing))\n CCTK_ERROR(\"thespacing is out of bounds\");\n\n if (!(size == 3))\n CCTK_ERROR(\"size is out of bounds\");\n\n ierr = CoordBase_GetBoundarySpecification(6, nboundaryzones, is_internal,\n is_staggered, shiftout);\n if (ierr)\n CCTK_ERROR(\n \"error returned from function CoordBase_GetBoundarySpecification\");\n\n for (d = 0; d < 3; ++d) {\n\n exterior_min[d] =\n physical_min[d] -\n thespacing[d] * (+(is_internal[2 * d] ? 0 : nboundaryzones[2 * d] - 1) +\n (is_staggered[2 * d] ? 0.5 : 0.0) + shiftout[2 * d]);\n exterior_max[d] =\n physical_max[d] +\n thespacing[d] *\n (+(is_internal[2 * d + 1] ? 0 : nboundaryzones[2 * d + 1] - 1) +\n (is_staggered[2 * d + 1] ? 0.5 : 0.0) + shiftout[2 * d + 1]);\n\n interior_min[d] = exterior_min[d] + thespacing[d] * nboundaryzones[2 * d];\n interior_max[d] =\n exterior_max[d] - thespacing[d] * nboundaryzones[2 * d + 1];\n }\n\n return 0;\n}\n\nCCTK_INT CoordBase_ConvertFromInteriorBoundary(\n CCTK_INT const size, CCTK_REAL *const physical_min,\n CCTK_REAL *const physical_max, CCTK_REAL const *const interior_min,\n CCTK_REAL const *const interior_max, CCTK_REAL *const exterior_min,\n CCTK_REAL *const exterior_max, CCTK_REAL const *const thespacing) {\n CCTK_INT nboundaryzones[6];\n CCTK_INT is_internal[6];\n CCTK_INT is_staggered[6];\n CCTK_INT shiftout[6];\n\n int d;\n int ierr;\n\n if (!(size >= 0))\n CCTK_ERROR(\"size is out of bounds\");\n if (!(physical_min))\n CCTK_ERROR(\"physical_min is out of bounds\");\n if (!(physical_max))\n CCTK_ERROR(\"physical_max is out of bounds\");\n if (!(interior_min))\n CCTK_ERROR(\"interior_min is out of bounds\");\n if (!(interior_max))\n CCTK_ERROR(\"interior_max is out of bounds\");\n if (!(exterior_min))\n CCTK_ERROR(\"exterior_min is out of bounds\");\n if (!(exterior_max))\n CCTK_ERROR(\"exterior_max is out of bounds\");\n if (!(thespacing))\n CCTK_ERROR(\"thespacing is out of bounds\");\n\n if (!(size == 3))\n CCTK_ERROR(\"size is out of bounds\");\n\n ierr = CoordBase_GetBoundarySpecification(6, nboundaryzones, is_internal,\n is_staggered, shiftout);\n if (ierr)\n CCTK_VError(\n __LINE__, __FILE__, \"CactusBase\",\n \"error returned from function CoordBase_GetBoundarySpecification\");\n\n for (d = 0; d < 3; ++d) {\n\n exterior_min[d] = interior_min[d] - thespacing[d] * nboundaryzones[2 * d];\n exterior_max[d] =\n interior_max[d] + thespacing[d] * nboundaryzones[2 * d + 1];\n\n physical_min[d] =\n exterior_min[d] +\n thespacing[d] * (+(is_internal[2 * d] ? 0 : nboundaryzones[2 * d] - 1) +\n (is_staggered[2 * d] ? 0.5 : 0.0) + shiftout[2 * d]);\n physical_max[d] =\n exterior_max[d] -\n thespacing[d] *\n (+(is_internal[2 * d + 1] ? 0 : nboundaryzones[2 * d + 1] - 1) +\n (is_staggered[2 * d + 1] ? 0.5 : 0.0) + shiftout[2 * d + 1]);\n }\n\n return 0;\n}\n\nCCTK_INT CoordBase_ConvertFromExteriorBoundary(\n CCTK_INT const size, CCTK_REAL *const physical_min,\n CCTK_REAL *const physical_max, CCTK_REAL *const interior_min,\n CCTK_REAL *const interior_max, CCTK_REAL const *const exterior_min,\n CCTK_REAL const *const exterior_max, CCTK_REAL const *const thespacing) {\n CCTK_INT nboundaryzones[6];\n CCTK_INT is_internal[6];\n CCTK_INT is_staggered[6];\n CCTK_INT shiftout[6];\n\n int d;\n int ierr;\n\n if (!(size >= 0))\n CCTK_ERROR(\"size is out of bounds\");\n if (!(physical_min))\n CCTK_ERROR(\"physical_min is out of bounds\");\n if (!(physical_max))\n CCTK_ERROR(\"physical_max is out of bounds\");\n if (!(interior_min))\n CCTK_ERROR(\"interior_min is out of bounds\");\n if (!(interior_max))\n CCTK_ERROR(\"interior_max is out of bounds\");\n if (!(exterior_min))\n CCTK_ERROR(\"exterior_min is out of bounds\");\n if (!(exterior_max))\n CCTK_ERROR(\"exterior_max is out of bounds\");\n if (!(thespacing))\n CCTK_ERROR(\"thespacing is out of bounds\");\n\n if (!(size == 3))\n CCTK_ERROR(\"size is out of bounds\");\n\n ierr = CoordBase_GetBoundarySpecification(6, nboundaryzones, is_internal,\n is_staggered, shiftout);\n if (ierr)\n CCTK_ERROR(\"Error returned from CoordBase_GetBoundarySpecification\");\n\n for (d = 0; d < 3; ++d) {\n\n physical_min[d] =\n exterior_min[d] +\n thespacing[d] * (+(is_internal[2 * d] ? 0 : nboundaryzones[2 * d] - 1) +\n (is_staggered[2 * d] ? 0.5 : 0.0) + shiftout[2 * d]);\n physical_max[d] =\n exterior_max[d] -\n thespacing[d] *\n (+(is_internal[2 * d + 1] ? 0 : nboundaryzones[2 * d + 1] - 1) +\n (is_staggered[2 * d + 1] ? 0.5 : 0.0) + shiftout[2 * d + 1]);\n\n interior_min[d] = exterior_min[d] + thespacing[d] * nboundaryzones[2 * d];\n interior_max[d] =\n exterior_max[d] - thespacing[d] * nboundaryzones[2 * d + 1];\n }\n\n return 0;\n}\n\nCCTK_INT CoordBase_GetBoundarySizesAndTypes(\n CCTK_POINTER_TO_CONST const cctkGH_, CCTK_INT const size,\n CCTK_INT *restrict const bndsize, CCTK_INT *restrict const is_ghostbnd,\n CCTK_INT *restrict const is_symbnd, CCTK_INT *restrict const is_physbnd) {\n cGH const *restrict const cctkGH = cctkGH_;\n\n /* Check arguments */\n int const dim = cctkGH->cctk_dim;\n if (size != 2 * dim) {\n CCTK_ERROR(\"Inconsistent size argument\");\n }\n\n /* Obtain multi-patch bbox information, specifying which boundaries\n are set by a multi-patch system (bbox=1) and which by a physical\n boundary condition (bbox=0) */\n CCTK_INT mp_bbox[2 * dim];\n if (CCTK_IsFunctionAliased(\"MultiPatch_GetBbox\")) {\n int const ierr = MultiPatch_GetBbox(cctkGH, 2 * dim, mp_bbox);\n if (ierr != 0) {\n CCTK_ERROR(\"Could not obtain multi-patch bbox specification\");\n }\n } else {\n for (int d = 0; d < 2 * dim; ++d) {\n mp_bbox[d] = 0;\n }\n }\n\n /* Obtain boundary information */\n CCTK_INT nboundaryzones[2 * dim];\n CCTK_INT is_internal[2 * dim];\n CCTK_INT is_staggered[2 * dim];\n CCTK_INT shiftout[2 * dim];\n if (CCTK_IsFunctionAliased(\"MultiPatch_GetBoundarySpecification\")) {\n /* We are using a multi-patch system */\n int const map = MultiPatch_GetMap(cctkGH);\n if (map < 0) {\n CCTK_ERROR(\n \"Could not determine current map (need to be called in local mode)\");\n }\n int const ierr = MultiPatch_GetBoundarySpecification(\n map, 2 * dim, nboundaryzones, is_internal, is_staggered, shiftout);\n if (ierr != 0) {\n CCTK_ERROR(\"Could not obtain boundary specification\");\n }\n } else if (CCTK_IsFunctionAliased(\"GetBoundarySpecification\")) {\n /* We are not using a multi-patch system */\n int const ierr = GetBoundarySpecification(\n 2 * dim, nboundaryzones, is_internal, is_staggered, shiftout);\n if (ierr != 0) {\n CCTK_ERROR(\"Could not obtain boundary specification\");\n }\n } else {\n CCTK_ERROR(\"Could not obtain boundary specification\");\n }\n\n /* Obtain symmetry information */\n int const symtable = SymmetryTableHandleForGrid(cctkGH);\n if (symtable < 0) {\n CCTK_ERROR(\"Could not obtain symmetry table\");\n }\n CCTK_INT symbnd[2 * dim];\n int const iret =\n Util_TableGetIntArray(symtable, 2 * dim, symbnd, \"symmetry_handle\");\n if (iret != 2 * dim) {\n CCTK_ERROR(\"Could not obtain symmetry information\");\n }\n\n /* Determine boundary types */\n for (int d = 0; d < 2 * dim; ++d) {\n /* Ghost boundaries (inter-process or mesh refinement boundaries)\n have cctk_bbox=0 */\n is_ghostbnd[d] = !cctkGH->cctk_bbox[d];\n /* Symmetry boundaries are not ghost boundaries, are described as\n symmetry boundaries, and are not multi-patch outer\n boundaries */\n is_symbnd[d] = !is_ghostbnd[d] && symbnd[d] >= 0 && !mp_bbox[d];\n /* Physical (outer) boundaries are all other boundaries */\n is_physbnd[d] = !is_ghostbnd[d] && !is_symbnd[d];\n }\n\n /* Determine boundary sizes */\n for (int dir = 0; dir < dim; ++dir) {\n for (int face = 0; face < 2; ++face) {\n\n if (is_ghostbnd[2 * dir + face]) {\n /* Ghost boundary */\n bndsize[2 * dir + face] = cctkGH->cctk_nghostzones[dir];\n } else {\n /* Symmetry or physical boundary */\n bndsize[2 * dir + face] = nboundaryzones[2 * dir + face];\n\n if (is_symbnd[2 * dir + face]) {\n /* Ensure that the number of symmetry zones is the same as\n the number of ghost zones */\n if (bndsize[2 * dir + face] != cctkGH->cctk_nghostzones[dir]) {\n CCTK_VWarn(CCTK_WARN_ALERT, __LINE__, __FILE__, CCTK_THORNSTRING,\n \"The number of symmetry points in direction %d face %d \"\n \"is %d, which is different from the number of ghost \"\n \"points (%d); this is probably an error\",\n dir, face, bndsize[2 * dir + face],\n cctkGH->cctk_nghostzones[dir]);\n }\n }\n }\n }\n }\n\n return 0;\n}\n" |
| }, |
| "test": {}, |
| "doc": { |
| "domain.pdf": "%PDF-1.3\n%\uc3e2\n5 0 obj\n<</Length 6 0 R/Filter /FlateDecode>>\nstream\nx\u07531R0\fE{5,[O@r\f,\u0014[\u0000\u0005YL\u83e5\u0013}D\u001cv\u000b\u0017Pr5\u0004\u001f~&^BFX$\u001aoH\u0017JbW%\u001eLbJ\u0015\u0016Z3Ah\u0016v0\u0018\nPID\fI\n\u0003- @9\f\u00128\u000fhPM[&ZDei*W\u057c\u001due\u0006\u0000\u0004BC\u0004(\u001ezN8Cx\n\\4\u001f \u001fs%S3[8\u0018q)\u000b7\u0003\u001e\u0019\u000e\u0003<tXx\u0000C\tg-=W\u0015aJnPMz\u001e]j\u000e&9Qn52Y.S\bH\u000bP<p&6g\\u\ud0dem\\t^\u01e1\u000b{endstream\nendobj\n6 0 obj\n337\nendobj\n4 0 obj\n<</Type/Page/MediaBox [0 0 151 87]\n/Parent 3 0 R\n/Resources<</ProcSet[/PDF]\n/ExtGState 8 0 R\n>>\n/Contents 5 0 R\n>>\nendobj\n3 0 obj\n<< /Type /Pages /Kids [\n4 0 R\n] /Count 1\n>>\nendobj\n1 0 obj\n<</Type /Catalog /Pages 3 0 R\n>>\nendobj\n7 0 obj\n<</Type/ExtGState\n/OPM 1>>endobj\n8 0 obj\n<</R7\n7 0 R>>\nendobj\n2 0 obj\n<</Producer(ESP Ghostscript 815.03)\n/CreationDate(D:20090202085906)\n/ModDate(D:20090202085906)>>endobj\nxref\n0 9\n0000000000 65535 f \n0000000630 00000 n \n0000000748 00000 n \n0000000571 00000 n \n0000000441 00000 n \n0000000015 00000 n \n0000000422 00000 n \n0000000678 00000 n \n0000000719 00000 n \ntrailer\n<< /Size 9 /Root 1 0 R /Info 2 0 R\n/ID [(gC\u0016bL'Q\u0015*)(gC\u0016bL'Q\u0015*)]\n>>\nstartxref\n859\n%%EOF\n", |
| "domain-external.pdf": "%PDF-1.3\n%\uc3e2\n5 0 obj\n<</Length 6 0 R/Filter /FlateDecode>>\nstream\nx\u07541r0\fD{u\n H8A8G$\u000b\u0017\u000b_?7\u0017\b\u001e\u0015\u001a\u0010}\"\u017f\u0010r>}OS#8\u01da#\u001b\u0724B\u0011\u0017*\u0372\u0012FQ&\u001e\u066b`Ey1z\u0019\u0010F\uf90d\u001d5\u0006\u0006(\u01a42\fz\u00111\u0001\u0010!V rC\u001c%Jm\u000b\u001a\u0014dQI\"6!QhZ\u001a\u001e|hG\u01c6\u00001a!\u0002\b\u001c\u0010h%?'nFZxPiR;G\u0004\u0018qk\u001b\u000b\u001e\u0015\u000e\u0006\u0011~Mx\u0000%B/;\u0111|dq\u001d<hK\t\u069czN\\l\u001b\ny\u007f\u0117\u000f(P\bH#p{J\f\u001b'W\u00132\b\u0014$\u0013w\u001c[\"\u001aZ{p1$WB~n|(x9\t\u001e'+b\u0005yaez^q?=\u0017L\u0001+6endstream\nendobj\n6 0 obj\n398\nendobj\n4 0 obj\n<</Type/Page/MediaBox [0 0 179 87]\n/Parent 3 0 R\n/Resources<</ProcSet[/PDF]\n/ExtGState 8 0 R\n>>\n/Contents 5 0 R\n>>\nendobj\n3 0 obj\n<< /Type /Pages /Kids [\n4 0 R\n] /Count 1\n>>\nendobj\n1 0 obj\n<</Type /Catalog /Pages 3 0 R\n>>\nendobj\n7 0 obj\n<</Type/ExtGState\n/OPM 1>>endobj\n8 0 obj\n<</R7\n7 0 R>>\nendobj\n2 0 obj\n<</Producer(ESP Ghostscript 815.03)\n/CreationDate(D:20090202085906)\n/ModDate(D:20090202085906)>>endobj\nxref\n0 9\n0000000000 65535 f \n0000000691 00000 n \n0000000809 00000 n \n0000000632 00000 n \n0000000502 00000 n \n0000000015 00000 n \n0000000483 00000 n \n0000000739 00000 n \n0000000780 00000 n \ntrailer\n<< /Size 9 /Root 1 0 R /Info 2 0 R\n/ID [(]=\u0013T\u0001\fo)(]=\u0013T\u0001\fo)]\n>>\nstartxref\n920\n%%EOF\n", |
| "domain-external.fig": "#FIG 3.2\nLandscape\nCenter\nMetric\nA4 \n100.00\nSingle\n-2\n1200 2\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 1800 1125 113 113 1800 1125 1913 1125\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 1350 1125 113 113 1350 1125 1463 1125\n1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 450 1125 113 113 450 1125 563 1125\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 2250 1125 113 113 2250 1125 2363 1125\n1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 900 1125 113 113 900 1125 1013 1125\n2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5\n\t 900 450 3150 450 3150 1800 900 1800 900 450\n", |
| "domain.fig": "#FIG 3.2\nLandscape\nCenter\nMetric\nA4 \n100.00\nSingle\n-2\n1200 2\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 1800 1125 113 113 1800 1125 1913 1125\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 1350 1125 113 113 1350 1125 1463 1125\n1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 450 1125 113 113 450 1125 563 1125\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 900 1125 113 113 900 1125 1013 1125\n2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5\n\t 450 450 2700 450 2700 1800 450 1800 450 450\n", |
| "domain-internal.fig": "#FIG 3.2\nLandscape\nCenter\nMetric\nA4 \n100.00\nSingle\n-2\n1200 2\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 1800 1125 113 113 1800 1125 1913 1125\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 2250 1125 113 113 2250 1125 2363 1125\n1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 900 1125 113 113 900 1125 1013 1125\n1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 1350 1125 113 113 1350 1125 1463 1125\n2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5\n\t 900 450 3150 450 3150 1800 900 1800 900 450\n", |
| "domain-external-staggered.fig": "#FIG 3.2\nLandscape\nCenter\nMetric\nA4 \n100.00\nSingle\n-2\n1200 2\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 1800 1125 113 113 1800 1125 1913 1125\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 1350 1125 113 113 1350 1125 1463 1125\n1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 450 1125 113 113 450 1125 563 1125\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 2250 1125 113 113 2250 1125 2363 1125\n1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 900 1125 113 113 900 1125 1013 1125\n2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5\n\t 1125 450 3375 450 3375 1800 1125 1800 1125 450\n", |
| "domain-internal-staggered.fig": "#FIG 3.2\nLandscape\nCenter\nMetric\nA4 \n100.00\nSingle\n-2\n1200 2\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 1800 1125 113 113 1800 1125 1913 1125\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 2250 1125 113 113 2250 1125 2363 1125\n1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 900 1125 113 113 900 1125 1013 1125\n1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 1350 1125 113 113 1350 1125 1463 1125\n2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5\n\t 675 450 2925 450 2925 1800 675 1800 675 450\n", |
| "domain-internal-staggered.pdf": "%PDF-1.3\n%\uc3e2\n5 0 obj\n<</Length 6 0 R/Filter /FlateDecode>>\nstream\nx\u0753=R0\f{B5'\u0004,GB\u0005Pp}\u0011vRx\"?}o|l8[x\u0018]\u007fCf9\u0016\u000bJ_aKVJ9EN\u0355\u0013K6RXcTi\u0016Q-Z.\u051cQ\u007f\u0000\u0154k\u0004\"KR\f@\u0004\u0000x\u00039\u0012>[P1+@SI\u0007s4z|\u001f\u001bDzue\u00000\u0001\u0001C\u000fs{4kQXqoP<^k\u001c57:\u04e9t{3cK9\u03edzNv\u0006~\u001fp\b7\u0000808GXc\u0696wt\b\u0006\u0005h} \u001b{\u001f[q\u001d\u001c\u0000\u00011aF\u0003\u0002\u0014\u001e\u000e\u0010\u001e4\u06764[q\uaede\u025a86jEVD?kk\u0007WE\nDendstream\nendobj\n6 0 obj\n339\nendobj\n4 0 obj\n<</Type/Page/MediaBox [0 0 144 87]\n/Parent 3 0 R\n/Resources<</ProcSet[/PDF]\n/ExtGState 8 0 R\n>>\n/Contents 5 0 R\n>>\nendobj\n3 0 obj\n<< /Type /Pages /Kids [\n4 0 R\n] /Count 1\n>>\nendobj\n1 0 obj\n<</Type /Catalog /Pages 3 0 R\n>>\nendobj\n7 0 obj\n<</Type/ExtGState\n/OPM 1>>endobj\n8 0 obj\n<</R7\n7 0 R>>\nendobj\n2 0 obj\n<</Producer(ESP Ghostscript 815.03)\n/CreationDate(D:20090202085906)\n/ModDate(D:20090202085906)>>endobj\nxref\n0 9\n0000000000 65535 f \n0000000632 00000 n \n0000000750 00000 n \n0000000573 00000 n \n0000000443 00000 n \n0000000015 00000 n \n0000000424 00000 n \n0000000680 00000 n \n0000000721 00000 n \ntrailer\n<< /Size 9 /Root 1 0 R /Info 2 0 R\n/ID [(RT~TfX1)(RT~TfX1)]\n>>\nstartxref\n861\n%%EOF\n", |
| "domain-external-staggered.pdf": "%PDF-1.3\n%\uc3e2\n5 0 obj\n<</Length 6 0 R/Filter /FlateDecode>>\nstream\nx\u07541r0\fD{u\n H8A8G$\u000b\u0017\u000b_?7\u0017\b_h\"\u0016>)\u03458[d=5j\u001fkzO?{M*I-\u0014q,*l\u0014e\u247d*\nVG\u001a\u00e8\u0001aN8QclbL-\u00e0\u0017.\u001c\u0013P\u001f\t\u0011b\u0005B/;\u0111^\u04afdjAA6\u001d*k\u0013\u0012Q\u07ad\u01c8v{l(+\u0018\f\u0010\u001c\u00136\u001a\"@\u000eVsf\u0007\u0005;\u0006)sD\u0011IxAY`\u0010\u05c4\bP\"rC\u001c\u03f7Jvn\u001c\u92b6@\u0369\u0115\u0336\u0458,N|c\u001e\u001e\n\u0001Vw^\u00175\u007fXp#jT\u001adNcK;y\\#R\u000bu\u000f:\u0006D*P\b\u062f\u054d\u0530\\\u000f%\u0012/;$~Eszo<\udb83\udc9d`~*t6endstream\nendobj\n6 0 obj\n401\nendobj\n4 0 obj\n<</Type/Page/MediaBox [0 0 193 87]\n/Parent 3 0 R\n/Resources<</ProcSet[/PDF]\n/ExtGState 8 0 R\n>>\n/Contents 5 0 R\n>>\nendobj\n3 0 obj\n<< /Type /Pages /Kids [\n4 0 R\n] /Count 1\n>>\nendobj\n1 0 obj\n<</Type /Catalog /Pages 3 0 R\n>>\nendobj\n7 0 obj\n<</Type/ExtGState\n/OPM 1>>endobj\n8 0 obj\n<</R7\n7 0 R>>\nendobj\n2 0 obj\n<</Producer(ESP Ghostscript 815.03)\n/CreationDate(D:20090202085905)\n/ModDate(D:20090202085905)>>endobj\nxref\n0 9\n0000000000 65535 f \n0000000694 00000 n \n0000000812 00000 n \n0000000635 00000 n \n0000000505 00000 n \n0000000015 00000 n \n0000000486 00000 n \n0000000742 00000 n \n0000000783 00000 n \ntrailer\n<< /Size 9 /Root 1 0 R /Info 2 0 R\n/ID [(\u0580Z!\u0002G\tr!\u000fq)(\u0580Z!\u0002G\tr!\u000fq)]\n>>\nstartxref\n923\n%%EOF\n", |
| "domain-external-shiftout.fig": "#FIG 3.2\nLandscape\nCenter\nMetric\nA4 \n100.00\nSingle\n-2\n1200 2\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 1800 1125 113 113 1800 1125 1913 1125\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 1350 1125 113 113 1350 1125 1463 1125\n1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 450 1125 113 113 450 1125 563 1125\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 2250 1125 113 113 2250 1125 2363 1125\n1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 900 1125 113 113 900 1125 1013 1125\n1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 2700 1125 113 113 2700 1125 2813 1125\n2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5\n\t 1350 450 3600 450 3600 1800 1350 1800 1350 450\n", |
| "domain-external-shiftout.pdf": "%PDF-1.3\n%\uc3e2\n5 0 obj\n<</Length 6 0 R/Filter /FlateDecode>>\nstream\nx\u07541 \f{NABAHBp\u001c_IE\"\u000f%\bM\u001bxzX;\u0017\\\u038f=E\u0120\u007f\tt/_\u0018\ncTD[(4\b\nk\u001e\u0001\u038d\u0010Q\u001btl^\u001ew\u0005)\u0745.\u00021{\n\u0006W\u00145n @\bG\bC\u0013H?\u04f7s\\lWhZ=zc\u0002jZa(\u0012u>zlz\n\u0142\u0007\u000e\u000b#\u0012\tq\u0015Z\\|\u0002\u0002O\u001b\"H\u0001\u0017\u001eTUg\u7285s\bo\u001d\u0016Gp%B\u0013H?>}Ta8v4S\u0002\u0000\u0015\u0336\u0010H\u0003pcr5uSHm\u001b_+,;<\bn.&k\u0015OFc@x%$\u0003F\u066e\u0011\u0005d\u0004w\u001db\u000blv]$&#b]c(\u0001\u0018#K\f\u0019O]\u0011Y\u0018k\u0005fm\f]q\u001bsw\"\n\u0006\tn,^tE=K?\u78af?c_endstream\nendobj\n6 0 obj\n452\nendobj\n4 0 obj\n<</Type/Page/MediaBox [0 0 207 87]\n/Parent 3 0 R\n/Resources<</ProcSet[/PDF]\n/ExtGState 8 0 R\n>>\n/Contents 5 0 R\n>>\nendobj\n3 0 obj\n<< /Type /Pages /Kids [\n4 0 R\n] /Count 1\n>>\nendobj\n1 0 obj\n<</Type /Catalog /Pages 3 0 R\n>>\nendobj\n7 0 obj\n<</Type/ExtGState\n/OPM 1>>endobj\n8 0 obj\n<</R7\n7 0 R>>\nendobj\n2 0 obj\n<</Producer(ESP Ghostscript 815.03)\n/CreationDate(D:20090202085906)\n/ModDate(D:20090202085906)>>endobj\nxref\n0 9\n0000000000 65535 f \n0000000745 00000 n \n0000000863 00000 n \n0000000686 00000 n \n0000000556 00000 n \n0000000015 00000 n \n0000000537 00000 n \n0000000793 00000 n \n0000000834 00000 n \ntrailer\n<< /Size 9 /Root 1 0 R /Info 2 0 R\n/ID [(5\u001d+??\u056b1.)(5\u001d+??\u056b1.)]\n>>\nstartxref\n974\n%%EOF\n", |
| "domain-internal.pdf": "%PDF-1.3\n%\uc3e2\n5 0 obj\n<</Length 6 0 R/Filter /FlateDecode>>\nstream\nx\u07541N\u00041\fE\"5IN@r\u0011,\u0014\u0014@,h\"W\u066fc\u001aynR'\u0014dG\u0749PYwE2jtEP*5Z\u0139G1&nJQm\u000bZw\u0016\\\u0019\b\u0003\u001d0\u0006'L\u0000(<\n\u0011\u001e^B\uf54a!\u0018\u0014uSf (\u05faf\u03437U\u253d\u001d\u001a\u0004\u00011aE\u0003\u0000t85pqoP\u01ecR#\u0018Yb\u000f)\u04bc\u001d\u001a\u0284eNX\u0000\u01619\u0016\u001e5X\\DZo\u0012\n\u06247\u889d\u000eoRr\u001e=FQ 4\u00008&h@\u001c\u2db4;M6W:f.\\)K~/=?\n\u000ecendstream\nendobj\n6 0 obj\n340\nendobj\n4 0 obj\n<</Type/Page/MediaBox [0 0 151 87]\n/Parent 3 0 R\n/Resources<</ProcSet[/PDF]\n/ExtGState 8 0 R\n>>\n/Contents 5 0 R\n>>\nendobj\n3 0 obj\n<< /Type /Pages /Kids [\n4 0 R\n] /Count 1\n>>\nendobj\n1 0 obj\n<</Type /Catalog /Pages 3 0 R\n>>\nendobj\n7 0 obj\n<</Type/ExtGState\n/OPM 1>>endobj\n8 0 obj\n<</R7\n7 0 R>>\nendobj\n2 0 obj\n<</Producer(ESP Ghostscript 815.03)\n/CreationDate(D:20090202085906)\n/ModDate(D:20090202085906)>>endobj\nxref\n0 9\n0000000000 65535 f \n0000000633 00000 n \n0000000751 00000 n \n0000000574 00000 n \n0000000444 00000 n \n0000000015 00000 n \n0000000425 00000 n \n0000000681 00000 n \n0000000722 00000 n \ntrailer\n<< /Size 9 /Root 1 0 R /Info 2 0 R\n/ID [(\u0004\u001bJ6\u0262$U\u0711i\u0012\u028e'S)(\u0004\u001bJ6\u0262$U\u0711i\u0012\u028e'S)]\n>>\nstartxref\n862\n%%EOF\n", |
| "documentation.tex": "% *======================================================================*\n% Cactus Thorn template for ThornGuide documentation\n% Author: Ian Kelley\n% Date: Sun Jun 02, 2002\n% $Header$ \n% Thorn documentation in the latex file doc/documentation.tex \n% will be included in ThornGuides built with the Cactus make system.\n% The scripts employed by the make system automatically include \n% pages about variables, parameters and scheduling parsed from the \n% relevent thorn CCL files.\n% \n% This template contains guidelines which help to assure that your \n% documentation will be correctly added to ThornGuides. More \n% information is available in the Cactus UsersGuide.\n% \n% Guidelines:\n% - Do not change anything before the line\n% % BEGIN CACTUS THORNGUIDE\",\n% except for filling in the title, author, date etc. fields.\n% - Each of these fields should only be on ONE line.\n% - Author names should be sparated with a \\\\ or a comma\n% - You can define your own macros are OK, but they must appear after\n% the BEGIN CACTUS THORNGUIDE line, and must not redefine standard \n% latex commands.\n% - To avoid name clashes with other thorns, 'labels', 'citations', \n% 'references', and 'image' names should conform to the following \n% convention: \n% ARRANGEMENT_THORN_LABEL\n% For example, an image wave.eps in the arrangement CactusWave and \n% thorn WaveToyC should be renamed to CactusWave_WaveToyC_wave.eps\n% - Graphics should only be included using the graphix package. \n% More specifically, with the \"includegraphics\" command. Do\n% not specify any graphic file extensions in your .tex file. This \n% will allow us (later) to create a PDF version of the ThornGuide\n% via pdflatex. |\n% - References should be included with the latex \"bibitem\" command. \n% - use \\begin{abstract}...\\end{abstract} instead of \\abstract{...}\n% - For the benefit of our Perl scripts, and for future extensions, \n% please use simple latex. \n%\n% *======================================================================* \n% \n% Example of including a graphic image:\n% \\begin{figure}[ht]\n% \t\\begin{center}\n% \t \\includegraphics[width=6cm]{MyArrangement_MyThorn_MyFigure}\n% \t\\end{center}\n% \t\\caption{Illustration of this and that}\n% \t\\label{MyArrangement_MyThorn_MyLabel}\n% \\end{figure}\n%\n% Example of using a label:\n% \\label{MyArrangement_MyThorn_MyLabel}\n%\n% Example of a citation:\n% \\cite{MyArrangement_MyThorn_Author99}\n%\n% Example of including a reference\n% \\bibitem{MyArrangement_MyThorn_Author99}\n% {J. Author, {\\em The Title of the Book, Journal, or periodical}, 1 (1999), \n% 1--16. {\\tt http://www.nowhere.com/}}\n%\n% *======================================================================* \n\n% If you are using CVS use this line to give version information\n% $Header$\n\n\\documentclass{article}\n\n% Use the Cactus ThornGuide style file\n% (Automatically used from Cactus distribution, if you have a \n% thorn without the Cactus Flesh download this from the Cactus\n% homepage at www.cactuscode.org)\n\\usepackage{../../../../doc/latex/cactus}\n\n\\begin{document}\n\n% The author of the documentation\n\\author{Cactus Maintainers \\textless\\code{cactusmaint@cactuscode.org}\\textgreater}\n\n% The title of the document (not necessarily the name of the Thorn)\n\\title{Coordinate Base Thorn}\n\n% the date your document was last changed:\n\\date{$ $Date$ $}\n\n\\maketitle\n\n% Do not delete next line\n% START CACTUS THORNGUIDE\n\n% Add all definitions used in this documentation here:\n\\def\\WRAGH{CCTK\\_WRAGH}\n\\def\\beforetable{\\\\[1mm]}\n\n\\hyphenation{Coord}\n\n% Add an abstract for this thorn's documentation\n\\begin{abstract}\nCoordBase provides a mechanism for registering coordinate systems, and\nmaintaining a database of coordinate systems and their coordinates,\nusing key-value tables.\n\nCoordBase also provides a way for specifying the extent of the\nsimulation domain that is independent of the actual coordinate and\nsymmetry thorns, and for specifying the discretisation of the boundary\nthat is independent of the actual boundary thorns.\n\\end{abstract}\n\n\n\\section{Introduction}\n\nMany applications which use Cactus will want to make use of coordinate\nsystems. The CoordBase thorn provides a method of registering\ncoordinate systems and their properties. Thorns which implement\ncoordinate systems will register the systems they provide with\nCoordBase. Since coordinate systems are composed of a collection of\ncoordinates, the coordinates which comprise the systems are registered\nwith CoordBase as well. The data describing coordinate systems are\nheld on Cactus key-value tables. A schema for the format of these\ntables is provided in section\n\\ref{CactusBase_CoordBase_coordinate_schema}. Developers are free to\ncompose and use their own schema, but are encouraged to use the one\ndetailed here, as this will be the standard for all of the core Cactus\nthorns.\n\nCoordBase specifies an extensible set of coordinate properties. The\nuse of key-value tables to hold these properties makes CoordBase\nflexible and configurable. The coordinate values themselves can be\nspecified in a number of ways, depending on the nature of the\ncoordinate system. This way symmetries of the coordinates on the\ncomputational grid can be exploited to minimize memory consumption.\nVia a function call, one can easily ascertain what coordinate system is\nassociated with any given grid variable, which is convenient for e.g.\\\nI/O. A method of registering default coordinates for all grid\nvariables of a certain dimension makes it simple to specify which\ncoordinate systems should be associated with which grid variables.\n\nThe coordinate infrastructure provided by CoordBase will work\nseamlessly with AMR and multi-model codes.\n\n%extensible database of coordinate systems, coordinates, and their\n%properties\n\nThorns which provide coordinates will inherit from CoordBase, and\nregister both the coordinate systems they provide, and the default\ncoordinate systems for the appropriate dimension of grid variables.\nIn addition, one can associate a coordinate with any Cactus grid\nvariable, within a thorn's interface.ccl.\nCoordinate systems specified in the interface.ccl override defaults\nfor the dimension.\n\nThe coordinate functions in the Cactus flesh are deprecated with the\nintroduction of this thorn. Please use the functions provided here in\npreference to those in the flesh.\n\n\n\\section{Coordinate system symmetries}\n\nSince computations performed with Cactus are done on a discrete\nlattice, only a discrete set of coordinate values are used for any\ncoordinate system. The symmetries of how the coordinate values vary\non the grid points make coordinates fall into three types:\n\\emph{uniform}, \\emph{nonuniform}, and \\emph{warped}. (At least these\nare the three cases that the CoordBase schema considers.) A uniform\ncoordinate varies from each of its neighbors by a constant. i.e.\\ its\nvalue can be determined from the index of the grid point from simply\nan origin and constant `delta'. A nonuniform coordinate has a\nspatially varying `delta'. For both uniform and nonuniform\ncoordinates, the coordinate values do not vary along the other\ndirections of the grid. (e.g.\\ the $x$ coordinate will be the same\nregardless of the `j' index of the grid point.) Thus one could\ncompletely determine the coordinate values of a 3D system of\nnonuniform coordinates by providing three 1D arrays. This later\nassumption is relaxed for a warped coordinate; a warped coordinate\nwill vary across the entire grid. Recall that `coordinate lines'\n(lines of constant coordinate value) cannot cross (because one n-tuple\nof coordinate values would specify muliple points in space), so this\nplaces a `bound' of sorts on the possible `warping' of the\ncoordinates.\n\nThe type of a coordinate system will be the same as that of its\ncoordinates. If there are different types of coordinates within the\nsame system, then the coordinate system is \\emph{mixed}. Note that a\nwarped coordinate system is the most general possible, so any\ncoordinate system could be regarded as warped if one wishes.\n\n\\subsection{Specifying coordinate values}\n\nAs mentioned above, for a uniform coordinate system, it is sufficient\nto specify the origin and spacing for a uniform coordinate. One may\nalso specify a grid variable to hold the coordinate values, if\ndesired. See section \\ref{CactusBase_CoordBase_coordinate_schema}. A\nnonuniform coordinate can be specified with a 1D grid variable, if\ndesired, or an nD variable. A warped coordinate system will always\nneed a nD grid variable. FMR and AMR will need an nD grid\nvariable to specify the coordinate values. A mixed coordinate system\ncan use some combination of the above, or simply an nD grid variable.\n\n\n\\section{Coordinate Thorns}\n\nGenerally coordinate thorns will allow the declaration of default\ncoordinate systems for a dimension to be controled by parameters.\n\nIf a thorn attempts to register a default for a dimension which\nalready has a default registered, a level 1 warning will result, and\nthe default will be overwritten with the new default. Since the order\nof execution of the registration calls will in general not be\nspecified, one must be careful when activating more than one coordinate thorn.\n\nCoordinate systems and defaults can be changed at any time throughout\na run, as can coordinate properties.\nIn general these are set at \\WRAGH\\ and CCTK\\_BASEGRID, respectively.\n\nThe coordinate thorns are responsible for filling out the portions of\nthe coordinate and coordinate system tables that are not written by\nthe registration routines. See sections\n\\ref{CactusBase_CoordBase_system_tables} and\n\\ref{CactusBase_CoordBase_coord_tables}.\n\n\\section{Application thorns}\n\nApplication thorns should check at CCTK\\_PARAMCHECK to see if the correct\ncoordinate system is being used for each relevant grid variable.\nWhile the old flesh API is still being used you may want to make this\nmerely a warning.\nUse Coord\\_GroupSystem() to find the coordinate system for groups (see\nsection \\ref{CactusBase_CoordBase_APIs}).\n\n\n\\section{Coordinate APIs}\n\\label{CactusBase_CoordBase_APIs}\n\n\\begin{verbatim}\nCCTK_INT systemhandle = Coord_SystemRegister(CCTK_POINTER_TO_CONST GH,\n CCTK_INT dim, \n CCTK_STRING systemname)\n\\end{verbatim}\nregisters a coordinate system, along with its\ndimension, with the CoordBase thorn. This will create a coordinate\nsystem table, and return the handle of the table for success, or a\nnegative error code upon error. The possible errors are:\\beforetable\n\\begin{tabular}{ll}\nCOORDERROR\\_INVALIDDIM & invalid dimension passed in\\\\\nCOORDERROR\\_INVALIDNAME & invalid name passed in\\\\\nCOORDERROR\\_TABLEERROR & error from key-value or hash tables in flesh\\\\\nCOORDERROR\\_SYSTEMEXISTS & coordinate system of this name already exists\\\\\n\\end{tabular}\n\\\\These error codes are defined in CoordBase.h. CoordBase holds the\ntable handles on a GH extension, under the name ``CoordBase''.\n\n\\begin{verbatim}\nCCTK_INT systemhandle = Coord_SystemHandle(CCTK_POINTER_TO_CONST GH,\n CCTK_STRING systemname)\n\\end{verbatim}\nreturns the handle for a given coordinate system, or \nnegative on error:\\beforetable\n\\begin{tabular}{ll}\n COORDERROR\\_TABLEERROR & error from hash table\\\\\n COORDERROR\\_NOSYSTEM & no coordinate system of this name is registered\\\\\n\\end{tabular}\n\n\\begin{verbatim}\nCCTK_INT coordhandle = Coord_CoordRegister(CCTK_POINTER_TO_CONST GH, \n CCTK_INT systemhandle, \n CCTK_INT direction,\n CCTK_STRING coordname)\n\\end{verbatim}\nregisters a coordinate within a coordinate system, in the specified\n`direction'. (Direction in this context means the index in the\ncoordinate basis, which ranges from 1 to the dimension of the system.)\nCoord\\_CoordRegister() returns the coordinate handle, or negative for an \nerror:\\beforetable\n\\begin{tabular}{ll}\nCOORDERROR\\_INVALIDDIM & invalid `direction'\\\\\nCOORDERROR\\_INVALIDHANDLE & invalid handle passed in / coordinate system\n does not exist\\\\\nCOORDERROR\\_TABLEERROR & error from hash or key-value tables in flesh\\\\\nCOORDERROR\\_COORDINATEEXISTS & coordinate already exists for this `direction'\\\\\nCOORDERROR\\_DUPLICATENAME & coordinate of this name already exists in this\n system\\\\\n\\end{tabular}\n\n\\begin{verbatim}\nCCTK_INT coordhandle = Coord_CoordHandle(CCTK_POINTER_TO_CONST GH,\n CCTK_STRING coordname,\n CCTK_STRING systemname)\n\\end{verbatim}\nreturns the coordinate handle for a given coordinatate in a coordinate system,\nor negative on error:\\beforetable\n\\begin{tabular}{ll}\nCOORDERROR\\_NOSYSTEM & no coordinate system of this name is registered\\\\\nCOORDERROR\\_TABLEERROR & error from hash table\\\\\nCOORDERROR\\_NOSUCHCOORD & no coordinate of the name is registered for this \n system\\\\\n\\end{tabular}\n\n\\begin{verbatim}\nint systemhandle = Coord_GroupSystem(const cGH *GH, \n const char *groupname)\n\\end{verbatim}\nreturns the handle for the coordinate system associated with a group of grid \nvariables, or negative on error.\nThis can either be the default for coordinate systems of this\ndimension, or the coordinate system that is specified in the\ninterface.ccl. Coordinate systems specified in interface.ccl will\noverride any defaults. The possible error codes are:\\beforetable\n\\begin{tabular}{ll}\nCOORDERROR\\_INVALIDGROUPNAME & no such group exists\\\\\nCOORDERROR\\_NOCOORDSYS & no coordinate system is associated with the\n group\n\\end{tabular}\n\n\\begin{verbatim}\nCCTK_INT systemhandle = Coord_SetDefaultSystem(CCTK_POINTER_TO_CONST GH,\n CCTK_STRING systemname)\n\\end{verbatim}\nsets this coordinate system to be the default for grid variables of\nthe same dimension. It returns the handle of the system, or negative\nfor errors:\\beforetable\n\\begin{tabular}{ll}\nCOORDERROR\\_INVALIDNAME & no coordinate system of this name has been \n\t\t\t registered\\\\\nCOORDERROR\\_NODIMENSION & coordinate system does not have a valid dimension\\\\\nCOORDERROR\\_DEFAULTEXISTS & grid variables of this dimension already have a \\\\\n & default coordinate system registered\\\\\n\\end{tabular}\n\\\\There can be a default coordinate system for each grid dimension. The\ndefault system will apply for each grid variable of that dimension,\nunless it is overridden.\n\n\\begin{verbatim}\nCCTK_INT systemhandle = Coord_GetDefaultSystem(CCTK_POINTER_TO_CONST GH,\n CCTK_INT dim)\n\\end{verbatim}\ngets the default coordinate system for grid variables of dimension {\\tt dim}\n(ranging from 1 to the maximum number of dimensions registered).\nIt returns the handle of the system, or negative for errors:\\beforetable\n\\begin{tabular}{ll}\nCOORDERROR\\_INVALIDDIM & given dimension is invalid\\\\\nCOORDERROR\\_NOSYSTEM & given dimension does not have a default coordinate \n system associated\n\\end{tabular}\n\n\n\\section{Coordinate Schema}\n\\label{CactusBase_CoordBase_coordinate_schema}\n\n\\subsection{Coordinate System Tables}\n\\label{CactusBase_CoordBase_system_tables}\n\nAssociated with each coordinate system is a table, which should have the\nfollowing entries:\\beforetable\n\\begin{tabular}{|l|l|l|}\n\\hline\n\\textbf{key} & \\textbf{data type} & \\textbf{value}\\\\\n\\hline\nNAME & CCTK\\_STRING & \\code{Cart3d|Spher3d|....}\\\\\nDIMENSION & CCTK\\_INT & \\code{1,2,3,...}\\\\\nTYPE & CCTK\\_STRING & \\code{uniform|nonuniform|warped|mixed}\\\\\nCOORDINATES & CCTK\\_INT array & \\verb|<coord1>,...<coord_dimension>|\\\\\n\\hline\n\\end{tabular}\n\\\\The values for the coordinates array are the handles for the\ncoordinate tables (see section\n\\ref{CactusBase_CoordBase_coord_tables}). The NAME and DIMENSION\nfields are filled out when Coord\\_SystemRegister() is called. The\nCOORDINATES field is filled out by Coord\\_CoordRegister(). It is left\nfor the coordinate thorn to fill out the TYPE field.\n\n\\subsection{Coordinate Tables}\n\\label{CactusBase_CoordBase_coord_tables}\n\nAssociated with each coordinate of each coordinate system is another\ntable, which should have the following entries:\\beforetable\n\\begin{tabular}{|l|l|l|}\n\\hline\n\\textbf{key} & \\textbf{data type} & \\textbf{values}\\\\\n\\hline\nSYSTEM & CCTK\\_INT & \\verb|<handle>|\\\\\nNAME & CCTK\\_STRING & \\code{x}\\\\\nDIRECTION & CCTK\\_INT & \\code{2}\\\\\nPHYSICALMIN & CCTK\\_INT & \\code{0}\\\\\nCOMPMIN & CCTK\\_REAL & \\\\\nPHYSICALMAX & CCTK\\_INT & \\\\\nCOMPMAX & CCTK\\_REAL & \\\\\nTYPE & CCTK\\_STRING & \\verb/uniform|non-uniform|warped/\\\\\nTIMEDEPENDENT & CCTK\\_INT & \\verb/<yes (1)|no (0)>/\\\\\nDATATYPE & CCTK\\_STRING & \\\\\nGAINDEX & CCTK\\_INT & \\\\\n\\hline\nDELTA\\footnotemark %{only for type=uniform}\n & CCTK\\_REAL & \\code{147.372e16}\\\\\n\\hline\n\\end{tabular}\n\\footnotetext{only for type=\\code{uniform}} \n\\\\\nCoord\\_CoordRegister() fills out the SYSTEM, NAME, and DIRECTION\nfields, and the COORDINATES field of the system table. The remaining\nfields are the responsibility of the coordinate thorn.\n\n% Each of these fields should be explained... \n% Though most are pretty self-explanatory.\n\n\n\\section{Specifying coordinate systems in the interface.ccl}\n\nCoordinate systems associated with grid variable groups can be\nspecified in the group's tags table, using the key \\code{COORDSYSTEM}.\nBelow is a grid array which could represent a vector field on a\n2-sphere.\n\\begin{verbatim}\nCCTK_REAL SphericalVectorField TYPE=ARRAY DIM=2 TAGS='COORDSYSTEM=\"sphere2d\" TENSORTYPE=\"vector\"'\n{\n field_theta, field_phi\n}\n\\end{verbatim}\nEven though another thorn has set a default for all 2D grid variables\nto something else, Coord\\_GroupSystem() will always return the handle\nfor sphere2d when called on this group.\n\n\n\\section{Specifying the extent of the physical domain}\n\\label{CactusBase:CoordBase:domain}\n\nCoordBase provides a way for specifying the extent of the simulation\ndomain that is independent of the actual coordinate and symmetry\nthorns. This is necessary because the size of the physical domain is\nnot necessarily the same as the size of the computational grid, which\nis usually enlarged by symmetry zones and/or boundary zones.\n\nThe physical domain is characterised by the location of its lower and\nupper boundary and by its grid spacing. These quantities are related\nto the extent and the number of grid cells that span the domain. The\nrelation between the size of the domain and the size of the\ncomputational grid is defined in section\n{\\ref{CactusBase:CoordBase:domain}} below. The domain extent as\ndefined in this section is the continuum extent and is independent of\nthe actual discretisation. This makes it possible to adapt the same\ndomain specification for different resolutions by changing only a\nsingle parameter.\n\nThe domain is specified in one of the following ways, which is\nselected by the keyword parameter {\\texttt{domainsize}}:\n\\begin{description}\n\\item[{\\texttt{minmax}}:]\nby the location of its lower and upper boundary\n\\item[{\\texttt{extent}}:]\nby its extent, i.e.\\ its width\n\\item[{\\texttt{spacing}}:]\nby grid spacing and the number of grid cells\n\\end{description}\nThe domain specification uses the number of grid cells instead of the\nnumber of grid points because the latter can easily lead to one-off\nerrors.\n\nThe domain size in each dimension is specificied in equivalent ways.\nFor example, the $x$-dimension is specified by a set of some of the\nfollowing parameters:\n\\begin{description}\n\\item[{\\texttt{zero\\_origin\\_x}} (boolean):]\nWhen the domain size is specified by extent or by spacing, then the\norigin (lower boundary) can either be located at $x=0$, which leads to\nthe domain $x \\in [0,L]$ with the extent $L$, or the domain can be\nsymmetric with respect to $x=0$, which leads to $x \\in [-L/2,L/2]$.\n\\item[{\\texttt{xmin}} and {\\texttt{xmax}}:]\nWhen the domain is specified by the location of its lower and upper\nboundary, then these specify the locations.\n\\item[{\\texttt{xextent}}:]\nWhen the domain is specified by its extent, then this specifies the\nextent.\n\\item[{\\texttt{dx}} (real) and {\\texttt{ncells\\_x}} (int):]\nWhen the domain is specified by grid spacing and the number of grid\ncells, then these specify the grid spacing and the number of grid\ncells.\n\\end{description}\n\n\n\\section{Specifying the location of the boundary points}\n\\label{CactusBase:CoordBase:boundary}\n\nCoordBase also provides a way for specifying the discretisation of the\nboundary that is independent of the actual boundary thorns. This\ndefines the locations of the boundary points and thus the extent of\nthe computational grid.\n\nEach face of the grid is specified independently. The specification\ndoes not depend on the resolution, so that it need not be adapted when\nthe resolution is changed. Figure\n{\\ref{CactusBase:CoordBase:fig-domain}} shows a domain with several\ninterior grid points and one boundary point.\n\n\\begin{figure}\n\\begin{center}\n\\includegraphics[scale=0.75]{domain}\n\\end{center}\n\\caption{A domain (rectangle) with three interior points (empty\ncircles) and one boundary point (full circle).}\n\\label{CactusBase:CoordBase:fig-domain}\n\\end{figure}\n\nWhile the physical boundary has a width of zero, the computational\ngrid can have more than one boundary points. This {\\emph{boundary\nsize}} is defined by the integer parameter\n{\\texttt{boundary\\_size\\_x\\_lower}} for the lower $x$ boundary (and\nsimilarly for the other boundaries). Figure\n{\\ref{CactusBase:CoordBase:fig-domain-external}} shows an example\nwhere there are two boundary points. When it is necessary to increase\nthe number of boundary points (e.g., to accommodate a larger stencil),\nthen this is the only parameter that needs to be changed.\n\n\\begin{figure}\n\\begin{center}\n\\includegraphics[scale=0.75]{domain-external}\n\\end{center}\n\\caption{A domain (rectangle) with three interior points (empty\ncircles) and two boundary points (full circles). This is an exterior\nboundary, i.e.\\ the boundary points are located outside of the\nphysical domain.}\n\\label{CactusBase:CoordBase:fig-domain-external}\n\\end{figure}\n\nDepending on the physical setup --- and depending on the personal\ntaste --- the boundary points should be located either inside or\noutside of the physical boundary. The boolean parameter\n{\\texttt{boundary\\_internal\\_x\\_lower}} specifies whether the boundary\npoints extend inwards at the lower $x$ face. Figure\n{\\ref{CactusBase:CoordBase:fig-domain-internal}} shows the same\nexample, but with internal boundary points.\n\n\\begin{figure}\n\\begin{center}\n\\includegraphics[scale=0.75]{domain-internal}\n\\end{center}\n\\caption{A domain (rectangle) with two interior points (empty circles)\nand two boundary points (full circles). This is an interior boundary,\ni.e.\\ the boundary points are located inside of the physical domain.}\n\\label{CactusBase:CoordBase:fig-domain-internal}\n\\end{figure}\n\nDepending on the physical setup --- and depending on the personal\ntaste --- the boundary points should either be staggered about the\nphysical boundary, or the last boundary point should be located\nexactly on the physical boundary. This is specified by the boolean\nparameter {\\texttt{boundary\\_staggered\\_x\\_lower}}. Figures\n{\\ref{CactusBase:CoordBase:fig-domain-external-staggered}} and\n{\\ref{CactusBase:CoordBase:fig-domain-internal-staggered}} show\nexampled of external and internal staggered boundary points.\n\n\\begin{figure}\n\\begin{center}\n\\includegraphics[scale=0.75]{domain-external-staggered}\n\\end{center}\n\\caption{A domain (rectangle) with three interior points (empty circles)\nand two boundary points (full circles) which are staggered about the\nphysical boundary. (This is an exterior boundary.)}\n\\label{CactusBase:CoordBase:fig-domain-external-staggered}\n\\end{figure}\n\n\\begin{figure}\n\\begin{center}\n\\includegraphics[scale=0.75]{domain-internal-staggered}\n\\end{center}\n\\caption{A domain (rectangle) with two interior points (empty circles)\nand two boundary points (full circles) which are staggered about the\nphysical boundary. (This is an interior boundary.)}\n\\label{CactusBase:CoordBase:fig-domain-internal-staggered}\n\\end{figure}\n\nFinally, the integer parameter {\\texttt{boundary\\_shiftout\\_x\\_lower}}\ncan be used to shift the boundary points outwards (or inwards with\nnegative values) by multiples of the grid spacing. Figure\n{\\ref{CactusBase:CoordBase:fig-domain-external-shiftout}} shows an\nexample of an exterior, non-staggered boundary with a shiftout of one.\n\n\\begin{figure}\n\\begin{center}\n\\includegraphics[scale=0.75]{domain-external-shiftout}\n\\end{center}\n\\caption{A domain (rectangle) with four interior points (empty circles)\nand two boundary points (full circles) which are shifted outwards by\none grid point. (This is an exterior, non-staggered boundary.)}\n\\label{CactusBase:CoordBase:fig-domain-external-shiftout}\n\\end{figure}\n\nThe following table gives examples for common situations:\n\n\\begin{tabular}{l|ccc|l}\nBoundary condition & internal? & staggered? & shiftout & example \\\\\\hline\nreflection symmetry, not staggered & no & no & 1\n & figure {\\ref{CactusBase:CoordBase:fig-domain-external-shiftout}} \\\\\nreflection symmetry, staggered & no & yes & 0\n & figure {\\ref{CactusBase:CoordBase:fig-domain-external-staggered}} \\\\\nperiodicity, closed boundary & no & no & 1\n & figure {\\ref{CactusBase:CoordBase:fig-domain-external-shiftout}} \\\\\nperiodicity, open boundary & no & no & 0\n & figure {\\ref{CactusBase:CoordBase:fig-domain-external}} \\\\\nperiodicity, staggered boundary & no & yes & 0\n & figure {\\ref{CactusBase:CoordBase:fig-domain-external-staggered}}\n\\end{tabular}\n\nFor other boundary conditions such as Dirichlet or Robin, one can\nchoose these parameters freely.\n\n\\section{Querying about boundary points}\n\\label{CactusBase:CoordBase:boundary-query}\n\nWhen iterating over grid points, one usually needs to know about the\nboundary sizes and boundary types present. One convenient way is\nprovided by the aliased function \\texttt{GetBoundarySizesAndTypes}:\n\\begin{verbatim}\nCCTK_INT FUNCTION GetBoundarySizesAndTypes\n (CCTK_POINTER_TO_CONST IN cctkGH,\n CCTK_INT IN size,\n CCTK_INT OUT ARRAY bndsize,\n CCTK_INT OUT ARRAY is_ghostbnd,\n CCTK_INT OUT ARRAY is_symbnd,\n CCTK_INT OUT ARRAY is_physbnd)\n\\end{verbatim}\nThe input argument \\texttt{size} describes the size of the four output\narrays as allocated by the caller, and should be \\texttt{2*cctk\\_dim}.\nThe output of this routine describes, for each of the faces of the\ndomain:\n\\begin{description}\n\\item[\\texttt{bndsize}] The number of boundary points\n\\item[\\texttt{is\\_ghostbnd}] Whether this face is a ghost\n (inter-process) boundary\n\\item[\\texttt{is\\_symbnd}] Whether this face is a symmetry boundary\n\\item[\\texttt{is\\_physbnd}] Whether this face is a physical boundary\n\\end{description}\n\n\\section{Driver Issues}\n\nWhen using the CoordBase domain and boundary parameters, the driver\n(PUGH, Carpet, etc) also needs to be kept informed.\n\nWhichever driver you're using, if you're specifying the number of boundary\nzones using CoordBase, note that this does \\textbf{not} automatically\ncarry over to the \\verb|driver::ghost_size_x|, \\verb|driver::ghost_size_y|,\nand \\verb|driver::ghost_size_z| parameters. If you want the ghost sizes\nto be anything other than their defaults (currently~$1$), you need to set\nthem explicitly.\n\n\\subsection{PUGH}\n\nIf you're using PUGH, you \\textbf{must} still explicitly set the\nparameters \\verb|driver::global_nx|, \\verb|driver::global_ny|,\nand \\verb|driver::global_nz|. If you don't set these parameters,\nPUGH will assume a default $10 \\times 10 \\times 10$~grid, which is\nalmost certainly not what you want!\n\n\\subsection{Carpet}\n\nIf you're using Carpet, things are nice: just set\n\\begin{verbatim}\nCarpet::domain_from_coordbase = true\n\\end{verbatim}\nand Carpet will get all its grid information from CoordBase.\n\n% Do not delete next line\n% END CACTUS THORNGUIDE\n\n\\end{document}\n" |
| } |
| } |