summaryrefslogtreecommitdiff
path: root/src/include
Commit message (Collapse)AuthorAge
* This patch makes complex arithmetic in C and C++ more efficient, andschnetter2007-04-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | makes it much more convenient for C++, expecially when templates are used. The flesh functions for complex arithmetic are defined (not only declared) by including Complex.c from the header file cctk_Complex.h. They are declared "static inline", so the the compiler can inline them, but does not have to create an out-of-line copy for every source file. Complex.c is also compiled stand-alone without the "static inline" prefix, so that out-of-line copies exist as well. Add some new complex arithmetic functions, e.g. ComplexNeg to change the sign. Make some complex arithmetic functions more efficient by using algorithms from glibc. These algorithms are LGPL. They should be faster and/or more accurate than the existing implementations. For C++, define the usual arithmetic operators (+-*/ etc.) as inline functions calling the corresponding complex arithmetic functions. This makes it possible to use complex numbers in the same way as real numbers, which makes it possible to instantiate templates for both CCTK_REAL and CCTK_COMPLEX. This leads to much code reduction in Carpet. The patch also appends a type postfix to the names of math functions called in the inlined routines: 'f' for HAVE_CCTK_REAL4, nothing for HAVE_CCTK_REAL8, and 'l' for HAVE_CCTK_REAL16. This avoids compiler warnings about conversions from "double" to "float" which may lose significant bits. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4418 17b73243-c579-4c4c-a9d2-2d5706c11dac
* remove external include guard "#ifndef _CCTK_TYPES_H" aroundjthorn2006-12-21
| | | | | | | | | | | | | | | #include "cctk_Types.h" since this is (a) wrong [the actual symbol is _CCTK_TYPES_H_ (with a trailing underscore)], (b) unnecessary [cctk_Types.h already has an internal include guard, and modern compilers have special-case optimizations for internal include guards so they're just as fast at compile-time as external ones], and (c) inconsistent with the 3 other files in this same directory (cctk_Groups.h, cctk_Misc.h, and util_Table.h) which #include "cctk_Types.h", none of which use an external include guard git-svn-id: http://svn.cactuscode.org/flesh/trunk@4397 17b73243-c579-4c4c-a9d2-2d5706c11dac
* oops, the previous commit lost a file, due to a permissions problemswhite2006-10-26
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4382 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added two new flesh API functions CCTK_ParameterSetNotifyRegister() andtradke2006-09-28
| | | | | | | | | | | | | CCTK_ParameterSetNotifyUnregister() to register/unregister user callback functions for parameter set nofications. See discussion thread http://www.cactuscode.org/old/pipermail/developers/2006-September/005090.html for details. This closes patch Cactus-2057 "add new flesh functions to register/unregister notify callbacks for parameter set operations". git-svn-id: http://svn.cactuscode.org/flesh/trunk@4375 17b73243-c579-4c4c-a9d2-2d5706c11dac
* add another error code for the interpolators:jthorn2006-08-31
| | | | | | | | | | previously specifying a grid spacing of zero caused the interpolator to return a generic "we encountered a NaN/infinity/non-finite" error code now there's a new error code specifically for this case git-svn-id: http://svn.cactuscode.org/flesh/trunk@4368 17b73243-c579-4c4c-a9d2-2d5706c11dac
* += new interpolator error codejthorn2006-08-13
| | | | | | | | CCTK_ERROR_INTERP_COORD_NAN (needed for a bugfix in some other interpolator code) git-svn-id: http://svn.cactuscode.org/flesh/trunk@4362 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add new flesh API functions CCTK_CompileDateTime() and Util_CurrentDateTime()tradke2006-07-28
| | | | | | | | | | | | | to return a date/time stamp following the ISO 8601 standard format if possible (see http://www.cactuscode.org/old/pipermail/developers/2006-July/004971.html). Add the timezone information in the time stamp returned by Util_CurrentTime(). You also need to update lib/make/make.configuration now in order to compile src/datestamp.c. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4358 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Declare and make use of new overloadable CCTK_SyncGroupsByDirI() whichtradke2006-07-06
| | | | | | | | | | | synchronises multiple groups in a single call. This function deprecates the old overloadable function CCTK_SyncGroup(). This patch concludes the discussion thread starting on http://www.cactuscode.org/old/pipermail/developers/2006-June/004933.html. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4348 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Added new command line option '--logdir <dir>' which sets the output directorytradke2006-06-29
| | | | | | | | | | for logfiles created by the \texttt{-r} option. If the directory doesn't exist yet, it will be created by Cactus. This applies patch http://www.cactuscode.org/old/pipermail/developers/2006-June/004901.html. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4337 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add a new command line option to select the buffering mode of stdout.schnetter2006-06-23
| | | | | | | | | | | | | The option is "-b <mode>", or "-buffering=<mode>", where mode can be "no", "line", or "full". This option uses the ANSI C function call setvbuf() to select the corresponding buffering mode. The buffering mode can be selected only once in a portable programme, and it has to be selected before the first output occurs. This means that it has to be implemented in the flesh. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4329 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Application of Frank Löffler's patch of 28.02.06swhite2006-06-15
| | | | | | | | | | | | | reduces FARGUMENTS line length in cctk.h http://www.cactuscode.org/old/pipermail/patches/2006-February/000138.html "Spaces in _CCTK_FARGUMENTS removed to use as less space as possible. This leaves thorn writers more space for their own variables. Space can be a problem because of Fortran standard and/or compiler limitations." git-svn-id: http://svn.cactuscode.org/flesh/trunk@4322 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Applies Erik's patch from 06.03.06swhite2006-05-11
| | | | | | | Define HAVE_CCTK_BYTE etc. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4294 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Applying Erik's patch from 6.10.05swhite2006-05-11
| | | | | | | New command line option to stop after printing the schedule git-svn-id: http://svn.cactuscode.org/flesh/trunk@4293 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Correct 3D stagger codesschnetter2006-04-20
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4284 17b73243-c579-4c4c-a9d2-2d5706c11dac
* According to the standard, the ptrdiff_t type is declared in <stddef.h> (andtradke2006-02-09
| | | | | | | not in <stdlib.h> as used in my previous commit). git-svn-id: http://svn.cactuscode.org/flesh/trunk@4251 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Define the variable cctki_dummy_int (which is used internally in thetradke2006-02-08
| | | | | | | | | | DECLARE_CCTK_ARGUMENTS macro to do pointer arithmetics) of type 'ptrdiff_t' rather than 'int'. This prevents compiler warnings on 64-bit systems where pointer offsets are assumed as long ints. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4250 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fix macro for getting size of staggered array.goodale2005-12-15
| | | | | | | Patch from David Rideout. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4215 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Patch from Erik Schnetter to track the capacity of the list andgoodale2005-12-13
| | | | | | | produce an error if it is exceeded. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4210 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Define macros CCTK_{INT,REAL,COMPLEX}_PRECISION to values of 1, 2, 4, 8, 16,goodale2005-12-13
| | | | | | | | | | | or 32, depending on the definition of the default data types CCTK_{INT,REAL,COMPLEX}. These new macros make type generic code more convenient to write. Patch from Erik Schnetter. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4209 17b73243-c579-4c4c-a9d2-2d5706c11dac
* migration from misnomer pointwise-reduction to reduce arrays globallyyye002005-11-14
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4195 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Pointwise reduction flesh supportyye002005-11-08
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4194 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Untabifying.goodale2005-10-03
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4163 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Untabifying.goodale2005-10-03
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4158 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Patch from Jian Tao to add some callback functionality to thegoodale2005-10-03
| | | | | | | | | | warning system. This allows thorns to register functions which will be called when CCTK_Warn or CCTK_Info are called, with the contents of the warning/info message, thus allowing thorns to do things like logging warnings to file or displaying on webpages. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4157 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
* Correct typos in commentsschnetter2005-09-25
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4142 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
* Clean up the declaration of CCTK_ReduceLocalArrays:schnetter2005-08-04
| | | | | | | | | | | | Correct indentation. Use one line per argument. Rename the *output_number* arguments to *output_value*, as we did for CCTK_ReduceGridArrays. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4104 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Avoid warning about unused variable cctki_dummy_int in thorns withoutschnetter2005-08-03
| | | | | | | grid functions git-svn-id: http://svn.cactuscode.org/flesh/trunk@4101 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Correct typo in commentschnetter2005-06-04
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4071 17b73243-c579-4c4c-a9d2-2d5706c11dac
* make CCTK_WARN_* #defines visible to Fortran code, as perjthorn2005-05-11
| | | | | | | | http://cactus.cct.lsu.edu/pipermail/developers/2005-May/000920.html http://cactus.cct.lsu.edu/pipermail/developers/2005-May/000938.html git-svn-id: http://svn.cactuscode.org/flesh/trunk@4044 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Remove duplicate definitionschnetter2005-04-16
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4028 17b73243-c579-4c4c-a9d2-2d5706c11dac
* fix header comment description of where more documentation can be foundjthorn2005-03-18
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@4013 17b73243-c579-4c4c-a9d2-2d5706c11dac
* remove a FIXME comment 'should write some latex docs'jthorn2005-03-18
| | | | | | | since there are now fairly extensive latex docs git-svn-id: http://svn.cactuscode.org/flesh/trunk@4012 17b73243-c579-4c4c-a9d2-2d5706c11dac
* change hexadecimal flags-words constants to decimal so Fortran 77jthorn2005-03-18
| | | | | | | | will grok them (keep hex values in comments since they're convenient for C bitwise-oring) git-svn-id: http://svn.cactuscode.org/flesh/trunk@4011 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Move check for C++ into CCODE sectionschnetter2005-02-27
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3995 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Fixed typo to properly end a comment which otherwise would have been enclosed intradke2005-02-22
| | | | | | | another comment. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3991 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add cctk_Interp.h to cctk.h (FCODE section). Surround C prototypes inhawke2005-02-18
| | | | | | | | | cctk_Interp.h with CCODE ifdefs. This allows Fortran code to use the same #def'd error codes as the C code. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3989 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Correct description of the warning levelsschnetter2005-02-07
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3980 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Correct description of the warning levelsschnetter2005-02-07
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3979 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Declare CCTK_CHAR in C a char instead of unsigned char.schnetter2005-01-30
| | | | | | | | | | | Turn CCTK_STRING from a #define into a typedef. Do not declare CCTK_CHAR in Fortran, as it does not make sense. Add some comments. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3975 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Introduce a parameter -L to select the logging level.schnetter2005-01-29
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3974 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
* Remove self field from cGH structureschnetter2005-01-29
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3971 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Add "activetimelevels" field to cGroupDynamicData structureschnetter2005-01-29
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3970 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Patch from Yaakoub to add a complex version of the 'pow' function.goodale2005-01-24
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3966 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Remove unnecessary #include <stdio.h>schnetter2005-01-21
| | | | git-svn-id: http://svn.cactuscode.org/flesh/trunk@3962 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Changed way that variables are automatically 'used' so that we don't getgoodale2005-01-07
| | | | | | | compiler warnings about the restrict qualifier. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3952 17b73243-c579-4c4c-a9d2-2d5706c11dac
* Use int instead of size_t for string length. All other flesh routinesschnetter2004-12-30
| | | | | | | also use int for lengths and not size_t. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3950 17b73243-c579-4c4c-a9d2-2d5706c11dac