1 /**********************************************************************************************************
2 Copyright (c) 2002-2013 Abdul-Rahman Allouche. All rights reserved
3 
4 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5 documentation files (the Gabedit), to deal in the Software without restriction, including without limitation
6 the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
7 and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8 
9   The above copyright notice and this permission notice shall be included in all copies or substantial portions
10   of the Software.
11 
12 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
13 TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
14 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
15 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
16 DEALINGS IN THE SOFTWARE.
17 ************************************************************************************************************/
18 
19 #ifndef __GABEDIT_GRID_H__
20 #define __GABEDIT_GRID_H__
21 #include "../MultiGrid/PoissonMG.h"
22 
23 typedef struct _Point5
24 {
25 	gdouble C[5];
26 }Point5;
27 typedef struct _GridLimits
28 {
29 	gdouble MinMax[2][4];
30 }GridLimits;
31 
32 typedef struct _Grid
33 {
34 	gint N[3];
35 	Point5 ***point;
36 	GridLimits limits;
37 	gboolean mapped;
38 }Grid;
39 gdouble get_value_orbital(gdouble x,gdouble y,gdouble z,gint k);
40 gdouble get_value_electronic_density_on_atom(gdouble x,gdouble y,gdouble z,gint n);
41 gdouble get_value_electronic_density_atomic(gdouble x,gdouble y,gdouble z,gint dump);
42 gdouble get_value_electronic_density(gdouble x,gdouble y,gdouble z,gint dump);
43 gdouble get_value_electronic_density_bonds(gdouble x,gdouble y,gdouble z,gint dump);
44 gdouble get_value_spin_density(gdouble x,gdouble y,gdouble z,gint dump);
45 gboolean test_grid_all_positive(Grid* grid);
46 Grid* grid_point_alloc(gint N[],GridLimits limits);
47 Grid* define_grid(gint N[],GridLimits limits);
48 Grid* free_grid(Grid* grid);
49 GridLimits limits;
50 gint NumPoints[3];
51 gdouble firstDirection[3];
52 gdouble secondDirection[3];
53 gdouble thirdDirection[3];
54 gdouble originOfCube[3];
55 Grid* get_grid_laplacian(Grid* grid, gint nBoundary);
56 Grid* get_grid_norm_gradient(Grid* grid, gint nBoundary);
57 Grid* get_grid_sign_lambda2_density(Grid* grid, gint nBoundary);
58 Grid* compute_mep_grid_using_multipol_from_density_grid(Grid* grid, gint lmax);
59 gdouble** compute_multipol_from_grid(Grid* grid, gint lmax, gdouble xOff, gdouble yOff, gdouble zOff);
60 Grid* compute_mep_grid_using_multipol_from_orbitals(gint N[],GridLimits limits, gint lmax);
61 Grid* compute_mep_grid_using_partial_charges_cube_grid(Grid* grid);
62 Grid* compute_mep_grid_using_partial_charges(gint N[],GridLimits limits);
63 Grid* solve_poisson_equation_from_density_grid(Grid* grid, PoissonSolverMethod psMethod);
64 Grid* solve_poisson_equation_from_orbitals(gint N[],GridLimits limits, PoissonSolverMethod psMethod);
65 gboolean compute_coulomb_integrale(Grid* grid);
66 gboolean compute_coulomb_integrale_iijj(gint N[],GridLimits limits, gint typeOrbi, gint i, gint typeOrbj, gint j,
67 		gdouble* pInteg, gdouble* pNormi, gdouble* pNormj, gdouble* pOverlap);
68 gboolean compute_coulomb_integrale_iijj_poisson(gint N[],GridLimits limits, gint typeOrbi, gint i, gint typeOrbj, gint j,
69 		gdouble* pInteg, gdouble* pNorm, gdouble* pNormj, gdouble* pOverlap);
70 Grid* define_grid_electronic_density(gint N[],GridLimits limits);
71 Grid* define_grid_ELFBECKE(gint N[],GridLimits limits);
72 Grid* define_grid_ELFSAVIN(gint N[],GridLimits limits);
73 Grid* define_grid_FED(gint N[],GridLimits limits, gint n);
74 Grid* compute_fed_grid_using_cube_grid(Grid* grid, gint n);
75 gboolean compute_transition_matrix_numeric(gint N[],GridLimits limits, gint typeOrbi, gint i, gint typeOrbj, gint j,
76 gdouble* pInteg, gdouble* pNormi, gdouble* pNormj, gdouble* pOverlap);
77 gboolean compute_spatial_overlapiijj_numeric(gint N[],GridLimits limits, gint typeOrbi, gint i, gint typeOrbj, gint j,
78 		gdouble* pInteg, gdouble* pNormi, gdouble* pNormj, gdouble* pOverlap);
79 gboolean compute_spatial_overlapij_numeric(gint N[],GridLimits limits, gint typeOrbi, gint i, gint typeOrbj, gint j,
80 		gdouble* pInteg, gdouble* pNormi, gdouble* pNormj, gdouble* pOverlap);
81 gboolean compute_isovalue_percent_from_grid(Grid* grid, gboolean square, gdouble percent, gdouble precision, gdouble* pIsovalue);
82 Grid* copyGrid(Grid* grid);
83 Grid* compute_mep_grid_exact(gint N[],GridLimits limits);
84 Grid* compute_mep_grid_using_orbitals(gint N[],GridLimits limits);
85 void reset_boundary(Grid* grid, gint nBoundary);
86 gdouble getLambda2(Grid* grid, gint i, gint j, gint k, gdouble* fcx, gdouble* fcy, gdouble* fcz, gdouble* lfcx, gdouble* lfcy, gdouble* lfcz, gint nBoundary);
87 gboolean get_charge_transfer_centers(Grid* grid, gdouble* CN, gdouble* CP, gdouble *qn, gdouble* qp, gdouble* H);
88 gboolean compute_integrale_from_grid_all_space(Grid* grid, gdouble* pInteg);
89 gdouble get_value_CBTF(gdouble x,gdouble y,gdouble z,gint i);
90 
91 #endif /* __GABEDIT_GRID_H__ */
92 
93