00001
00011 #ifndef ETCOUPL_H
00012 #define ETCOUPL_H
00013
00014 #include "hastl.h"
00015 #include "abstree.h"
00016 #include "halocorb.h"
00017 #include "command.h"
00018 #include "hacompmod.h"
00019 #include "hamatdb.h"
00020
00021 class HaQCMod;
00022 class HaMolecule;
00023 class HaMolSet;
00024 class HaAtom;
00025 class HaMat_double;
00026
00027
00028 class ETNode;
00029
00030 class ETEdge
00031 {
00032 public:
00033 ETEdge();
00034 ETEdge(int new_inode1, int new_inode2);
00035 ~ETEdge() { }
00036
00037 bool operator==(const ETEdge& rhs) const;
00038 bool operator< (const ETEdge& rhs) const;
00039
00040 double coupling;
00041 double dist;
00042
00043 int inode1;
00044 int inode2;
00045
00046 protected:
00047 void SetDefaultParam();
00048 };
00049
00050
00051 class ETNode
00052 {
00053 public:
00054 ETNode();
00055 ETNode(HaAtom* new_pAtHost);
00056 virtual ~ETNode() { }
00057
00058 bool operator==(const ETNode& rhs) const;
00059 bool operator< (const ETNode& rhs) const;
00060
00061
00062
00063 list<ETEdge> edges;
00064
00065 int set_edges_flag;
00066 HaAtom* GetHost() { return pAtHost; }
00067
00068 friend class ETEdge;
00069 friend class ETCoupl;
00070
00071 double GetX() const;
00072 double GetY() const;
00073 double GetZ() const;
00074
00075 protected:
00076 HaAtom* pAtHost;
00077 void SetDefaultParam();
00078
00079 };
00080
00081 class ETPath
00083 {
00084 public:
00085 ETPath();
00086 virtual ~ETPath() { }
00087
00088 bool clear();
00089 bool empty() { return trace.empty(); }
00090
00091 double coupling;
00092 list<int> trace;
00093
00094 };
00095
00096 class PathStep
00097 {
00098 public:
00099 PathStep();
00100 PathStep(double new_coupling, int new_destination, int new_source);
00101 virtual ~PathStep();
00102
00103 bool operator == (const PathStep & rhs) const;
00104 bool operator < (const PathStep & rhs) const;
00105
00106 double coupling;
00107 int destination;
00108 int source;
00109
00110 };
00111
00112 const int BEST_PATH = 0, COUPL_MAP = 1;
00113 const int HAM_S_DIP_TR = 0, HAM_TR = 1;
00114
00116 class ETCoupl: public HaCompMod
00117 {
00118 friend class ETEffHamDlg;
00119 public:
00120
00121 ETCoupl(HaMolSet* new_phost_mset = NULL);
00122 ~ETCoupl();
00123
00124 HaQCMod* GetQCMod() { return ptr_qc_mod; }
00125
00126
00127
00128 virtual void SetDebugLevel(int new_debug_level);
00129 virtual int OnDelAtoms(AtomCollection& del_atoms);
00130
00131 bool clear();
00132
00133 bool path_coupl_calc();
00134 bool select_important(double thresh);
00135
00136
00137 bool calc_intermol_path_coupl();
00138
00139 bool InitiateNodes();
00140 bool SetEdges(int inode);
00141 bool set_dir_path_coupl(ETEdge& edge);
00142
00143 int GetCalcType() { return calc_type; }
00144 void SetCalcType(const int new_calc_type) { calc_type = new_calc_type; }
00145
00146 bool DuttonModelCalc();
00147
00148 bool CalcGFLocOrb();
00149 bool CalcGFLocOrbHeff();
00150 int PrintOvlpElem();
00151 int PrintHeffElem();
00152
00153 bool SetDAdipoleMat();
00154 double GetDAfield() { return DA_field; }
00155 bool SetDAfield(double field);
00156 bool FindMinSplit(double& min_field, double& min_split);
00157
00158 bool CreateEigVecContour(int idx, double flvl, int grid_size);
00159 bool PrintEigVecCoef(int idx);
00160 bool ScanEigEneField(int first_eig_val, int last_eig_val, double ifield_val, double ffield_val,
00161 double step_val);
00162
00163 double calc_edge_dist();
00164
00165 vector<ETNode> nodes;
00166
00167 bool nodes_init_flag;
00168
00169 static int m_hbond_paths_flag;
00170
00171 vector<PathStep> best_path;
00172 vector<PathStep> coupl_map;
00173
00174 double GetTunEne() const;
00175 void SetTunEne(const double new_tun_ene);
00176
00177 bool PutSubMatToDB();
00178 bool GetSubMatFromDB();
00179
00180 bool CalcHDAfromGF();
00181 bool SetDAOrbFromEig();
00182 bool CalcHDAPert(double& hda_coupl);
00183
00184 double GetDAsplit() const;
00185
00186 bool SetDACoef1();
00187 bool PrintProtectMat() const;
00188
00189 bool RecalcHeff();
00190 bool DiagHeff();
00191 int ZeroLongInter(double cutoff);
00192
00193 int ham_trunc_type;
00194
00195 HaMat_double heff_mat;
00196 HaMat_double ssl;
00197 HaMat_double cmol;
00198 HaVec_double enel;
00199
00200 HaMat_double don_acc_vec;
00201 HaMat_double extern_field;
00202 HaMat_double protect_mat;
00203
00204
00205
00206 HaMat_double DA_dipole;
00207
00208
00209 double DA_field;
00210
00211 HaString db_file_name;
00212 int ida_eig_1;
00213 int ida_eig_2;
00214 Operator_Type oper_type;
00215
00216 bool donor_orb_set;
00217 bool acceptor_orb_set;
00218
00219 int set_da_orb_from_eig;
00220 int set_dab_huck_inter;
00221
00222
00223 double pw_nb_decay;
00224 double pw_nb_min_dist;
00225 double pw_hb_decay;
00226 double pw_hb_min_dist;
00227 double pw_ln_cov_decay;
00228
00229 double best_path_coupl;
00230 int log_calc_result;
00231
00232 double pw_nb_decay_intermol;
00233 double nb_dist_limit;
00234 double tun_ene;
00235
00236 int calc_type;
00237
00238 vector<const HaLocOrb*> src_orbitals;
00239 vector<const HaLocOrb*> tgt_orbitals;
00240
00241 int rebuild_mol_coupl_map;
00242
00243 PtrDoubleMap mol1_coupl_map;
00244 PtrDoubleMap mol2_coupl_map;
00245
00246
00247 protected:
00248
00249 HaQCMod* ptr_qc_mod;
00250
00251 };
00252
00253
00254 #endif