Sequencer.h

Go to the documentation of this file.
00001 
00007 #ifndef SEQUENCER_H
00008 #define SEQUENCER_H
00009 
00010 #include "converse.h"
00011 #include "Priorities.h"
00012 #include "PatchTypes.h"
00013 
00014 class HomePatch;
00015 class SimParameters;
00016 class SubmitReduction;
00017 class CollectionMgr;
00018 class ControllerBroadcasts;
00019 class LdbCoordinator;
00020 class Random;
00021 
00022 class Sequencer
00023 {
00024     friend class HomePatch;
00025 public:
00026     Sequencer(HomePatch *p);
00027     virtual ~Sequencer(void);
00028     void run(void);             // spawn thread, etc.
00029     void awaken(void) {
00030       CthAwakenPrio(thread, CK_QUEUEING_IFIFO, PRIORITY_SIZE, &priority);
00031     }
00032     void suspend(void);
00033 
00034 protected:
00035     virtual void algorithm(void);       // subclasses redefine this method
00036 
00037     void integrate(int); // Verlet integrator
00038     void minimize(); // CG minimizer
00039       SubmitReduction *min_reduction;
00040 
00041     void runComputeObjects(int migration = 1, int pairlists = 0, int pressureStep = 0);
00042     int pairlistsAreValid;
00043     int pairlistsAge;
00044 
00045     void calcFixVirial(Tensor& fixVirialNormal, Tensor& fixVirialNbond, Tensor& fixVirialSlow,
00046       Vector& fixForceNormal, Vector& fixForceNbond, Vector& fixForceSlow);
00047 
00048     void submitReductions(int);
00049     void submitHalfstep(int);
00050     void submitMinimizeReductions(int, BigReal fmax2);
00051     void submitCollections(int step, int zeroVel = 0);
00052 
00053     void submitMomentum(int step);
00054     void correctMomentum(int step, BigReal drifttime);
00055 
00056     void saveForce(const int ftag = Results::normal);
00057     void addForceToMomentum(BigReal, const int ftag = Results::normal, const int useSaved = 0);
00058     void addForceToMomentum3(const BigReal timestep1, const int ftag1, const int useSaved1,
00059         const BigReal timestep2, const int ftag2, const int useSaved2,
00060         const BigReal timestep3, const int ftag3, const int useSaved3);
00061     void addVelocityToPosition(BigReal);
00062     
00063     void addRotDragToPosition(BigReal);
00064     void addMovDragToPosition(BigReal);
00065 
00066     void minimizeMoveDownhill(BigReal fmax2);
00067     void newMinimizeDirection(BigReal);
00068     void newMinimizePosition(BigReal);
00069     void quenchVelocities();
00070 
00071     void hardWallDrude(BigReal,int);
00072 
00073     void rattle1(BigReal,int);
00074     // void rattle2(BigReal,int);
00075 
00076     void maximumMove(BigReal);
00077     void minimizationQuenchVelocity(void);
00078 
00079     void reloadCharges();
00080 
00081     BigReal adaptTempT;         // adaptive tempering temperature
00082     void adaptTempUpdate(int); // adaptive tempering temperature update
00083 
00084     void rescaleVelocities(int);
00085     void rescaleaccelMD(int, int, int); // for accelMD
00086     int rescaleVelocities_numTemps;
00087     void reassignVelocities(BigReal,int);
00088     void reinitVelocities(void);
00089     void rescaleVelocitiesByFactor(BigReal);
00090     void tcoupleVelocities(BigReal,int);
00091     void berendsenPressure(int);
00092       int berendsenPressure_count;
00093       int checkpoint_berendsenPressure_count;
00094     void langevinPiston(int);
00095       int slowFreq;
00096     void newtonianVelocities(BigReal, const BigReal, const BigReal, 
00097                              const BigReal, const int, const int, const int);
00098     void langevinVelocities(BigReal);
00099     void langevinVelocitiesBBK1(BigReal);
00100     void langevinVelocitiesBBK2(BigReal);
00101     // Multigrator
00102     void scalePositionsVelocities(const Tensor& posScale, const Tensor& velScale);
00103     void multigratorPressure(int step, int callNumber);
00104     void scaleVelocities(const BigReal velScale);
00105     BigReal calcKineticEnergy();
00106     void multigratorTemperature(int step, int callNumber);
00107     SubmitReduction *multigratorReduction;
00108     int doKineticEnergy;
00109     int doMomenta;
00110     // End of Multigrator
00111     
00112     void cycleBarrier(int,int);
00113         void traceBarrier(int);
00114 #ifdef MEASURE_NAMD_WITH_PAPI
00115         void papiMeasureBarrier(int);
00116 #endif
00117     void terminate(void);
00118 
00119     Random *random;
00120     SimParameters *const simParams;     // for convenience
00121     HomePatch *const patch;             // access methods in patch
00122     SubmitReduction *reduction;
00123     SubmitReduction *pressureProfileReduction;
00124 
00125     CollectionMgr *const collection;
00126     ControllerBroadcasts * broadcast;
00127 
00128     int ldbSteps;
00129     void rebalanceLoad(int timestep);
00130 
00131 
00132 private:
00133     CthThread thread;
00134     unsigned int priority;
00135     static void threadRun(Sequencer*);
00136 
00137     LdbCoordinator *ldbCoordinator;
00138 };
00139 
00140 #endif

Generated on Sun Nov 19 01:17:15 2017 for NAMD by  doxygen 1.4.7