BALL
1.4.1
|
00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: pair6_12RDFIntegrator.h,v 1.24 2005/12/23 17:01:59 amoll Exp $ 00005 // 00006 00007 #ifndef BALL_SOLVATION_PAIR6_12RDFINTEGRATOR_H 00008 #define BALL_SOLVATION_PAIR6_12RDFINTEGRATOR_H 00009 00010 #ifndef BALL_STRUCTURE_RDFINTEGRATOR_H 00011 # include <BALL/STRUCTURE/RDFIntegrator.h> 00012 #endif 00013 00014 #ifndef BALL_MATHS_PIECEWISEFUNCTION_H 00015 # include <BALL/MATHS/piecewiseFunction.h> 00016 #endif 00017 00018 #ifndef BALL_DATATYPE_OPTIONS_H 00019 # include <BALL/DATATYPE/options.h> 00020 #endif 00021 00022 // ?????: DOCU ... documentation for constants 00023 00024 namespace BALL 00025 { 00034 class BALL_EXPORT Pair6_12RDFIntegrator 00035 : public RDFIntegrator 00036 { 00037 public: 00038 00039 BALL_CREATE(Pair6_12RDFIntegrator) 00040 00041 00045 struct BALL_EXPORT Option 00046 { 00052 static const char* METHOD; 00053 00059 static const char* SAMPLES; 00060 00066 static const char* VERBOSITY; 00067 }; 00068 00069 struct BALL_EXPORT Default 00070 { 00074 static const Size VERBOSITY; 00075 00079 static const Size METHOD; 00080 00084 static const Size SAMPLES; 00085 }; 00086 00089 enum IntegrationMethod 00090 { 00091 METHOD__UNKNOWN = 0, 00092 METHOD__ANALYTICAL = 1, 00093 METHOD__TRAPEZIUM = 2 00094 }; 00095 00099 00102 Pair6_12RDFIntegrator(); 00103 00107 Pair6_12RDFIntegrator(const Pair6_12RDFIntegrator& integrator); 00108 00116 Pair6_12RDFIntegrator(double A, double B, double k1, double k2, 00117 const RadialDistributionFunction& rdf); 00118 00121 virtual ~Pair6_12RDFIntegrator(); 00122 00124 00127 00132 const Pair6_12RDFIntegrator& operator = 00133 (const Pair6_12RDFIntegrator& integrator); 00134 00137 virtual void clear(); 00138 00140 00141 00142 00149 void setConstants(double A, double B, double k1, double k2); 00150 00157 void getConstants(double& A, double& B, double& k1, double& k2); 00158 00163 double integrateToInf(double from) const; 00164 00173 double integrateToInf(double from, double A, double B, double k1, 00174 double k2); 00175 00182 double integrate(double from, double to) const; 00183 00193 double integrate(double from, double to, double A, double B, double k1, 00194 double k2); 00195 00201 virtual double operator () (double x) const; 00202 00204 00207 00213 bool operator == (const Pair6_12RDFIntegrator& integrator) const; 00214 00216 00219 Options options; 00220 00221 00225 00230 virtual void dump (std::ostream& s = std::cout, Size depth = 0) const; 00231 00233 00234 protected: 00235 00236 /*_ Repulsion constant 00237 */ 00238 double A_; 00239 00240 /*_ Dispersion constant 00241 */ 00242 double B_; 00243 00244 /*_ Geometry constant 00245 */ 00246 double k1_; 00247 00248 /*_ Geometry constant 00249 */ 00250 double k2_; 00251 00252 00253 private: 00254 00255 /*_ Integrate an interval analytically. This method does the actual work. 00256 @param interval the interval to be integrated 00257 @param coeffs the coefficients for this interval 00258 @param x0 the value to be subtracted from x 00259 @return the value of the integral 00260 */ 00261 double analyticallyIntegrateInterval(const Interval& interval, 00262 const Coefficients& coeffs, float x0) const; 00263 00264 /*_ Integrate an interval numerically. 00265 @param interval the interval to be integrated 00266 @return the value of the integral 00267 */ 00268 double numericallyIntegrateInterval(const Interval& interval) const; 00269 00270 /*_ Project a number from the integration beam to the projection beam 00271 of an atom center for the rdf thingy. 00272 @param x the value to be projected 00273 @return the projection of <b> x </b> 00274 */ 00275 double project(double x) const; 00276 00277 /*_ Do the reverse of project(). 00278 @param x the valut to be reversly projected 00279 @return the projection of <b> x </b> 00280 */ 00281 double unproject(double x) const; 00282 }; 00283 00284 } // namespace BALL 00285 00286 #endif // BALL_SOLVATION_PAIR6_12RDFINTEGRATOR_H