--- trunk/src/integrators/RNEMD.hpp 2009/03/19 21:03:36 1330 +++ branches/development/src/rnemd/RNEMD.hpp 2012/08/07 18:26:40 1773 @@ -6,19 +6,10 @@ * redistribute this software in source and binary code form, provided * that the following conditions are met: * - * 1. Acknowledgement of the program authors must be made in any - * publication of scientific results based in part on use of the - * program. An acceptable form of acknowledgement is citation of - * the article in which the program was described (Matthew - * A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher - * J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented - * Parallel Simulation Engine for Molecular Dynamics," - * J. Comput. Chem. 26, pp. 252-271 (2005)) - * - * 2. Redistributions of source code must retain the above copyright + * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 3. Redistributions in binary form must reproduce the above copyright + * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. @@ -37,6 +28,16 @@ * arising out of the use of or inability to use software, even if the * University of Notre Dame has been advised of the possibility of * such damages. + * + * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your + * research, please cite the appropriate papers when you publish your + * work. Good starting points are: + * + * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). + * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). + * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ /** @@ -51,44 +52,113 @@ #define INTEGRATORS_RNEMD_HPP #include "brains/SimInfo.hpp" #include "math/RandNumGen.hpp" +#include "selection/SelectionEvaluator.hpp" +#include "selection/SelectionManager.hpp" +#include -namespace oopse { +using namespace std; +namespace OpenMD { - /** - * @class RNEMD RNEMD.hpp "integrators/RNEMD.hpp" - * @todo document - */ class RNEMD { public: RNEMD(SimInfo* info); virtual ~RNEMD(); - + + void doRNEMD(); void doSwap(); - void set_RNEMD_swapTime(RealType swapTime) { swapTime_ = swapTime; } - void set_RNEMD_nBins(int nbins) { nBins_ = nbins; } - RealType get_RNEMD_exchange_total() { return exchangeSum_; } - void set_RNEMD_exchange_total(RealType et) {exchangeSum_ = et;} - + void doNIVS(); + void doVSS(); + void collectData(); + void getStarted(); + bool inSlabA(Vector3d pos); + bool inSlabB(Vector3d pos); + void parseOutputFileFormat(const std::string& format); + void writeOutputFile(); + void writeReal(int index, unsigned int bin); + void writeVector(int index, unsigned int bin); + private: - - enum RNEMDTypeEnum { - rnemdKinetic, - rnemdPx, - rnemdPy, - rnemdPz, - rnemdUnknown + + enum RNEMDMethod { + rnemdSwap, + rnemdNIVS, + rnemdVSS, + rnemdUnkownMethod }; - + enum RNEMDFluxType { + rnemdKE, // translational kinetic energy flux + rnemdRotKE, // rotational kinetic energy flux + rnemdFullKE, // full kinetic energy flux + rnemdPx, // flux of momentum along x axis + rnemdPy, // flux of momentum along y axis + rnemdPz, // flux of momentum along z axis + rnemdPvector, // flux of momentum vector + rnemdKePx, // flux of translational KE and x-momentum + rnemdKePy, // flux of translational KE and y-momentum + rnemdKePvector, // full combo platter + rnemdUnknownFluxType + }; + + enum OutputFields { + BEGININDEX = 0, + Z = BEGININDEX, + TEMPERATURE, + VELOCITY, + DENSITY, + ENDINDEX + }; + + struct OutputData { + string title; + string units; + string dataType; + vector accumulator; + }; + + typedef bitset OutputBitSet; + typedef map OutputMapType; + SimInfo* info_; - RandNumGen* randNumGen_; - int nBins_; - RealType swapTime_; - RealType exchangeSum_; - RNEMDTypeEnum rnemdType_; - std::map stringToEnumMap_; + map stringToMethod_; + map stringToFluxType_; + RNEMDMethod rnemdMethod_; + RNEMDFluxType rnemdFluxType_; + string rnemdObjectSelection_; + SelectionEvaluator evaluator_; + SelectionManager seleMan_; + bool usePeriodicBoundaryConditions_; + int nBins_; + RealType slabWidth_; + RealType slabACenter_; + RealType slabBCenter_; - }; + RealType kineticFlux_; // target or desired *flux* + Vector3d momentumFluxVector_; // target or desired *flux* + RealType kineticTarget_; // target or desired one-time exchange energy + Vector3d momentumTarget_; // target or desired one-time exchange momentum + + RealType kineticExchange_; // actual exchange energy (running total) + Vector3d momentumExchange_; // actual exchange momentum (running total) + + RealType exchangeTime_; + + RealType targetJzpz2_; + + unsigned int trialCount_; + unsigned int failTrialCount_; + unsigned int failRootCount_; + + string rnemdFileName_; + ofstream rnemdFile_; + + RealType runTime_, statusTime_; + + vector data_; + OutputBitSet outputMask_; + OutputMapType outputMap_; + + }; } -#endif //INTEGRATORS_VELOCITIZER_HPP +#endif //INTEGRATORS_RNEMD_HPP