ergo
|
#include <stdlib.h>
#include <cmath>
#include <stdio.h>
#include <errno.h>
#include <memory.h>
#include <time.h>
#include <pthread.h>
#include <stdexcept>
#include "grid_hicu.h"
#include "basisinfo.h"
#include "integrals_general.h"
#include "cubature_rules.h"
#include "utilities.h"
#include "pi.h"
#include "box_system.h"
#include "integrator.h"
#include "functionals.h"
#include "aos.h"
#include "dft_common.h"
#include "rho-mat.h"
#include "units.h"
Classes | |
struct | ShellSpecStructWithExtent |
struct | DensitySpecStruct |
struct | rhoTreeNode_ |
struct | GridGenerationParamsStruct |
struct | compute_grid_for_box_params_struct |
struct | ComputeGridResultValuesStruct |
struct | compute_grid_thread_func_struct |
Defines | |
#define | __CVERSION__ |
#define | _XOPEN_SOURCE 500 |
#define | _XOPEN_SOURCE_EXTENDED 1 |
#define | USE_EXP_STD |
#define | USE_ERF_STD |
#define | DO_EXTRA_ERROR_CHECKING |
#define | FILE_BATCH_N 1000000 |
#define | MAX_NO_OF_POINTS_PER_BATCH 100 |
#define | MAX_NO_OF_SHLBLOCKS 44444 |
#define | EXPONENT_DIFF_LIMIT 1e-22 |
#define | DISTR_CENTER_DIST_LIMIT 1e-22 |
#define | N_BATCH_JOBS 22 |
#define | MAX_NO_OF_POINTS_PER_WRITE 50000 |
#define | HICU_SPARSE_MATRIX_ACCESS_ROUTINE at |
#define | solid_harmonic_s_0(x, y, z, x2, y2, z2, r2) 1 |
#define | solid_harmonic_p_2(x, y, z, x2, y2, z2, r2) x |
#define | solid_harmonic_p_0(x, y, z, x2, y2, z2, r2) y |
#define | solid_harmonic_p_1(x, y, z, x2, y2, z2, r2) z |
#define | solid_harmonic_d_0(x, y, z, x2, y2, z2, r2) (x * y) |
#define | solid_harmonic_d_1(x, y, z, x2, y2, z2, r2) (y * z) |
#define | solid_harmonic_d_2(x, y, z, x2, y2, z2, r2) ((2 * z2 - x2 - y2) / (2 * std::sqrt((ergo_real)3))) |
#define | solid_harmonic_d_3(x, y, z, x2, y2, z2, r2) (x * z) |
#define | solid_harmonic_d_4(x, y, z, x2, y2, z2, r2) (0.5 * (x2 - y2)) |
#define | solid_harmonic_f_0(x, y, z, x2, y2, z2, r2) ((0.5 * std::sqrt(2.5) * (3 * x2 - y2) * y) / std::sqrt((ergo_real)15)) |
#define | solid_harmonic_f_1(x, y, z, x2, y2, z2, r2) (x * y * z) |
#define | solid_harmonic_f_2(x, y, z, x2, y2, z2, r2) (0.5 * std::sqrt((ergo_real)1.5) * (5 * z2 - r2) * y / std::sqrt((ergo_real)15)) |
#define | solid_harmonic_f_3(x, y, z, x2, y2, z2, r2) (0.5 * (5 * z2 - 3 * r2) * z / std::sqrt((ergo_real)15)) |
#define | solid_harmonic_f_4(x, y, z, x2, y2, z2, r2) (0.5 * std::sqrt((ergo_real)1.5) * (5 * z2 - r2) * x / std::sqrt((ergo_real)15)) |
#define | solid_harmonic_f_5(x, y, z, x2, y2, z2, r2) (0.5 * (x2 - y2) * z) |
#define | solid_harmonic_f_6(x, y, z, x2, y2, z2, r2) (0.5 * std::sqrt((ergo_real)2.5) * (x2 - 3 * y2) * x / std::sqrt((ergo_real)15)) |
#define | MAX_DEPTH 888 |
#define | MAX_NO_OF_TEST_POINTS 1000 |
Typedefs | |
typedef struct rhoTreeNode_ | rhoTreeNode |
typedef std::vector < std::vector< std::vector < int > > > | tripleVectorOfInt |
typedef real | coor3DPtr [3] |
Functions | |
static void | print_box (BoxStruct *box) |
static void | get_distribution_box (BoxStruct *box, DistributionSpecStruct *distr, real targetRhoError) |
static void | get_shell_box (BoxStruct *box, ShellSpecStructWithExtent *shell) |
static real | compute_value_at_point (DensitySpecStruct *density, int noOfNonzeroShells, int *nonZeroShellsIndexList, int noOfNonzeroBasFuncs, int *nonZeroBasFuncsIndexList, const real *localFullDensityMatrix, real(*coor)[3], real *workList) |
static real | compute_integral_from_points (const BasisInfoStruct &bis, DensitySpecStruct *density, int noOfNonzeroShells, int *nonZeroShellsIndexList, int noOfNonzeroBasFuncs, int *nonZeroBasFuncsIndexList, const real *localFullDensityMatrix, int nPoints, real(*coor)[3], real *weight, real *workList, real &minValue, real &maxValue, real &maxAbsValue) |
template<class Treal > | |
Treal | hicuErf (Treal a) |
template<> | |
float | hicuErf (float a) |
template<> | |
double | hicuErf (double a) |
template<> | |
long double | hicuErf (long double a) |
static real | to_power (real x, int n) |
static real | compute_1d_gaussian_integral_recursive (real a, real b, int n, real alpha) |
static real | compute_1d_gaussian_integral (real a, real b, int n, real alpha) |
static real | compute_integral_over_box (DistributionSpecStruct *distr, BoxStruct *box) |
static int | get_rhotree_indexes_for_box (int *resultList, int resultListMaxCount, const rhoTreeNode *node, const BoxStruct *inputBoxPtr) |
static void | callbackGga (DftIntegratorBl *grid, int bllen, real &energy) |
static void | callbackLda (DftIntegratorBl *grid, int bllen, real &energy) |
static void | integrate_density_and_energy (const BasisInfoStruct &bis, DensitySpecStruct *density, DftIntegratorBl *integrator, real &electrons, real &energy, int noOfGridPoints, real(*coor)[3], real *weight, real *dmagao) |
static int | compute_grid_for_box (compute_grid_for_box_params_struct *params, int maxlen, real(*coor)[3], real *weight, BoxStruct *box, real analyticalIntegralValue, real *workList, ComputeGridResultValuesStruct &resultValues, bool resolutionIsOk) |
static rhoTreeNode * | BuildRhoTreeBranch (int noOfDistributionsTot, DistributionSpecStruct *rho_alt_1, ShellSpecStructWithExtent *rho_alt_2, int distrIndexListN, int *distrIndexList, real targetRhoError) |
static rhoTreeNode * | BuildRhoTree (int noOfDistributions, DistributionSpecStruct *rho_alt_1, ShellSpecStructWithExtent *rho_alt_2, real targetRhoError) |
static void | free_rho_tree_memory (rhoTreeNode *rootNode) |
static int | round_real (real x) |
static void | getSubBox (const BoxStruct &startBox, BoxStruct &subBox, int Nx, int Ny, int Nz, int ix, int iy, int iz) |
static void * | compute_grid_thread_func (void *arg) |
static int | compute_grid (const BasisInfoStruct &bis, DensitySpecStruct *density, const GridGenerationParamsStruct &gridGenerationParams, real boxdist, real startBoxSizeDebug, const char *gridFileName, int noOfThreads, bool generateSparsePatternOnly, Dft::SparsePattern *sparsePattern) |
static int | do_merge_sort_distrs (int n, DistributionSpecStruct *list, DistributionSpecStruct *workList) |
static int | compute_extent_for_shells (ShellSpecStructWithExtent *shellList, const BasisInfoStruct &bis, real targetRhoError) |
static int | get_product_distrs (const BasisInfoStruct &bis, const Dft::Matrix &dmat, real targetRhoError, DistributionSpecStruct *rho, int maxCount) |
static void | get_shell_list_with_extents (const BasisInfoStruct &bis, int maxCountShellList, ShellSpecStructWithExtent *shellList, real targetRhoError) |
static int | get_density (const BasisInfoStruct &bis, DistributionSpecStruct *rho, int maxCountRho, real targetRhoError, int nbast, const Dft::Matrix &dmat, BasisFuncStruct *basisFuncList) |
int | hicu_grid_generate (const char *grid_file_name, const BasisInfoStruct &bis, ergo_real maxError, ergo_real boxSize, ergo_real startBoxSizeDebug, int use_error_per_volume, int do_double_checking, int compare_to_refined, int use_energy_criterion, int use_energy_criterion_only, int do_variation_checking, const Dft::Matrix *dmat, Dft::SparsePattern *sparsePattern, int nThreads, bool generateSparsePatternOnly) |
void | grid_generate_sparse_pattern (const BasisInfoStruct &bis, ergo_real maxError, ergo_real boxSize, ergo_real startBoxSizeDebug, Dft::SparsePattern &sparsePattern) |
Variables | |
static const int | CUBATURE_RULE = 3 |
static const int | CUBATURE_RULE_2 = 6 |
const real | COORD_DIFF_FOR_SAMEPOINT_CRITERION = 1.0e-11 |
const real | DISTR_PRODUCT_THRESHOLD = 1e-12 |
const real | DENSITY_ACCURACY_COMPARISON_FACTOR = 10.0 |
const real | RELATIVE_DENSITY_VARIATION_LIMIT = 0.5 |
const real | DISTR_COEFF_CUTOFF_VALUE = 1e-12 |
const real | TARGET_RHO_ERROR_FACTOR = 1e-4 |
pthread_mutex_t | global_main_hicu_mutex = PTHREAD_MUTEX_INITIALIZER |
const int | HICU_GRID_PLOT_RESOLUTION = 50 |
#define __CVERSION__ |
#define _XOPEN_SOURCE 500 |
#define _XOPEN_SOURCE_EXTENDED 1 |
#define DISTR_CENTER_DIST_LIMIT 1e-22 |
Referenced by get_density().
#define DO_EXTRA_ERROR_CHECKING |
#define EXPONENT_DIFF_LIMIT 1e-22 |
Referenced by get_density().
#define FILE_BATCH_N 1000000 |
Referenced by compute_grid_thread_func().
#define HICU_SPARSE_MATRIX_ACCESS_ROUTINE at |
#define MAX_DEPTH 888 |
Referenced by get_rhotree_indexes_for_box().
#define MAX_NO_OF_POINTS_PER_BATCH 100 |
Referenced by compute_grid_thread_func().
#define MAX_NO_OF_POINTS_PER_WRITE 50000 |
Referenced by compute_grid_thread_func().
#define MAX_NO_OF_SHLBLOCKS 44444 |
Referenced by compute_grid_thread_func().
#define MAX_NO_OF_TEST_POINTS 1000 |
Referenced by compute_grid_for_box().
#define N_BATCH_JOBS 22 |
Referenced by compute_grid_thread_func().
#define solid_harmonic_d_0 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | (x * y) |
Referenced by compute_value_at_point().
#define solid_harmonic_d_1 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | (y * z) |
Referenced by compute_value_at_point().
#define solid_harmonic_d_2 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | ((2 * z2 - x2 - y2) / (2 * std::sqrt((ergo_real)3))) |
Referenced by compute_value_at_point().
#define solid_harmonic_d_3 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | (x * z) |
Referenced by compute_value_at_point().
#define solid_harmonic_d_4 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | (0.5 * (x2 - y2)) |
Referenced by compute_value_at_point().
#define solid_harmonic_f_0 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | ((0.5 * std::sqrt(2.5) * (3 * x2 - y2) * y) / std::sqrt((ergo_real)15)) |
Referenced by compute_value_at_point().
#define solid_harmonic_f_1 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | (x * y * z) |
Referenced by compute_value_at_point().
#define solid_harmonic_f_2 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | (0.5 * std::sqrt((ergo_real)1.5) * (5 * z2 - r2) * y / std::sqrt((ergo_real)15)) |
Referenced by compute_value_at_point().
#define solid_harmonic_f_3 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | (0.5 * (5 * z2 - 3 * r2) * z / std::sqrt((ergo_real)15)) |
Referenced by compute_value_at_point().
#define solid_harmonic_f_4 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | (0.5 * std::sqrt((ergo_real)1.5) * (5 * z2 - r2) * x / std::sqrt((ergo_real)15)) |
Referenced by compute_value_at_point().
#define solid_harmonic_f_5 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | (0.5 * (x2 - y2) * z) |
Referenced by compute_value_at_point().
#define solid_harmonic_f_6 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | (0.5 * std::sqrt((ergo_real)2.5) * (x2 - 3 * y2) * x / std::sqrt((ergo_real)15)) |
Referenced by compute_value_at_point().
#define solid_harmonic_p_0 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | y |
Referenced by compute_value_at_point().
#define solid_harmonic_p_1 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | z |
Referenced by compute_value_at_point().
#define solid_harmonic_p_2 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | x |
Referenced by compute_value_at_point().
#define solid_harmonic_s_0 | ( | x, | |
y, | |||
z, | |||
x2, | |||
y2, | |||
z2, | |||
r2 | |||
) | 1 |
Referenced by compute_value_at_point().
#define USE_ERF_STD |
#define USE_EXP_STD |
typedef struct rhoTreeNode_ rhoTreeNode |
typedef std::vector< std::vector< std::vector<int> > > tripleVectorOfInt |
static rhoTreeNode* BuildRhoTree | ( | int | noOfDistributions, |
DistributionSpecStruct * | rho_alt_1, | ||
ShellSpecStructWithExtent * | rho_alt_2, | ||
real | targetRhoError | ||
) | [static] |
References DistributionSpecStruct_::coeff, DistributionSpecStruct_::extent, DistributionSpecStruct_::exponent, and BuildRhoTreeBranch().
Referenced by compute_grid().
static rhoTreeNode* BuildRhoTreeBranch | ( | int | noOfDistributionsTot, |
DistributionSpecStruct * | rho_alt_1, | ||
ShellSpecStructWithExtent * | rho_alt_2, | ||
int | distrIndexListN, | ||
int * | distrIndexList, | ||
real | targetRhoError | ||
) | [static] |
References do_output(), LOG_CAT_ERROR, LOG_AREA_DFT, get_distribution_box(), rhoTreeNode_::box, get_shell_box(), NO_OF_DIMENSIONS, BoxStruct_::min, BoxStruct_::max, rhoTreeNode_::child1, rhoTreeNode_::child2, rhoTreeNode_::distrIndex, DistributionSpecStruct_::centerCoords, ShellSpecStructWithExtent::s, ShellSpecStruct_::centerCoords, COORD_DIFF_FOR_SAMEPOINT_CRITERION, DistributionSpecStruct_::extent, and ShellSpecStructWithExtent::extent.
Referenced by BuildRhoTree().
static void callbackGga | ( | DftIntegratorBl * | grid, |
int | bllen, | ||
real & | energy | ||
) | [static] |
References DftIntegratorBl_::ntypso, DftIntegratorBl_::weight, DftIntegratorBl_::curr_point, FunDensProp_::grada, DftIntegratorBl_::g, DftIntegratorBl_::grad, FunDensProp_::rhob, DftIntegratorBl_::r, DftIntegratorBl_::rho, FunDensProp_::gradb, FunDensProp_::gradab, FunDensProp_::rhoa, selected_func, and Functional_::func.
Referenced by integrate_density_and_energy().
static void callbackLda | ( | DftIntegratorBl * | grid, |
int | bllen, | ||
real & | energy | ||
) | [static] |
References pi, hicuErf(), and compute_1d_gaussian_integral_recursive().
Referenced by compute_integral_over_box().
References pi, hicuErf(), and to_power().
Referenced by compute_1d_gaussian_integral().
static int compute_extent_for_shells | ( | ShellSpecStructWithExtent * | shellList, |
const BasisInfoStruct & | bis, | ||
real | targetRhoError | ||
) | [static] |
References BasisInfoStruct::noOfBasisFuncs, get_max_basis_func_abs_value(), get_basis_func_extent_list(), BasisInfoStruct::noOfShells, ShellSpecStructWithExtent::s, ShellSpecStruct_::startIndexInMatrix, ShellSpecStruct_::noOfBasisFuncs, and ShellSpecStructWithExtent::extent.
Referenced by get_shell_list_with_extents().
static int compute_grid | ( | const BasisInfoStruct & | bis, |
DensitySpecStruct * | density, | ||
const GridGenerationParamsStruct & | gridGenerationParams, | ||
real | boxdist, | ||
real | startBoxSizeDebug, | ||
const char * | gridFileName, | ||
int | noOfThreads, | ||
bool | generateSparsePatternOnly, | ||
Dft::SparsePattern * | sparsePattern | ||
) | [static] |
References do_output(), LOG_CAT_INFO, LOG_AREA_DFT, DensitySpecStruct::noOfShells, LOG_CAT_ERROR, DensitySpecStruct::noOfDistributions, GridGenerationParamsStruct::maxerrorPerBox, GridGenerationParamsStruct::targetRhoError, DensitySpecStruct::nbast, get_shell_box(), DensitySpecStruct::shellList, NO_OF_DIMENSIONS, BoxStruct_::min, BoxStruct_::max, UNIT_one_Angstrom, print_box(), compute_integral_over_box(), DensitySpecStruct::distrList, round_real(), BuildRhoTree(), getSubBox(), get_rhotree_indexes_for_box(), HICU_GRID_PLOT_RESOLUTION, compute_grid_thread_func_struct::density, compute_grid_thread_func(), and free_rho_tree_memory().
Referenced by hicu_grid_generate(), and grid_generate_sparse_pattern().
static int compute_grid_for_box | ( | compute_grid_for_box_params_struct * | params, |
int | maxlen, | ||
real(*) | coor[3], | ||
real * | weight, | ||
BoxStruct * | box, | ||
real | analyticalIntegralValue, | ||
real * | workList, | ||
ComputeGridResultValuesStruct & | resultValues, | ||
bool | resolutionIsOk | ||
) | [static] |
References NO_OF_DIMENSIONS, BoxStruct_::max, BoxStruct_::min, compute_grid_for_box_params_struct::gridGenerationParams, GridGenerationParamsStruct::maxerrorPerBox, GridGenerationParamsStruct::useErrorPerVolume, GridGenerationParamsStruct::compareToRefined, MAX_NO_OF_TEST_POINTS, use_cubature_rule(), CUBATURE_RULE, integrate_density_and_energy(), compute_grid_for_box_params_struct::bis, compute_grid_for_box_params_struct::density, compute_grid_for_box_params_struct::dftIntegrator, compute_grid_for_box_params_struct::dmagao, GridGenerationParamsStruct::targetRhoError, GridGenerationParamsStruct::useEnergyCriterionOnly, GridGenerationParamsStruct::useEnergyCriterion, compute_integral_from_points(), compute_grid_for_box_params_struct::noOfNonzeroShells, compute_grid_for_box_params_struct::nonZeroShellsIndexList, compute_grid_for_box_params_struct::noOfNonzeroBasisFuncs, compute_grid_for_box_params_struct::nonZeroBasisFuncIndexList, compute_grid_for_box_params_struct::localFullDensityMatrix, DENSITY_ACCURACY_COMPARISON_FACTOR, GridGenerationParamsStruct::doDoubleChecking, CUBATURE_RULE_2, GridGenerationParamsStruct::doVariationChecking, RELATIVE_DENSITY_VARIATION_LIMIT, DensitySpecStruct::noOfDistributions, compute_integral_over_box(), DensitySpecStruct::distrList, ComputeGridResultValuesStruct::totalIntegralResultNumerical, ComputeGridResultValuesStruct::totalIntegralResultAnalytical, ComputeGridResultValuesStruct::totalIntegralResultEnergy, ComputeGridResultValuesStruct::estimatedIntegralErrorEnergy, and ComputeGridResultValuesStruct::estimatedIntegralErrorDensity.
Referenced by compute_grid_thread_func().
static void* compute_grid_thread_func | ( | void * | arg | ) | [static] |
References compute_grid_thread_func_struct::resultCode, compute_grid_thread_func_struct::density, compute_grid_thread_func_struct::startBox, compute_grid_thread_func_struct::rhoTreeRootNode, compute_grid_thread_func_struct::rhoTreeRootNodeShells, DensitySpecStruct::noOfShells, compute_grid_thread_func_struct::Nx, compute_grid_thread_func_struct::Ny, compute_grid_thread_func_struct::Nz, compute_grid_thread_func_struct::gridFile, compute_grid_thread_func_struct::generateSparsePatternOnly, compute_grid_thread_func_struct::sparsePattern, compute_grid_thread_func_struct::bis, DensitySpecStruct::nbast, DFT_MAX_BLLEN, compute_grid_for_box_params_struct::dmagao, do_output(), LOG_CAT_INFO, LOG_AREA_DFT, compute_grid_thread_func_struct::threadNo, FILE_BATCH_N, MAX_NO_OF_POINTS_PER_BATCH, compute_grid_thread_func_struct::maxNoOfRelevantDistrsPerBox, MAX_NO_OF_SHLBLOCKS, compute_grid_thread_func_struct::jobMutex, compute_grid_thread_func_struct::currJobNumber, N_BATCH_JOBS, getSubBox(), get_rhotree_indexes_for_box(), DensitySpecStruct::shellList, ShellSpecStructWithExtent::s, ShellSpecStruct_::shellType, ShellSpecStruct_::startIndexInMatrix, DensitySpecStruct::distrList, compute_integral_over_box(), compute_grid_for_box_params_struct::density, DensitySpecStruct::noOfDistributions, compute_grid_for_box_params_struct::gridGenerationParams, compute_grid_thread_func_struct::gridGenerationParams, compute_grid_for_box_params_struct::nonZeroBasisFuncIndexList, compute_grid_for_box_params_struct::noOfNonzeroBasisFuncs, compute_grid_for_box_params_struct::nonZeroShellsIndexList, compute_grid_for_box_params_struct::noOfNonzeroShells, compute_grid_for_box_params_struct::nShlblocks, compute_grid_for_box_params_struct::listShlblocks_otherformat, compute_grid_for_box_params_struct::dftIntegrator, dft_integrator_bl_new(), selected_func, DftIntegratorBl_::shl_bl_cnt, DftIntegratorBl_::shlblocks, ergoShellsToOrbs(), DftIntegratorBl_::bas_bl_cnt, DftIntegratorBl_::basblocks, compute_grid_for_box_params_struct::localFullDensityMatrix, DensitySpecStruct::dmat, Dft::Matrix::at(), compute_grid_for_box(), dft_integrator_bl_free(), compute_grid_thread_func_struct::fileMutex, MAX_NO_OF_POINTS_PER_WRITE, compute_grid_thread_func_struct::counterArrForPlot, HICU_GRID_PLOT_RESOLUTION, BoxStruct_::min, BoxStruct_::max, compute_grid_thread_func_struct::noOfPoints, compute_grid_thread_func_struct::noOfWrittenBatches, compute_grid_thread_func_struct::resultValues, and LOG_CAT_ERROR.
Referenced by compute_grid().
static real compute_integral_from_points | ( | const BasisInfoStruct & | bis, |
DensitySpecStruct * | density, | ||
int | noOfNonzeroShells, | ||
int * | nonZeroShellsIndexList, | ||
int | noOfNonzeroBasFuncs, | ||
int * | nonZeroBasFuncsIndexList, | ||
const real * | localFullDensityMatrix, | ||
int | nPoints, | ||
real(*) | coor[3], | ||
real * | weight, | ||
real * | workList, | ||
real & | minValue, | ||
real & | maxValue, | ||
real & | maxAbsValue | ||
) | [static] |
References compute_value_at_point(), and BasisInfoStruct::noOfBasisFuncs.
Referenced by compute_grid_for_box().
static real compute_integral_over_box | ( | DistributionSpecStruct * | distr, |
BoxStruct * | box | ||
) | [static] |
References DistributionSpecStruct_::coeff, DistributionSpecStruct_::exponent, NO_OF_DIMENSIONS, DistributionSpecStruct_::monomialInts, BoxStruct_::min, DistributionSpecStruct_::centerCoords, BoxStruct_::max, and compute_1d_gaussian_integral().
Referenced by compute_grid_for_box(), compute_grid_thread_func(), and compute_grid().
static real compute_value_at_point | ( | DensitySpecStruct * | density, |
int | noOfNonzeroShells, | ||
int * | nonZeroShellsIndexList, | ||
int | noOfNonzeroBasFuncs, | ||
int * | nonZeroBasFuncsIndexList, | ||
const real * | localFullDensityMatrix, | ||
real(*) | coor[3], | ||
real * | workList | ||
) | [static] |
References DensitySpecStruct::nbast, DensitySpecStruct::shellList, ShellSpecStructWithExtent::s, ShellSpecStruct_::centerCoords, ShellSpecStruct_::noOfContr, ShellSpecStruct_::coeffList, ShellSpecStruct_::exponentList, ShellSpecStruct_::shellType, solid_harmonic_s_0, solid_harmonic_p_0, solid_harmonic_p_1, solid_harmonic_p_2, solid_harmonic_d_0, solid_harmonic_d_1, solid_harmonic_d_2, solid_harmonic_d_3, solid_harmonic_d_4, solid_harmonic_f_0, solid_harmonic_f_1, solid_harmonic_f_2, solid_harmonic_f_3, solid_harmonic_f_4, solid_harmonic_f_5, and solid_harmonic_f_6.
Referenced by compute_integral_from_points().
static int do_merge_sort_distrs | ( | int | n, |
DistributionSpecStruct * | list, | ||
DistributionSpecStruct * | workList | ||
) | [static] |
References do_output(), LOG_CAT_ERROR, LOG_AREA_DFT, DistributionSpecStruct_::monomialInts, and DistributionSpecStruct_::exponent.
Referenced by get_density().
static void free_rho_tree_memory | ( | rhoTreeNode * | rootNode | ) | [static] |
References rhoTreeNode_::child1, and rhoTreeNode_::child2.
Referenced by compute_grid().
static int get_density | ( | const BasisInfoStruct & | bis, |
DistributionSpecStruct * | rho, | ||
int | maxCountRho, | ||
real | targetRhoError, | ||
int | nbast, | ||
const Dft::Matrix & | dmat, | ||
BasisFuncStruct * | basisFuncList | ||
) | [static] |
References do_output(), LOG_CAT_INFO, LOG_AREA_DFT, get_product_distrs(), BasisInfoStruct::basisFuncList, BasisInfoStruct::noOfBasisFuncs, do_merge_sort_distrs(), LOG_CAT_ERROR, BoxSystem::create_box_system(), EXPONENT_DIFF_LIMIT, DISTR_CENTER_DIST_LIMIT, BoxSystem::get_items_near_point(), DistributionSpecStruct_::coeff, pi, and DISTR_COEFF_CUTOFF_VALUE.
Referenced by hicu_grid_generate(), and SCF_unrestricted::output_density_images().
static void get_distribution_box | ( | BoxStruct * | box, |
DistributionSpecStruct * | distr, | ||
real | targetRhoError | ||
) | [static] |
References DistributionSpecStruct_::coeff, DistributionSpecStruct_::exponent, NO_OF_DIMENSIONS, BoxStruct_::min, DistributionSpecStruct_::centerCoords, and BoxStruct_::max.
Referenced by BuildRhoTreeBranch().
static int get_product_distrs | ( | const BasisInfoStruct & | bis, |
const Dft::Matrix & | dmat, | ||
real | targetRhoError, | ||
DistributionSpecStruct * | rho, | ||
int | maxCount | ||
) | [static] |
References BasisInfoStruct::noOfBasisFuncs, get_max_basis_func_abs_value(), get_basis_func_extent_list(), BasisInfoStruct::basisFuncList, BasisFuncStruct_::centerCoords, BoxSystem::create_box_system(), do_output(), LOG_CAT_ERROR, LOG_AREA_DFT, BoxSystem::get_items_near_point(), get_product_simple_primitives(), DISTR_PRODUCT_THRESHOLD, Dft::Matrix::at(), DistributionSpecStruct_::coeff, and DISTR_COEFF_CUTOFF_VALUE.
Referenced by get_density(), and hicu_grid_generate().
static int get_rhotree_indexes_for_box | ( | int * | resultList, |
int | resultListMaxCount, | ||
const rhoTreeNode * | node, | ||
const BoxStruct * | inputBoxPtr | ||
) | [static] |
References MAX_DEPTH, rhoTreeNode_::box, NO_OF_DIMENSIONS, BoxStruct_::min, BoxStruct_::max, rhoTreeNode_::distrIndex, rhoTreeNode_::child1, and rhoTreeNode_::child2.
Referenced by compute_grid_thread_func(), and compute_grid().
static void get_shell_box | ( | BoxStruct * | box, |
ShellSpecStructWithExtent * | shell | ||
) | [static] |
References NO_OF_DIMENSIONS, BoxStruct_::min, ShellSpecStructWithExtent::s, ShellSpecStruct_::centerCoords, ShellSpecStructWithExtent::extent, and BoxStruct_::max.
Referenced by BuildRhoTreeBranch(), and compute_grid().
static void get_shell_list_with_extents | ( | const BasisInfoStruct & | bis, |
int | maxCountShellList, | ||
ShellSpecStructWithExtent * | shellList, | ||
real | targetRhoError | ||
) | [static] |
static void getSubBox | ( | const BoxStruct & | startBox, |
BoxStruct & | subBox, | ||
int | Nx, | ||
int | Ny, | ||
int | Nz, | ||
int | ix, | ||
int | iy, | ||
int | iz | ||
) | [static] |
References BoxStruct_::min, and BoxStruct_::max.
Referenced by compute_grid_thread_func(), and compute_grid().
void grid_generate_sparse_pattern | ( | const BasisInfoStruct & | bis, |
ergo_real | maxError, | ||
ergo_real | boxSize, | ||
ergo_real | startBoxSizeDebug, | ||
Dft::SparsePattern & | sparsePattern | ||
) |
References global_main_hicu_mutex, output_current_memory_usage(), LOG_AREA_DFT, BasisInfoStruct::noOfBasisFuncs, BasisInfoStruct::noOfShells, TARGET_RHO_ERROR_FACTOR, get_shell_list_with_extents(), DensitySpecStruct::noOfShells, DensitySpecStruct::shellList, DensitySpecStruct::nbast, DensitySpecStruct::dmat, DensitySpecStruct::basisFuncList, DensitySpecStruct::noOfDistributions, DensitySpecStruct::distrList, GridGenerationParamsStruct::maxerrorPerBox, GridGenerationParamsStruct::targetRhoError, and compute_grid().
Referenced by XCEvaluator::XCEvaluator().
int hicu_grid_generate | ( | const char * | grid_file_name, |
const BasisInfoStruct & | bis, | ||
ergo_real | maxError, | ||
ergo_real | boxSize, | ||
ergo_real | startBoxSizeDebug, | ||
int | use_error_per_volume, | ||
int | do_double_checking, | ||
int | compare_to_refined, | ||
int | use_energy_criterion, | ||
int | use_energy_criterion_only, | ||
int | do_variation_checking, | ||
const Dft::Matrix * | dmat, | ||
Dft::SparsePattern * | sparsePattern, | ||
int | nThreads, | ||
bool | generateSparsePatternOnly | ||
) |
References global_main_hicu_mutex, output_current_memory_usage(), LOG_AREA_DFT, do_output(), LOG_CAT_INFO, BasisInfoStruct::noOfBasisFuncs, Dft::Matrix::isSparse(), Dft::Matrix::at(), BasisInfoStruct::noOfShells, TARGET_RHO_ERROR_FACTOR, get_shell_list_with_extents(), get_product_distrs(), get_density(), DensitySpecStruct::noOfShells, DensitySpecStruct::shellList, DensitySpecStruct::nbast, DensitySpecStruct::dmat, DensitySpecStruct::basisFuncList, DensitySpecStruct::noOfDistributions, DensitySpecStruct::distrList, GridGenerationParamsStruct::maxerrorPerBox, GridGenerationParamsStruct::targetRhoError, GridGenerationParamsStruct::doDoubleChecking, GridGenerationParamsStruct::compareToRefined, GridGenerationParamsStruct::useEnergyCriterion, GridGenerationParamsStruct::useEnergyCriterionOnly, GridGenerationParamsStruct::useErrorPerVolume, GridGenerationParamsStruct::doVariationChecking, and compute_grid().
Referenced by grid_open_cartesian().
Treal hicuErf | ( | Treal | a | ) |
Referenced by compute_1d_gaussian_integral_recursive(), and compute_1d_gaussian_integral().
float hicuErf | ( | float | a | ) |
double hicuErf | ( | double | a | ) |
References DM::erf().
long double hicuErf | ( | long double | a | ) |
static void integrate_density_and_energy | ( | const BasisInfoStruct & | bis, |
DensitySpecStruct * | density, | ||
DftIntegratorBl * | integrator, | ||
real & | electrons, | ||
real & | energy, | ||
int | noOfGridPoints, | ||
real(*) | coor[3], | ||
real * | weight, | ||
real * | dmagao | ||
) | [static] |
References DftIntegratorBl_::coor, DftIntegratorBl_::weight, DftIntegratorBl_::curr_point, DftIntegratorBl_::dogga, dft_get_orbs(), DftIntegratorBl_::atv, DftIntegratorBl_::shl_bl_cnt, DftIntegratorBl_::shlblocks, BasisInfoStruct::noOfBasisFuncs, DensitySpecStruct::dmat, Dft::Matrix::isSparse(), getrho_blocked_gga(), Dft::Matrix::asSparse(), DftIntegratorBl_::bas_bl_cnt, DftIntegratorBl_::basblocks, DftIntegratorBl_::r, DftIntegratorBl_::rho, DftIntegratorBl_::g, DftIntegratorBl_::rad, getrho_blocked_lda(), Dft::Matrix::asFull(), selected_func, Functional_::is_gga, callbackGga(), and callbackLda().
Referenced by compute_grid_for_box().
static void print_box | ( | BoxStruct * | box | ) | [static] |
References do_output(), LOG_CAT_INFO, LOG_AREA_DFT, NO_OF_DIMENSIONS, BoxStruct_::min, and BoxStruct_::max.
Referenced by compute_grid().
static int round_real | ( | real | x | ) | [static] |
Referenced by compute_grid().
Referenced by compute_1d_gaussian_integral_recursive().
const real COORD_DIFF_FOR_SAMEPOINT_CRITERION = 1.0e-11 |
Referenced by BuildRhoTreeBranch().
const int CUBATURE_RULE = 3 [static] |
Referenced by compute_grid_for_box().
const int CUBATURE_RULE_2 = 6 [static] |
Referenced by compute_grid_for_box().
const real DENSITY_ACCURACY_COMPARISON_FACTOR = 10.0 |
Referenced by compute_grid_for_box().
const real DISTR_COEFF_CUTOFF_VALUE = 1e-12 |
Referenced by get_product_distrs(), and get_density().
const real DISTR_PRODUCT_THRESHOLD = 1e-12 |
Referenced by get_product_distrs().
pthread_mutex_t global_main_hicu_mutex = PTHREAD_MUTEX_INITIALIZER |
Referenced by hicu_grid_generate(), and grid_generate_sparse_pattern().
const int HICU_GRID_PLOT_RESOLUTION = 50 |
Referenced by compute_grid_thread_func(), and compute_grid().
const real RELATIVE_DENSITY_VARIATION_LIMIT = 0.5 |
Referenced by compute_grid_for_box().
const real TARGET_RHO_ERROR_FACTOR = 1e-4 |
Referenced by hicu_grid_generate(), and grid_generate_sparse_pattern().