Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

SimParameters.h

Go to the documentation of this file.
00001 
00007 /*****************************************************************************
00008  * $Source: /home/cvs/namd/cvsroot/namd2/src/SimParameters.h,v $
00009  * $Author: char $
00010  * $Date: 2013/01/24 17:42:06 $
00011  * $Revision: 1.1220 $
00012  *****************************************************************************/
00013 
00014 #ifndef SIMPARAMETERS_H
00015 #define SIMPARAMETERS_H
00016 
00017 #include "common.h"
00018 #include "Vector.h"
00019 #include "Lattice.h"
00020 
00021 #include "MGridforceParams.h"
00022 
00023 class ParseOptions;
00024 class Communicate;
00025 class ConfigList;
00026 class MIStream;
00027 
00028 //  The class SimParameters is really just a glorified structure used to
00029 //  maintain the global simulation parameters.  The only functions
00030 //  associated with the class are used to get the parameters from the
00031 //  ConfigList object, to send that Parameters from the master node 
00032 //  to the other nodes, and to receive the Parameters on the other nodes.
00033 
00034 
00035 //  The following definitions are used to distinguish between possible
00036 //  bonded exclusion settings
00037 typedef int  ExclusionSettings;
00038 
00039 #define NONE            0
00040 #define ONETWO          1
00041 #define ONETHREE        2
00042 #define ONEFOUR         3
00043 #define SCALED14        4
00044 
00045 //  The following definitions are used to distinguish between multiple
00046 //  timestep integration schemes
00047 typedef int  MTSChoices;
00048 
00049 #define NAIVE           0
00050 #define VERLETI         1
00051 
00052 //  The following definitions are used to distinuish between multiple
00053 //  long-short range force splittings
00054 #define SHARP           0
00055 #define XPLOR           1
00056 #define C1              2
00057 #define C2              3
00058 
00059 //  The following definitions are used to distinguish among load
00060 //  balancers and their strategies
00061 #define LDBAL_NONE              0
00062 #define LDBAL_CENTRALIZED       1       // default
00063 #define LDBAL_HYBRID            2
00064 
00065 #define LDBSTRAT_DEFAULT        10      // default
00066 #define LDBSTRAT_COMPREHENSIVE  11
00067 #define LDBSTRAT_REFINEONLY     12
00068 #define LDBSTRAT_OLD            13
00069 
00070 // The following definitions are used to distinguish between patch-splitting
00071 // strategies
00072 #define SPLIT_PATCH_POSITION    0       // atom position determines patch
00073 #define SPLIT_PATCH_HYDROGEN    1       // hydrogen groups are not broken up
00074 
00075 // The following definitions are used to distinguish the range of rigid
00076 // bond calculations: none, all bonds to hydrogen, or only water
00077 #define RIGID_NONE    0
00078 #define RIGID_ALL     1
00079 #define RIGID_WATER   2
00080 
00081 // Added by JLai -- The following definitions are used to distinguish
00082 // the different GoMethodologies available to the Go program
00083 // -- 6.3.11
00084 typedef int GoChoices;
00085 #define GO_MATRIX 1
00086 #define GO_SPARSE 2
00087 #define GO_LOWMEM 3
00088 
00089 // Used for controlling PME parallelization with ckloop
00090 // The higher level will include all parallelization for lower ones
00091 // E.g. If setting useCkLoop to 3, then xpencil's kspace, all
00092 // backward ffts and send_untrans/ungrid routines will be parallelized
00093 #define CKLOOP_CTRL_PME_UNGRIDCALC 6
00094 #define CKLOOP_CTRL_PME_FORWARDFFT 5
00095 #define CKLOOP_CTRL_PME_SENDTRANS 4
00096 #define CKLOOP_CTRL_PME_KSPACE 3
00097 #define CKLOOP_CTRL_PME_BACKWARDFFT 2
00098 #define CKLOOP_CTRL_PME_SENDUNTRANS 1
00099 
00100 class SimParameters
00101 {
00102 private:
00103 public:
00104 
00105 //  MAKE SURE THAT THIS CLASS CAN BE BIT COPIED OR YOU WILL HAVE TO
00106 //  ADD SPECIAL CODE TO send_SimParameters() and receive_SimParameters()
00107 
00108   Bool lonepairs;  // enable lone pairs
00109   int watmodel; // integer code for the water model in use
00110                 // choices are defined in common.h
00111   Bool LJcorrection; // flag for whether water tail corrections should be used
00112         BigReal dt;                     //  Timestep size
00113         int N;                          //  Number of steps to be performed
00114         int stepsPerCycle;              //  Number of timesteps per cycle
00115 
00116         zVector cellBasisVector1;       //  Basis vector for periodic cell
00117         zVector cellBasisVector2;       //  Basis vector for periodic cell
00118         zVector cellBasisVector3;       //  Basis vector for periodic cell
00119         zVector cellOrigin;             //  Fixed center of periodic cell
00120         Lattice lattice;                //  All data for periodic cell
00121         
00122         int nonbondedFrequency;         //  Number of timesteps between
00123                                         //  nonbonded evaluation
00124         int fullElectFrequency;         //  Number of timesteps between
00125                                         //  full electrostatic evaluation
00126         BigReal fmaTheta;               //  DPMTA theta value
00127         int ldBalancer;                 //  None, Centralized or Hybrid
00128         int ldbStrategy;                //  What load balancing strategy to use
00129         int ldbPeriod;                  //  How often to do load balancing
00130         int firstLdbStep;               //  What step to do the first 
00131                                         //  load-balance on.
00132         int lastLdbStep;                //  What step to do the last
00133                                         //  load-balance on.
00134         int hybridGroupSize;            //  hybrid group size
00135         BigReal ldbBackgroundScaling;   //  scaling factor for background load
00136         BigReal ldbPMEBackgroundScaling;//  scaling factor for PME background
00137         BigReal ldbHomeBackgroundScaling;//  scaling factor for home background
00138         BigReal ldbRelativeGrainsize;   //  fraction of average load per compute
00139         
00140         int traceStartStep; //the timestep when trace is turned on, default to 3*firstLdbStep;
00141         int numTraceSteps; //the number of timesteps that are traced, default to 2*ldbPeriod;
00142         
00143 #ifdef MEASURE_NAMD_WITH_PAPI
00144         Bool papiMeasure; //default to false
00145         int papiMeasureStartStep; //the timestep when to measure using PAPI, default to 3*firstLdbStep;
00146         int numPapiMeasureSteps; //the number of timesteps when performance are measured with PAPI, default to 40;
00147 #endif
00148         
00149         Bool outputMaps; //control whether to dump compute/patch map before load balancing
00150         Bool simulateInitialMapping; //if true, the initial mapping during startup is dumped and exit
00151         int simulatedPEs;
00152         int simulatedNodeSize;
00153 
00154         Bool benchTimestep; //only cares about benchmarking the timestep, so no file output to save SUs for large-scale benchmarking
00155 
00156         //whether to use CkLoop library to parallelize a loop in a function like OpenMP.
00157         //It has multiple control levels. The higher the value is (must be positive), the more parallelization will be performed
00158         //Currently, it is mainly used for PME computation. The default value is 0, meaning it is disabled
00159         //Refer to macros CKLOOP_CTRL_* in this file for the ordering of different levels
00160         int useCkLoop; 
00161 
00162         int twoAwayX;                   //  half-size patches in X dimension
00163         int twoAwayY;                   //  half-size patches in Y dimension
00164         int twoAwayZ;                   //  half-size patches in Z dimension
00165         int maxPatches;                 //  maximum patch count
00166         Bool ldbUnloadPME;              //  unload processors doing PME
00167         Bool ldbUnloadZero;             //  unload processor 0
00168         Bool ldbUnloadOne;              //  unload processor 1 
00169         Bool ldbUnloadOutputPEs;        //  unload output processors
00170         Bool noPatchesOnZero;           //  no patches on processor 0
00171         Bool noPatchesOnOutputPEs;      //  no patches on output PEs
00172         Bool noPatchesOnOne;            //  no patches on processor 1
00173         
00174         BigReal initialTemp;            //  Initial temperature for the 
00175                                         //  simulation
00176         Bool comMove;                   //  Should the center of mass be 
00177                                         //  able to move
00178         Bool zeroMomentum;              //  remove momentum drift from PME
00179         Bool zeroMomentumAlt;           //  alternate method for testing
00180         Bool wrapWater;                 //  Wrap water around on output
00181         Bool wrapAll;                   //  Wrap clusters around on output
00182         Bool wrapNearest;               //  Wrap to closest image to origin
00183         BigReal dielectric;             //  Dielectric constant
00184         ExclusionSettings exclude;      //  What electrostatic exclusions should
00185                                         //  be made
00186         BigReal scale14;                //  Scaling factor for 1-4 
00187                                         //  electrostatics
00188         BigReal nonbondedScaling;       //  Scaling factor for nonbonded forces
00189         int dcdFrequency;               //  How often (in timesteps) should
00190                                         //  a DCD trajectory file be updated
00191   int dcdUnitCell;  // Whether to write unit cell information in the DCD
00192         int velDcdFrequency;            //  How often (in timesteps) should
00193                                         //  a velocity DCD file be updated
00194         int forceDcdFrequency;          //  How often (in timesteps) should
00195                                         //  a force DCD file be updated
00196         int xstFrequency;               //  How often (in timesteps) should
00197                                         //  a XST trajectory file be updated
00198         char auxFilename[128];          //  auxilary output filename
00199         char dcdFilename[128];          //  DCD filename
00200         char velDcdFilename[128];       //  Velocity DCD filename
00201         char forceDcdFilename[128];     //  Force DCD filename
00202         char xstFilename[128];          //  Extended system trajectory filename
00203         char outputFilename[128];       //  Output file name.  This name will
00204                                         //  have .coor appended to it 
00205                                         //  for the coordinates and 
00206                                         //  .vel appended to
00207                                         //  it for the velocities
00208         char restartFilename[128];      //  Base name of the restart file
00209         int restartFrequency;           //  How often (in timesteps) shoud the
00210                                         //  restart files be updated
00211         Bool restartSave;               //  unique filenames for restart files
00212         Bool binaryRestart;             //  should restart files be
00213                                         //  binary format rather than PDB
00214         Bool binaryOutput;              //  should output files be
00215                                         //  binary format rather than PDB
00216         BigReal cutoff;                 //  Cutoff distance
00217         BigReal margin;                 //  Fudge factor on patch size
00218         BigReal patchDimension;         //  Dimension of each side of a patch
00219                                         //  This is either cutoff+margin or
00220                                         //  pairlistDist+margin depending on
00221                                         //  whether or not switching is on
00222                                         //  or not
00223         BigReal limitDist;              //  Distance below which nonbonded
00224                                         //  forces between atoms are limited
00225         Bool switchingActive;           //  Flag TRUE->using switching function
00226                                         //  for electrostatics and vdw
00227         Bool vdwForceSwitching;         //  Flag TRUE->using force switching
00228                                         //  function for vdw
00229         BigReal switchingDist;          //  Distance at which switching
00230                                         //  becomes active
00231         Bool martiniSwitching;          //  Flag TRUE->use Martini residue-based
00232                                         //  coarse-grain switching function
00233         Bool martiniDielAllow;          //  Allow non-standard dielectric constant 
00234                                         //  for use with Martini when dielectric != 15.0
00235         BigReal pairlistDist;           //  Distance within which atom pairs 
00236                                         //  should be added to pairlist
00237         int pairlistMinProcs;           //  Minimum number of processors
00238                                         //  to enable pairlists
00239         int usePairlists;               //  Derived from pairlistMinProcs
00240 
00241         int pairlistsPerCycle;          //  regenerate x times per cycle
00242         BigReal pairlistShrink;         //  tol *= (1 - x) on regeneration
00243         BigReal pairlistGrow;           //  tol *= (1 + x) on trigger
00244         BigReal pairlistTrigger;        //  trigger is atom > (1 - x) * tol
00245         int outputPairlists;            //  print pairlist warnings this often
00246 
00247         Bool constraintsOn;             //  Flag TRUE-> harmonic constraints 
00248                                         //  active
00249         int constraintExp;              //  Exponent for harmonic constraints
00250 
00251         /* BEGIN gf */
00252         Bool gridforceOn;               //  Flag TRUE -> gridforce active
00253         Bool gridforceVolts;            //  Flag TRUE -> gridforce using volts as units
00254         zVector gridforceScale;         //  Gridforce scale factor
00255         Bool gridforceContA1;           //  Flag TRUE -> grid continuous in A1 direction
00256         Bool gridforceContA2;           //  Flag TRUE -> grid continuous in A2 direction
00257         Bool gridforceContA3;           //  Flag TRUE -> grid continuous in A3 direction
00258         zVector gridforceVOffset;       //  Gridforce potential offsets
00259         Bool gridforceLite;             //  Flag TRUE -> use lightweight, fast, feature-poor gridforce
00260         /* END gf */
00261         Bool mgridforceOn;
00262         MGridforceParamsList mgridforcelist;
00263 
00264         //****** BEGIN selective restraints (X,Y,Z) changes 
00265         Bool selectConstraintsOn;       //  Flag TRUE-> selective restraints  
00266                                         //  active
00267         Bool constrXOn, constrYOn,       
00268              constrZOn;                 //  Flag TRUE-> select which Cartesian 
00269                                         //  component to restrain
00270         //****** END selective restraints (X,Y,Z) changes 
00271 
00272         // spherical constraints
00273         Bool sphericalConstraintsOn;
00274         zVector sphericalConstrCenter;
00275 
00276         BigReal constraintScaling;      //  Scaling factor for constraint forces
00277 
00278         //****** BEGIN CHARMM/XPLOR type changes
00279         Bool paraTypeXplorOn;           //  FLAG TRUE-> parametrs are XPLOR format (default)
00280         Bool paraTypeCharmmOn;          //  FLAG TRUE-> parametrs are CHARMM format
00281         //****** END CHARMM/XPLOR type changes
00282 
00283         // Ported by JLai -- JE - Go
00284         Bool goGroPair;           //  FLAG FALSE->Explicit Gromacs pairs will be calculated
00285         Bool goForcesOn;          //  FLAG TRUE-> Go forces will be calculated
00286         char goParameters[128];   //  File for Go parameters
00287         char goCoordinates[128];  //  File for Go structure and atom chain types
00288         //JLai 6.3.11
00289         GoChoices  goMethod;      //  Integer for Go method -- 1) Matrix-Go, 3) Low-mem-Go
00290         // End of port -- JL
00291 
00292         //****** BEGIN moving constraints changes 
00293         Bool movingConstraintsOn;       //  Flag TRUE-> moving constraints 
00294                                         //  active
00295         zVector movingConsVel;           //  Velocity of the movement, A/timestep
00296         //****** END moving constraints changes 
00297         //****** BEGIN rotating constraints changes 
00298         Bool rotConstraintsOn;          //  Flag TRUE-> rotating constraints 
00299                                         //  active
00300         zVector rotConsAxis;             //  Axis of rotation
00301         zVector rotConsPivot;            //  Pivot point of rotation
00302         BigReal rotConsVel;             //  Velocity of rotation, Deg/timestep
00303         //****** END rotating constraints changes 
00304 
00305         //****** BEGIN moving drag changes
00306         Bool movDragOn;               //  Flag TRUE-> moving drag active
00307         char movDragFile[128];        //  PDB file defining dragged atoms
00308                                       //  by non-zero value in the column
00309         BigReal movDragGlobVel;       //  global drag velocity (A/step)
00310         char movDragVelFile[128];     //  PDB file; XYZ scale moving drag
00311                                       //  velocity for each atom
00312         //****** END moving drag changes
00313         //****** BEGIN rotating drag changes
00314         Bool rotDragOn;               //  Flag TRUE-> rotating drag active
00315         char rotDragFile[128];        //  PDB file defining dragged atoms
00316                                       //  by non-zero value in the column
00317         char rotDragAxisFile[128];    //  PDB file; XYZ define axes for atoms;
00318         char rotDragPivotFile[128];   //  PDB file; XYZ define pivots for atoms
00319         BigReal rotDragGlobVel;       //  global drag velocity (deg/step)
00320         char rotDragVelFile[128];     //  PDB file; B or O scales angular
00321                                       //  velocity for each atom
00322         //****** END rotating drag changes
00323         //****** BEGIN "constant" torque changes
00324         Bool consTorqueOn;            //  Flag TRUE-> "constant" torque active
00325         char consTorqueFile[128];     //  PDB file defining torqued atoms
00326                                       //  by non-zero value in the column
00327         char consTorqueAxisFile[128]; //  PDB file; XYZ define axes for atoms;
00328         char consTorquePivotFile[128];//  PDB file; XYZ define pivots for atoms
00329         BigReal consTorqueGlobVal;    //  global "torque" (Kcal/(mol*A^2))
00330         char consTorqueValFile[128];  //  PDB file; B or O scales "torque"
00331                                       //  for each atom
00332         //****** END "constant" torque changes
00333 
00334         //****** BEGIN SMD constraints changes   
00335         Bool SMDOn;                     //  Flag TRUE-> SMD constraints active
00336         BigReal SMDVel;                 //  Velocity of the movement, A/timestep
00337         zVector SMDDir;                  //  Direction of the movement
00338         BigReal SMDk;                   //  Elastic constant for SMD
00339         BigReal SMDk2;                  //  Transverse elastic constant for SMD
00340         char SMDFile[128];              //  File for SMD information
00341         int SMDOutputFreq;              //  Output frequency for SMD constr.
00342         //****** END SMD constraints changes 
00343         
00344   //****** BEGIN tabulated energy section
00345   Bool tabulatedEnergies;
00346   int tableNumTypes;
00347   char tabulatedEnergiesFile[128];
00348   char tableInterpType[128];
00349   Real tableSpacing;
00350   BigReal tableMaxDist;
00351   //****** END tabulated energy section
00352 
00353         // TMD
00354         Bool TMDOn, TMDDiffRMSD;
00355         BigReal TMDk;
00356         char TMDFile[128], TMDFile2[128];
00357         int TMDOutputFreq;
00358         int TMDFirstStep, TMDLastStep;
00359         BigReal TMDInitialRMSD, TMDFinalRMSD;
00360 
00361         //Symmetry restraints
00362         Bool symmetryOn, symmetryScaleForces;
00363         BigReal symmetryk;
00364         char symmetrykfile[128];
00365         char symmetryFile[128];
00366         char symmetryMatrixFile[128];
00367         int symmetryFirstStep, symmetryLastStep, symmetryFirstFullStep, symmetryLastFullStep;
00368 
00369         
00370 // Modifications for alchemical simulations
00371 // Begin alch flags
00372 
00373   Bool alchOn;              //  Doing alchemical simulation?
00374   Bool alchFepOn;           //  Doing alchemical simulation?
00375   Bool alchThermIntOn;      //  Doing thermodynamic integration?
00376   Bool alchFepWCARepuOn;    //  Doing WCA decomposition repulsion interaction?
00377   Bool alchFepWCADispOn;    //  Doing WCA decomposition dispersion interaction?
00378   Bool alchFepElecOn;       //  Doing electrostatic interaction perturbation?
00379   Bool alchFepWhamOn;       //  Doing Wham postprocessing for FEP?
00380   int alchMethod;           //  Which alchemical method to use? fep or ti
00381   BigReal alchLambda;       //  lambda for dynamics
00382   BigReal alchLambda2;      //  lambda for comparison
00383   BigReal alchRepLambda;    //  lambda for WCA repulsive interaction
00384   BigReal alchDispLambda;   //  lambda for WCA dispersion interaction
00385   BigReal alchElecLambda;   //  lambda for electrostatic perturbation
00386   BigReal alchFepWCArcut1;  //  rcut1 of WCA decompistion repulsion
00387   BigReal alchFepWCArcut2;  //  rcut2 of WCA decomposition repulsion
00388   BigReal alchFepWCArcut3;  //  rcut3 of WCA decomposition repulsion
00389   BigReal alchTemp;         //  temperature for alchemical calculation
00390   int alchOutFreq;          //  freq. of alchemical output
00391   Bool alchEnsembleAvg;      //if do ensemble average for the net free energy difference 
00392   char alchOutFile[128];    //  alchemical output filename
00393   int alchEquilSteps;       //  # of equil. steps in the window
00394   BigReal alchVdwShiftCoeff; //  r2 shift coeff used for generating  
00395                             //  the alchemical altered vdW interactions
00396   BigReal alchElecLambdaStart;  //  lambda value for starting point of
00397                                 //  electrostatic interactions of 
00398                                 //  exnihilated particles.  For annihilated
00399                                 //  particles the starting point is
00400                                 //  (1-alchElecLambdaStart)
00401   BigReal alchVdwLambdaEnd;  //  lambda value for endpoint of vdW
00402                              //  interactions of exnihilated particles.
00403                              //  For annihilated particles the endpoint is 
00404                              //  (1-alchVdwLambdaEnd)
00405   Bool alchDecouple;  // alchemical decoupling rather than annihilation
00406 
00407 // End alch flags
00408 //fepe
00409 
00410   
00411         Bool lesOn;                     //  Locally enhanced sampling?
00412         int lesFactor;                  //  local enhancement factor
00413         Bool lesReduceTemp;             //  Reduce enhanced atom temperature?
00414         Bool lesReduceMass;             //  Reduce enhanced atom mass?
00415 
00416         Bool extForcesOn;               //  Are ext command forces present?
00417         char extForcesCommand[256];
00418         char extCoordFilename[128];
00419         char extForceFilename[128];
00420 
00421   Bool printBadContacts;        //print indices of bad contacts being moved downhill
00422 
00423   //gbis implicit solvent parameters
00424   Bool GBISOn;                    //do generalized born implicit solvent
00425   BigReal fsMax;
00426   Bool GBISserOn;                 //do generalized born implicit solvent serial
00427   BigReal solvent_dielectric;     //epsilon_s
00428   BigReal coulomb_radius_offset;  //rho_0
00429   BigReal kappa;      //debye screening length; k = sqrt(ion concentration mol/L ) / 0.304
00430   BigReal ion_concentration;
00431         BigReal gbis_delta;                                                     //three parameters for born radius calc
00432         BigReal gbis_beta;
00433         BigReal gbis_gamma;
00434         BigReal alpha_cutoff;                                           //pairwise cutoff for integrating born radius
00435         BigReal alpha_max;                                                              //maximum allowable born radius
00436   Bool LCPOOn;                    //do LCPO SASA for GBSA
00437   BigReal surface_tension;        //surface tension (kcal/mol/Ang^2) for LCPO
00438 
00439         Bool drudeOn;       // Perform integration of Drude oscillators?
00440         Bool drudeHardWallOn;  // Apply maximum Drude bond length restriction?
00441         BigReal drudeTemp;  // (low) temperature for freezing Drude oscillators
00442         BigReal drudeDamping;    // Langevin damping coefficient (1/ps)
00443                                  //   defaults to langevinDamping
00444         BigReal drudeBondLen;    // Length beyond which to apply quartic
00445                                  //   restraining potential to Drude bond
00446         BigReal drudeBondConst;  // Force constant for restraining potential
00447         BigReal drudeNbtholeCut;             // Radius of thole pair interaction
00448 
00449         Bool pairInteractionOn;         //  Calculate pair interactions?
00450         int pairInteractionGroup1;      //  Interaction group 1.
00451         int pairInteractionGroup2;      //  Interaction group 2.
00452         Bool pairInteractionSelf;       //  Compute just within group.
00453      
00454         Bool cosAngles;    // Can some angles be cos-based
00455         Bool globalForcesOn;            //  Are global forces present?
00456         Bool tclForcesOn;               //  Are Tcl forces present?
00457 #ifdef NAMD_TCL
00458         Bool tclIsThreaded;             //  Is Tcl library thread-safe?
00459 #endif
00460         Bool tclBCOn;                   //  Are Tcl boundary forces present
00461         char *tclBCScript;              //  Script defining tclBC calcforces
00462         char tclBCArgs[128];            //  Extra args for calcforces command
00463         Bool freeEnergyOn;              //  Doing free energy perturbation?
00464         Bool miscForcesOn;              //  Using misc forces?
00465         Bool colvarsOn;         //  Using the colvars module?
00466 
00467         Bool fixedAtomsOn;              //  Are there fixed atoms?
00468         Bool fixedAtomsForces;          //  Calculate forces anyway?
00469 
00470         Bool langevinOn;                //  Flag TRUE-> langevin dynamics active
00471         BigReal langevinTemp;           //  Temperature for Langevin dynamics
00472         BigReal langevinDamping;        //  Damping coefficient (1/ps)
00473         Bool langevinHydrogen;          //  Flag TRUE-> apply to hydrogens
00474         Bool langevin_useBAOAB;         //  Flag TRUE-> use the experimental BAOAB integrator for NVT instead of the BBK one
00475                                         //  See Leimkuhler and Matthews (AMRX 2012); implemented in NAMD by CM June2012
00476         
00477         // BEGIN LA
00478         Bool loweAndersenOn;            //  Flag TRUE-> Lowe-Andersen dynamics active
00479         BigReal loweAndersenTemp;       //  Temperature for Lowe-Andersen dynamics
00480         BigReal loweAndersenRate;       //  Collision frequency for Lowe-Andersen dynamics (1/ps)
00481         BigReal loweAndersenCutoff;     //  Cutoff radius for Lowe-Andersen dynamics
00482         // END LA
00483 
00484         Bool globalOn;                  //  Flag TRUE-> use global integrator
00485         Bool dihedralOn;                //  Flag TRUE-> dihedral dynamics active
00486         Bool COLDOn;                    //  Flag TRUE-> constrained overdamped
00487                                         //  langevin dynamics active
00488         BigReal COLDRate;               //  Damping coefficient for COLD.
00489         BigReal COLDTemp;               //  Temperature for COLD.
00490 
00491         Bool tCoupleOn;                 //  Flag TRUE-> Temperature coupling 
00492                                         //  active
00493         BigReal tCoupleTemp;            //  Temperature for temp coupling
00494 
00495         int rescaleFreq;                //  Velocity rescale frequency
00496         BigReal rescaleTemp;            //  Temperature to rescale to
00497 
00498         Bool accelMDOn;                 //  Perform accelerated MD
00499         Bool accelMDdihe;               //  Apply boost to the dihedral potential
00500         Bool accelMDdual;               //  dual boost mode  
00501         Bool accelMDDebugOn;            //  Debugging accelerated MD
00502         BigReal accelMDFirstStep;       //  First aMD step
00503         BigReal accelMDLastStep;        //  Last aMD step
00504         int accelMDOutFreq;             //  aMD output frequency
00505         BigReal accelMDE;               //  aMD E
00506         BigReal accelMDalpha;           //  aMD alpha
00507         BigReal accelMDTE;              //  E for total potential in the dual boost mode
00508         BigReal accelMDTalpha;          //  alpha for total potential in the dual boost mode
00509 
00510         /* Begin Adaptive Temperature Sampling */
00511         Bool adaptTempOn;                      //  is adaptTempOn
00512         Bool adaptTempDebug;                   //  Debuggin adaptive temperature sampling
00513         int adaptTempFirstStep;                //  First adaptTemp step
00514         int adaptTempLastStep;                 //  Last adaptTemp step
00515         int adaptTempOutFreq;                  //  adaptTemp output frequency
00516         int adaptTempFreq;                     //  Steps between adaptTemp updates
00517         BigReal adaptTempTmin;                 //  Lower temperature bound
00518         BigReal adaptTempTmax;                 //  Upper temperature bound
00519         BigReal adaptTempAutoDt;               //  Auto jump size. Value determines upper bound, adaotTempDt determines lower bound 
00520         int adaptTempBins;                     //  Number of bins to store average energy values
00521         BigReal adaptTempDt;                   //  timestep for adaptTemp updates - only affects Temperature random walk
00522         BigReal adaptTempCgamma;               //  Cgamma variable for adaptive bin averaging Cgamma = 0 is normal Averaging. 1 > Cgamma >= 0
00523         Bool adaptTempLangevin;                //  Couple to Langevin Thermostat
00524         Bool adaptTempRescale;                 //  Couple to Vel. Rescaling
00525         char adaptTempInFile[128];             //  Restart information for adaptTemp to read
00526         char adaptTempRestartFile[128];        //  File to write restart information
00527         int  adaptTempRestartFreq;             //  Frequency of writing restart output
00528         Bool adaptTempRandom;                  //  Do we assign random temperatures when we step out of [Tmin,Tmax]?
00529         /* End Adaptive Temperature Sampling */
00530 
00531         int reassignFreq;               //  Velocity reassignment frequency
00532         BigReal reassignTemp;           //  Temperature to reassign to
00533         BigReal reassignIncr;           //  Added to reassignTemp each time
00534         BigReal reassignHold;           //  Hold reassignTemp at this value
00535 
00536         Bool useGroupPressure;          //  Use group rather than atomic
00537                                         //  quantities for pressure calc
00538 
00539         Bool excludeFromPressure;       //  Flag TRUE-> some atoms not rescaled
00540  
00541         Bool useFlexibleCell;           //  Use anisotropic cell fluctuations
00542         Bool useConstantArea;           //  x,y dimensions fixed.
00543         Bool useConstantRatio;          //  x,y ratio fixed.
00544 
00545   Bool fixCellDims; // fix the cell dimensions
00546   Bool fixCellDimX;
00547   Bool fixCellDimY;
00548   Bool fixCellDimZ;
00549 
00550         Bool berendsenPressureOn;       //  Berendsen pressure bath
00551         BigReal berendsenPressureTarget;
00552         BigReal berendsenPressureCompressibility;
00553         BigReal berendsenPressureRelaxationTime;
00554         int berendsenPressureFreq;
00555 
00556         Bool langevinPistonOn;          //  Langevin piston pressure control
00557         Bool langevinPistonBarrier;     //  Turn off to extrapolate cell
00558         BigReal langevinPistonTarget;
00559         BigReal langevinPistonPeriod;
00560         BigReal langevinPistonDecay;
00561         BigReal langevinPistonTemp;
00562 
00563         BigReal surfaceTensionTarget;
00564 
00565         Bool pressureProfileOn;         // Compute lateral pressure profile?
00566         int pressureProfileSlabs;       // Number of slabs
00567         int pressureProfileFreq;        // How often to store profile data
00568         int pressureProfileAtomTypes;
00569         Bool pressureProfileEwaldOn;    // Compute Ewald contribution?
00570         int pressureProfileEwaldX;
00571         int pressureProfileEwaldY;
00572         int pressureProfileEwaldZ;
00573         
00574         zVector strainRate;
00575         zVector strainRate2; // off diagonal elements (xy, xz, yz)
00576 
00577         unsigned int randomSeed;        //  Seed for random number generator
00578 
00579         Bool FMAOn;                     //  Flag TRUE-> FMA active
00580         int FMALevels;                  //  Number of Levels for FMA
00581         int FMAMp;                      //  Number of multipole terms for FMA
00582         Bool FMAFFTOn;                  //  FFT on/off flag for FMA
00583         int FMAFFTBlock;                //  FFT blocking factor for FMA
00584 
00585         Bool fullDirectOn;              //  Should direct calculations of
00586                                         //  full electrostatics be performed?
00587 
00588         Bool MSMOn;      // enable MSM (multilevel summation method)
00589                          // for long-range electrostatics
00590 
00591         int MSMQuality;  // choose MSM quality 0 (low) - 3 (high), using
00592                          // optimal combination of approximation and splitting
00593                          // defaults to "low" for fastest performance
00594 
00595         int MSMApprox;   // choose MSM approximation
00596                          // defaults to "cubic" (low) for fastest performance
00597 
00598         int MSMSplit;    // choose MSM splitting function
00599                          // defaults to "Taylor2" (low) for fastest performance
00600 
00601         int MSMLevels;   // select number of MSM levels
00602                          // default (0) adapts number of levels to the
00603                          // system for fastest performance
00604 
00605         int MSMBlockSizeX;  // controls size of parallel work decomposition
00606         int MSMBlockSizeY;  // controls size of parallel work decomposition
00607         int MSMBlockSizeZ;  // controls size of parallel work decomposition
00608 
00609         BigReal MSMGridSpacing;  // defaults to 2.5 A, best for atomic systems
00610 
00611         BigReal MSMPadding;      // pad grid along non-periodic boundaries
00612                                  // defaults to 2.5 A
00613                                  // increase if atoms are drifting beyond
00614                                  // edge of grid, which will terminate 
00615                                  // simulation prematurely
00616 
00617         Bool MsmSerialOn;   // use serial MSM solver for testing
00618 
00619         Bool PMEOn;                     //  Flag TRUE -> PME active
00620         BigReal PMETolerance;           //  Direct space tolerance
00621         BigReal PMEEwaldCoefficient;    //  From tolerance and cutoff
00622         int PMEInterpOrder;             //  Order of interpolation
00623         int PMEGridSizeX;               //  No. of grid points in x dim
00624         int PMEGridSizeY;               //  No. of grid points in y dim
00625         int PMEGridSizeZ;               //  No. of grid points in z dim
00626         BigReal PMEGridSpacing;         //  Maximum spacing between points
00627         int PMEProcessors;              //  No. of processors to use
00628         int PMEMinSlices;               //  Min slices per PME slab
00629         int PMEMinPoints;               //  Min points per PME pencil
00630         Bool PMEBarrier;                //  Use barrier before sendTrans
00631         int PMEPencils;                 //  Size of pencil grid in each dim
00632         int PMEPencilsX;                //  Size of pencil grid in X dim
00633         int PMEPencilsY;                //  Size of pencil grid in Y dim
00634         int PMEPencilsZ;                //  Size of pencil grid in Z dim
00635         int PMEPencilsYLayout;          //  Y pencil layout strategy
00636         int PMEPencilsXLayout;          //  X pencil layout strategy
00637         int PMESendOrder;               //  Message ordering strategy
00638 
00639         Bool useDPME;                   //  Flag TRUE -> old DPME code
00640         Bool useOptPME;                 //  Flag TRUE -> use the scalable version of PME
00641         Bool useManyToMany;             //  Flag TRUE -> use the manytomany optimization of PME. 
00642                                         //  This flag requres useOptPME to be set.
00643 
00644         Bool FFTWEstimate;
00645         Bool FFTWPatient;
00646         Bool FFTWUseWisdom;
00647         char FFTWWisdomFile[128];
00648         char *FFTWWisdomString;
00649 
00650         #ifdef OPENATOM_VERSION
00651         Bool openatom;                  // Flag TRUE -> OpenAtom QM/MM active
00652         #endif // OPENATOM_VERSION 
00653 
00654         Bool minimizeCGOn;              //  Flag TRUE-> CG minimization active
00655         Bool minVerbose;                //  Flag TRUE-> print extra minimization data
00656         BigReal minTinyStep;            //  Minimization parameter
00657         BigReal minBabyStep;            //  Minimization parameter
00658         BigReal minLineGoal;            //  Minimization parameter
00659         Bool minimizeOn;                //  Flag TRUE-> minimization active
00660         BigReal maximumMove;            //  Maximum movement per timestep 
00661                                         //  during minimization
00662 
00663         Bool sphericalBCOn;             //  Flag TRUE-> spherical boundary 
00664                                         //  conditions are active
00665         zVector sphericalCenter;                //  Center specified by user
00666         BigReal sphericalBCk1;          //  First force constant for 
00667                                         //  spherical BC
00668         BigReal sphericalBCk2;          //  Second force constant for 
00669                                         //  spherical BC
00670         BigReal sphericalBCr1;          //  First radius for spherical BC
00671         BigReal sphericalBCr2;          //  Second radius for spherical BC
00672         int sphericalBCexp1;            //  First radius for spherical BC
00673         int sphericalBCexp2;            //  Second radius for spherical BC
00674 
00675         Bool cylindricalBCOn;           //  Flag TRUE->cylindrical boundary
00676                                         //  conditions are active
00677         zVector cylindricalCenter;
00678         char cylindricalBCAxis;         //  'x', 'y', or 'z'
00679         BigReal cylindricalBCr1;
00680         BigReal cylindricalBCr2;
00681         BigReal cylindricalBCl1;
00682         BigReal cylindricalBCl2;
00683         int cylindricalBCexp1;
00684         int cylindricalBCexp2;
00685         BigReal cylindricalBCk1;
00686         BigReal cylindricalBCk2;
00687 
00688         Bool eFieldOn;                  //  Should a electric field be applied
00689         zVector eField;                 //  Electric field vector to be applied
00690         BigReal eFieldFreq;             // Frequency of the electric field
00691         BigReal eFieldPhase;            // Phase phi, cos(w*t-phi*PI/180) 
00692 
00693         Bool stirOn;                   // Should a stirring torque be applied
00694         char stirFilename[128];        // Stirring filename (atoms marked)
00695         //do the below two even needed to be defined?
00696         BigReal stirStartingTheta;     // Stir starting theta offset
00697         BigReal stirVel;               // Stir angular velocity
00698         BigReal stirK;                 // Stir force harmonic spring constant
00699         zVector stirAxis;              // Direction of stir axis
00700         zVector stirPivot;             // Pivot point of stir axis
00701 
00702         Bool extraBondsOn;              // read extra bonded forces
00703 
00704         Bool consForceOn;               //  Should constant force be applied
00705   char consForceFile[128];
00706         BigReal consForceScaling;
00707 
00708         int outputEnergies;             //  Number of timesteps between energy
00709                                         //  outputs
00710 
00711         int outputMomenta;              //  Number of timesteps between momentum
00712                                         //  outputs
00713 
00714         int outputTiming;               //  Number of timesteps between timing
00715                                         //  outputs
00716 
00717         int outputCudaTiming;           //  Number of timesteps between timing
00718                                         //  outputs of CUDA code
00719 
00720         int outputPressure;             //  Number of timesteps between pressure
00721                                         //  tensor outputs
00722 
00723         Bool mergeCrossterms;           //  Merge crossterm energy w/ dihedrals
00724 
00725         int firstTimestep;              //  Starting timestep.  Will be 0 unless
00726                                         //  restarting a simulation
00727 
00728         MTSChoices MTSAlgorithm;        //  What multiple timestep algorithm
00729                                         //  to use
00730 
00731         int longSplitting;              //  What electrostatic splitting        
00732                                         //  to use
00733 
00734         Bool ignoreMass;                //  Mass < 3.5 does not indicate hydrogen, etc.
00735 
00736         int splitPatch;                 // How are patches determined?
00737         BigReal hgroupCutoff;           // what is the added hydrogen margin?
00738 
00739         int mollyOn;                    // mollify long range forces?
00740         BigReal mollyTol;               // error tolerance for molly
00741         int mollyIter;                  // max number of iterations for molly
00742 
00743         int rigidBonds;                 // what type of rigid bonds to hydrogens
00744                                         // none, all, or only water
00745 
00746         BigReal rigidTol;               // error tolerance for rigid bonds
00747         int rigidIter;                  // Number of NR iterations 
00748         int rigidDie;                   // die if rigidTol not achieved
00749 
00750         Bool useSettle;                 // Use SETTLE; requires rigid waters
00751 
00752         Bool testOn;                    //  Do tests rather than simulation
00753         Bool commOnly;                  //  Don't do any force evaluations
00754         Bool statsOn;                   //  Don't do any force evaluations
00755 
00756         int totalAtoms;                 //  Total Number of atoms in simulation
00757         int maxSelfPart;                // maximum number of self partitions
00758                                         // that a patch can be split into
00759         int maxPairPart;                // maximum number of pair partitions
00760                                         // that a patch can be split into
00761         int numAtomsSelf;               // maximum number of atoms in a single
00762                                         // self-compute 
00763         int numAtomsSelf2;              // maximum number of atoms in a pair compute
00764                                         // in the presence of twoAwayX,Y,Z options
00765         int numAtomsPair;               // maximum number of atoms in a single
00766                                         // pair-compute 
00767         int numAtomsPair2;              // maximum number of atoms in a single
00768                                         // pair-compute 
00769         int minAtomsPerPatch;           // minimum average atoms per patch
00770                                         //  (may create larger patches) 
00771         int maxExclusionFlags;          // maximum size of exclusion check list
00772                                         // for any given atom
00773         Bool outputPatchDetails;        // print number of atoms per patch
00774         Bool staticAtomAssignment;      // never migrate atoms
00775 
00776         //
00777         // hydrogen bond simulation parameters
00778         //
00779 
00780         // should the hydrogen bond term be used?  If FALSE, all other
00781         // hydrogen bond parameters are unnecessary in simulation.
00782         Bool HydrogenBonds;
00783 
00784         // should the antecedent atom be used in the calculation of hbonds?
00785         Bool useAntecedent;
00786 
00787         // exponents used in hydrogen bond energy function:
00788         //   aaAngleExp = exp for H-A-AA angle term (n)
00789         //   haAngleExp = exp for D-H-A angle term (m)
00790         //   distAttExp = exp for attractive A-D distance term (j)
00791         //   distRepExp = exp for repulsive A-D distance term (i)
00792         int aaAngleExp, haAngleExp, distAttExp, distRepExp;
00793 
00794         // cutoff D-H-A angle, and on/off angles for switch fcn (in degrees)
00795         BigReal dhaCutoffAngle, dhaOnAngle, dhaOffAngle;
00796 
00797         // cutoff distance for D-A separation in hbonds (in Angstroms), and
00798         // on/off distances for hbond radial term switching function
00799         BigReal daCutoffDist, daOnDist, daOffDist;
00800 
00801         // IMD parameters
00802         int IMDon;    // enable IMD
00803         int IMDport;  // port on which to listen for connections
00804         int IMDfreq;  // frequency at which coordinates will be available
00805         int IMDwait;  // if true, pause the simulation when there is no
00806                       // connection
00807         int IMDignore;  // IMD connection does not influence simulation
00808                         // only sends coordinates and energies to VMD
00809         
00810         // AMBER options
00811         Bool amberOn; // FLAG TRUE-> amber force field is used
00812         Bool readExclusions; // FLAG TRUE-> Read exclusions from parm file
00813         BigReal vdwscale14; //  Scaling factor for 1-4 VDW interactions
00814 
00815         // GROMACS options
00816         Bool gromacsOn; // FLAG TRUE -> gromacs-style force field is used
00817 
00818         // OPLS options
00819         Bool vdwGeometricSigma;  // Lennard-J sigma uses geometric mean
00820 
00821         // ScriptTcl argument passing
00822         BigReal scriptArg1;
00823         BigReal scriptArg2;
00824         BigReal scriptArg3;
00825         BigReal scriptArg4;
00826         BigReal scriptArg5;
00827 
00828         Bool useCompressedPsf;
00829         Bool genCompressedPsf;
00830 
00831         Bool usePluginIO;
00832 
00833         Bool mallocTest;
00834         Bool printExclusions;
00835 
00836         //default value is -1
00837         int proxySendSpanningTree;
00838         int proxyRecvSpanningTree;
00839 
00840     int proxyTreeBranchFactor;
00841 
00842 
00843     //fields needed for Parallel IO Input
00844     int numinputprocs;
00845     char *binAtomFile;
00846     char *binCoorFile;
00847     char *binVelFile; 
00848     char *binRefFile; 
00849     
00850     //fields needed for Parallel IO Output
00851     int numoutputprocs; 
00852     int numoutputwrts;
00853 
00854         char computeMapFilename[128];           //  store compute map
00855         Bool storeComputeMap;
00856         Bool loadComputeMap;
00857 
00858 public:
00859 
00860         SimParameters() : mgridforcelist() {};
00861         SimParameters(ConfigList *c, char *&cwd) : mgridforcelist() {
00862           initialize_config_data(c,cwd);
00863         };
00864         ~SimParameters() {};
00865 
00866         void initialize_config_data(ConfigList *, char *&cwd);
00867                                         //  Initialize SimParameters data
00868                                         //  from the ConfigList object
00869         void send_SimParameters(MOStream *);    
00870                                         //  Used by the master process
00871                                         //  to send the paramters to
00872                                         //  the other processors
00873         void receive_SimParameters(MIStream *);  
00874                                         //  Used by the other processors
00875                                         //  to receive the data from the
00876                                         //  master process
00877         void scriptSet(const char *, const char *);
00878                                         //  Set parameters at run time
00879 
00880         int isSendSpanningTreeOn(){ return proxySendSpanningTree == 1; }
00881         int isSendSpanningTreeUnset() { return proxySendSpanningTree == -1; }
00882         int isRecvSpanningTreeOn(){ return proxyRecvSpanningTree == 1; }
00883         int isRecvSpanningTreeUnset() { return proxyRecvSpanningTree == -1; }
00884 
00885 private:
00886 
00887         void config_parser(ParseOptions &opts);
00888 
00889         void config_parser_basic(ParseOptions &opts);
00890         void config_parser_fileio(ParseOptions &opts);
00891         void config_parser_fullelect(ParseOptions &opts);
00892         void config_parser_methods(ParseOptions &opts);
00893         void config_parser_constraints(ParseOptions &opts);
00894 #ifdef OPENATOM_VERSION
00895         void config_parser_openatom(ParseOptions &opts);
00896 #endif //OPENATOM_VERSION
00897         /* BEGIN gf */
00898         void config_parser_gridforce(ParseOptions &opts);
00899         /* END gf */
00900         void config_parser_movdrag(ParseOptions &opts);
00901         void config_parser_rotdrag(ParseOptions &opts);
00902         void config_parser_constorque(ParseOptions &opts);
00903         void config_parser_boundary(ParseOptions &opts);
00904         void config_parser_misc(ParseOptions &opts);
00905         void config_parser_mgridforce(ParseOptions &opts);
00906         void parse_mgrid_string_param(ConfigList *config,
00907                                       const char *fieldname, char** dest);
00908         void parse_mgrid_params(ConfigList *config);
00909         void print_mgrid_params();
00910   
00911         void check_config(ParseOptions &opts, ConfigList *config, char *&cwd);
00912 
00913         void print_config(ParseOptions &opts, ConfigList *config, char *&cwd);
00914 
00915         void create_output_directories(const char *dirname);
00916 
00917         int fmaFrequency;               //  outdated parameter name
00918         char loadBalancer[64];          //  Load balancer
00919         char loadStrategy[64];          //  Load balancing strategy
00920 
00921 };
00922 
00923 #endif
00924 

Generated on Sat May 18 04:07:19 2013 for NAMD by  doxygen 1.3.9.1