00001 // QMcBeaver 00002 // 00003 // Constructed by 00004 // 00005 // Michael Todd Feldmann 00006 // and 00007 // David Randall "Chip" Kent IV 00008 // 00009 // Copyright 2000. All rights reserved. 00010 // 00011 // drkent@users.sourceforge.net mtfeldmann@users.sourceforge.net 00012 00013 #ifndef QMCThreeBodyCorrelationFunctionParameters_H 00014 #define QMCThreeBodyCorrelationFunctionParameters_H 00015 00016 #include <iostream> 00017 #include <string> 00018 00019 #include "Array1D.h" 00020 #include "Array2D.h" 00021 #include "QMCThreeBodyCorrelationFunctionFactory.h" 00022 #include "StringManipulation.h" 00023 00024 using namespace std; 00025 00036 class QMCThreeBodyCorrelationFunctionParameters 00037 { 00038 public: 00042 QMCThreeBodyCorrelationFunctionParameters(); 00043 00050 QMCThreeBodyCorrelationFunctionParameters( 00051 const QMCThreeBodyCorrelationFunctionParameters & rhs); 00052 00057 ~QMCThreeBodyCorrelationFunctionParameters(); 00058 00065 Array1D<double> getFreeParameters(); 00066 00073 string getParticle1Type(); 00074 00081 string getParticle2Type(); 00082 00089 string getParticle3Type(); 00090 00098 int getNumberOfFreeParameters(); 00099 00104 int getNumberOfTotalParameters(); 00105 00114 QMCThreeBodyCorrelationFunction * getThreeBodyCorrelationFunction(); 00115 00119 bool isUsed() const; 00120 00125 void setParticle1Type(string val); 00126 00131 void setParticle2Type(string val); 00132 00137 void setParticle3Type(string val); 00138 00144 void operator = (const QMCThreeBodyCorrelationFunctionParameters & rhs); 00145 00151 bool read(istream & strm); 00152 00156 friend ostream & operator << (ostream & strm, 00157 QMCThreeBodyCorrelationFunctionParameters & rhs); 00158 00162 double getCutoffDist(); 00163 00168 void zeroOutDerivatives(); 00169 00174 void setFreeParameters(const Array1D<double> & free); 00175 00180 void setTotalParameters(const Array1D<double> & total); 00181 00186 void totalDerivativesToFree(int & shift, 00187 Array1D<double> & p_a, 00188 Array1D< Array2D<double> > & p2_xa, 00189 Array1D<double> & p3_xxa) const; 00190 00194 void totalDerivativesAccumulate(QMCThreeBodyCorrelationFunctionParameters & rhs); 00195 00199 Array1D<double> pt_a; 00200 Array1D< Array2D<double> > pt2_xa; 00201 Array1D<double> pt3_xxa; 00202 00203 private: 00204 void initializeThreeBodyCorrelationFunctionParameters(); 00205 void setThreeBodyCorrelationFunction(); 00206 00211 void getFree(const Array1D<double> & total, 00212 Array1D<double> & free); 00213 00218 void totalToFree(const Array1D<double> & total, 00219 Array1D<double> & free) const; 00220 00224 inline int map(int l, int m, int n) const 00225 { 00226 return l*NeN*Nee + m*Nee + n; 00227 } 00228 00233 void freeToTotal(const Array1D<double> & free, 00234 Array1D<double> & total); 00235 00241 void makeParamDepMatrix(); 00242 void gaussianParamDepMatrix(); 00243 00252 bool checkCuspAndSymmetry(); 00253 00254 Array1D<string> ParticleTypes; 00255 00256 int NumberOfParameterTypes; 00257 Array1D<int> NumberOfParameters; 00258 00263 Array1D<double> Parameters; 00264 00269 Array1D<bool> isFree; 00270 00271 Array1D<double> tempArray; 00272 int TotalNumberOfParameters; 00273 00274 Array1D<double> freeParameters; 00275 int NumberOfFreeParameters; 00276 00277 int NeN; 00278 int Nee; 00279 00280 int C; 00281 double cutoff; 00282 00283 Array2D<double> paramDepMatrix; 00284 00285 string threeBodyCorrelationFunctionType; 00286 QMCThreeBodyCorrelationFunction* ThreeBodyCorrelationFunction; 00287 }; 00288 00289 #endif