BALL  1.4.1
periodicBoundary.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: periodicBoundary.h,v 1.22 2005/12/23 17:01:51 amoll Exp $
00005 //
00006 
00007 #ifndef BALL_MOLMEC_COMMON_PERIODICBOUNDARY_H
00008 #define BALL_MOLMEC_COMMON_PERIODICBOUNDARY_H
00009 
00010 #ifndef BALL_COMMON_H
00011 # include <BALL/common.h>
00012 #endif
00013 
00014 #ifndef BALL_DATATYPE_OPTIONS_H
00015 # include <BALL/DATATYPE/options.h>
00016 #endif
00017 
00018 #ifndef BALL_MATHS_SIMPLEBOX3_H
00019 # include <BALL/MATHS/simpleBox3.h>
00020 #endif
00021 
00022 namespace BALL 
00023 {
00024   class ForceField;
00025 
00026   class PeriodicBoundary;
00027 
00034   class BALL_EXPORT PeriodicBoundary
00035   {
00036     public:
00037 
00038     BALL_CREATE(PeriodicBoundary)
00039 
00040     
00043     
00044     
00045     typedef std::pair<Size, Size>       AtomIndexPair;
00046 
00048     typedef std::vector<AtomIndexPair>    AtomIndexArray;
00049 
00051 
00054 
00056     struct BALL_EXPORT Option 
00057     {
00059       static const char* PERIODIC_BOX_LOWER;
00060 
00062       static const char* PERIODIC_BOX_UPPER;
00063 
00065       static const char* PERIODIC_BOX_ENABLED;
00066     
00068       static const char* PERIODIC_BOX_DISTANCE;
00069       
00071       static const char* PERIODIC_BOX_ADD_SOLVENT;
00072       
00077       static const char* PERIODIC_BOX_SOLVENT_FILE;
00078 
00081       static const char* PERIODIC_BOX_SOLVENT_SOLUTE_DISTANCE;
00082 
00085       static const char* PERIODIC_WATER_FILE;
00086 
00087       };
00088     
00090     struct BALL_EXPORT Default 
00091     {
00093       static const Vector3 PERIODIC_BOX_LOWER; 
00094 
00096       static const Vector3 PERIODIC_BOX_UPPER;
00097 
00099       static const bool PERIODIC_BOX_ENABLED;
00100 
00102       static const float PERIODIC_BOX_DISTANCE;
00103 
00105       static const bool PERIODIC_BOX_ADD_SOLVENT;
00106 
00111       static const char* PERIODIC_BOX_SOLVENT_FILE;
00112 
00114       static const float PERIODIC_BOX_SOLVENT_SOLUTE_DISTANCE;
00115 
00117       static const char* PERIODIC_WATER_FILE;
00118     };
00119 
00121 
00124 
00127     PeriodicBoundary();
00128 
00131     PeriodicBoundary(const ForceField& force_field);
00132 
00135     PeriodicBoundary(const PeriodicBoundary& periodic_boundary);
00136 
00139     virtual ~PeriodicBoundary();
00140 
00142 
00145       
00148     PeriodicBoundary& operator = (const PeriodicBoundary& periodic_boundary);
00149 
00152     virtual void clear();
00153 
00155 
00158 
00161     bool setup();
00162 
00165     Size  generateMoleculesVector();
00166 
00168 
00171     
00173     void enable();
00174 
00176     void disable();
00177 
00180     SimpleBox3 getBox() const; 
00181 
00186     void setBox(const SimpleBox3& box);
00187 
00204     Size addSolvent(const String& filename);
00205     
00212     Size removeSolvent();
00213 
00215 
00218       
00223     bool isEnabled() const;
00224 
00226 
00229     
00234     void updateMolecules();
00235 
00237 
00240     
00245     Options*  options;
00246 
00248 
00249     protected:
00250 
00251     private:
00252 
00253     /*_ @name Private Attributes  
00254     */
00255     //_@{
00256 
00257     //_ Pointer to the force field of the periodic boundary 
00258     ForceField* force_field_;
00259 
00260     //_ Indicates if periodic boundary is enabled or not 
00261     bool    enabled_;
00262 
00263     //_ The box of the periodic boundary 
00264     SimpleBox3    box_;
00265 
00266     //_ An pair vector with the start and end indices of all molecules (atoms of the molecules)
00267     AtomIndexArray  molecules_;
00268 
00269     //_@}
00270 
00271   };
00272 
00273 } // namespace BALL
00274 
00275 #endif // BALL_MOLMEC_COMMON_PERIODICBOUNDARY_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines