#include <cmath>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "dft_common.h"
#include "functionals.h"
Defines | |
#define | _POSIX_SOURCE 1 |
#define | __CVERSION__ |
#define | COMP_DER(c, delta, eps, field, fun, ord) |
#define | T2(der, derdif, eps, label) |
Typedefs | |
typedef void(*) | DaltonEnFunc (real *res, const real *rho, const real *rho13, const real *grad) |
Functions | |
void | edrc_ (real *drc, const real *rho, const real *rho13, const real *rhogrd) |
void | evwn_ (real *vwn, const real *rho, const real *rho13, const real *rhogrd) |
void | ebck_ (real *bck, const real *rho, const real *rho13, const real *rhogrd) |
void | elyp_ (real *lyp, const real *rho, const real *rho13, const real *rhogrd) |
void | dftpot1 (SecondDrv *ds, const real *w, const real *rho, const real *grad, const int *triplet) |
void | condft_ (void) |
static __inline__ void | test_var (real comp, real refer, const char *fun, const char *drv, int *counter) |
static int | test_first (const char *fun_name, EnergyFunc func, FirstOrderFun first_func) |
static int | test_second (const char *fname, FirstOrderFun first_fun, SecondOrderFun second_fun) |
static int | test_third (const char *fname, SecondOrderFun second_fun, ThirdOrderFun third_fun) |
static int | test_fourth (const char *fname, ThirdOrderFun third_fun, FourthOrderFun fourth_fun) |
static int | test_derivatives (Functional *f, int *orders, DaltonEnFunc dal_fun) |
int | main (int argc, char *argv[]) |
Variables | |
const int | GRID_STEP = 1 |
(c) Pawel Salek, pawsa@theochem.kth.se, 2001-10-15
The test build can be done by: g77 -O fun-tester.c -o fun-tester -L. -ldft -lm or cc -O fun-tester.c -o fun-tester -L. -ldft -lm -lg2c
NOTES: this file is short but in a separate file to reduce the number of dependences and be able to easily compile the code for the TEST_BUILD.
#define __CVERSION__ |
#define _POSIX_SOURCE 1 |
#define COMP_DER | ( | c, | |||
delta, | |||||
eps, | |||||
field, | |||||
fun, | |||||
ord | ) |
Value:
eps = c*delta; \ drv##ord##_clear(&m); dt = dp; dt.field -= eps; fun ## _fun(&m, 1, &dt); \ drv##ord##_clear(&p); dt = dp; dt.field += eps; fun ## _fun(&p, 1, &dt)
#define T2 | ( | der, | |||
derdif, | |||||
eps, | |||||
label | ) |
Value:
num = (p.derdif-m.derdif)/(2*eps);\ test_var(d.der, num, fname, label ":" #der, &fail)
typedef void(*) DaltonEnFunc(real *res, const real *rho, const real *rho13, const real *grad) |
void condft_ | ( | void | ) |
void dftpot1 | ( | SecondDrv * | ds, | |
const real * | w, | |||
const real * | rho, | |||
const real * | grad, | |||
const int * | triplet | |||
) |
int main | ( | int | argc, | |
char * | argv[] | |||
) |
static int test_derivatives | ( | Functional * | f, | |
int * | orders, | |||
DaltonEnFunc | dal_fun | |||
) | [static] |
static int test_first | ( | const char * | fun_name, | |
EnergyFunc | func, | |||
FirstOrderFun | first_func | |||
) | [static] |
static int test_fourth | ( | const char * | fname, | |
ThirdOrderFun | third_fun, | |||
FourthOrderFun | fourth_fun | |||
) | [static] |
static int test_second | ( | const char * | fname, | |
FirstOrderFun | first_fun, | |||
SecondOrderFun | second_fun | |||
) | [static] |
static int test_third | ( | const char * | fname, | |
SecondOrderFun | second_fun, | |||
ThirdOrderFun | third_fun | |||
) | [static] |
static __inline__ void test_var | ( | real | comp, | |
real | refer, | |||
const char * | fun, | |||
const char * | drv, | |||
int * | counter | |||
) | [static] |
const int GRID_STEP = 1 |