IGMPlot: src/include/toolbox.h Source File

IGMPlot 3.16 Optimized IGMplot version able to use wfn/wfx/xyz files

Loading...
Searching...
No Matches
toolbox.h
Go to the documentation of this file.
1/*
2 * Copyright University of Reims Champagne-Ardenne
3 * Authors and Contributors: Akilan RAJAMANI, Corentin LEFEBVRE, Johanna KLEIN,
4 * Emmanuel PLUOT, Hugo ROUSSEL, Gaetan RUBEZ, Hassan KHARTABIL,
5 * Jean-Charles BOISSON and Eric HENON
6 * (24/07/2017)
7 * jean-charles.boisson@univ-reims.fr, eric.henon@univ-reims.fr
8 *
9 * This software is a computer program whose purpose is to
10 * detect and quantify interactions from electron density
11 * obtained either internally from promolecular density or
12 * calculated from an input wave function input file. It also
13 * prepares for the visualization of isosurfaces representing
14 * several descriptors (dg) coming from the IGM methodology.
15 *
16 * This software is governed by the CeCILL-C license under French law and
17 * abiding by the rules of distribution of free software. You can use,
18 * modify and/ or redistribute the software under the terms of the CeCILL-C
19 * license as circulated by CEA, CNRS and INRIA at the following URL
20 * "http://www.cecill.info".
21 *
22 * As a counterpart to the access to the source code and rights to copy,
23 * modify and redistribute granted by the license, users are provided only
24 * with a limited warranty and the software's author, the holder of the
25 * economic rights, and the successive licensors have only limited
26 * liability.
27 *
28 * In this respect, the user's attention is drawn to the risks associated
29 * with loading, using, modifying and/or developing or reproducing the
30 * software by the user in light of its specific status of free software,
31 * that may mean that it is complicated to manipulate, and that also
32 * therefore means that it is reserved for developers and experienced
33 * professionals having in-depth computer knowledge. Users are therefore
34 * encouraged to load and test the software's suitability as regards their
35 * requirements in conditions enabling the security of their systems and/or
36 * data to be ensured and, more generally, to use and operate it in the
37 * same conditions as regards security.
38 *
39 * The fact that you are presently reading this means that you have had
40 * knowledge of the CeCILL-C license and that you accept its terms.
41 *
42 * */
43
48
49#ifndef _TOOLBOX_H_
50#define _TOOLBOX_H_
51
52
53// STL
54// JC Move to general
55//#include <set>
56//#include <sstream>
57//#include <iostream>
58//#include <fstream>
59//#include <iomanip>
60//#include <fstream>
61//#include <cstdlib>
62//#include <vector>
63
64// LOCAL
65//#include <general.h>
66#include <eig3.h>
67//#include <reader.h> fait planter la compil ...
68// donc, je redefinis les atomnames ici ...: pas propre ...
69const std::string ATOM_NAMES_ERIC [] =
70 {
71 "H","He","Li","Be","B","C","N","O","F","Ne","Na","Mg","Al","Si","P","S","Cl","Ar","K","Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu","Zn","Ga","Ge","As","Se","Br","Kr","Rb","Sr","Y","Zr","Nb","Mo","Tc", "Ru","Rh","Pd","Ag","Cd","In","Sn","Sb","Te","I","Xe","Cs","Ba","La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu","Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi","Po","At","Rn","Fr","Ra","Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr"
72 };
73
74
86double getMaxFromPrec3DMatrix (double*** _3DMatrix, const unsigned int dimX, const unsigned int dimY,
87 const unsigned int dimZ, double *** rho, const double lowerlimit, const double upperlimit);
88
100double getMinFromPrec3DMatrix (double*** _3DMatrix, const unsigned int dimX, const unsigned int dimY,
101 const unsigned int dimZ, double *** rho, const double lowerlimit, const double upperlimit);
102
103
113double getMaxFrom2Matrices(double*** cube1, double*** cube2,double threshold, const unsigned int dimX, const unsigned int dimY, const unsigned int dimZ);
114// this method returns the maximum value found in cube1 for which cube2 >threshold
115
116
129//double getMaxFromPrecVectorized3DMatrix (double* _Vectorized3DMatrix, double* cubeRho, const double threshold, const unsigned int dimX, const unsigned int dimY, const unsigned int dimZ);
130double getMaxFromPrecVectorized3DMatrix (double* _Vectorized3DMatrix, double* cubeRho, const double lowerlimit, const double upperlimit,
131 unsigned int dimX, const unsigned int dimY, const unsigned int dimZ);
132
133
139std::string getCondensedInformationFromNumericSet(std::set<int> numericValues);
140
146void space(size_t nbSpaces, size_t limit=100);
147
154//void printCurrentState(bool start=true, bool end=false, unsigned int currentValue=0, unsigned int totalToReach=0);
155void printCurrentState(unsigned int done, unsigned int total, time_t ellapsed);
156
157
158void printDEBUG(std::string message);
159
166double getScalarProduct( const double *vectorA, const double *vectorB );
167
174double getCrossProductMagn(const double *vectorA, const double *vectorB);
175
176
182double getNormOfVector( const double *vectorA);
183
189/*double getNormOfVector(const double vectorA[3]);*/
190
191
200void computeRotationMatrix(const double V[3], const double alpha, double rotMat[3][3]);
201
208 void fortranMatMul33Matrix3Vector(const double matrix[3][3], const double V[3], double VR[3]);
209
214void print_3_3_matrix(const double matrix[3][3]);
215
221std::string getAtomName(const unsigned int iatom);
222
228bool isStringInt(const std::string s);
229
236bool invSym33(double M[3][3], double MINV[3][3]);
237
244int modulo(int a, int b);
245
246
253double distance(double a[3], double b[3]);
254
255
261void getTransposed(double **M1, double M2[3][3]);
262
268void getTransposed(double M1[3][3], double M2[3][3]);
269
274bool isNumeric(std::string const &str);
275
276#endif
277
eig3.h
Eigen-decomposition for symmetric 3x3 real matrices.Public domain, copied from the public domain Java...
isNumeric
bool isNumeric(std::string const &str)
function that takes a string as input and check it is numeric
Definition toolbox.cpp:676
getMaxFrom2Matrices
double getMaxFrom2Matrices(double ***cube1, double ***cube2, double threshold, const unsigned int dimX, const unsigned int dimY, const unsigned int dimZ)
From cube1, return the maximum value found for which cube2 > threshold.
Definition toolbox.cpp:114
getMaxFromPrec3DMatrix
double getMaxFromPrec3DMatrix(double ***_3DMatrix, const unsigned int dimX, const unsigned int dimY, const unsigned int dimZ, double ***rho, const double lowerlimit, const double upperlimit)
From a 3D matrix, return the maximum value found.
Definition toolbox.cpp:55
distance
double distance(double a[3], double b[3])
function that returns the distance between two points a and b
Definition toolbox.cpp:636
getScalarProduct
double getScalarProduct(const double *vectorA, const double *vectorB)
Tool procedure computing scalar product between two 3D vectors.
Definition toolbox.cpp:392
getCondensedInformationFromNumericSet
std::string getCondensedInformationFromNumericSet(std::set< int > numericValues)
From a set of numeric value, return a string version of the content with interval (if the information...
Definition toolbox.cpp:179
fortranMatMul33Matrix3Vector
void fortranMatMul33Matrix3Vector(const double matrix[3][3], const double V[3], double VR[3])
Specific version of Fortran MatMul for 3*3 matrix and a vector.
space
void space(size_t nbSpaces, size_t limit=100)
Print spaces characters.
Definition toolbox.cpp:248
getCrossProductMagn
double getCrossProductMagn(const double *vectorA, const double *vectorB)
computes the magnitude of the cross product between two given vectors
Definition toolbox.cpp:397
getTransposed
void getTransposed(double **M1, double M2[3][3])
function that take the transposed matrix of M1 and put it in M2
Definition toolbox.cpp:647
getMaxFromPrecVectorized3DMatrix
double getMaxFromPrecVectorized3DMatrix(double *_Vectorized3DMatrix, double *cubeRho, const double lowerlimit, const double upperlimit, unsigned int dimX, const unsigned int dimY, const unsigned int dimZ)
From a Vectorized 3D matrix, return the maximum value found.
Definition toolbox.cpp:142
printCurrentState
void printCurrentState(unsigned int done, unsigned int total, time_t ellapsed)
Tool to display timing info for user.
Definition toolbox.cpp:263
invSym33
bool invSym33(double M[3][3], double MINV[3][3])
function that computes the inverse of a 3x3 symmetric matrix
Definition toolbox.cpp:565
getMinFromPrec3DMatrix
double getMinFromPrec3DMatrix(double ***_3DMatrix, const unsigned int dimX, const unsigned int dimY, const unsigned int dimZ, double ***rho, const double lowerlimit, const double upperlimit)
From a 3D matrix, return the maximum value found.
Definition toolbox.cpp:85
getNormOfVector
double getNormOfVector(const double *vectorA)
Tool procedure computing the norm of a given 3D vector.
Definition toolbox.cpp:506
isStringInt
bool isStringInt(const std::string s)
function to test that a string really represents an integer
Definition toolbox.cpp:558
modulo
int modulo(int a, int b)
function that returns the modulo of a by b (works for negative a values)
Definition toolbox.cpp:625