|
IGMPlot 3.16
Optimized IGMplot version able to use wfn/wfx/xyz files
|
Class designed to manage the entire problem solving concerning the processing of molecular interactions It reads the problem when created and solves it when asked for. More...
#include <NCISolver.h>

Data Structures | |
| struct | point |
| structure to save 3D point (triplet of doubles) More... | |
Public Types | |
| typedef struct NCISolver::point | point |
| structure to save 3D point (triplet of doubles) | |
Public Member Functions | |
| NCISolver (const char *parameterFileName, bool logParam=true) | |
| Main constructor. | |
| ~NCISolver () | |
| Destructor. | |
| void | solve () |
| Solves the problem. | |
| void | lineProcessing (int posY, int posZ, int cubePosYZ) |
| Process all the information for an entire line of the grid. | |
| void | output () |
| Outputs according the output type given in the parameters. | |
| std::string | score () |
| Return a string with the interaction's score. | |
| 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] | |
| unsigned int | index1 (const unsigned int i) |
| identify which kind of AO it is | |
| void | initializeLI () |
| Tool procedure that initializes LI array (36 GTO types) | |
| void | initializeL3 () |
| Tool procedure that initializes L3 array (s,p,d,f,g GTOs) | |
| void | getLambdaOfHessian (double **hessian, double *eigenValues, double **eigenVect) |
| Using the eig3 implementation of diagonalisation. | |
| double | getPredictedSize () |
| Return the predicted size of the ouput in MB. | |
| bool | getRuninfostate () |
| Return the runinfo state (true = built by printCurrentState) | |
| 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. | |
| 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. | |
| void | findmaxc () |
| find the maximum value for primitive coefficients accross the MOs | |
| 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 parameters | |
| int | cptype (double L123[3]) |
| determine the signature of the critical point (algebrix sum of the signs of the three eigenvalues) | |
| 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 | |
| void | IGMPRO (double *dx, double *dy, double *dz, double &deltag, double &qg) |
| compute the deltag descriptor at current point | |
| void | gradPRO (double *dx, double *dy, double *dz, double **gradAtom) |
| compute the promolecular ED gradient at current point | |
| 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 Rmin wrapping 0.999 electron | |
| void | findRminAllPrim () |
| function that compute the minimum radius for all primitives | |
Private Member Functions | |
| void | calcprops_wfn () |
| IGM dg dgInter dgIntra CUBE calculations. | |
| void | calcprops_wfn_cyl () |
| IBSI + BDA calculations, no cube generated. | |
| void | setDensityMatrixForPauli (double **D) |
| compute matrix density elements from wave function | |
| void | setPrimList () |
| filtering primitives according to fragment definitions | |
| void | setIBSIPrimList () |
| filtering primitives according to the cutoff radius around atom pairs | |
| void | setCOREMOandELEC () |
| count the number of core MOs and electrons | |
| void | setChemFormula () |
| establish the chemical formula of the studied system | |
| 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) | |
| 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. | |
| 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. | |
| void | IGMH (double **gradAtom, double &deltagIntraCURRENT, double &deltagInterCURRENT, double &qgIntraCURRENT, double &qgInterCURRENT) |
| Compute the deltagIntra and deltagInter quantities. | |
| 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 HIRSHFELD ATOM Partition. | |
| void | rhoFree__pregradFree (double *dist, double *rhoFree, double *pregradFree) |
| Compute quantities needed to compute next rho and gradrho at the promol level. | |
| 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. | |
| double | rhopromolFRAG1FRAG2 (double *rhoFree) |
| Compute the free promol ED for FRAG1+FRAG2 system. | |
| double | rhoHIRSHFRAG1FRAG2 (double rhoQM, double *rhoFree) |
| estimated QM ED for the FRAG1+FRAG2 system from HIRSHFELD partition | |
Private Attributes | |
| param_t | params |
| Problem's parameters. | |
| ProgData * | data |
| Problem's data. | |
| Results * | results |
| Results' values. | |
| Node ** | nodes |
| A program node used by threads. | |
| axis_t * | posGrid |
| Array with current grid position. | |
| struct timeval start interm | stop |
| start and stop time to provide timing info for the user | |
| bool | runinfostate |
| runinfo file state (timing info for users printed by | |
| int | zyAxisSize |
| Number of row in the grid. | |
| unsigned long int | fullSize |
| Number of nodes in the grid. | |
| int | currentPercentage |
| Current completion in percent. | |
| bool | log |
| Activates logs. | |
| double | total |
| Total dg inter. | |
| double | max |
| Maximum percent value. | |
| unsigned int | LI [35][3] |
| For index0. | |
| unsigned int | L3 [35] |
| For index1. | |
| double | predictedSize |
| Predicted size of the data on HDD. | |
| unsigned int | nbThreads |
| The number of threads for the current run. | |
| unsigned int | fragNbPrim |
| The number of primitives to be considered in the IGM WFN( WFX) calculations (cube mode) | |
| unsigned int * | fragPrim |
| the list (array) of primitives to be considered in the IGM QM calculations | |
| unsigned int * | fragAPrim |
| the list (array) of primitives of fragment A | |
| unsigned int * | fragBPrim |
| the list (array) of primitives of fragment B | |
| unsigned int * | allPrim |
| the list (array) of ALL primitives | |
| unsigned int * | fragAIndexToFragPrimIndex |
| An array converting indexes of fragAPrim to indexes of fragPrim. | |
| unsigned int * | fragBIndexToFragPrimIndex |
| An array converting indexes of fragAPrim to indexes of fragPrim. | |
| bool * | inMoleculeA |
| Array to store the membership of each primitives of Fragment A. | |
| bool * | inMoleculeB |
| Array to store the membership of each primitives of Fragment B. | |
| unsigned int | nbPrimInA |
| the number of primitives in fragment A (Cube mode) | |
| unsigned int | nbPrimInB |
| the number of primitives in fragment B (Cube mode) | |
| unsigned int * | nprimbond |
| double * | primRmin |
| Array to store the minimum radius below which a primitive has to be computed (scalProd speedup test) | |
| unsigned int | COREHeavyAtomWarning |
| Boolean flag to indicate if one atom exceeds the upper atomic number limit for BDA treatment. | |
| double | elecNumb |
| The total theoretical number of electrons. | |
| double | WFNelecNumb |
| The real number of electrons reac from WFN. | |
| double | coreElecWFN |
| The number of core electrons (BDA calculations only account for valence orbitals) | |
| double | MOoccupied |
| The number of MO occupied with occupancy >=0.1. | |
| std::vector< int > | atomTypeList |
| List of atom types present in the system. | |
| std::vector< int > | atomTypeNb |
| List of the number of atoms for each atom type. | |
| unsigned int ** | primbond |
| the list (array) of primitives to be considered in the IBSI calculation | |
| double * | maxc |
| the maximum value of primitive coefficient accross the MOs | |
| unsigned int | npri |
| the size of the basis set read from WFN | |
| std::vector< moleculeOrbital > | molecularOrbitals |
| the set of expressions of MOs read from the WFN/WFX | |
Static Private Attributes | |
| static double | maxElectron |
| The accuracy required for atomic orbitals calculation (speed-up procedure by J. Pilme) | |
Class designed to manage the entire problem solving concerning the processing of molecular interactions It reads the problem when created and solves it when asked for.
| NCISolver::NCISolver | ( | const char * | parameterFileName, |
| bool | logParam = true ) |
Main constructor.
| parameterFileName | The file containing the parameters |
| logParam | activation of the logs |
HEAD
NB FILE
MOLECULE B DESCRIPTION
SEPARATOR
BOX DEFINITION
CYLINDRICAL FEATURES
BOX DEFINITION
MINIMUM COORDINATE VALUES
MAXIMUM COORDINATE VALUES
INCREMENTS
MINIMUM COORDINATE VALUES
MAXIMUM COORDINATE VALUES
INCREMENTS
NB STEPS
SEPARATOR
INTERMOLECULAR
RHO RANGE (.dat)
RDG RANGE (.dat)
RHO RANGE (.cube)
RHO RANGE (.cube)
RHO RANGE (.cube)
RHO RANGE (.cube)
RHO RANGE (.cube)
RDG isovalue (.vmd)
dg_intra isovalue (.vmd)
dg_inter isovalue (.vmd)
SEPARATOR
OUTPUT OPTION
depending on outputtype, different files are generated :

| void NCISolver::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
| nbPrim | input --> Number of primitives forming the basis set |
| prim | input --> Array of primitive indices (each returned index points toward the proper primitive index in the WFX/WFN data): 1 dimension [0:nbPrim-1] |
| matrixHessianEigVec | input --> the change-of-basis 3x3 matrix |
| chi | input/output --> atomic orbital (and derivatives) values at current point, 2 dimensions: [0:nbprim-1][0:9] |
| dx,dy,dz | input --> Arrays of x-xat,y-yat,z-zar between the atoms and the current space point 1 dimension [0:nbatoms-1] |
| phi | input/output --> Molecular orbital values (and derivatives), 2 dimensions: [0:nmo-1][0:9] limited to primitives FRAG1 + FRAG2 (or for atoms within the IBSI radius, default = all primitives) |
| gg | input/output --> Electron density gradient vector at current point limited to FRAG1 + FRAG2 (or Atom1 + Atom2 for IBSI) |

|
private |
IGM dg dgInter dgIntra CUBE calculations.
k = 0, n(3)-1 ................ E N D O F Z A X I S ...............................................
j = 0, n(2)-1 ................ E N D O F Y A X I S ...............................................


|
private |
IBSI + BDA calculations, no cube generated.
vector associated with the AB bond (bond currently examined)
current bond is concerned (To prepare Eq. 17 of the Paper in CPC 2018)
current bond is concerned (To prepare Eq. 17 of the Paper in CPC 2018)
current bond is concerned (To prepare Eq. 17 of the Paper in CPC 2018)


| void NCISolver::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.
| nbPrim | input --> Number of primitives forming the basis set (can be a subset of the total nb of primitives) |
| prim | input --> Array of primitive indices (each returned index points toward the proper primitive index in the WFX/WFN data): 1 dimension [0:nbPrim-1], can be a subset of the total nb of primitives |
| d2 | input --> Array of squared distance between the atoms and the current space point 1 dimension [0:nbatoms-1] |
| dx,dy,dz | input --> Arrays of x-xat,y-yat,z-zar between the atoms and the current space point 1 dimension [0:nbatoms-1] |
| chi | output --> atomic orbital (and derivatives) values at current point, 2 dimensions: [0:nbprim-1][0:9] |


| void NCISolver::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.
| nbPrim | input --> Number of primitives forming the basis set (can be a subset of the total nb of primitives) |
| prim | input --> Array of primitive indices (each returned index points toward the proper primitive index in the WFX/WFN data): 1 dimension [0:nbPrim-1], can be a subset of the total nb of primitives |
| chi | input --> atomic orbital (and derivatives) values at current point, 2 dimensions: [0:nbprim-1][0:9] |
| phi | output --> Molecular orbital values (and derivatives), 2 dimensions: [0:nmo-1][0:9] |
| rho | output --> Electron density at current point |
| grad | output --> Electron density gradient vector at current point limited to FRAG1 + FRAG2 (or Atom1 + Atom2 for IBSI) |
| hess | output --> ED hessian at current point, 2 dimensions: [0:2][0:2] |

| int NCISolver::cptype | ( | double | L123[3] | ) |
determine the signature of the critical point (algebrix sum of the signs of the three eigenvalues)
| L123 | input --> array of three eigenvalues of the ED hessian |

| double NCISolver::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 Rmin wrapping 0.999 electron
| void NCISolver::getLambdaOfHessian | ( | double ** | hessian, |
| double * | eigenValues, | ||
| double ** | eigenVect ) |
Using the eig3 implementation of diagonalisation.
| hessian | The 3*3 hessian |
| eigenValues | eigen values (in/out parameter) |
| eigenVect | eigen vectors (out parameter) |


| double NCISolver::getPredictedSize | ( | ) |
Return the predicted size of the ouput in MB.

| bool NCISolver::getRuninfostate | ( | ) |
Return the runinfo state (true = built by printCurrentState)

|
private |
Compute the atomic contribution to the ED gradient according to the GBP partition.
| nbPrim | input --> Number of primitives forming the basis set |
| prim | input --> Array of primitive indices (each returned index points toward the proper |
| gradPrim | : input --> Gradient based partition : contribution of each primitive to the ED gradient |
| gradAtom | : output --> GBP atomic Gradient partition : contribution of each ATOM to the ED gradient |


|
private |
Compute the atomic contribution to the ED gradient according to the Hirschfeld partition.
| fullRHOGRAD | : input --> true: rho and gradrho are for the whole system, else limited to fragments |
| threadID | : input --> the current index of the thread |
| rho | : input --> ED at the current grid point |
| gradrho | : input --> ED gradient vector at the current grid point |
| dx | : input --> array of positions of current grid node relative to every atom |
| dy | : input --> array of positions of current grid node relative to every atom |
| dz | : input --> array of positions of current grid node relative to every atom |
| ip | : input --> current position in the third nested dimension of the grid (currently crossed) |
| rhoFree | : input --> the free promol ED for each atom |
| pregradFree | : input --> SumOverBRho: a quantity common to the 3 components of the free promol ED grad for each atom |
| gradAtom | : output --> Hirschfeld atomic Gradient partition : contribution of each ATOM to the ED gradient |
| rhoAtom | : output --> Hirschfeld Atomic Electron Density : contribution of each ATOM to the ED of FRAG1+FRAG2 |


| void NCISolver::gradPRO | ( | double * | dx, |
| double * | dy, | ||
| double * | dz, | ||
| double ** | gradAtom ) |
compute the promolecular ED gradient at current point
| dx | input --> vector x position of the current point with respect to the atoms (bohr) |
| dy | input --> vector y position of the current point with respect to the atoms (bohr) |
| dz | input --> vector z position of the current point with respect to the atoms (bohr) |
| gradAtom | output the resulting promol. gradient for each atom |
|
private |
compute the deltagIntra and deltagIntrer in cartesian coordinates (not cylindrical)
| chi | : input --> the primitives |
| phi | : input --> double array of Molecular Orbitals (first index = MO index, second index = 0 - 10 coding for the MO value, its first derivative, …) |
| dx | input --> array of positions of current grid node relative to every atom |
| dy | input --> array of positions of current grid node relative to every atom |
| dz | input --> array of positions of current grid node relative to every atom |
| gradPrim | : output --> Gradient based partition : contribution of each primitive to the ED gradient |
| deltagIntraCURRENT | : output --> the deltagIntra value for the current node |
| deltagInterCURRENT | : output --> the deltagInter value for the current node |
| qgIntraCURRENT | : output --> the qgIntra value for the current node |
| qgInterCURRENT | : output --> the qgInter value for the current node |
eric: IGM model, gathering primitive gradients lying on the left gradPrim of the current examined node, and separately, gathering primitive gradients lying on the right of current node --> all primitives belonging to a given atom will be put in the same set, whether they have a positive or negative ED slope here !
eric: IGM model applied solely to FRAG1+FRAG2 (may be a subset of the whole system!)
the output will now be the intra and inter contributions:


|
private |
Compute the deltagInter quantity between two given atoms of a bond and the associated BDA based on HIRSHFELD ATOM Partition.
| gradAtom1QM | : input --> ED Gradient obtained at QM level for atom1 |
| gradAtom2QM | : input --> ED Gradient obtained at QM level for atom2 |
| bda | : output --> the bonding density asymmetry |
|
private |
Compute the deltagIntra and deltagInter quantities.
| gradAtom | : input --> Hirschfeld atomic ED Gradient partition : contribution of each ATOM to the ED gradient |
| deltagIntraCURRENT | : output --> the deltagIntra value for the current node |
| deltagInterCURRENT | : output --> the deltagInter value for the current node |
| qgIntraCURRENT | : output --> the qgIntra value for the current node |
| qgInterCURRENT | : output --> the qgInter value for the current node |
eric: IGM model applied solely to FRAG1+FRAG2 (may be a subset of the whole system!)
the output will now be the intra and inter contributions:


| void NCISolver::IGMPRO | ( | double * | dx, |
| double * | dy, | ||
| double * | dz, | ||
| double & | deltag, | ||
| double & | qg ) |
compute the deltag descriptor at current point
| dx | input --> vector x position of the current point with respect to the atoms (bohr) |
| dy | input --> vector y position of the current point with respect to the atoms (bohr) |
| dz | input --> vector z position of the current point with respect to the atoms (bohr) |
| deltag | output --> the deltag descriptor at current point accounting for all interactions |
| qg | output --> the qg descriptor at current point accounting for all interactions |


| unsigned int * NCISolver::index0 | ( | const unsigned int | i | ) |
get the triplet (i,j,k) defining a GTO (or STO) from a code in the range [0:34]
| i | input --> an integer in the range [0:34] |

| unsigned int NCISolver::index1 | ( | const unsigned int | i | ) |
identify which kind of AO it is
| i | input --> an integer in the range [0:34] |
| void NCISolver::lineProcessing | ( | int | posY, |
| int | posZ, | ||
| int | cubePosYZ ) |
Process all the information for an entire line of the grid.
| posY | the current position in the Y axis |
| posZ | the current position in the Z acis |
| cubePosYZ | basic position for the index |

| bool NCISolver::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 parameters
| nbPrim | input --> Number of primitives forming the basis set |
| prim | input --> Array of primitive indices (each returned index points toward the proper primitive index in the WFX/WFN data): 1 dimension [0:nbPrim-1] |
| rcurr | input --> current position during the search (solution at the end if the convergence is achieved else NULL) |
| L | : output -> eigenvalues of the ED hessian |
| G | : output -> kinetic energy density at the cp in Hartree |
| rhocp | output -> ED at the cp in a.u. |
| gradrhocp | output -> ED gradient magnitude at the cp in a.u. |


|
private |
Compute quantities needed to compute next rho and gradrho at the promol level.
| dist | input --> distance between the current node and every atom (dist given in bohr) |
| rhoFree | : output --> ED for each atom at the promolecular level |
| pregradFree | : output --> sumBRhoOverR needed for the calculation of the ED gradient for each atom at the promolecular level sumBRhoOverR is a scalar |

|
private |
Compute quantities needed to compute next rho and gradrho at the promol level.
| dist | input --> distance between the current node and every atom (dist given in bohr) |
| rhoFree | : output --> ED for each atom at the promolecular level |
| pregradFree | : output --> sumBRhoOverR needed for the calculation of the ED gradient for each atom at the promolecular level sumBRhoOverR is a scalar |
| sumSquareBRho | : output --> sum_ B_i^2 * rho_i |

|
private |
estimated QM ED for the FRAG1+FRAG2 system from HIRSHFELD partition
| rhoFree | : input --> ED for each atom at the promolecular level (for the WHOLE system) |
| rhoQM | : input -_> the true rho obtained by means of QM for the WHOLE system |

|
private |
Compute the free promol ED for FRAG1+FRAG2 system.
| rhoFree | : input --> ED for each atom at the promolecular level (for the WHOLE system) |

| std::string NCISolver::score | ( | ) |
Return a string with the interaction's score.
|
private |
compute matrix density elements from wave function
| D | input/output --> points towards the density Matrix |

|
private |
The number of primitives to be considered in the IBSI calculation for each atom pair (an array)