ergo
|
Common DFT routines. More...
#include <ctype.h>
#include <cmath>
#include <pthread.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <list>
#include <map>
#include "dft_common.h"
#include "functionals.h"
#include "grid_atomic.h"
#include "output.h"
#include "barrier.h"
Classes | |
class | ShellTree |
Class that allows to find in NLogN time all shells that overlap with a given box. More... | |
struct | Ball |
Macros | |
#define | _XOPEN_SOURCE 500 |
#define | _XOPEN_SOURCE_EXTENDED 1 |
#define | _BSD_SOURCE 1 |
#define | __CVERSION__ |
Functions | |
void * | dal_malloc_ (size_t sz, const char *place, unsigned line) |
int | sync_threads (bool release, int nThreads) |
creates or destroys a barrier for nThreads. More... | |
static void | dft_set_hf_weight (real w) |
static real | dft_get_hf_weight (void) |
static int | ergo_fort_print (const char *format,...) |
EXTERN_C void | dft_init (void) |
EXTERN_C int | dft_get_num_threads (void) |
EXTERN_C void | dft_set_num_threads (int nThreads) |
int | dft_setfunc (const char *line) |
static ergo_real | distance (const ergo_real *a, const ergo_real *b) |
Coomputes distance between two points, they do not need to be of the Vector3D type. More... | |
void | ergoShellsToOrbs (const int *nshlbl, const int(*shlblock)[2], int *norbbl, int(*orbblock)[2], const BasisInfoStruct &bis) |
transform shell block indices to orbital block indices. More... | |
real | dftene_ (const real *rho, const real *grad) |
void | dftptf0_ (real *rho, real *grad, real *wght, real *vx) |
void | dftpot0_ (FirstDrv *ds, const real *weight, const FunDensProp *dp) |
void | dftpot1_ (SecondDrv *ds, const real *w, const FunDensProp *dp, const int *triplet) |
Variables | |
int | ZEROI = 0 |
int | ONEI = 1 |
int | THREEI = 3 |
int | FOURI = 4 |
real | ZEROR = 0.0 |
real | ONER = 1.0 |
real | TWOR = 2.0 |
real | FOURR = 4.0 |
static const ergo_real | GET_BLOCKS_FUDGE_FACTOR = 1.0 |
static const ergo_real | SET_SHELL_RADII_ORBITAL_THR = 1e-11 |
static real | dft_hf_weight = 0.0 |
int(* | fort_print )(const char *format,...) = printf |
static int | dft_thread_count = -1 |
Common DFT routines.
Mostly functional mixing.
(c) Pawel Salek, pawsa, 2001-08-02 NOTES: Adding new functionals: a. use @the ochem .kth .sefun-slater.c as template. b. add 'extern Functional MyFunctional;' to functionals.h c. add '&MyFunctional' to available_functionals below. d. have a beer. Or some crackers, if you prefer.
#define __CVERSION__ |
#define _BSD_SOURCE 1 |
#define _XOPEN_SOURCE 500 |
#define _XOPEN_SOURCE_EXTENDED 1 |
void* dal_malloc_ | ( | size_t | sz, |
const char * | place, | ||
unsigned | line | ||
) |
References GET_BLOCKS_FUDGE_FACTOR, and SET_SHELL_RADII_ORBITAL_THR.
|
static |
References dft_hf_weight.
Referenced by dft_set_num_threads(), and dft_setfunc().
EXTERN_C int dft_get_num_threads | ( | void | ) |
References dft_thread_count, EXTERN_C, and fort_print.
Referenced by dft_get_uxc_mt(), dft_get_xc_mt(), dft_lin_resp_mt(), getXC_mt(), grid_open_cartesian(), grid_open_stream(), and grid_test_scaling().
EXTERN_C void dft_init | ( | void | ) |
References ergo_fort_print(), fort_print, and fun_printf.
Referenced by main(), test_mol(), and test_small().
|
static |
References dft_hf_weight.
Referenced by dft_set_num_threads(), and dft_setfunc().
EXTERN_C void dft_set_num_threads | ( | int | nThreads | ) |
References dft_get_hf_weight(), dft_set_hf_weight(), dft_thread_count, dftlistfuncs_(), fort_print, FSYM, FUN_CONF_ERROR, fun_get_hf_weight, FUN_OK, fun_printf, fun_select_by_name(), fun_set_cam_param, fun_set_hf_weight, and FUN_UNKNOWN.
Referenced by es_set_nthreads().
int dft_setfunc | ( | const char * | line | ) |
References dft_get_hf_weight(), dft_set_hf_weight(), dftlistfuncs_(), fort_print, FUN_CONF_ERROR, fun_get_hf_weight, FUN_OK, fun_printf, fun_select_by_name(), fun_set_cam_param, fun_set_hf_weight, and FUN_UNKNOWN.
Referenced by calculation_shared(), es_run(), main(), test_mol(), and test_small().
void dftpot0_ | ( | FirstDrv * | ds, |
const real * | weight, | ||
const FunDensProp * | dp | ||
) |
void dftpot1_ | ( | SecondDrv * | ds, |
const real * | w, | ||
const FunDensProp * | dp, | ||
const int * | triplet | ||
) |
References daxpy_(), FunSecondFuncDrv::df00001, FunThirdFuncDrv::df00001, FunFourthFuncDrv::df00001, FunSecondFuncDrv::df00002, FunFourthFuncDrv::df00002, FunFourthFuncDrv::df00003, FunFourthFuncDrv::df00004, FunFourthFuncDrv::df0001, FunFourthFuncDrv::df00011, FunFourthFuncDrv::df00012, FunFourthFuncDrv::df00013, FunFourthFuncDrv::df0002, FunFourthFuncDrv::df00021, FunFourthFuncDrv::df00022, FunFourthFuncDrv::df0003, FunFourthFuncDrv::df00031, FunFourthFuncDrv::df0004, FunSecondFuncDrv::df0010, FunThirdFuncDrv::df0010, FunFourthFuncDrv::df0010, FunSecondFuncDrv::df00101, FunFourthFuncDrv::df00101, FunFourthFuncDrv::df00102, FunFourthFuncDrv::df00103, FunSecondFuncDrv::df0011, FunThirdFuncDrv::df0011, FunFourthFuncDrv::df0011, FunFourthFuncDrv::df00111, FunFourthFuncDrv::df00112, FunFourthFuncDrv::df0012, FunFourthFuncDrv::df00121, FunFourthFuncDrv::df0013, FunSecondFuncDrv::df0020, FunThirdFuncDrv::df0020, FunFourthFuncDrv::df0020, FunFourthFuncDrv::df00201, FunFourthFuncDrv::df00202, FunThirdFuncDrv::df0021, FunFourthFuncDrv::df0021, FunFourthFuncDrv::df00211, FunFourthFuncDrv::df0022, FunThirdFuncDrv::df0030, FunFourthFuncDrv::df0030, FunFourthFuncDrv::df00301, FunFourthFuncDrv::df0031, FunFourthFuncDrv::df0040, FunSecondFuncDrv::df0100, FunFourthFuncDrv::df0100, FunFourthFuncDrv::df01001, FunFourthFuncDrv::df01002, FunFourthFuncDrv::df01003, FunFourthFuncDrv::df0101, FunFourthFuncDrv::df01011, FunFourthFuncDrv::df01012, FunFourthFuncDrv::df0102, FunFourthFuncDrv::df01021, FunFourthFuncDrv::df0103, FunFourthFuncDrv::df0110, FunFourthFuncDrv::df01101, FunFourthFuncDrv::df01102, FunFourthFuncDrv::df0111, FunFourthFuncDrv::df01111, FunFourthFuncDrv::df0112, FunThirdFuncDrv::df0120, FunFourthFuncDrv::df0120, FunFourthFuncDrv::df01201, FunFourthFuncDrv::df0121, FunFourthFuncDrv::df0130, FunFourthFuncDrv::df0200, FunFourthFuncDrv::df02001, FunFourthFuncDrv::df02002, FunFourthFuncDrv::df0201, FunFourthFuncDrv::df02011, FunFourthFuncDrv::df0202, FunFourthFuncDrv::df0210, FunFourthFuncDrv::df02101, FunFourthFuncDrv::df0211, FunFourthFuncDrv::df0220, FunFourthFuncDrv::df0300, FunFourthFuncDrv::df03001, FunFourthFuncDrv::df0301, FunFourthFuncDrv::df0310, FunFourthFuncDrv::df0400, FunSecondFuncDrv::df1000, FunThirdFuncDrv::df1000, FunFourthFuncDrv::df1000, FunSecondFuncDrv::df10001, FunThirdFuncDrv::df10001, FunFourthFuncDrv::df10001, FunFourthFuncDrv::df10002, FunFourthFuncDrv::df10003, FunSecondFuncDrv::df1001, FunThirdFuncDrv::df1001, FunFourthFuncDrv::df1001, FunFourthFuncDrv::df10011, FunFourthFuncDrv::df10012, FunFourthFuncDrv::df1002, FunFourthFuncDrv::df10021, FunFourthFuncDrv::df1003, FunSecondFuncDrv::df1010, FunThirdFuncDrv::df1010, FunFourthFuncDrv::df1010, FunFourthFuncDrv::df10101, FunFourthFuncDrv::df10102, FunThirdFuncDrv::df1011, FunFourthFuncDrv::df1011, FunFourthFuncDrv::df10111, FunFourthFuncDrv::df1012, FunThirdFuncDrv::df1020, FunFourthFuncDrv::df1020, FunFourthFuncDrv::df10201, FunFourthFuncDrv::df1021, FunFourthFuncDrv::df1030, FunSecondFuncDrv::df1100, FunThirdFuncDrv::df1100, FunFourthFuncDrv::df1100, FunThirdFuncDrv::df11001, FunFourthFuncDrv::df11001, FunFourthFuncDrv::df11002, FunFourthFuncDrv::df1101, FunFourthFuncDrv::df11011, FunFourthFuncDrv::df1102, FunThirdFuncDrv::df1110, FunFourthFuncDrv::df1110, FunFourthFuncDrv::df11101, FunFourthFuncDrv::df1111, FunFourthFuncDrv::df1120, FunFourthFuncDrv::df1200, FunFourthFuncDrv::df12001, FunFourthFuncDrv::df1201, FunFourthFuncDrv::df1210, FunFourthFuncDrv::df1300, FunSecondFuncDrv::df2000, FunThirdFuncDrv::df2000, FunFourthFuncDrv::df2000, FunThirdFuncDrv::df20001, FunFourthFuncDrv::df20001, FunFourthFuncDrv::df20002, FunThirdFuncDrv::df2001, FunFourthFuncDrv::df2001, FunFourthFuncDrv::df20011, FunFourthFuncDrv::df2002, FunThirdFuncDrv::df2010, FunFourthFuncDrv::df2010, FunFourthFuncDrv::df20101, FunFourthFuncDrv::df2011, FunFourthFuncDrv::df2020, FunThirdFuncDrv::df2100, FunFourthFuncDrv::df2100, FunFourthFuncDrv::df21001, FunFourthFuncDrv::df2101, FunFourthFuncDrv::df2110, FunFourthFuncDrv::df2200, FunThirdFuncDrv::df3000, FunFourthFuncDrv::df3000, FunFourthFuncDrv::df30001, FunFourthFuncDrv::df3001, FunFourthFuncDrv::df3010, FunFourthFuncDrv::df3100, FunFourthFuncDrv::df4000, drv2_clear(), drv3_clear(), drv4_clear(), SecondDrv::fG, SecondDrv::fGG, Functional_::fourth, SecondDrv::fR, SecondDrv::fRG, SecondDrv::fRR, SecondDrv::fRZ, SecondDrv::fZ, SecondDrv::fZG, SecondDrv::fZZ, FunDensProp_::grada, FunDensProp_::gradb, FunDensProp_::rhoa, FunDensProp_::rhob, Functional_::second, selected_func, and Functional_::third.
Referenced by hessianCb(), and lin_resp_cb_b_lda().
Coomputes distance between two points, they do not need to be of the Vector3D type.
In a way, we lose here some error checking. Perhaps it should be avoided.
Referenced by compute_operator_matrix_sparse(), compute_T_matrix_sparse(), create_joblist_exchange_for_two_boxes_recursive(), do_interaction_recursive(), get_basis_func_pair_list_1el(), get_basis_func_pair_list_2el(), get_joblists_J_for_two_boxes_recursive(), get_K_contribs_from_2_interacting_boxes(), get_list_of_labeled_distrs(), get_list_of_labeled_distrs_maxLimitingFactor(), get_maxLimitingFactor(), get_mulliken_charges(), ShellTree::getOverlappingWith(), and mat::PuriInfo< Treal, VectorType, TdebugPolicy >::improveCorrectOccupation().
|
static |
References do_voutput(), EXTERN_C, LOG_AREA_DFT, and LOG_CAT_INFO.
Referenced by dft_init().
void ergoShellsToOrbs | ( | const int * | nshlbl, |
const int(*) | shlblock[2], | ||
int * | norbbl, | ||
int(*) | orbblock[2], | ||
const BasisInfoStruct & | bis | ||
) |
transform shell block indices to orbital block indices.
IORIDX contains preprocessed information about where given shell begins and ends in given symmetry.
References ShellSpecStruct_::noOfBasisFuncs, BasisInfoStruct::shellList, and ShellSpecStruct_::startIndexInMatrix.
Referenced by SparsePattern::add(), compute_grid_thread_func(), and dft_integrate().
int sync_threads | ( | bool | release, |
int | nThreads | ||
) |
creates or destroys a barrier for nThreads.
release | tells whether we are to destroy the barrier (true) or just sync (false). |
nThreads | informs the code how many threads are supposed to block on the barrier. |
References ergo_barrier_destroy(), ergo_barrier_init(), ergo_barrier_wait(), and PTHREAD_BARRIER_SERIAL_THREAD.
Referenced by dft_integrate(), getBoundingBox(), XCEvaluatorRestricted::getXC(), and XCEvaluatorUnrestricted::getXC().
|
static |
Referenced by dft_get_hf_weight(), and dft_set_hf_weight().
|
static |
Referenced by dft_get_num_threads(), and dft_set_num_threads().
int(* fort_print) (const char *format,...) = printf |
Referenced by dft_get_num_threads(), dft_init(), dft_set_num_threads(), and dft_setfunc().
int FOURI = 4 |
real FOURR = 4.0 |
|
static |
Referenced by dal_malloc_(), and ErgoMolInfo::getBlocks().
int ONEI = 1 |
Referenced by dft_get_uxc(), and dft_get_xc().
real ONER = 1.0 |
|
static |
Referenced by dal_malloc_(), and ErgoMolInfo::setShellRadii().
int THREEI = 3 |
real TWOR = 2.0 |
int ZEROI = 0 |
Referenced by hessianCb().
real ZEROR = 0.0 |