00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef ORBITAL_H
00024 #define ORBITAL_H
00025
00026 #include<string.h>
00027 #include "QMData.h"
00028 #include "Molecule.h"
00029
00032 class Orbital {
00033 private:
00034 int atomid;
00035 int shellid;
00036
00037 int numatoms;
00038 const float *atompos;
00039
00040
00041 int num_wave_f;
00042
00043
00044 float *wave_f;
00045
00046 int num_basis_funcs;
00047
00048 const float *basis_array;
00049
00050
00051
00052
00053
00054
00055 int numtypes;
00056 const basis_atom_t *basis_set;
00057
00058 const int *atom_types;
00059 const int *atom_sort;
00060
00061 const int *atom_basis;
00062
00063 const float **norm_factors;
00064
00065
00066 const int *num_shells_per_atom;
00067 const int *num_prim_per_shell;
00068 const int *shell_types;
00069
00070
00071
00072 int numvoxels[3];
00073 float voxelsize;
00074 float origin[3];
00075 float gridsize[3];
00076
00077 float *grid_data;
00078
00079
00080
00081 public:
00082 Orbital(const float *atompos,
00083 const float *wave_function,
00084 const float *basis,
00085 const basis_atom_t *bset,
00086 const int *types,
00087 const int *atom_sort,
00088 const int *atom_basis,
00089 const float **norm_factors,
00090 const int *num_shells_per_atom,
00091 const int *num_prim_per_shell,
00092 const int *orbital_symmetry,
00093 int numatoms, int numtypes, int num_wave_f,
00094 int num_basis_funcs,
00095 int orbid);
00096
00097 ~Orbital(void);
00098
00099
00100
00101 int total_shells() {
00102 int shellcnt=0;
00103 for (int at=0; at<numatoms; at++) {
00104 for (int shell=0; shell < num_shells_per_atom[at]; shell++) {
00105 shellcnt++;
00106 }
00107 }
00108
00109 return shellcnt;
00110 }
00111
00112
00113 int max_primitives(void);
00114
00115
00116 int max_shell_type(void);
00117
00118
00119
00120 int max_wave_f_count(void);
00121
00122
00123 const float* get_origin() { return origin; }
00124
00125
00126 const float* get_gridsize() { return gridsize; }
00127
00128
00129 const int* get_numvoxels() { return numvoxels; }
00130
00131
00132
00133 void get_grid_axes(float xaxis[3], float yaxis[3], float zaxis[3]) {
00134 xaxis[0] = gridsize[0];
00135 yaxis[1] = gridsize[1];
00136 zaxis[2] = gridsize[2];
00137 xaxis[1] = xaxis[2] = yaxis[0] = yaxis[2] = zaxis[0] = zaxis[1] = 0.0;
00138 }
00139
00140
00141 float get_resolution() { return voxelsize; }
00142
00143
00144
00145
00146 void set_grid(float newori[3], float newdim[3], float voxelsize);
00147
00148
00149 void set_resolution(float voxelsize);
00150
00151
00152 float* get_grid_data() { return grid_data; }
00153
00154
00155
00156
00157
00158 int set_grid_to_bbox(const float *pos, float padding,
00159 float resolution);
00160
00161
00162
00163
00164 void find_optimal_grid(float threshold,
00165 int minstepsize, int maxstepsize);
00166
00167
00168
00169
00170
00171 int check_plane(int w, float threshold, int minstepsize, int &stepsize);
00172
00173
00174
00175 void normalize_wavefunction(const float *wfn);
00176
00177
00178 int calculate_mo(DrawMolecule *mol, int density);
00179
00180
00181 float evaluate_grid_point(float grid_x, float grid_y, float grid_z);
00182
00183
00184 double flops_per_gridpoint();
00185
00186 void print_wavefunction();
00187 };
00188
00189
00190
00191 int evaluate_grid(int numatoms,
00192 const float *wave_f,
00193 const float *basis_array,
00194 const float *atompos,
00195 const int *atom_basis,
00196 const int *num_shells_per_atom,
00197 const int *num_prim_per_shell,
00198 const int *shell_types,
00199 const int *numvoxels,
00200 float voxelsize,
00201 const float *origin,
00202 int density,
00203 float * orbitalgrid);
00204
00205
00206 int evaluate_grid_fast(int numatoms,
00207 const float *wave_f,
00208 const float *basis_array,
00209 const float *atompos,
00210 const int *atom_basis,
00211 const int *num_shells_per_atom,
00212 const int *num_prim_per_shell,
00213 const int *shell_types,
00214 const int *numvoxels,
00215 float voxelsize,
00216 const float *origin,
00217 int density,
00218 float * orbitalgrid);
00219
00220 #endif
00221