59#define THREE std::setw(3) << std::setfill(' ')
62#define FOUR std::setw(4) << std::setfill(' ')
65#define FIVE std::setw(5) << std::setfill(' ')
68#define SIX std::setw(6) << std::setfill(' ')
71#define SEVEN std::setw(7) << std::setfill(' ')
74#define HEIGHT std::setw(8) << std::setfill(' ')
77#define NINE std::setw(9) << std::setfill(' ')
112 struct timeval start, interm,
stop;
137 unsigned int LI[35][3];
251 std::vector<criticalpoint> cpList;
307 void IGM(
double** chi,
double** phi,
308 double* dx,
double* dy,
double* dz,
double** gradPrim,
309 double &deltagIntraCURRENT,
double &deltagInterCURRENT,
double &qgIntraCURRENT,
double &qgInterCURRENT);
330void gradAtomHirsh(
bool fullRHOGRAD,
unsigned int threadID,
double rho,
double gradrho[3],
331 double*** dx,
double*** dy,
double*** dz,
int ip,
332 double* rhoFree,
double *pregradFree,
double** gradAtom,
double* rhoAtom);
341void gradAtomGBP(
unsigned int nbPrim,
unsigned int* prim,
double** gradPrim,
double** gradAtom);
353void IGMH(
double** gradAtom,
double &deltagIntraCURRENT,
double &deltagInterCURRENT,
double &qgIntraCURRENT,
double &qgInterCURRENT);
361void IGMBDA(
double *gradAtom1QM,
double *gradAtom2QM,
double &bda);
381 double* rhoFree,
double** gradFree,
double* lapFree);
418using FunctionType = double (*)(double, double);
419static FunctionType functions[];
420static FunctionType derivatives[];
432typedef struct basinProperties
439 basinProperties(
double e = 0.0,
double v = 0.0,
double k = 0.0) : electrons(e), volume(v), KinExcess(k) {}
447 NCISolver(
const char* parameterFileName,
bool logParam =
true);
484 unsigned int*
index0(
const unsigned int i);
491 unsigned int index1(
const unsigned int i);
532void calcQMAO(
unsigned int nbPrim,
unsigned int* prim,
double* d2,
double* dx,
double* dy,
double* dz,
double** chi);
545void calcQMPROP(
unsigned int nbPrim,
unsigned int* prim,
double** chi,
double** phi,
double &rho,
double* grad,
double** hess);
563bool NewtonRaphson(
unsigned int nbPrim,
unsigned int* prim,
double rcurr[3],
double L[3],
double &G,
double &rhocp,
double &gradrhocp);
570int cptype(
double L123[3]);
582void basischange(
unsigned int nbPrim,
unsigned int* prim,
double matrixHessianEigVec[3][3],
583 double **chi,
double* dx,
double* dy,
double* dz,
double **phi,
double gg[3]);
593void IGMPRO(
double *dx,
double *dy,
double *dz,
double &deltag,
double &qg);
603void dgdgAtPRO(
double *dx,
double *dy,
double *dz,
double &deltag, std::vector<double>& dgAt);
613void gradPRO(
double *dx,
double *dy,
double *dz,
double **gradAtom);
631void rhogradlap(
unsigned int at1,
unsigned int at2,
double* rhoFree,
double** gradFree,
double* lapFree,
632 double &rhopro,
double* gradpro,
double &normgradpro,
double &lap);
643static double func0(
double r,
double alpha);
652static double func1(
double r,
double alpha);
662static double func2(
double r,
double alpha);
670static double func3(
double r,
double alpha);
677static double func4(
double r,
double alpha);
688 double tolerance = 0.010,
689 int maxIterations = 100,
690 double initialGuess = 0.01
722std::map<std::pair<int, int>,
basinProperties>
computeBasinProperties(
double*** ELFbasin,
double*** KE,
double*** rho,
const unsigned int dimX,
const unsigned int dimY,
const unsigned int dimZ);
729std::pair<size_t, size_t>
find2max(
const std::vector<double>& dgAt);
739 double* dx,
double* dy,
double* dz);
Worker for one Node of the NCI grid.
double getPredictedSize()
Return the predicted size of the ouput in MB.
Definition NCISolver.cpp:9051
void IGMPRO(double *dx, double *dy, double *dz, double &deltag, double &qg)
compute the deltag descriptor at current point
Definition NCISolver.cpp:11646
double * primRmin
Array to store the minimum radius below which a primitive has to be computed (scalProd speedup test)
Definition NCISolver.h:201
void solve()
Solves the problem.
Definition NCISolver.cpp:7627
double MOoccupied
The number of MO occupied with occupancy >=0.1.
Definition NCISolver.h:224
void rhoFree__pregradFree(double *dist, double *rhoFree, double *pregradFree)
Compute quantities needed to compute next rho and gradrho at the promol level.
Definition NCISolver.cpp:10172
unsigned int * nprimbond
Definition NCISolver.h:198
void IGMBDA(double *gradAtom1QM, double *gradAtom2QM, double &bda)
Compute the deltagInter quantity between two given atoms of a bond and the associated BDA based on HI...
Definition NCISolver.cpp:10711
bool runinfostate
runinfo file state (timing info for users printed by
Definition NCISolver.h:116
int cptype(double L123[3])
determine the signature of the critical point (algebrix sum of the signs of the three eigenvalues)
Definition NCISolver.cpp:11532
unsigned int * fragAIndexToFragPrimIndex
An array converting indexes of fragAPrim to indexes of fragPrim.
Definition NCISolver.h:174
void IGMH(double **gradAtom, double &deltagIntraCURRENT, double &deltagInterCURRENT, double &qgIntraCURRENT, double &qgInterCURRENT)
Compute the deltagIntra and deltagInter quantities.
Definition NCISolver.cpp:10589
~NCISolver()
Destructor.
Definition NCISolver.cpp:1918
param_t params
Problem's parameters.
Definition NCISolver.h:93
static double func2(double r, double alpha)
function that used to limit the number of GTO to be calculated (speedup test, Hugo ROUSSEL work)Funct...
Definition NCISolver.cpp:11973
struct NCISolver::basinProperties basinProperties
structure to save ELF basin population and volume
unsigned int LI[35][3]
For index0.
Definition NCISolver.h:137
void findmaxc()
find the maximum value for primitive coefficients accross the MOs
Definition NCISolver.cpp:11253
std::map< std::pair< int, int >, basinProperties > computeBasinProperties(double ***ELFbasin, double ***KE, double ***rho, const unsigned int dimX, const unsigned int dimY, const unsigned int dimZ)
function to compute the number of electron in each ELF basin
Definition NCISolver.cpp:12084
bool * inMoleculeA
Array to store the membership of each primitives of Fragment A.
Definition NCISolver.h:185
std::string score()
Return a string with the interaction's score.
Definition NCISolver.cpp:8854
Node ** nodes
A program node used by threads.
Definition NCISolver.h:104
static double maxElectron
The accuracy required for atomic orbitals calculation (speed-up procedure by J. Pilme)
Definition NCISolver.h:182
std::vector< int > decodeBasin(double n)
function decode an atom index pair
Definition NCISolver.cpp:12074
std::vector< int > atomTypeNb
List of the number of atoms for each atom type.
Definition NCISolver.h:235
void rhoFree_gradFree_lapFree(double *dist, double *dx, double *dy, double *dz, double *rhoFree, double **gradFree, double *lapFree)
Compute quantities needed to compute next rho and gradrho anf laplacian at the promol level G2.
Definition NCISolver.cpp:10229
double rhopromolFRAG1FRAG2(double *rhoFree)
Compute the free promol ED for FRAG1+FRAG2 system.
Definition NCISolver.cpp:10205
unsigned int * fragBPrim
the list (array) of primitives of fragment B
Definition NCISolver.h:164
unsigned int * allPrim
the list (array) of ALL primitives
Definition NCISolver.h:169
NCISolver(const char *parameterFileName, bool logParam=true)
Main constructor.
Definition NCISolver.cpp:59
unsigned int nbPrimInA
the number of primitives in fragment A (Cube mode)
Definition NCISolver.h:191
unsigned int * index0(const unsigned int i)
get the triplet (i,j,k) defining a GTO (or STO) from a code in the range [0:34]
Definition NCISolver.cpp:8861
void dgdgAtPRO(double *dx, double *dy, double *dz, double &deltag, std::vector< double > &dgAt)
compute the deltag descriptor at current point as well as every atomic contribution
Definition NCISolver.cpp:11761
int currentPercentage
Current completion in percent.
Definition NCISolver.h:125
void calcQMAO(unsigned int nbPrim, unsigned int *prim, double *d2, double *dx, double *dy, double *dz, double **chi)
Compute primitives from WFX/WFN data at current grid point.
Definition NCISolver.cpp:10728
static double func1(double r, double alpha)
function that used to limit the number of GTO to be calculated (speedup test, Hugo ROUSSEL work)Funct...
Definition NCISolver.cpp:11963
std::pair< size_t, size_t > find2max(const std::vector< double > &dgAt)
function to find the two largest values of a vector of numbers
Definition NCISolver.cpp:12158
double rhoHIRSHFRAG1FRAG2(double rhoQM, double *rhoFree)
estimated QM ED for the FRAG1+FRAG2 system from HIRSHFELD partition
Definition NCISolver.cpp:10513
Results * results
Results' values.
Definition NCISolver.h:101
void gradPRO(double *dx, double *dy, double *dz, double **gradAtom)
compute the promolecular ED gradient at current point
Definition NCISolver.cpp:11713
void calcQMPROP(unsigned int nbPrim, unsigned int *prim, double **chi, double **phi, double &rho, double *grad, double **hess)
Compute primitives and MOs from WFX/WFN data at current grid point.
Definition NCISolver.cpp:11141
void initializeL3()
Tool procedure that initializes L3 array (s,p,d,f,g GTOs)
Definition NCISolver.cpp:8975
static double func0(double r, double alpha)
function that used to limit the number of GTO to be calculated (speedup test, Hugo ROUSSEL work)Funct...
Definition NCISolver.cpp:11952
struct NCISolver::point point
structure to save 3D point (triplet of doubles)
double coreElecWFN
The number of core electrons (BDA calculations only account for valence orbitals)
Definition NCISolver.h:221
axis_t * posGrid
Array with current grid position.
Definition NCISolver.h:107
static double func3(double r, double alpha)
function that used to limit the number of GTO to be calculated (speedup test, Hugo ROUSSEL work)Funct...
Definition NCISolver.cpp:11983
unsigned int COREHeavyAtomWarning
Boolean flag to indicate if one atom exceeds the upper atomic number limit for BDA treatment.
Definition NCISolver.h:212
void rhoFree__pregradFree_sumSquareBRho(double *dist, double *rhoFree, double *pregradFree, double *sumSquareBRho)
Compute quantities needed to compute next rho and gradrho at the promol level.
Definition NCISolver.cpp:10133
static double func4(double r, double alpha)
function that used to limit the number of GTO to be calculated (speedup test, Hugo ROUSSEL work)Funct...
Definition NCISolver.cpp:11995
void basischange(unsigned int nbPrim, unsigned int *prim, double matrixHessianEigVec[3][3], double **chi, double *dx, double *dy, double *dz, double **phi, double gg[3])
changes the basis for several vectors of the QM calculation
Definition NCISolver.cpp:11556
double gradnormIGM(double *pregradFree, double *dx, double *dy, double *dz)
function to compute the norm of the IGM ED gradient in PROMOLECULAR mode
Definition NCISolver.cpp:10449
unsigned int nbThreads
The number of threads for the current run.
Definition NCISolver.h:146
void setChemFormula()
establish the chemical formula of the studied system
Definition NCISolver.cpp:9589
double total
Total dg inter.
Definition NCISolver.h:131
unsigned int * fragPrim
the list (array) of primitives to be considered in the IGM QM calculations
Definition NCISolver.h:153
double elecNumb
The total theoretical number of electrons.
Definition NCISolver.h:215
bool NewtonRaphson(unsigned int nbPrim, unsigned int *prim, double rcurr[3], double L[3], double &G, double &rhocp, double &gradrhocp)
performs a Newton-Raphson procedure to get the Critical point closest to the guess passed in paramete...
Definition NCISolver.cpp:11273
void setCOREMOandELEC()
count the number of core MOs and electrons
Definition NCISolver.cpp:9382
ProgData * data
Problem's data.
Definition NCISolver.h:96
void calcprops_wfn_cyl()
IBSI + BDA calculations, no cube generated.
Definition NCISolver.cpp:6001
int zyAxisSize
Number of row in the grid.
Definition NCISolver.h:119
unsigned int * fragAPrim
the list (array) of primitives of fragment A
Definition NCISolver.h:159
unsigned int * fragBIndexToFragPrimIndex
An array converting indexes of fragAPrim to indexes of fragPrim.
Definition NCISolver.h:178
void getLambdaOfHessian(double **hessian, double *eigenValues, double **eigenVect)
Using the eig3 implementation of diagonalisation.
Definition NCISolver.cpp:9021
std::vector< moleculeOrbital > molecularOrbitals
the set of expressions of MOs read from the WFN/WFX
Definition NCISolver.h:247
void findRminAllPrim()
function that compute the minimum radius for all primitives
Definition NCISolver.cpp:12025
unsigned int L3[35]
For index1.
Definition NCISolver.h:140
double * maxc
the maximum value of primitive coefficient accross the MOs
Definition NCISolver.h:241
void setIBSIPrimList()
filtering primitives according to the cutoff radius around atom pairs
Definition NCISolver.cpp:9245
unsigned int npri
the size of the basis set read from WFN
Definition NCISolver.h:244
void lineProcessing(int posY, int posZ, int cubePosYZ)
Process all the information for an entire line of the grid.
Definition NCISolver.cpp:8675
void gradAtomGBP(unsigned int nbPrim, unsigned int *prim, double **gradPrim, double **gradAtom)
Compute the atomic contribution to the ED gradient according to the GBP partition.
Definition NCISolver.cpp:10545
unsigned int nbPrimInB
the number of primitives in fragment B (Cube mode)
Definition NCISolver.h:194
void setDensityMatrixForPauli(double **D)
compute matrix density elements from wave function
Definition NCISolver.cpp:9062
struct timeval start interm stop
start and stop time to provide timing info for the user
Definition NCISolver.h:112
unsigned long int fullSize
Number of nodes in the grid.
Definition NCISolver.h:122
unsigned int index1(const unsigned int i)
identify which kind of AO it is
Definition NCISolver.cpp:8879
double WFNelecNumb
The real number of electrons reac from WFN.
Definition NCISolver.h:218
unsigned int ** primbond
the list (array) of primitives to be considered in the IBSI calculation
Definition NCISolver.h:238
void initializeLI()
Tool procedure that initializes LI array (36 GTO types)
Definition NCISolver.cpp:8901
std::vector< int > atomTypeList
List of atom types present in the system.
Definition NCISolver.h:232
void setPrimList()
filtering primitives according to fragment definitions
Definition NCISolver.cpp:9106
void IGM(double **chi, double **phi, double *dx, double *dy, double *dz, double **gradPrim, double &deltagIntraCURRENT, double &deltagInterCURRENT, double &qgIntraCURRENT, double &qgInterCURRENT)
compute the deltagIntra and deltagIntrer in cartesian coordinates (not cylindrical)
Definition NCISolver.cpp:9624
bool * inMoleculeB
Array to store the membership of each primitives of Fragment B.
Definition NCISolver.h:188
double encodeBasin(int a, int b)
function Code an atom index pair
Definition NCISolver.cpp:12064
unsigned int fragNbPrim
The number of primitives to be considered in the IGM WFN( WFX) calculations (cube mode)
Definition NCISolver.h:149
void calcprops_wfn()
IGM dg dgInter dgIntra CUBE calculations.
Definition NCISolver.cpp:1948
bool getRuninfostate()
Return the runinfo state (true = built by printCurrentState)
Definition NCISolver.cpp:9056
double max
Maximum percent value.
Definition NCISolver.h:134
void gradAtomHirsh(bool fullRHOGRAD, unsigned int threadID, double rho, double gradrho[3], double ***dx, double ***dy, double ***dz, int ip, double *rhoFree, double *pregradFree, double **gradAtom, double *rhoAtom)
Compute the atomic contribution to the ED gradient according to the Hirschfeld partition.
Definition NCISolver.cpp:9956
void output()
Outputs according the output type given in the parameters.
Definition NCISolver.cpp:8704
bool log
Activates logs.
Definition NCISolver.h:128
double predictedSize
Predicted size of the data on HDD.
Definition NCISolver.h:143
void rhogradlap(unsigned int at1, unsigned int at2, double *rhoFree, double **gradFree, double *lapFree, double &rhopro, double *gradpro, double &normgradpro, double &lap)
compute the promolecular ED + gradient + hessien at current point
Definition NCISolver.cpp:10393
double findRmin(int GTOType, double alpha, double tolerance=0.010, int maxIterations=100, double initialGuess=0.01)
function that takes as input the type (s,p,d,f,g) of GTO and its alpha exponent and returns a radius ...
Definition NCISolver.cpp:11854
Class used to handle every node data storage and processing ; implemented for multiprocessing impleme...
Definition Node.h:59
Class designed to store the program's main dataprovide some utilities concerning those.
Definition ProgData.h:65
Class designed to store all results that can be used as output by the program.
Definition Results.h:67
structure to save 3D point (triplet of doubles)
Definition NCISolver.h:425
double x
x,y,z coordinates
Definition NCISolver.h:427
Structure describing one axis.
Definition general.h:2173
Structure used for the storage of the parameters read from the parameter file param....
Definition general.h:2039