ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/rnemd/RNEMD.hpp
(Generate patch)

Comparing branches/development/src/rnemd/RNEMD.hpp (file contents):
Revision 1731 by gezelter, Thu May 31 12:25:30 2012 UTC vs.
Revision 1808 by gezelter, Mon Oct 22 20:42:10 2012 UTC

# Line 44 | Line 44
44   * @file RNEMD.hpp
45   * @author gezelter
46   * @date 03/13/2009
47 * @time 15:56pm
47   * @version 1.0
48   */
49  
# Line 59 | Line 58 | namespace OpenMD {
58   using namespace std;
59   namespace OpenMD {
60  
62  /**
63   * @class RNEMD RNEMD.hpp "integrators/RNEMD.hpp"
64   * @todo document
65   */
61    class RNEMD {
62    public:
63      RNEMD(SimInfo* info);
# Line 70 | Line 65 | namespace OpenMD {
65      
66      void doRNEMD();
67      void doSwap();
68 <    void doScale();
69 <    void doShiftScale();
68 >    void doNIVS();
69 >    void doVSS();
70      void collectData();
71      void getStarted();
72 <    void getStatus();
73 <    void set_RNEMD_exchange_time(RealType exchangeTime) {
74 <      exchangeTime_ = exchangeTime;
75 <    }
76 <    void set_RNEMD_nBins(int nbins) { nBins_ = nbins; }
77 <    void set_RNEMD_logWidth(int logWidth) { rnemdLogWidth_ = logWidth; }
78 <    void set_RNEMD_exchange_total(RealType et) { exchangeSum_ = et; }
79 <    void set_RNEMD_target_flux(RealType targetFlux) {targetFlux_ = targetFlux;}
85 <    void set_RNEMD_target_JzKE(RealType targetJzKE) {targetJzKE_ = targetJzKE;}
86 <    void set_RNEMD_target_jzpx(RealType targetJzpx) {targetJzpx_ = targetJzpx;}
87 <    void set_RNEMD_target_jzpy(RealType targetJzpy) {targetJzpy_ = targetJzpy;}
88 <    void set_RNEMD_target_jzpz(RealType targetJzpz) {targetJzpz_ = targetJzpz;}
89 <    void set_RNEMD_target_jzpz2(RealType targetJzpz2) {targetJzpz2_ = targetJzpz2;}
90 <    RealType get_RNEMD_exchange_total() { return exchangeSum_; }
72 >    bool inSlabA(Vector3d pos);
73 >    bool inSlabB(Vector3d pos);
74 >    void parseOutputFileFormat(const std::string& format);
75 >    void writeOutputFile();
76 >    void writeReal(int index, unsigned int bin);
77 >    void writeVector(int index, unsigned int bin);
78 >    void writeRealStdDev(int index, unsigned int bin);
79 >    void writeVectorStdDev(int index, unsigned int bin);
80  
81    private:
82  
83 <    enum RNEMDTypeEnum {
84 <      rnemdKineticSwap,
85 <      rnemdKineticScale,
86 <      rnemdKineticScaleVAM,
87 <      rnemdKineticScaleAM,
99 <      rnemdPxScale,
100 <      rnemdPyScale,
101 <      rnemdPzScale,
102 <      rnemdPx,
103 <      rnemdPy,
104 <      rnemdPz,
105 <      rnemdShiftScaleV,
106 <      rnemdShiftScaleVAM,
107 <      rnemdUnknown
83 >    enum RNEMDMethod {
84 >      rnemdSwap,
85 >      rnemdNIVS,
86 >      rnemdVSS,
87 >      rnemdUnkownMethod
88      };
89 +    enum RNEMDFluxType {
90 +      rnemdKE,       // translational kinetic energy flux
91 +      rnemdRotKE,    // rotational kinetic energy flux
92 +      rnemdFullKE,   // full kinetic energy flux
93 +      rnemdPx,       // flux of momentum along x axis
94 +      rnemdPy,       // flux of momentum along y axis
95 +      rnemdPz,       // flux of momentum along z axis
96 +      rnemdPvector,  // flux of momentum vector
97 +      rnemdKePx,     // flux of translational KE and x-momentum
98 +      rnemdKePy,     // flux of translational KE and y-momentum
99 +      rnemdKePvector, // full combo platter
100 +      rnemdUnknownFluxType
101 +    };
102 +
103 +    enum OutputFields {
104 +      BEGININDEX = 0,
105 +      Z = BEGININDEX,
106 +      TEMPERATURE,
107 +      VELOCITY,
108 +      DENSITY,
109 +      ENDINDEX
110 +    };
111 +
112 +    struct OutputData {
113 +      string title;
114 +      string units;
115 +      string dataType;
116 +      vector<Accumulator*> accumulator;
117 +    };
118 +
119 +    typedef bitset<ENDINDEX-BEGININDEX> OutputBitSet;
120 +    typedef map<string, OutputFields> OutputMapType;
121      
122      SimInfo* info_;
123 <    RandNumGen* randNumGen_;
124 <    map<string, RNEMDTypeEnum> stringToEnumMap_;
125 <    RNEMDTypeEnum rnemdType_;
123 >
124 >    map<string, RNEMDMethod> stringToMethod_;
125 >    map<string, RNEMDFluxType> stringToFluxType_;
126 >    RNEMDMethod rnemdMethod_;
127 >    RNEMDFluxType rnemdFluxType_;
128      string rnemdObjectSelection_;
129      SelectionEvaluator evaluator_;
130      SelectionManager seleMan_;
131      bool usePeriodicBoundaryConditions_;
132 <    bool outputTemp_;
133 <    bool outputVx_;
134 <    bool outputVy_;
135 <    bool output3DTemp_;
136 <    bool outputRotTemp_;
137 <    // James put this in.
138 <    bool outputDen_;
139 <    bool outputVz_;
140 <    int nBins_; /**< The number of bins to divide the simulation box into.  */
141 <    /*!
142 <      The middle bin for the RNEMD method. midBin_ = nBins_/2;
143 <      Depending on the setting of the flux, this box should contain the minimum energy (temperature)
144 <      within the simulation.
145 <    */
132 <    int midBin_;
133 <    int rnemdLogWidth_; /**< Number of elements to print out in logs */
134 <    RealType zShift_;
132 >    int nBins_;
133 >    RealType slabWidth_;
134 >    RealType slabACenter_;
135 >    RealType slabBCenter_;
136 >
137 >    RealType kineticFlux_;        // target or desired *flux*
138 >    Vector3d momentumFluxVector_; // target or desired *flux*
139 >
140 >    RealType kineticTarget_;     // target or desired one-time exchange energy
141 >    Vector3d momentumTarget_;    // target or desired one-time exchange momentum
142 >
143 >    RealType kineticExchange_;    // actual exchange energy (running total)
144 >    Vector3d momentumExchange_;   // actual exchange momentum (running total)
145 >
146      RealType exchangeTime_;
147 <    RealType targetFlux_;
137 <    RealType targetJzKE_;
138 <    RealType targetJzpx_;
139 <    RealType targetJzpy_;
140 <    RealType targetJzpz_;
147 >
148      RealType targetJzpz2_;
142    Vector3d jzp_, njzp_;
143    RealType exchangeSum_;
144    int failTrialCount_;
145    int failRootCount_;
146    ofstream rnemdLog_;
147    int logFrameCount_;
148    // James added denLog, vzzLog
149    ofstream tempLog_, vxzLog_, vyzLog_, denLog_, vzzLog_, denLog2_;
150    ofstream xTempLog_, yTempLog_, zTempLog_, rotTempLog_, AhLog_;
151    // keeps track of what's being averaged James added DenHist, pzzHist
152    vector<RealType> tempHist_, pxzHist_, pyzHist_, mHist_, DenHist_, pzzHist_, DenHist2_;
153    vector<RealType> xTempHist_, yTempHist_, zTempHist_, rotTempHist_;
154    // keeps track of the number of degrees of freedom being averaged
155    //vector<int> pxzCount_, pyzCount_;
156    vector<int> tempCount_, xyzTempCount_, rotTempCount_;
157    RealType Asum_, Jsum_, AhCount_, runTime_, statusTime_;
158    int Numcount_;
159    bool outputAh_;
160  };
149  
150 +    unsigned int trialCount_;
151 +    unsigned int failTrialCount_;
152 +    unsigned int failRootCount_;
153 +
154 +    string rnemdFileName_;
155 +    ofstream rnemdFile_;
156 +
157 +    RealType runTime_, statusTime_;
158 +
159 +    vector<OutputData> data_;
160 +    OutputBitSet outputMask_;
161 +    OutputMapType outputMap_;
162 +    Accumulator* areaAccumulator_;
163 +    bool doRNEMD_;
164 +
165 +  };
166   }
167   #endif //INTEGRATORS_RNEMD_HPP

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines