summaryrefslogtreecommitdiff
path: root/src/main/Groups.c
Commit message (Collapse)AuthorAge
* use lrint and casts to avoid compiler warnings about type conversionrhaas2013-07-04
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@5030 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Make data parameter of expression evaluation functions consthinder2012-11-30
| | | | | | data is a pointer to user-supplied data used for evaluating the expression. It should not be modified by the evaluation. Note that this modifies the flesh API to the (undocumented) thorn-visible function Util_ExpressionEvaluate. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4922 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Introduce cctk_ash, retire cctk_lssheschnett2012-07-04
| | | | | | | | | | | | Introduce cctk_ash, describing the process-local array shape that has been allocated. This may be larger than cctk_lsh, the process-local shape that should be used. Retire cctk_lssh and related infrastructure to handle staggered grid functions. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4841 17b73243-c579-4c4c-a9d2-2d5706c11dac
* detect error in dimension size settings of grid arrays, and produce a ↵knarf2010-10-27
| | | | | | meaningful error message git-svn-id: http://svn.cactuscode.org/flesh/trunk@4644 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add a new function CCTK_MaxGFDim to the flesh which returns theschnetter2008-04-07
| | | | | | | | | | | | | | | | | (maximum) dimension of all grid functions. Cactus can currently not handle the case where one uses grid arrays of dimension D while grid functions have a dimension less than D. During initialisation, Cactus sets cctk_dim to the largest dimension of all grid variables in all active thorns. This is arguably wrong; cctk_dim should be set to the (maximum) dimension of the grid functions. This patch adds a new function CCTK_MaxGFDim to the flesh which returns the (maximum) dimension of all grid functions. This function is used to set cctk_dim. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4476 17b73243-c579-4c4c-a9d2-2d5706c11dac
* bugfix for CCTK_TraverseString(): do not overwrite a previously set error codetradke2008-02-29
| | | | | | | while continuing to parse following tokens git-svn-id: http://svn.cactuscode.org/flesh/trunk@4464 17b73243-c579-4c4c-a9d2-2d5706c11dac
* slightly clarify wording in GRDOC comments forjthorn2006-05-14
| | | | | | | | | | | CCTK_GroupTagsTable() CCTK_GroupTagsTableI() (this change is *only* to comment wording -- there's no change to executable code) git-svn-id: http://svn.cactuscode.org/flesh/trunk@4298 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Undo changes that prevent more unwanted warnings about unused variables.schnetter2005-09-28
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4155 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Introduce macros CCTK_DECLARE and CCTK_DECLARE_INIT which declare orschnetter2005-09-26
| | | | | | | | | | | | | | declare and initialise local variables. They also add the necessary magic to prevent compiler warnings about unused variables. If the compiler supports __attribute__((unused)), then use this. Otherwise, use the existing fallback of taking the variable's address. In Fortran, use the variable's kind as fallback. Use these macros in autogenerated code and in "cctk.h". git-svn-id: http://svn.cactuscode.org/flesh/trunk@4146 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add Cactus variable type CCTK_POINTER_TO_CONSTschnetter2005-08-25
| | | | | | | | | | Complete the implementation of the Cactus variable type CCTK_POINTER_TO_CONST. Define a constant CCTK_VARIABLE_POINTER_TO_CONST. Handle this variable when asking for its name and its size. Allow values of this type in tables. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4113 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Do not emit an error message "invalid group/variable name" fromschnetter2005-05-21
| | | | | | | | | | CCTK_TraverseString if a name is a valid group name, but the group has zero variables. Instead, do nothing in this case, which is correct, because the callback function should be called for each variable in the group. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4057 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Make CCTK_BYTE and CCTK_CHAR be distinct types. CCTK_BYTE is for gridschnetter2005-01-29
| | | | | | | | | | | | variables, and CCTK_CHAR (like CCTK_STRING) only for other purposes, e.g. tables. * Introduce unique integer constants for them * Add missing conversion functions from and to strings * Add table functions for CCTK_BYTE. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3972 17b73243-c579-4c4c-a9d2-2d5706c11dac
* CCTK_TraverseString() returns error code (-5) if it encounters an invalidtradke2004-06-09
| | | | | | | variable or group name. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3764 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added missing fortran wrapper prototypes.tradke2004-06-04
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3756 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Changed deprecation commentallen2004-05-03
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3686 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fixed CCTKi_GroupLengthAsPointer() to return the length of a single vectortradke2004-04-30
| | | | | | | | | variable for vector groups. This closes Cactus/1664: vector group with multiple elements passes arrays of incorrect size to F90. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3680 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Provide Fortran wrappers for some flesh functions that return a string.schnetter2004-04-12
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3662 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Check malloc return values more carefully: malloc(0)==0 is not anschnetter2004-04-04
| | | | | | | | | | error. CCTKi_Extract: Ensure dimension>=0, and do not access the array when dimension==0. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3644 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Complete list of error codes for CCTK_FirstVarIndexschnetter2004-04-04
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3642 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fixed parsing of vector groups in CCTK_TraverseString().tradke2004-04-01
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3634 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Option strings parsed in CCTK_TraverseString() should now be enclosed in curlytradke2004-03-13
| | | | | | | | | | brackets. A level-1 warning will be issued if the old-style square bracket notation is used. This closes PR CactusBase/1615: "Vector group variable namesclash with I/O options". git-svn-id: http://svn.cactuscode.org/flesh/trunk@3589 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add entry "tagstable" to the cGroup structure.schnetter2004-02-05
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3565 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Allow vector groups of scalars.schnetter2003-11-21
| | | | | | | | | | Allow vector groups with more than one declared variable. Much of this patch consists of removing special case code for scalars. Scalars are now almost everywhere treated as rank 0 arrays. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3465 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Introduce the new Cactus variable type CCTK_INT1.schnetter2003-10-13
| | | | | | | Extend routines to handle the new type. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3431 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Allow vector groups of size 0.schnetter2003-10-07
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3426 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Deprecated CCTK_NumTimeLevels and all variants.allen2003-07-16
| | | | | | | | | | | | | | | | Replaced with new names int CCTK_MaxTimeLevels(const char *group); int CCTK_MaxTimeLevelsVN(const char *var); int CCTK_MaxTimeLevelsVI(int var); int CCTK_MaxTimeLevelsGN(const char *group); int CCTK_MaxTimeLevelsGI(int group); This is because we are adding CCTK_ActiveTimeLevels and also the names make more sense. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3281 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added CCTK_NumTimeLevels and CCTK_NumTimeLevelsIallen2003-06-08
| | | | | | | Fixes Cactus/1309 git-svn-id: http://svn.cactuscode.org/flesh/trunk@3237 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Bugfix in setting size of a vector group, found by Ian Hawke.goodale2003-02-10
| | | | | | | Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@3130 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Putting semicolons at the end of CCTK_FILEVERSIONs.goodale2002-11-12
| | | | | | | Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@3029 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added fortran wrapper for CCTK_FirstVarIndex().tradke2002-11-03
| | | | | | | This closes PR Cactus/1292. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3019 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Removed the definition of the magic 'cctk_one' constant used to build the thorntradke2002-06-21
| | | | | | | | | | | | | | bindings. Added internal routine CCTKi_VarDataPtr() which returns the data pointer for a given variable+timelevel, or NULL if the variable doesn't exist. This routine is regarded internal and should not be used anywhere else but in the thorn bindings. You must also update src/main/Groups.c and lib/sbin/GridFuncStuff.pl now and do a 'make <configuration>-clean; make <configuration>-rebuild;'. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2910 17b73243-c579-4c4c-a9d2-2d5706c11dac
* TAGS tables for groups.goodale2002-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can now do TAGS='foo=... bar=...' in a group definition in your interface.ccl files. The intention is that this can be used to assign tensor types and coordinate systems to gorups. This is implemented as a table, the handle of which you can get by calling CCTK_GroupTagsTable or CCTK_GroupTagsTableI and query using the normal table operators. Note that currently the Util_TableCreateFromString function, which is used to generate the table, doesn't support setting of string members. This will be changed soon. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2845 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Changing FN_POINTERs to FPOINTERsallen2002-04-29
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@2774 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Allow implementation name for fully qualified parameter names when setting ↵goodale2002-04-03
| | | | | | | | | array sizes. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2687 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Removed the old regex stuff in CCTKi_ExtractSize() since Tom's new expressiontradke2001-11-27
| | | | | | | | parser stuff works much better now. This gets rid of gcc warnings about unused local variables. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2472 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Stuff for utility table routines, implemented by Jonathon Thornburg.goodale2001-11-13
| | | | | | | | | Documentation should follow shortly... Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2462 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Updated to use new version of expression parser.goodale2001-11-04
| | | | | | | Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2450 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Don't stop if a variable type isn't know, but give a level 4 warningallen2001-10-26
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@2437 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Using the expression parser for array sizes again now that the memory buggoodale2001-10-25
| | | | | | | | | has been fixed. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2436 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added missing variable initialization in vector group setup.tradke2001-10-23
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@2428 17b73243-c579-4c4c-a9d2-2d5706c11dac
* New function to provide the implementation which provided a groupallen2001-10-23
| | | | | | | | | const char *CCTK_GroupImplementationI(int group) Also reduced warning level to fix Cactus/812 in DecomposeName git-svn-id: http://svn.cactuscode.org/flesh/trunk@2427 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Use the old regex parameter parsing to extract the sizes of variable dims.tradke2001-10-23
| | | | | | | The new expression parser is buggy for cases like '<param>+<constant>'. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2420 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Changed the extraction of array size and vector group length from parametersgoodale2001-10-13
| | | | | | | | | | to use expression parser. This allows any combination of parameters and integer constants combined with +,-,/ and *, with parentheses. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2402 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Preliminary support for 'vector' Grid Variables -goodale2001-10-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | defined as <type> <group_name>[<size>] ... as per a normal 1 variable group except with an extra argument. This creates a vector of GVS, with an extra index (the last one for a GA or GF) corresponding to the element in the vector. For scalars this creates an array similar to a DISTRIB=CONSTANT GA. <size> may be either an integer or an integer-valued parameter. So, fortran sees REAL foo[param] TYPE=GF DIM=3 as CCTK_REAL foo(nx,ny,nz,param) and in C it should be accessed as foo[CCTK_GFINDEX3D(cctkGH,i,j,k)*l] When we have COMPACT groups you will also be able to make the extra index the first one rather than the last one. Please treat this as volatile until it is documented, and let me know if you are using it. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2392 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Include "cctk_GNU.h" which also knows where to include <regex.h> from.tradke2001-09-06
| | | | | | | Thanks Tom. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2343 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Include system header file regex.h only if HAVE_REGEX_H is defined.tradke2001-09-06
| | | | | | | Otherwise take the one from "../gnu/". git-svn-id: http://svn.cactuscode.org/flesh/trunk@2342 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Extended parsing of SIZE option for ARRAY variables.tradke2001-09-03
| | | | | | | | | Now this can be a comma-separated list of positive integer constants or parameter names (optionally with an integer constant added/substracted to/from it). git-svn-id: http://svn.cactuscode.org/flesh/trunk@2327 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fixed parsing of option string in CCTK_TraverseString().tradke2001-07-31
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@2297 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fixed grdoc for CCTK_GroupGhostsizesI().tradke2001-07-02
| | | | | | | This close PR Cactus-731. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2259 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Now CCTK_VarTypeName() knows about CCTK_VARIABLE_COMPLEX8, ↵tradke2001-06-27
| | | | | | CCTK_VARIABLE_COMPLEX16, and CCTK_VARIABLE_COMPLEX32 types also. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2256 17b73243-c579-4c4c-a9d2-2d5706c11dac