Collective Variables Module - Developer Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
SimParameters.h
1 
7 /*****************************************************************************
8  * $Source: /namd/cvsroot/namd2/src/SimParameters.h,v $
9  * $Author: jim $
10  * $Date: 2017/02/03 21:39:23 $
11  * $Revision: 1.1246 $
12  *****************************************************************************/
13 
14 #ifndef SIMPARAMETERS_H
15 #define SIMPARAMETERS_H
16 
17 #include "common.h"
18 #include "Vector.h"
19 #include "Lattice.h"
20 
21 #include "MGridforceParams.h"
22 
23 class ParseOptions;
24 class Communicate;
25 class ConfigList;
26 class MIStream;
27 
28 // The class SimParameters is really just a glorified structure used to
29 // maintain the global simulation parameters. The only functions
30 // associated with the class are used to get the parameters from the
31 // ConfigList object, to send that Parameters from the master node
32 // to the other nodes, and to receive the Parameters on the other nodes.
33 
34 
35 // The following definitions are used to distinguish between possible
36 // bonded exclusion settings
37 typedef int ExclusionSettings;
38 
39 #define NONE 0
40 #define ONETWO 1
41 #define ONETHREE 2
42 #define ONEFOUR 3
43 #define SCALED14 4
44 
45 // The following definitions are used to distinguish between multiple
46 // timestep integration schemes
47 typedef int MTSChoices;
48 
49 #define NAIVE 0
50 #define VERLETI 1
51 
52 // The following definitions are used to distinuish between multiple
53 // long-short range force splittings
54 #define SHARP 0
55 #define XPLOR 1
56 #define C1 2
57 #define C2 3
58 
59 // The following definitions are used to distinguish among load
60 // balancers and their strategies
61 #define LDBAL_NONE 0
62 #define LDBAL_CENTRALIZED 1 // default
63 #define LDBAL_HYBRID 2
64 
65 #define LDBSTRAT_DEFAULT 10 // default
66 #define LDBSTRAT_COMPREHENSIVE 11
67 #define LDBSTRAT_REFINEONLY 12
68 #define LDBSTRAT_OLD 13
69 
70 // The following definitions are used to distinguish between patch-splitting
71 // strategies
72 #define SPLIT_PATCH_POSITION 0 // atom position determines patch
73 #define SPLIT_PATCH_HYDROGEN 1 // hydrogen groups are not broken up
74 
75 // The following definitions are used to distinguish the range of rigid
76 // bond calculations: none, all bonds to hydrogen, or only water
77 #define RIGID_NONE 0
78 #define RIGID_ALL 1
79 #define RIGID_WATER 2
80 
81 // Added by JLai -- The following definitions are used to distinguish
82 // the different GoMethodologies available to the Go program
83 // -- 6.3.11
84 typedef int GoChoices;
85 #define GO_MATRIX 1
86 #define GO_SPARSE 2
87 #define GO_LOWMEM 3
88 
89 // Used for controlling PME parallelization with ckloop
90 // The higher level will include all parallelization for lower ones
91 // E.g. If setting useCkLoop to 3, then xpencil's kspace, all
92 // backward ffts and send_untrans/ungrid routines will be parallelized
93 #define CKLOOP_CTRL_PME_UNGRIDCALC 6
94 #define CKLOOP_CTRL_PME_FORWARDFFT 5
95 #define CKLOOP_CTRL_PME_SENDTRANS 4
96 #define CKLOOP_CTRL_PME_KSPACE 3
97 #define CKLOOP_CTRL_PME_BACKWARDFFT 2
98 #define CKLOOP_CTRL_PME_SENDUNTRANS 1
99 
101 {
102 private:
103 public:
104 
105 // MAKE SURE THAT THIS CLASS CAN BE BIT COPIED OR YOU WILL HAVE TO
106 // ADD SPECIAL CODE TO send_SimParameters() and receive_SimParameters()
107 
108  Bool lonepairs; // enable lone pairs
109  int watmodel; // integer code for the water model in use
110  // choices are defined in common.h
111  Bool LJcorrection; // flag for whether water tail corrections should be used
112  BigReal dt; // Timestep size
113  int N; // Number of steps to be performed
114  int stepsPerCycle; // Number of timesteps per cycle
115 
116  zVector cellBasisVector1; // Basis vector for periodic cell
117  zVector cellBasisVector2; // Basis vector for periodic cell
118  zVector cellBasisVector3; // Basis vector for periodic cell
119  zVector cellOrigin; // Fixed center of periodic cell
120  Lattice lattice; // All data for periodic cell
121 
122  int nonbondedFrequency; // Number of timesteps between
123  // nonbonded evaluation
124  int fullElectFrequency; // Number of timesteps between
125  // full electrostatic evaluation
126  BigReal fmaTheta; // DPMTA theta value
127  int ldBalancer; // None, Centralized or Hybrid
128  int ldbStrategy; // What load balancing strategy to use
129  int ldbPeriod; // How often to do load balancing
130  int firstLdbStep; // What step to do the first
131  // load-balance on.
132  int lastLdbStep; // What step to do the last
133  // load-balance on.
134  int hybridGroupSize; // hybrid group size
135  BigReal ldbBackgroundScaling; // scaling factor for background load
136  BigReal ldbPMEBackgroundScaling;// scaling factor for PME background
137  BigReal ldbHomeBackgroundScaling;// scaling factor for home background
138  BigReal ldbRelativeGrainsize; // fraction of average load per compute
139 
140  int traceStartStep; //the timestep when trace is turned on, default to 3*firstLdbStep;
141  int numTraceSteps; //the number of timesteps that are traced, default to 2*ldbPeriod;
142 
143 #ifdef MEASURE_NAMD_WITH_PAPI
144  Bool papiMeasure; //default to false
145  int papiMeasureStartStep; //the timestep when to measure using PAPI, default to 3*firstLdbStep;
146  int numPapiMeasureSteps; //the number of timesteps when performance are measured with PAPI, default to 40;
147 #endif
148 
149  Bool outputMaps; //control whether to dump compute/patch map before load balancing
150  Bool simulateInitialMapping; //if true, the initial mapping during startup is dumped and exit
151  int simulatedPEs;
152  int simulatedNodeSize;
153  Bool disableTopology; // ignore torus information during patch placement
154  Bool verboseTopology; // print torus information during patch placement
155 
156  Bool benchTimestep; //only cares about benchmarking the timestep, so no file output to save SUs for large-scale benchmarking
157 
158  //whether to use CkLoop library to parallelize a loop in a function like OpenMP.
159  //It has multiple control levels. The higher the value is (must be positive), the more parallelization will be performed
160  //Currently, it is mainly used for PME computation. The default value is 0, meaning it is disabled
161  //Refer to macros CKLOOP_CTRL_* in this file for the ordering of different levels
162  int useCkLoop;
163 
164  int twoAwayX; // half-size patches in X dimension
165  int twoAwayY; // half-size patches in Y dimension
166  int twoAwayZ; // half-size patches in Z dimension
167  int maxPatches; // maximum patch count
168  Bool ldbUnloadPME; // unload processors doing PME
169  Bool ldbUnloadZero; // unload processor 0
170  Bool ldbUnloadOne; // unload processor 1
171  Bool ldbUnloadOutputPEs; // unload output processors
172  Bool noPatchesOnZero; // no patches on processor 0
173  Bool noPatchesOnOutputPEs; // no patches on output PEs
174  Bool noPatchesOnOne; // no patches on processor 1
175 
176  BigReal initialTemp; // Initial temperature for the
177  // simulation
178  Bool comMove; // Should the center of mass be
179  // able to move
180  Bool zeroMomentum; // remove momentum drift from PME
181  Bool zeroMomentumAlt; // alternate method for testing
182  Bool wrapWater; // Wrap water around on output
183  Bool wrapAll; // Wrap clusters around on output
184  Bool wrapNearest; // Wrap to closest image to origin
185  BigReal dielectric; // Dielectric constant
186  ExclusionSettings exclude; // What electrostatic exclusions should
187  // be made
188  BigReal scale14; // Scaling factor for 1-4
189  // electrostatics
190  BigReal nonbondedScaling; // Scaling factor for nonbonded forces
191  int dcdFrequency; // How often (in timesteps) should
192  // a DCD trajectory file be updated
193  int dcdUnitCell; // Whether to write unit cell information in the DCD
194  int velDcdFrequency; // How often (in timesteps) should
195  // a velocity DCD file be updated
196  int forceDcdFrequency; // How often (in timesteps) should
197  // a force DCD file be updated
198  int xstFrequency; // How often (in timesteps) should
199  // a XST trajectory file be updated
200  char auxFilename[128]; // auxilary output filename
201  char dcdFilename[128]; // DCD filename
202  char velDcdFilename[128]; // Velocity DCD filename
203  char forceDcdFilename[128]; // Force DCD filename
204  char xstFilename[128]; // Extended system trajectory filename
205  char outputFilename[128]; // Output file name. This name will
206  // have .coor appended to it
207  // for the coordinates and
208  // .vel appended to
209  // it for the velocities
210  char restartFilename[128]; // Base name of the restart file
211  int restartFrequency; // How often (in timesteps) shoud the
212  // restart files be updated
213  Bool restartSave; // unique filenames for restart files
214  Bool restartSaveDcd; // unique filenames for DCD files
215  Bool binaryRestart; // should restart files be
216  // binary format rather than PDB
217  Bool binaryOutput; // should output files be
218  // binary format rather than PDB
219  BigReal cutoff; // Cutoff distance
220  BigReal margin; // Fudge factor on patch size
221  BigReal patchDimension; // Dimension of each side of a patch
222  // This is either cutoff+margin or
223  // pairlistDist+margin depending on
224  // whether or not switching is on
225  // or not
226  BigReal limitDist; // Distance below which nonbonded
227  // forces between atoms are limited
228  Bool switchingActive; // Flag TRUE->using switching function
229  // for electrostatics and vdw
230  Bool vdwForceSwitching; // Flag TRUE->using force switching
231  // function for vdw
232  BigReal switchingDist; // Distance at which switching
233  // becomes active
234  Bool martiniSwitching; // Flag TRUE->use Martini residue-based
235  // coarse-grain switching function
236  Bool martiniDielAllow; // Allow non-standard dielectric constant
237  // for use with Martini when dielectric != 15.0
238  BigReal pairlistDist; // Distance within which atom pairs
239  // should be added to pairlist
240  int pairlistMinProcs; // Minimum number of processors
241  // to enable pairlists
242  int usePairlists; // Derived from pairlistMinProcs
243 
244  int pairlistsPerCycle; // regenerate x times per cycle
245  BigReal pairlistShrink; // tol *= (1 - x) on regeneration
246  BigReal pairlistGrow; // tol *= (1 + x) on trigger
247  BigReal pairlistTrigger; // trigger is atom > (1 - x) * tol
248  int outputPairlists; // print pairlist warnings this often
249 
250  Bool constraintsOn; // Flag TRUE-> harmonic constraints
251  // active
252  int constraintExp; // Exponent for harmonic constraints
253 
254  /* BEGIN gf */
255  Bool gridforceOn; // Flag TRUE -> gridforce active
256  Bool gridforceVolts; // Flag TRUE -> gridforce using volts as units
257  zVector gridforceScale; // Gridforce scale factor
258  Bool gridforceContA1; // Flag TRUE -> grid continuous in A1 direction
259  Bool gridforceContA2; // Flag TRUE -> grid continuous in A2 direction
260  Bool gridforceContA3; // Flag TRUE -> grid continuous in A3 direction
261  zVector gridforceVOffset; // Gridforce potential offsets
262  Bool gridforceLite; // Flag TRUE -> use lightweight, fast, feature-poor gridforce
263  Bool gridforcechecksize; //Flag TRUE -> check if grid is larger than PBC cell dimensions
264  /* END gf */
265  Bool mgridforceOn;
266  MGridforceParamsList mgridforcelist;
267 
268  //****** BEGIN selective restraints (X,Y,Z) changes
269  Bool selectConstraintsOn; // Flag TRUE-> selective restraints
270  // active
271  Bool constrXOn, constrYOn,
272  constrZOn; // Flag TRUE-> select which Cartesian
273  // component to restrain
274  //****** END selective restraints (X,Y,Z) changes
275 
276  // spherical constraints
277  Bool sphericalConstraintsOn;
278  zVector sphericalConstrCenter;
279 
280  BigReal constraintScaling; // Scaling factor for constraint forces
281 
282  //****** BEGIN CHARMM/XPLOR type changes
283  Bool paraTypeXplorOn; // FLAG TRUE-> parametrs are XPLOR format (default)
284  Bool paraTypeCharmmOn; // FLAG TRUE-> parametrs are CHARMM format
285  //****** END CHARMM/XPLOR type changes
286 
287  // Ported by JLai -- JE - Go
288  Bool goGroPair; // FLAG FALSE->Explicit Gromacs pairs will be calculated
289  Bool goForcesOn; // FLAG TRUE-> Go forces will be calculated
290  char goParameters[128]; // File for Go parameters
291  char goCoordinates[128]; // File for Go structure and atom chain types
292  //JLai 6.3.11
293  GoChoices goMethod; // Integer for Go method -- 1) Matrix-Go, 3) Low-mem-Go
294  // End of port -- JL
295 
296  //****** BEGIN moving constraints changes
297  Bool movingConstraintsOn; // Flag TRUE-> moving constraints
298  // active
299  zVector movingConsVel; // Velocity of the movement, A/timestep
300  //****** END moving constraints changes
301  //****** BEGIN rotating constraints changes
302  Bool rotConstraintsOn; // Flag TRUE-> rotating constraints
303  // active
304  zVector rotConsAxis; // Axis of rotation
305  zVector rotConsPivot; // Pivot point of rotation
306  BigReal rotConsVel; // Velocity of rotation, Deg/timestep
307  //****** END rotating constraints changes
308 
309  //****** BEGIN moving drag changes
310  Bool movDragOn; // Flag TRUE-> moving drag active
311  char movDragFile[128]; // PDB file defining dragged atoms
312  // by non-zero value in the column
313  BigReal movDragGlobVel; // global drag velocity (A/step)
314  char movDragVelFile[128]; // PDB file; XYZ scale moving drag
315  // velocity for each atom
316  //****** END moving drag changes
317  //****** BEGIN rotating drag changes
318  Bool rotDragOn; // Flag TRUE-> rotating drag active
319  char rotDragFile[128]; // PDB file defining dragged atoms
320  // by non-zero value in the column
321  char rotDragAxisFile[128]; // PDB file; XYZ define axes for atoms;
322  char rotDragPivotFile[128]; // PDB file; XYZ define pivots for atoms
323  BigReal rotDragGlobVel; // global drag velocity (deg/step)
324  char rotDragVelFile[128]; // PDB file; B or O scales angular
325  // velocity for each atom
326  //****** END rotating drag changes
327  //****** BEGIN "constant" torque changes
328  Bool consTorqueOn; // Flag TRUE-> "constant" torque active
329  char consTorqueFile[128]; // PDB file defining torqued atoms
330  // by non-zero value in the column
331  char consTorqueAxisFile[128]; // PDB file; XYZ define axes for atoms;
332  char consTorquePivotFile[128];// PDB file; XYZ define pivots for atoms
333  BigReal consTorqueGlobVal; // global "torque" (Kcal/(mol*A^2))
334  char consTorqueValFile[128]; // PDB file; B or O scales "torque"
335  // for each atom
336  //****** END "constant" torque changes
337 
338  //****** BEGIN SMD constraints changes
339  Bool SMDOn; // Flag TRUE-> SMD constraints active
340  BigReal SMDVel; // Velocity of the movement, A/timestep
341  zVector SMDDir; // Direction of the movement
342  BigReal SMDk; // Elastic constant for SMD
343  BigReal SMDk2; // Transverse elastic constant for SMD
344  char SMDFile[128]; // File for SMD information
345  int SMDOutputFreq; // Output frequency for SMD constr.
346  //****** END SMD constraints changes
347 
348  //****** BEGIN tabulated energy section
349  Bool tabulatedEnergies;
350  int tableNumTypes;
351  char tabulatedEnergiesFile[128];
352  char tableInterpType[128];
353  Real tableSpacing;
354  BigReal tableMaxDist;
355  //****** END tabulated energy section
356 
357  // TMD
358  Bool TMDOn, TMDDiffRMSD;
359  BigReal TMDk;
360  char TMDFile[128], TMDFile2[128];
361  int TMDOutputFreq;
362  int TMDFirstStep, TMDLastStep;
363  BigReal TMDInitialRMSD, TMDFinalRMSD;
364 
365  //Symmetry restraints
366  Bool symmetryOn, symmetryScaleForces;
367  BigReal symmetryk;
368  char symmetrykfile[128];
369  char symmetryFile[128];
370  char symmetryMatrixFile[128];
371  int symmetryFirstStep, symmetryLastStep, symmetryFirstFullStep, symmetryLastFullStep;
372 
373 
374 //fepb
375  Bool alchOnAtStartup; // Ensure that alchemy is set up properly
376  Bool alchOn; // Doing alchemical simulation?
377  Bool alchFepOn; // Doing alchemical simulation?
378  Bool alchThermIntOn; // Doing thermodynamic integration?
379  Bool alchFepWCARepuOn; // Doing WCA decomposition repulsion interaction?
380  Bool alchFepWCADispOn; // Doing WCA decomposition dispersion interaction?
381  Bool alchFepElecOn; // Doing electrostatic interaction perturbation?
382  Bool alchFepWhamOn; // Doing Wham postprocessing for FEP?
383  int alchMethod; // Which alchemical method to use? fep or ti
384  BigReal alchLambda; // lambda for dynamics
385  BigReal alchLambda2; // lambda for comparison
386  int alchLambdaFreq; // freq. (in steps) with which lambda changes
387  // from alchLambda to alchLambda2
388  BigReal getCurrentLambda(const int); // getter for changing lambda
389  BigReal getLambdaDelta(void); // getter for lambda increment
390  BigReal alchRepLambda; // lambda for WCA repulsive interaction
391  BigReal alchDispLambda; // lambda for WCA dispersion interaction
392  BigReal alchElecLambda; // lambda for electrostatic perturbation
393  BigReal alchFepWCArcut1; // rcut1 of WCA decompistion repulsion
394  BigReal alchFepWCArcut2; // rcut2 of WCA decomposition repulsion
395  BigReal alchFepWCArcut3; // rcut3 of WCA decomposition repulsion
396  BigReal alchTemp; // temperature for alchemical calculation
397  int alchOutFreq; // freq. of alchemical output
398  Bool alchEnsembleAvg; //if do ensemble average for the net free energy difference
399  char alchOutFile[128]; // alchemical output filename
400  int alchEquilSteps; // # of equil. steps in the window
401  BigReal alchVdwShiftCoeff; // r2 shift coeff used for generating
402  // the alchemical altered vdW interactions
403  BigReal alchElecLambdaStart; // lambda value for starting point of
404  // electrostatic interactions of
405  // exnihilated particles. For annihilated
406  // particles the starting point is
407  // (1-alchElecLambdaStart)
408  BigReal getElecLambda(const BigReal); // return min[0,x/(1-elecStart)]
409  BigReal alchVdwLambdaEnd; // lambda value for endpoint of vdW
410  // interactions of exnihilated particles.
411  // For annihilated particles the endpoint is
412  // (1-alchVdwLambdaEnd)
413  BigReal getVdwLambda(const BigReal); // return max[1,x/vdwEnd]
414  BigReal alchBondLambdaEnd; // lambda value for endpoint of bonded
415  // interactions involving exnihilated particles.
416  // For annihilated particles the endpoint is
417  // (1-alchBondLambdaEnd)
418  BigReal getBondLambda(const BigReal); // return max[1,x/bondEnd]
419  Bool alchDecouple; // alchemical decoupling rather than annihilation
420  Bool alchBondDecouple; // decouple purely alchemical bonds
421 //fepe
422 
423 
424  Bool lesOn; // Locally enhanced sampling?
425  int lesFactor; // local enhancement factor
426  Bool lesReduceTemp; // Reduce enhanced atom temperature?
427  Bool lesReduceMass; // Reduce enhanced atom mass?
428 
429  Bool extForcesOn; // Are ext command forces present?
430  char extForcesCommand[256];
431  char extCoordFilename[128];
432  char extForceFilename[128];
433 
434 
435  // Defines variables for QM/MM calculations
436  Bool qmForcesOn; // Are QM/MM command forces present?
437  char qmParamPDB[128];
438  Bool qmParamPDBDefined;
439  char qmExecPath[256];
440  char qmSoftware[128];
441  char qmChrgModeS[16];
442  int qmChrgMode;
443  char qmColumn[16];
444  char qmBaseDir[256];
445  char qmSecProc[256];
446  Bool qmSecProcOn;
447  char qmPrepProc[256];
448  Bool qmPrepProcOn;
449  int qmFormat ;
450  Bool qmReplaceAll ;
451 
452  Bool qmBondOn;
453  char qmBondColumn[16];
454  Bool qmBondDist;
455  int qmBondValType;
456  char qmBondValueTypeS[16];
457  char qmBondSchemeS[16] ;
458  int qmBondScheme;
459  Bool qmPCSwitchOn;
460  char qmPCSwitchTypeS[16];
461  int qmPCSwitchType;
462  char qmPCSchemeS[16];
463  int qmPCScheme;
464  int qmSimsPerNode;
465 
466  Bool qmVDW ;
467  Bool qmNoPC ;
468  Bool qmElecEmbed ;
469  int qmPCSelFreq ;
470  Bool qmCustomPCSel;
471 
472  Bool qmLSSOn ;
473  int qmLSSFreq ;
474  char qmLSSResname[5] ;
475  char qmLSSModeS[16];
476  int qmLSSMode;
477 
478  int qmOutFreq ;
479  int qmPosOutFreq ;
480 
481  Bool printBadContacts; //print indices of bad contacts being moved downhill
482 
483  //gbis implicit solvent parameters
484  Bool GBISOn; //do generalized born implicit solvent
485  BigReal fsMax;
486  Bool GBISserOn; //do generalized born implicit solvent serial
487  BigReal solvent_dielectric; //epsilon_s
488  BigReal coulomb_radius_offset; //rho_0
489  BigReal kappa; //debye screening length; k = sqrt(ion concentration mol/L ) / 0.304
490  BigReal ion_concentration;
491  BigReal gbis_delta; //three parameters for born radius calc
492  BigReal gbis_beta;
493  BigReal gbis_gamma;
494  BigReal alpha_cutoff; //pairwise cutoff for integrating born radius
495  BigReal alpha_max; //maximum allowable born radius
496  Bool LCPOOn; //do LCPO SASA for GBSA
497  BigReal surface_tension; //surface tension (kcal/mol/Ang^2) for LCPO
498 
499  Bool drudeOn; // Perform integration of Drude oscillators?
500  Bool drudeHardWallOn; // Apply maximum Drude bond length restriction?
501  BigReal drudeTemp; // (low) temperature for freezing Drude oscillators
502  BigReal drudeDamping; // Langevin damping coefficient (1/ps)
503  // defaults to langevinDamping
504  BigReal drudeBondLen; // Length beyond which to apply quartic
505  // restraining potential to Drude bond
506  BigReal drudeBondConst; // Force constant for restraining potential
507  BigReal drudeNbtholeCut; // Radius of thole pair interaction
508 
509  Bool pairInteractionOn; // Calculate pair interactions?
510  int pairInteractionGroup1; // Interaction group 1.
511  int pairInteractionGroup2; // Interaction group 2.
512  Bool pairInteractionSelf; // Compute just within group.
513 
514  Bool cosAngles; // Can some angles be cos-based
515  Bool globalForcesOn; // Are global forces present?
516  Bool tclForcesOn; // Are Tcl forces present?
517 #ifdef NAMD_TCL
518  Bool tclIsThreaded; // Is Tcl library thread-safe?
519 #endif
520  Bool tclBCOn; // Are Tcl boundary forces present
521  char *tclBCScript; // Script defining tclBC calcforces
522  char tclBCArgs[128]; // Extra args for calcforces command
523  Bool freeEnergyOn; // Doing free energy perturbation?
524  Bool miscForcesOn; // Using misc forces?
525  Bool colvarsOn; // Using the colvars module?
526 
527  Bool fixedAtomsOn; // Are there fixed atoms?
528  Bool fixedAtomsForces; // Calculate forces anyway?
529  Bool fixedAtomsForceOutput; // Output fixed forces?
530 
531  Bool langevinOnAtStartup; // Ensure that langevin is set up properly
532  Bool langevinOn; // Flag TRUE-> langevin dynamics active
533  BigReal langevinTemp; // Temperature for Langevin dynamics
534  BigReal langevinDamping; // Damping coefficient (1/ps)
535  Bool langevinHydrogen; // Flag TRUE-> apply to hydrogens
536  Bool langevin_useBAOAB; // Flag TRUE-> use the experimental BAOAB integrator for NVT instead of the BBK one
537  // See Leimkuhler and Matthews (AMRX 2012); implemented in NAMD by CM June2012
538 
539  // BEGIN LA
540  Bool loweAndersenOn; // Flag TRUE-> Lowe-Andersen dynamics active
541  BigReal loweAndersenTemp; // Temperature for Lowe-Andersen dynamics
542  BigReal loweAndersenRate; // Collision frequency for Lowe-Andersen dynamics (1/ps)
543  BigReal loweAndersenCutoff; // Cutoff radius for Lowe-Andersen dynamics
544  // END LA
545 
546  Bool globalOn; // Flag TRUE-> use global integrator
547  Bool dihedralOn; // Flag TRUE-> dihedral dynamics active
548  Bool COLDOn; // Flag TRUE-> constrained overdamped
549  // langevin dynamics active
550  BigReal COLDRate; // Damping coefficient for COLD.
551  BigReal COLDTemp; // Temperature for COLD.
552 
553  Bool tCoupleOn; // Flag TRUE-> Temperature coupling
554  // active
555  BigReal tCoupleTemp; // Temperature for temp coupling
556 
557  int rescaleFreq; // Velocity rescale frequency
558  BigReal rescaleTemp; // Temperature to rescale to
559 
560  Bool accelMDOn; // Perform accelerated MD
561  Bool accelMDdihe; // Apply boost to the dihedral potential
562  Bool accelMDdual; // dual boost mode
563  Bool accelMDDebugOn; // Debugging accelerated MD
564  BigReal accelMDFirstStep; // First aMD step
565  BigReal accelMDLastStep; // Last aMD step
566  int accelMDOutFreq; // aMD output frequency
567  BigReal accelMDE; // aMD E
568  BigReal accelMDalpha; // aMD alpha
569  BigReal accelMDTE; // E for total potential in the dual boost mode
570  BigReal accelMDTalpha; // alpha for total potential in the dual boost mode
571 
572  Bool accelMDG; // Perform Gaussian accelMD calculation
573  int accelMDGiE; // Flag to set the mode iE in Gaussian accelMD
574  int accelMDGcMDSteps; // No. of cMD steps
575  int accelMDGEquiSteps; // No. of quilibration steps after adding boost potential
576  int accelMDGcMDPrepSteps; // No. of preparation cMD steps
577  int accelMDGEquiPrepSteps; // No. of preparation equilibration steps
578  BigReal accelMDGSigma0P; // upper limit of std of total potential
579  BigReal accelMDGSigma0D; // upper limit of std of dihedral potential
580  Bool accelMDGRestart; // Flag to set use restart file in Gaussian accelMD
581  char accelMDGRestartFile[128]; // restart file name
582  Bool accelMDGresetVaftercmd; // Flag to reset potential after first accelMDGcMDSteps steps
583 
584  /* Begin Adaptive Temperature Sampling */
585  Bool adaptTempOn; // is adaptTempOn
586  Bool adaptTempDebug; // Debuggin adaptive temperature sampling
587  int adaptTempFirstStep; // First adaptTemp step
588  int adaptTempLastStep; // Last adaptTemp step
589  int adaptTempOutFreq; // adaptTemp output frequency
590  int adaptTempFreq; // Steps between adaptTemp updates
591  BigReal adaptTempTmin; // Lower temperature bound
592  BigReal adaptTempTmax; // Upper temperature bound
593  BigReal adaptTempAutoDt; // Auto jump size. Value determines upper bound, adaotTempDt determines lower bound
594  int adaptTempBins; // Number of bins to store average energy values
595  BigReal adaptTempDt; // timestep for adaptTemp updates - only affects Temperature random walk
596  BigReal adaptTempCgamma; // Cgamma variable for adaptive bin averaging Cgamma = 0 is normal Averaging. 1 > Cgamma >= 0
597  Bool adaptTempLangevin; // Couple to Langevin Thermostat
598  Bool adaptTempRescale; // Couple to Vel. Rescaling
599  char adaptTempInFile[128]; // Restart information for adaptTemp to read
600  char adaptTempRestartFile[128]; // File to write restart information
601  int adaptTempRestartFreq; // Frequency of writing restart output
602  Bool adaptTempRandom; // Do we assign random temperatures when we step out of [Tmin,Tmax]?
603  /* End Adaptive Temperature Sampling */
604 
605  int reassignFreq; // Velocity reassignment frequency
606  BigReal reassignTemp; // Temperature to reassign to
607  BigReal reassignIncr; // Added to reassignTemp each time
608  BigReal reassignHold; // Hold reassignTemp at this value
609 
610  Bool useGroupPressure; // Use group rather than atomic
611  // quantities for pressure calc
612 
613  Bool excludeFromPressure; // Flag TRUE-> some atoms not rescaled
614 
615  Bool useFlexibleCell; // Use anisotropic cell fluctuations
616  Bool useConstantArea; // x,y dimensions fixed.
617  Bool useConstantRatio; // x,y ratio fixed.
618 
619  Bool fixCellDims; // fix the cell dimensions
620  Bool fixCellDimX;
621  Bool fixCellDimY;
622  Bool fixCellDimZ;
623 
624  Bool berendsenPressureOn; // Berendsen pressure bath
625  BigReal berendsenPressureTarget;
626  BigReal berendsenPressureCompressibility;
627  BigReal berendsenPressureRelaxationTime;
628  int berendsenPressureFreq;
629 
630  Bool langevinPistonOn; // Langevin piston pressure control
631  Bool langevinPistonBarrier; // Turn off to extrapolate cell
632  BigReal langevinPistonTarget;
633  BigReal langevinPistonPeriod;
634  BigReal langevinPistonDecay;
635  BigReal langevinPistonTemp;
636 
637  Bool multigratorOn; // Multigrator temperature and/or pressure control
638  BigReal multigratorPressureTarget;
639  BigReal multigratorPressureRelaxationTime;
640  int multigratorPressureFreq;
641  BigReal multigratorTemperatureTarget;
642  BigReal multigratorTemperatureRelaxationTime;
643  int multigratorTemperatureFreq;
644  int multigratorNoseHooverChainLength;
645 
646  BigReal surfaceTensionTarget;
647 
648  Bool pressureProfileOn; // Compute lateral pressure profile?
649  int pressureProfileSlabs; // Number of slabs
650  int pressureProfileFreq; // How often to store profile data
651  int pressureProfileAtomTypes;
652  Bool pressureProfileEwaldOn; // Compute Ewald contribution?
653  int pressureProfileEwaldX;
654  int pressureProfileEwaldY;
655  int pressureProfileEwaldZ;
656 
657  zVector strainRate;
658  zVector strainRate2; // off diagonal elements (xy, xz, yz)
659 
660  unsigned int randomSeed; // Seed for random number generator
661 
662  Bool FMAOn; // Flag TRUE-> FMA active
663  int FMALevels; // Number of Levels for FMA
664  int FMAMp; // Number of multipole terms for FMA
665  Bool FMAFFTOn; // FFT on/off flag for FMA
666  int FMAFFTBlock; // FFT blocking factor for FMA
667 
668  Bool fullDirectOn; // Should direct calculations of
669  // full electrostatics be performed?
670 
671  Bool MSMOn; // enable MSM (multilevel summation method)
672  // for long-range electrostatics
673 
674  int MSMQuality; // choose MSM quality 0 (low) - 3 (high), using
675  // optimal combination of approximation and splitting
676  // defaults to "low" for fastest performance
677 
678  int MSMApprox; // choose MSM approximation
679  // defaults to "cubic" (low) for fastest performance
680 
681  int MSMSplit; // choose MSM splitting function
682  // defaults to "Taylor2" (low) for fastest performance
683 
684  int MSMLevels; // select number of MSM levels
685  // default (0) adapts number of levels to the
686  // system for fastest performance
687 
688  int MSMBlockSizeX; // controls size of parallel work decomposition
689  int MSMBlockSizeY; // controls size of parallel work decomposition
690  int MSMBlockSizeZ; // controls size of parallel work decomposition
691 
692  BigReal MSMGridSpacing; // defaults to 2.5 A, best for atomic systems
693 
694  BigReal MSMPadding; // pad grid along non-periodic boundaries
695  // defaults to 2.5 A
696  // increase if atoms are drifting beyond
697  // edge of grid, which will terminate
698  // simulation prematurely
699 
700  BigReal MSMxmin; // define extent of non-periodic boundaries
701  BigReal MSMxmax;
702  BigReal MSMymin;
703  BigReal MSMymax;
704  BigReal MSMzmin;
705  BigReal MSMzmax;
706 
707  Bool MsmSerialOn; // use serial MSM solver for testing
708 
709  Bool FMMOn;
710  int FMMLevels;
711  BigReal FMMPadding;
712 
713  Bool PMEOn; // Flag TRUE -> PME active
714  BigReal PMETolerance; // Direct space tolerance
715  BigReal PMEEwaldCoefficient; // From tolerance and cutoff
716  int PMEInterpOrder; // Order of interpolation
717  int PMEGridSizeX; // No. of grid points in x dim
718  int PMEGridSizeY; // No. of grid points in y dim
719  int PMEGridSizeZ; // No. of grid points in z dim
720  BigReal PMEGridSpacing; // Maximum spacing between points
721  int PMEProcessors; // No. of processors to use
722  int PMEMinSlices; // Min slices per PME slab
723  int PMEMinPoints; // Min points per PME pencil
724  Bool PMEBarrier; // Use barrier before sendTrans
725  int PMEPencils; // Size of pencil grid in each dim
726  int PMEPencilsX; // Size of pencil grid in X dim
727  int PMEPencilsY; // Size of pencil grid in Y dim
728  int PMEPencilsZ; // Size of pencil grid in Z dim
729  int PMEPencilsYLayout; // Y pencil layout strategy
730  int PMEPencilsXLayout; // X pencil layout strategy
731  int PMESendOrder; // Message ordering strategy
732  Bool PMEOffload; // Offload reciprocal sum to accelerator
733 
734  Bool useDPME; // Flag TRUE -> old DPME code
735  Bool usePMECUDA; // Flag TRUE -> use the PME CUDA version
736  Bool useCUDA2; // Flag TRUE -> use ComputeNonbondedCUDA2
737  Bool useOptPME; // Flag TRUE -> use the scalable version of PME
738  Bool useManyToMany; // Flag TRUE -> use the manytomany optimization of PME.
739  // This flag requres useOptPME to be set.
740 
741  Bool FFTWEstimate;
742  Bool FFTWPatient;
743  Bool FFTWUseWisdom;
744  char FFTWWisdomFile[128];
745  char *FFTWWisdomString;
746 
747  #ifdef OPENATOM_VERSION
748  Bool openatom; // Flag TRUE -> OpenAtom QM/MM active
749  #endif // OPENATOM_VERSION
750 
751  Bool minimizeCGOn; // Flag TRUE-> CG minimization active
752  Bool minVerbose; // Flag TRUE-> print extra minimization data
753  BigReal minTinyStep; // Minimization parameter
754  BigReal minBabyStep; // Minimization parameter
755  BigReal minLineGoal; // Minimization parameter
756  Bool minimizeOn; // Flag TRUE-> minimization active
757  BigReal maximumMove; // Maximum movement per timestep
758  // during minimization
759 
760  Bool sphericalBCOn; // Flag TRUE-> spherical boundary
761  // conditions are active
762  zVector sphericalCenter; // Center specified by user
763  BigReal sphericalBCk1; // First force constant for
764  // spherical BC
765  BigReal sphericalBCk2; // Second force constant for
766  // spherical BC
767  BigReal sphericalBCr1; // First radius for spherical BC
768  BigReal sphericalBCr2; // Second radius for spherical BC
769  int sphericalBCexp1; // First radius for spherical BC
770  int sphericalBCexp2; // Second radius for spherical BC
771 
772  Bool cylindricalBCOn; // Flag TRUE->cylindrical boundary
773  // conditions are active
774  zVector cylindricalCenter;
775  char cylindricalBCAxis; // 'x', 'y', or 'z'
776  BigReal cylindricalBCr1;
777  BigReal cylindricalBCr2;
778  BigReal cylindricalBCl1;
779  BigReal cylindricalBCl2;
780  int cylindricalBCexp1;
781  int cylindricalBCexp2;
782  BigReal cylindricalBCk1;
783  BigReal cylindricalBCk2;
784 
785  Bool eFieldOn; // Should a electric field be applied
786  Bool eFieldNormalized; // Is eField vector scaled by cell basis vectors
787  zVector eField; // Electric field vector to be applied
788  BigReal eFieldFreq; // Frequency of the electric field
789  BigReal eFieldPhase; // Phase phi, cos(w*t-phi*PI/180)
790 
791  Bool stirOn; // Should a stirring torque be applied
792  char stirFilename[128]; // Stirring filename (atoms marked)
793  //do the below two even needed to be defined?
794  BigReal stirStartingTheta; // Stir starting theta offset
795  BigReal stirVel; // Stir angular velocity
796  BigReal stirK; // Stir force harmonic spring constant
797  zVector stirAxis; // Direction of stir axis
798  zVector stirPivot; // Pivot point of stir axis
799 
800  Bool extraBondsOn; // read extra bonded forces
801 
802  Bool consForceOn; // Should constant force be applied
803  char consForceFile[128];
804  BigReal consForceScaling;
805 
806  int outputEnergies; // Number of timesteps between energy
807  // outputs
808 
809  int outputMomenta; // Number of timesteps between momentum
810  // outputs
811 
812  int outputTiming; // Number of timesteps between timing
813  // outputs
814 
815  int outputCudaTiming; // Number of timesteps between timing
816  // outputs of CUDA code
817 
818  int outputPressure; // Number of timesteps between pressure
819  // tensor outputs
820 
821  Bool mergeCrossterms; // Merge crossterm energy w/ dihedrals
822 
823  int firstTimestep; // Starting timestep. Will be 0 unless
824  // restarting a simulation
825 
826  MTSChoices MTSAlgorithm; // What multiple timestep algorithm
827  // to use
828 
829  int longSplitting; // What electrostatic splitting
830  // to use
831 
832  Bool ignoreMass; // Mass < 3.5 does not indicate hydrogen, etc.
833 
834  int splitPatch; // How are patches determined?
835  BigReal hgroupCutoff; // what is the added hydrogen margin?
836 
837  int mollyOn; // mollify long range forces?
838  BigReal mollyTol; // error tolerance for molly
839  int mollyIter; // max number of iterations for molly
840 
841  int rigidBonds; // what type of rigid bonds to hydrogens
842  // none, all, or only water
843 
844  BigReal rigidTol; // error tolerance for rigid bonds
845  int rigidIter; // Number of NR iterations
846  int rigidDie; // die if rigidTol not achieved
847 
848  Bool useSettle; // Use SETTLE; requires rigid waters
849 
850  Bool testOn; // Do tests rather than simulation
851  Bool commOnly; // Don't do any force evaluations
852  Bool statsOn; // Don't do any force evaluations
853 
854  int totalAtoms; // Total Number of atoms in simulation
855  int maxSelfPart; // maximum number of self partitions
856  // that a patch can be split into
857  int maxPairPart; // maximum number of pair partitions
858  // that a patch can be split into
859  int numAtomsSelf; // maximum number of atoms in a single
860  // self-compute
861  int numAtomsSelf2; // maximum number of atoms in a pair compute
862  // in the presence of twoAwayX,Y,Z options
863  int numAtomsPair; // maximum number of atoms in a single
864  // pair-compute
865  int numAtomsPair2; // maximum number of atoms in a single
866  // pair-compute
867  int minAtomsPerPatch; // minimum average atoms per patch
868  // (may create larger patches)
869  int maxExclusionFlags; // maximum size of exclusion check list
870  // for any given atom
871  Bool outputPatchDetails; // print number of atoms per patch
872  Bool staticAtomAssignment; // never migrate atoms
873  Bool replicaUniformPatchGrids; // same patch grid size on all replicas
874 
875  //
876  // hydrogen bond simulation parameters
877  //
878 
879  // should the hydrogen bond term be used? If FALSE, all other
880  // hydrogen bond parameters are unnecessary in simulation.
881  Bool HydrogenBonds;
882 
883  // should the antecedent atom be used in the calculation of hbonds?
884  Bool useAntecedent;
885 
886  // exponents used in hydrogen bond energy function:
887  // aaAngleExp = exp for H-A-AA angle term (n)
888  // haAngleExp = exp for D-H-A angle term (m)
889  // distAttExp = exp for attractive A-D distance term (j)
890  // distRepExp = exp for repulsive A-D distance term (i)
891  int aaAngleExp, haAngleExp, distAttExp, distRepExp;
892 
893  // cutoff D-H-A angle, and on/off angles for switch fcn (in degrees)
894  BigReal dhaCutoffAngle, dhaOnAngle, dhaOffAngle;
895 
896  // cutoff distance for D-A separation in hbonds (in Angstroms), and
897  // on/off distances for hbond radial term switching function
898  BigReal daCutoffDist, daOnDist, daOffDist;
899 
900  // IMD parameters
901  int IMDon; // enable IMD
902  int IMDport; // port on which to listen for connections
903  int IMDfreq; // frequency at which coordinates will be available
904  int IMDwait; // if true, pause the simulation when there is no
905  // connection
906  int IMDignore; // IMD connection does not influence simulation
907  // only sends coordinates and energies to VMD
908 
909  // AMBER options
910  Bool amberOn; // FLAG TRUE-> amber force field is used
911  Bool readExclusions; // FLAG TRUE-> Read exclusions from parm file
912  BigReal vdwscale14; // Scaling factor for 1-4 VDW interactions
913 
914  // GROMACS options
915  Bool gromacsOn; // FLAG TRUE -> gromacs-style force field is used
916 
917  // OPLS options
918  Bool vdwGeometricSigma; // Lennard-J sigma uses geometric mean
919 
920  // ScriptTcl argument passing
921  BigReal scriptArg1;
922  BigReal scriptArg2;
923  BigReal scriptArg3;
924  BigReal scriptArg4;
925  BigReal scriptArg5;
926  int scriptIntArg1;
927  int scriptIntArg2;
928  char scriptStringArg1[128];
929  char scriptStringArg2[128];
930 
931  Bool useCompressedPsf;
932  Bool genCompressedPsf;
933 
934  Bool usePluginIO;
935 
936  Bool mallocTest;
937  Bool printExclusions;
938 
939  //default value is -1
940  int proxySendSpanningTree;
941  int proxyRecvSpanningTree;
942 
943  int proxyTreeBranchFactor;
944 
945 
946  //fields needed for Parallel IO Input
947  int numinputprocs;
948  char *binAtomFile;
949  char *binCoorFile;
950  char *binVelFile;
951  char *binRefFile;
952 
953  //fields needed for Parallel IO Output
954  int numoutputprocs;
955  int numoutputwrts;
956 
957  char computeMapFilename[128]; // store compute map
958  Bool storeComputeMap;
959  Bool loadComputeMap;
960 
961  // MIC-specific parameters
962  int mic_hostSplit;
963  int mic_numParts_self_p1;
964  int mic_numParts_pair_p1;
965  int mic_numParts_pair_p2;
966  int mic_unloadMICPEs;
967  int mic_deviceThreshold;
968  int mic_singleKernel;
969 
970 public:
971 
972  SimParameters() : mgridforcelist(), parseopts(0) {};
973  SimParameters(ConfigList *c, char *&cwd) : mgridforcelist(), parseopts(0) {
974  initialize_config_data(c,cwd);
975  };
976  ~SimParameters() {};
977 
978  void initialize_config_data(ConfigList *, char *&cwd);
979  // Initialize SimParameters data
980  // from the ConfigList object
981  void send_SimParameters(MOStream *);
982  // Used by the master process
983  // to send the paramters to
984  // the other processors
985  void receive_SimParameters(MIStream *);
986  // Used by the other processors
987  // to receive the data from the
988  // master process
989  void scriptSet(const char *, const char *);
990  // Set parameters at run time
991  void close_dcdfile(); // *** implemented in Output.C ***
992  static void nonbonded_select();
993 
994  int isSendSpanningTreeOn(){ return proxySendSpanningTree == 1; }
995  int isSendSpanningTreeUnset() { return proxySendSpanningTree == -1; }
996  int isRecvSpanningTreeOn(){ return proxyRecvSpanningTree == 1; }
997  int isRecvSpanningTreeUnset() { return proxyRecvSpanningTree == -1; }
998 
999  char* getfromparseopts(const char* name, char *outbuf);
1000  int istrueinparseopts(const char* name);
1001  int issetinparseopts(const char* name);
1002 
1003  void readExtendedSystem(const char *filename, Lattice *latptr=0);
1004 private:
1005  ParseOptions *parseopts;
1006 
1007  void config_parser(ParseOptions &opts);
1008 
1009  void config_parser_basic(ParseOptions &opts);
1010  void config_parser_fileio(ParseOptions &opts);
1011  void config_parser_fullelect(ParseOptions &opts);
1012  void config_parser_methods(ParseOptions &opts);
1013  void config_parser_constraints(ParseOptions &opts);
1014 #ifdef OPENATOM_VERSION
1015  void config_parser_openatom(ParseOptions &opts);
1016 #endif //OPENATOM_VERSION
1017  /* BEGIN gf */
1018  void config_parser_gridforce(ParseOptions &opts);
1019  /* END gf */
1020  void config_parser_movdrag(ParseOptions &opts);
1021  void config_parser_rotdrag(ParseOptions &opts);
1022  void config_parser_constorque(ParseOptions &opts);
1023  void config_parser_boundary(ParseOptions &opts);
1024  void config_parser_misc(ParseOptions &opts);
1025  void config_parser_mgridforce(ParseOptions &opts);
1026  void parse_mgrid_string_param(ConfigList *config,
1027  const char *fieldname, char** dest);
1028  void parse_mgrid_params(ConfigList *config);
1029  void print_mgrid_params();
1030 
1031  void check_config(ParseOptions &opts, ConfigList *config, char *&cwd);
1032 
1033  void print_config(ParseOptions &opts, ConfigList *config, char *&cwd);
1034 
1035  void create_output_directories(const char *dirname);
1036 
1037  int fmaFrequency; // outdated parameter name
1038  char loadBalancer[64]; // Load balancer
1039  char loadStrategy[64]; // Load balancing strategy
1040 
1041 };
1042 
1043 #endif
1044 
Definition: SimParameters.h:100