00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00037 #ifndef _GENERAL_H_
00038 #define _GENERAL_H_
00039
00040 #include <stdlib.h>
00041
00042 #ifdef __cplusplus
00043 #define EXTERN_C extern "C"
00044 #else
00045 #define EXTERN_C
00046 #endif
00047
00048 #if defined(__cplusplus)
00049 #define RESTRICT
00050 #else
00051
00052 #define RESTRICT restrict
00053 #endif
00054
00055 #if !defined(__CVERSION)
00056 #define __CVERSION__
00057 #endif
00058
00059 #include "functionals.h"
00060
00061 #include "basisinfo.h"
00062 #include "molecule.h"
00063 #include "grid_reader.h"
00064
00065
00066
00067
00068
00069
00070 #ifdef NO_UNDERSCORE
00071 #define FSYM(a) a
00072 #define FSYM2(a) a
00073 #else
00074 #define FSYM(a) a ## _
00075 #if defined(VAR_G77) || defined(HAVE_GCPP)
00076 #define FSYM2(a) a ## __
00077 #else
00078 #define FSYM2(a) a ## _
00079 #endif
00080 #endif
00081
00082 #if defined(VAR_PGF77)
00083 #define __FUNCTION__ "PGI_does_not_define__FUNCTION__"
00084 #endif
00085 #if defined(SYS_SUN)
00086 #define __FUNCTION__ "SUNs CC compiler_does_not_define__FUNCTION__"
00087 #endif
00088 #if defined(SYS_IRIX)
00089 #define __FUNCTION__ "SGIs CC compiler_does_not_define__FUNCTION__"
00090 #endif
00091 #if defined(SYS_DEC)
00092 #define __FUNCTION__ "DEC CC compiler does not define __FUNCTION__"
00093 #endif
00094
00095 #define ELEMENTS(arr) (sizeof(arr)/sizeof(arr[0]))
00096
00097
00098 EXTERN_C void dftpot0_(FirstDrv *ds, const real* weight, const FunDensProp* dp);
00099 EXTERN_C void dftpot1_(SecondDrv *ds, const real* w, const FunDensProp* dp,
00100 const int* triplet);
00101
00102 EXTERN_C int dft_setfunc(const char *line);
00103 EXTERN_C void grid_set_tmpdir(const char *tmpdir);
00104
00105
00106 EXTERN_C real dft_get_xc(int nElectrons, const real* dmat,
00107 const BasisInfoStruct *bis, const Molecule *mol,
00108 const Dft::GridParams& gss,
00109 real* ksm, real* edfty,
00110 int nThreads);
00111 EXTERN_C real dft_get_uxc(int nElectrons,
00112 const real* dmata, const real *dmatb,
00113 const BasisInfoStruct *bis, const Molecule *mol,
00114 const Dft::GridParams& gss,
00115 real* xca, real *xcb, real* edfty,
00116 int nThreads);
00117
00118
00119 typedef void (*DFTPropEvalMaster)(void);
00120 typedef void (*DFTPropEvalSlave)(real* work, int* lwork, const int* iprint);
00121
00122 extern int (*fort_print)(const char* format, ...);
00123
00124
00125 #if !defined __inline__
00126
00127 #define __inline__
00128 #endif
00129
00130 #endif