ergo
xcmat_test.cc File Reference

Tests the DFT XC matrix construction. More...

#include <stdio.h>
#include <unistd.h>
#include <memory>
#include <limits>
#include "integrals_1el_potential.h"
#include "integrals_2el.h"
#include "memorymanag.h"
#include "grid_reader.h"
#include "dft_common.h"
#include "xc_matrix.h"

Functions

static bool compare_matrices (char mat_name, const real *computed, const long double *ref, int sz, ergo_real eps)
 
static int test_small (const IntegralInfo &ii, const char *functional, const Dft::GridParams::RadialScheme &gridScheme, const char *gridSchemeName, const int *charges, const real(*coords)[3], const long double(*XCRef)[2])
 
static int test_small_both ()
 
static int test_mol (const char *mol_fname, const char *basisSet, const char *xcFunc)
 
int main (int argc, char *argv[])
 

Detailed Description

Tests the DFT XC matrix construction.

This test computes the XC energy many times and checks that the resulting energy is the same every time. If this fails, it is probably because of some bug related to synchronization of threads.

Function Documentation

◆ compare_matrices()

static bool compare_matrices ( char  mat_name,
const real computed,
const long double *  ref,
int  sz,
ergo_real  eps 
)
static

References template_blas_fabs().

Referenced by test_small().

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ test_mol()

◆ test_small()

static int test_small ( const IntegralInfo ii,
const char *  functional,
const Dft::GridParams::RadialScheme gridScheme,
const char *  gridSchemeName,
const int *  charges,
const real(*)  coords[3],
const long double(*)  XCRef[2] 
)
static

◆ test_small_both()

static int test_small_both ( )
static