00001
00009 #ifndef HAATOMBASIS_H
00010 #define HAATOMBASIS_H
00011
00012 #include "hastring.h"
00013 #include "haio.h"
00014 #include "halinalg.h"
00015 #include "haatom.h"
00016
00017 class InternalBasis;
00018 class AtomCollection;
00019
00020 struct b_type;
00021
00022 class GauShell
00025 {
00026 public:
00027 GauShell();
00028 GauShell(int new_l_ang, const int NGauss);
00029 GauShell(int new_l_ang, const HaMat_double& cf_new);
00030
00031 virtual ~GauShell();
00032
00033 int GetL() const { return l_ang;}
00034
00035 const char* GetShellSymbol() const;
00036
00037 const char* GetShellFunSymbol(int ifun);
00038 int GetNBfunc() const;
00039 int GetNBfuncCart() const;
00040
00041 int GetNumGauss(void) const;
00042 bool SetNumGauss(const int NGauss);
00043
00044 bool SetCoef(const double* NewCoef);
00045 bool SetCoef(const HaMat_double& new_cf_mat);
00046 const HaMat_double& GetCoef() const { return coef;}
00047
00048 double GetExp( int ig) { return coef(1,ig); }
00049 double GetCoef( int ig ) { return coef(2,ig); }
00050
00051 void SaveGaussianInp(ostream& os) const;
00052
00053 bool operator == (const GauShell & rhs) const;
00054 bool operator < (const GauShell & rhs) const;
00055
00056 double FunPointVal(const double x, const double y, const double z,
00057 const double* coef, const int num_coef ) const;
00058
00059 int Normalize();
00060
00061 protected:
00062
00063 bool spherical_fun_flag;
00064
00065 int l_ang;
00066 int NumGauss;
00067 bool DestroyCoef();
00068 HaMat_double coef;
00069
00070 };
00071
00072 typedef vector<GauShell> ShellsType;
00073
00074 class HaPseudoPot;
00075
00076 class HaAtomBasis
00080 {
00081
00082 friend class HaQCMod;
00083
00084 public:
00085 HaAtomBasis();
00086 HaAtomBasis(const HaString& NewBasName, const HaString& NewAtomType);
00087 HaAtomBasis(const HaString& NewBasName, HaAtom* aptr );
00088 HaAtomBasis(const HaAtomBasis & ref);
00089 virtual ~HaAtomBasis(){}
00090
00091 HaAtomBasis& copy_from(const HaAtomBasis & ref);
00092 int SetForAtom(const char* BasName, HaAtom* aptr );
00093
00094 const char* GetBasName() const;
00095 bool SetBasName(const HaString & name);
00096
00097 bool SetAtHost(HaAtom* new_phatm);
00098 HaAtom* GetAtHost();
00099 const HaAtom* GetAtHost() const;
00100
00101 bool SetFromGaussianInp(istream& is);
00102 void SaveGaussianInp(ostream& os) const;
00103
00104
00105 const HaString& GetAtomType() const;
00106 bool SetAtomType(const HaString& atype);
00107 int GetNBfunc() const;
00108 int GetNBfuncCart() const;
00109
00110 bool AddShell(GauShell & shl);
00111
00112
00113 void clear();
00114 void clear_coef() { Shells.clear(); }
00115
00116 void SetPseudoPotName(const HaString& new_pot_name);
00117 bool SetPseudoPotFromName();
00118
00119 void SetPseudoPotPtr(const HaPseudoPot* new_ppot);
00120 const HaPseudoPot* GetPseudoPot() const { return ppot; }
00121 bool IsSetPseudoPot() const { return (ppot != NULL); }
00122
00123 int GetNumElectr()const;
00124
00125
00126
00127 bool operator == (const HaAtomBasis & rhs) const;
00128 bool operator < (const HaAtomBasis & rhs) const;
00129
00130 bool Print_info(ostream &sout, const int level) const;
00131
00132 protected:
00133 HaAtom* phatm;
00134 HaString BasName;
00135 HaString AtomType;
00136 HaString PseudoName;
00137 const HaPseudoPot* ppot;
00138 public:
00139 vector<GauShell> Shells;
00140 };
00141
00142
00143
00144 class GauBasisSet: public vector<HaAtomBasis>
00146 {
00147 public:
00148 GauBasisSet();
00149 ~GauBasisSet();
00150
00151 typedef vector<HaAtomBasis>::iterator AtomBasIterator;
00152
00153
00154
00155 int LoadToGaussianBas(b_type& gaub) const;
00156
00157 int LoadToGaussianBCommon() const;
00158 int LoadToGaussianB2Common() const;
00159 InternalBasis* CreateIPackBas();
00160 vector<HaAtom*> host_atoms;
00161
00162 int GetNBfunc() const;
00163 int GetNBfuncCart() const;
00164 int pure_fun_flag;
00165
00166 int InitForMolSet(const char* bname, HaMolSet* pmset);
00167 int InitForAtoms(const char* bname, AtomCollection* at_coll);
00168 HaAtomBasis* AddBasisToAtom(const char* BasName, HaAtom* aptr);
00169
00170 static int CalcOvlpMat(GauBasisSet* pbas1, GauBasisSet* pbas2, HaMat_double& ovlp_mat);
00171 };
00172
00173
00174
00175 #endif