Collective Variables Module - Developer Documentation
SimParameters.h
1 
7 /*****************************************************************************
8  * $Source: /home/cvs/namd/cvsroot/namd2/src/SimParameters.h,v $
9  * $Author: jim $
10  * $Date: 2017/03/30 20:06:17 $
11  * $Revision: 1.1248 $
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  Bool qmChrgFromPSF;
440  char qmExecPath[256];
441  char qmSoftware[128];
442  char qmChrgModeS[16];
443  int qmChrgMode;
444  char qmColumn[16];
445  char qmBaseDir[256];
446  char qmSecProc[256];
447  Bool qmSecProcOn;
448  char qmPrepProc[256];
449  Bool qmPrepProcOn;
450  int qmFormat ;
451  Bool qmReplaceAll ;
452  Bool qmMOPACAddConfigChrg;
453 
454  Bool qmBondOn;
455  char qmBondColumn[16];
456  Bool qmBondDist;
457  int qmBondValType;
458  char qmBondValueTypeS[16];
459  char qmBondSchemeS[16] ;
460  int qmBondScheme;
461  Bool qmPCSwitchOn;
462  char qmPCSwitchTypeS[16];
463  int qmPCSwitchType;
464  char qmPCSchemeS[16];
465  int qmPCScheme;
466  int qmSimsPerNode;
467 
468  Bool qmVDW ;
469  Bool qmNoPC ;
470  Bool qmElecEmbed ;
471  int qmPCSelFreq ;
472  Bool qmCustomPCSel;
473 
474  Bool qmLSSOn ;
475  int qmLSSFreq ;
476  char qmLSSResname[5] ;
477  char qmLSSModeS[16];
478  int qmLSSMode;
479 
480  Bool qmCSMD;
481  char qmCSMDFile[128];
482 
483  int qmEnergyOutFreq ;
484  int qmOutFreq ;
485  int qmPosOutFreq ;
486 
487  Bool printBadContacts; //print indices of bad contacts being moved downhill
488 
489  //gbis implicit solvent parameters
490  Bool GBISOn; //do generalized born implicit solvent
491  BigReal fsMax;
492  Bool GBISserOn; //do generalized born implicit solvent serial
493  BigReal solvent_dielectric; //epsilon_s
494  BigReal coulomb_radius_offset; //rho_0
495  BigReal kappa; //debye screening length; k = sqrt(ion concentration mol/L ) / 0.304
496  BigReal ion_concentration;
497  BigReal gbis_delta; //three parameters for born radius calc
498  BigReal gbis_beta;
499  BigReal gbis_gamma;
500  BigReal alpha_cutoff; //pairwise cutoff for integrating born radius
501  BigReal alpha_max; //maximum allowable born radius
502  Bool LCPOOn; //do LCPO SASA for GBSA
503  BigReal surface_tension; //surface tension (kcal/mol/Ang^2) for LCPO
504 
505  Bool drudeOn; // Perform integration of Drude oscillators?
506  Bool drudeHardWallOn; // Apply maximum Drude bond length restriction?
507  BigReal drudeTemp; // (low) temperature for freezing Drude oscillators
508  BigReal drudeDamping; // Langevin damping coefficient (1/ps)
509  // defaults to langevinDamping
510  BigReal drudeBondLen; // Length beyond which to apply quartic
511  // restraining potential to Drude bond
512  BigReal drudeBondConst; // Force constant for restraining potential
513  BigReal drudeNbtholeCut; // Radius of thole pair interaction
514 
515  Bool pairInteractionOn; // Calculate pair interactions?
516  int pairInteractionGroup1; // Interaction group 1.
517  int pairInteractionGroup2; // Interaction group 2.
518  Bool pairInteractionSelf; // Compute just within group.
519 
520  Bool cosAngles; // Can some angles be cos-based
521  Bool globalForcesOn; // Are global forces present?
522  Bool tclForcesOn; // Are Tcl forces present?
523 #ifdef NAMD_TCL
524  Bool tclIsThreaded; // Is Tcl library thread-safe?
525 #endif
526  Bool tclBCOn; // Are Tcl boundary forces present
527  char *tclBCScript; // Script defining tclBC calcforces
528  char tclBCArgs[128]; // Extra args for calcforces command
529  Bool freeEnergyOn; // Doing free energy perturbation?
530  Bool miscForcesOn; // Using misc forces?
531  Bool colvarsOn; // Using the colvars module?
532 
533  Bool fixedAtomsOn; // Are there fixed atoms?
534  Bool fixedAtomsForces; // Calculate forces anyway?
535  Bool fixedAtomsForceOutput; // Output fixed forces?
536 
537  Bool langevinOnAtStartup; // Ensure that langevin is set up properly
538  Bool langevinOn; // Flag TRUE-> langevin dynamics active
539  BigReal langevinTemp; // Temperature for Langevin dynamics
540  BigReal langevinDamping; // Damping coefficient (1/ps)
541  Bool langevinHydrogen; // Flag TRUE-> apply to hydrogens
542  Bool langevin_useBAOAB; // Flag TRUE-> use the experimental BAOAB integrator for NVT instead of the BBK one
543  // See Leimkuhler and Matthews (AMRX 2012); implemented in NAMD by CM June2012
544 
545  // BEGIN LA
546  Bool loweAndersenOn; // Flag TRUE-> Lowe-Andersen dynamics active
547  BigReal loweAndersenTemp; // Temperature for Lowe-Andersen dynamics
548  BigReal loweAndersenRate; // Collision frequency for Lowe-Andersen dynamics (1/ps)
549  BigReal loweAndersenCutoff; // Cutoff radius for Lowe-Andersen dynamics
550  // END LA
551 
552  Bool globalOn; // Flag TRUE-> use global integrator
553  Bool dihedralOn; // Flag TRUE-> dihedral dynamics active
554  Bool COLDOn; // Flag TRUE-> constrained overdamped
555  // langevin dynamics active
556  BigReal COLDRate; // Damping coefficient for COLD.
557  BigReal COLDTemp; // Temperature for COLD.
558 
559  Bool tCoupleOn; // Flag TRUE-> Temperature coupling
560  // active
561  BigReal tCoupleTemp; // Temperature for temp coupling
562 
563  int rescaleFreq; // Velocity rescale frequency
564  BigReal rescaleTemp; // Temperature to rescale to
565 
566  Bool accelMDOn; // Perform accelerated MD
567  Bool accelMDdihe; // Apply boost to the dihedral potential
568  Bool accelMDdual; // dual boost mode
569  Bool accelMDDebugOn; // Debugging accelerated MD
570  BigReal accelMDFirstStep; // First aMD step
571  BigReal accelMDLastStep; // Last aMD step
572  int accelMDOutFreq; // aMD output frequency
573  BigReal accelMDE; // aMD E
574  BigReal accelMDalpha; // aMD alpha
575  BigReal accelMDTE; // E for total potential in the dual boost mode
576  BigReal accelMDTalpha; // alpha for total potential in the dual boost mode
577 
578  Bool accelMDG; // Perform Gaussian accelMD calculation
579  int accelMDGiE; // Flag to set the mode iE in Gaussian accelMD
580  int accelMDGcMDSteps; // No. of cMD steps
581  int accelMDGEquiSteps; // No. of quilibration steps after adding boost potential
582  int accelMDGcMDPrepSteps; // No. of preparation cMD steps
583  int accelMDGEquiPrepSteps; // No. of preparation equilibration steps
584  BigReal accelMDGSigma0P; // upper limit of std of total potential
585  BigReal accelMDGSigma0D; // upper limit of std of dihedral potential
586  Bool accelMDGRestart; // Flag to set use restart file in Gaussian accelMD
587  char accelMDGRestartFile[128]; // restart file name
588  Bool accelMDGresetVaftercmd; // Flag to reset potential after first accelMDGcMDSteps steps
589 
590  /* Begin Adaptive Temperature Sampling */
591  Bool adaptTempOn; // is adaptTempOn
592  Bool adaptTempDebug; // Debuggin adaptive temperature sampling
593  int adaptTempFirstStep; // First adaptTemp step
594  int adaptTempLastStep; // Last adaptTemp step
595  int adaptTempOutFreq; // adaptTemp output frequency
596  int adaptTempFreq; // Steps between adaptTemp updates
597  BigReal adaptTempTmin; // Lower temperature bound
598  BigReal adaptTempTmax; // Upper temperature bound
599  BigReal adaptTempAutoDt; // Auto jump size. Value determines upper bound, adaotTempDt determines lower bound
600  int adaptTempBins; // Number of bins to store average energy values
601  BigReal adaptTempDt; // timestep for adaptTemp updates - only affects Temperature random walk
602  BigReal adaptTempCgamma; // Cgamma variable for adaptive bin averaging Cgamma = 0 is normal Averaging. 1 > Cgamma >= 0
603  Bool adaptTempLangevin; // Couple to Langevin Thermostat
604  Bool adaptTempRescale; // Couple to Vel. Rescaling
605  char adaptTempInFile[128]; // Restart information for adaptTemp to read
606  char adaptTempRestartFile[128]; // File to write restart information
607  int adaptTempRestartFreq; // Frequency of writing restart output
608  Bool adaptTempRandom; // Do we assign random temperatures when we step out of [Tmin,Tmax]?
609  /* End Adaptive Temperature Sampling */
610 
611  int reassignFreq; // Velocity reassignment frequency
612  BigReal reassignTemp; // Temperature to reassign to
613  BigReal reassignIncr; // Added to reassignTemp each time
614  BigReal reassignHold; // Hold reassignTemp at this value
615 
616  Bool useGroupPressure; // Use group rather than atomic
617  // quantities for pressure calc
618 
619  Bool excludeFromPressure; // Flag TRUE-> some atoms not rescaled
620 
621  Bool useFlexibleCell; // Use anisotropic cell fluctuations
622  Bool useConstantArea; // x,y dimensions fixed.
623  Bool useConstantRatio; // x,y ratio fixed.
624 
625  Bool fixCellDims; // fix the cell dimensions
626  Bool fixCellDimX;
627  Bool fixCellDimY;
628  Bool fixCellDimZ;
629 
630  Bool berendsenPressureOn; // Berendsen pressure bath
631  BigReal berendsenPressureTarget;
632  BigReal berendsenPressureCompressibility;
633  BigReal berendsenPressureRelaxationTime;
634  int berendsenPressureFreq;
635 
636  Bool langevinPistonOn; // Langevin piston pressure control
637  Bool langevinPistonBarrier; // Turn off to extrapolate cell
638  BigReal langevinPistonTarget;
639  BigReal langevinPistonPeriod;
640  BigReal langevinPistonDecay;
641  BigReal langevinPistonTemp;
642 
643  Bool multigratorOn; // Multigrator temperature and/or pressure control
644  BigReal multigratorPressureTarget;
645  BigReal multigratorPressureRelaxationTime;
646  int multigratorPressureFreq;
647  BigReal multigratorTemperatureTarget;
648  BigReal multigratorTemperatureRelaxationTime;
649  int multigratorTemperatureFreq;
650  int multigratorNoseHooverChainLength;
651 
652  BigReal surfaceTensionTarget;
653 
654  Bool pressureProfileOn; // Compute lateral pressure profile?
655  int pressureProfileSlabs; // Number of slabs
656  int pressureProfileFreq; // How often to store profile data
657  int pressureProfileAtomTypes;
658  Bool pressureProfileEwaldOn; // Compute Ewald contribution?
659  int pressureProfileEwaldX;
660  int pressureProfileEwaldY;
661  int pressureProfileEwaldZ;
662 
663  zVector strainRate;
664  zVector strainRate2; // off diagonal elements (xy, xz, yz)
665 
666  unsigned int randomSeed; // Seed for random number generator
667 
668  Bool FMAOn; // Flag TRUE-> FMA active
669  int FMALevels; // Number of Levels for FMA
670  int FMAMp; // Number of multipole terms for FMA
671  Bool FMAFFTOn; // FFT on/off flag for FMA
672  int FMAFFTBlock; // FFT blocking factor for FMA
673 
674  Bool fullDirectOn; // Should direct calculations of
675  // full electrostatics be performed?
676 
677  Bool MSMOn; // enable MSM (multilevel summation method)
678  // for long-range electrostatics
679 
680  int MSMQuality; // choose MSM quality 0 (low) - 3 (high), using
681  // optimal combination of approximation and splitting
682  // defaults to "low" for fastest performance
683 
684  int MSMApprox; // choose MSM approximation
685  // defaults to "cubic" (low) for fastest performance
686 
687  int MSMSplit; // choose MSM splitting function
688  // defaults to "Taylor2" (low) for fastest performance
689 
690  int MSMLevels; // select number of MSM levels
691  // default (0) adapts number of levels to the
692  // system for fastest performance
693 
694  int MSMBlockSizeX; // controls size of parallel work decomposition
695  int MSMBlockSizeY; // controls size of parallel work decomposition
696  int MSMBlockSizeZ; // controls size of parallel work decomposition
697 
698  BigReal MSMGridSpacing; // defaults to 2.5 A, best for atomic systems
699 
700  BigReal MSMPadding; // pad grid along non-periodic boundaries
701  // defaults to 2.5 A
702  // increase if atoms are drifting beyond
703  // edge of grid, which will terminate
704  // simulation prematurely
705 
706  BigReal MSMxmin; // define extent of non-periodic boundaries
707  BigReal MSMxmax;
708  BigReal MSMymin;
709  BigReal MSMymax;
710  BigReal MSMzmin;
711  BigReal MSMzmax;
712 
713  Bool MsmSerialOn; // use serial MSM solver for testing
714 
715  Bool FMMOn;
716  int FMMLevels;
717  BigReal FMMPadding;
718 
719  Bool PMEOn; // Flag TRUE -> PME active
720  BigReal PMETolerance; // Direct space tolerance
721  BigReal PMEEwaldCoefficient; // From tolerance and cutoff
722  int PMEInterpOrder; // Order of interpolation
723  int PMEGridSizeX; // No. of grid points in x dim
724  int PMEGridSizeY; // No. of grid points in y dim
725  int PMEGridSizeZ; // No. of grid points in z dim
726  BigReal PMEGridSpacing; // Maximum spacing between points
727  int PMEProcessors; // No. of processors to use
728  int PMEMinSlices; // Min slices per PME slab
729  int PMEMinPoints; // Min points per PME pencil
730  Bool PMEBarrier; // Use barrier before sendTrans
731  int PMEPencils; // Size of pencil grid in each dim
732  int PMEPencilsX; // Size of pencil grid in X dim
733  int PMEPencilsY; // Size of pencil grid in Y dim
734  int PMEPencilsZ; // Size of pencil grid in Z dim
735  int PMEPencilsYLayout; // Y pencil layout strategy
736  int PMEPencilsXLayout; // X pencil layout strategy
737  int PMESendOrder; // Message ordering strategy
738  Bool PMEOffload; // Offload reciprocal sum to accelerator
739 
740  Bool useDPME; // Flag TRUE -> old DPME code
741  Bool usePMECUDA; // Flag TRUE -> use the PME CUDA version
742  Bool useCUDA2; // Flag TRUE -> use ComputeNonbondedCUDA2
743  int bondedCUDA; // Bitmask for calculating bonded interactions on GPU
744  Bool useOptPME; // Flag TRUE -> use the scalable version of PME
745  Bool useManyToMany; // Flag TRUE -> use the manytomany optimization of PME.
746  // This flag requres useOptPME to be set.
747 
748  Bool FFTWEstimate;
749  Bool FFTWPatient;
750  Bool FFTWUseWisdom;
751  char FFTWWisdomFile[128];
752  char *FFTWWisdomString;
753 
754  #ifdef OPENATOM_VERSION
755  Bool openatom; // Flag TRUE -> OpenAtom QM/MM active
756  #endif // OPENATOM_VERSION
757 
758  Bool minimizeCGOn; // Flag TRUE-> CG minimization active
759  Bool minVerbose; // Flag TRUE-> print extra minimization data
760  BigReal minTinyStep; // Minimization parameter
761  BigReal minBabyStep; // Minimization parameter
762  BigReal minLineGoal; // Minimization parameter
763  Bool minimizeOn; // Flag TRUE-> minimization active
764  BigReal maximumMove; // Maximum movement per timestep
765  // during minimization
766 
767  Bool sphericalBCOn; // Flag TRUE-> spherical boundary
768  // conditions are active
769  zVector sphericalCenter; // Center specified by user
770  BigReal sphericalBCk1; // First force constant for
771  // spherical BC
772  BigReal sphericalBCk2; // Second force constant for
773  // spherical BC
774  BigReal sphericalBCr1; // First radius for spherical BC
775  BigReal sphericalBCr2; // Second radius for spherical BC
776  int sphericalBCexp1; // First radius for spherical BC
777  int sphericalBCexp2; // Second radius for spherical BC
778 
779  Bool cylindricalBCOn; // Flag TRUE->cylindrical boundary
780  // conditions are active
781  zVector cylindricalCenter;
782  char cylindricalBCAxis; // 'x', 'y', or 'z'
783  BigReal cylindricalBCr1;
784  BigReal cylindricalBCr2;
785  BigReal cylindricalBCl1;
786  BigReal cylindricalBCl2;
787  int cylindricalBCexp1;
788  int cylindricalBCexp2;
789  BigReal cylindricalBCk1;
790  BigReal cylindricalBCk2;
791 
792  Bool eFieldOn; // Should a electric field be applied
793  Bool eFieldNormalized; // Is eField vector scaled by cell basis vectors
794  zVector eField; // Electric field vector to be applied
795  BigReal eFieldFreq; // Frequency of the electric field
796  BigReal eFieldPhase; // Phase phi, cos(w*t-phi*PI/180)
797 
798  Bool stirOn; // Should a stirring torque be applied
799  char stirFilename[128]; // Stirring filename (atoms marked)
800  //do the below two even needed to be defined?
801  BigReal stirStartingTheta; // Stir starting theta offset
802  BigReal stirVel; // Stir angular velocity
803  BigReal stirK; // Stir force harmonic spring constant
804  zVector stirAxis; // Direction of stir axis
805  zVector stirPivot; // Pivot point of stir axis
806 
807  Bool extraBondsOn; // read extra bonded forces
808 
809  Bool consForceOn; // Should constant force be applied
810  char consForceFile[128];
811  BigReal consForceScaling;
812 
813  int outputEnergies; // Number of timesteps between energy
814  // outputs
815 
816  int outputMomenta; // Number of timesteps between momentum
817  // outputs
818 
819  int outputTiming; // Number of timesteps between timing
820  // outputs
821 
822  int outputCudaTiming; // Number of timesteps between timing
823  // outputs of CUDA code
824 
825  int outputPressure; // Number of timesteps between pressure
826  // tensor outputs
827 
828  Bool mergeCrossterms; // Merge crossterm energy w/ dihedrals
829 
830  int firstTimestep; // Starting timestep. Will be 0 unless
831  // restarting a simulation
832 
833  MTSChoices MTSAlgorithm; // What multiple timestep algorithm
834  // to use
835 
836  int longSplitting; // What electrostatic splitting
837  // to use
838 
839  Bool ignoreMass; // Mass < 3.5 does not indicate hydrogen, etc.
840 
841  int splitPatch; // How are patches determined?
842  BigReal hgroupCutoff; // what is the added hydrogen margin?
843 
844  int mollyOn; // mollify long range forces?
845  BigReal mollyTol; // error tolerance for molly
846  int mollyIter; // max number of iterations for molly
847 
848  int rigidBonds; // what type of rigid bonds to hydrogens
849  // none, all, or only water
850 
851  BigReal rigidTol; // error tolerance for rigid bonds
852  int rigidIter; // Number of NR iterations
853  int rigidDie; // die if rigidTol not achieved
854 
855  Bool useSettle; // Use SETTLE; requires rigid waters
856 
857  Bool testOn; // Do tests rather than simulation
858  Bool commOnly; // Don't do any force evaluations
859  Bool statsOn; // Don't do any force evaluations
860 
861  int totalAtoms; // Total Number of atoms in simulation
862  int maxSelfPart; // maximum number of self partitions
863  // that a patch can be split into
864  int maxPairPart; // maximum number of pair partitions
865  // that a patch can be split into
866  int numAtomsSelf; // maximum number of atoms in a single
867  // self-compute
868  int numAtomsSelf2; // maximum number of atoms in a pair compute
869  // in the presence of twoAwayX,Y,Z options
870  int numAtomsPair; // maximum number of atoms in a single
871  // pair-compute
872  int numAtomsPair2; // maximum number of atoms in a single
873  // pair-compute
874  int minAtomsPerPatch; // minimum average atoms per patch
875  // (may create larger patches)
876  int maxExclusionFlags; // maximum size of exclusion check list
877  // for any given atom
878  Bool outputPatchDetails; // print number of atoms per patch
879  Bool staticAtomAssignment; // never migrate atoms
880  Bool replicaUniformPatchGrids; // same patch grid size on all replicas
881 
882  //
883  // hydrogen bond simulation parameters
884  //
885 
886  // should the hydrogen bond term be used? If FALSE, all other
887  // hydrogen bond parameters are unnecessary in simulation.
888  Bool HydrogenBonds;
889 
890  // should the antecedent atom be used in the calculation of hbonds?
891  Bool useAntecedent;
892 
893  // exponents used in hydrogen bond energy function:
894  // aaAngleExp = exp for H-A-AA angle term (n)
895  // haAngleExp = exp for D-H-A angle term (m)
896  // distAttExp = exp for attractive A-D distance term (j)
897  // distRepExp = exp for repulsive A-D distance term (i)
898  int aaAngleExp, haAngleExp, distAttExp, distRepExp;
899 
900  // cutoff D-H-A angle, and on/off angles for switch fcn (in degrees)
901  BigReal dhaCutoffAngle, dhaOnAngle, dhaOffAngle;
902 
903  // cutoff distance for D-A separation in hbonds (in Angstroms), and
904  // on/off distances for hbond radial term switching function
905  BigReal daCutoffDist, daOnDist, daOffDist;
906 
907  // IMD parameters
908  int IMDon; // enable IMD
909  int IMDport; // port on which to listen for connections
910  int IMDfreq; // frequency at which coordinates will be available
911  int IMDwait; // if true, pause the simulation when there is no
912  // connection
913  int IMDignore; // IMD connection does not influence simulation
914  // only sends coordinates and energies to VMD
915  int IMDignoreForces; // Only the Forces are ignored. Finish, Pause and Resume are enabled
916 
917 
918  // AMBER options
919  Bool amberOn; // FLAG TRUE-> amber force field is used
920  Bool readExclusions; // FLAG TRUE-> Read exclusions from parm file
921  BigReal vdwscale14; // Scaling factor for 1-4 VDW interactions
922 
923  // GROMACS options
924  Bool gromacsOn; // FLAG TRUE -> gromacs-style force field is used
925 
926  // OPLS options
927  Bool vdwGeometricSigma; // Lennard-J sigma uses geometric mean
928 
929  // ScriptTcl argument passing
930  BigReal scriptArg1;
931  BigReal scriptArg2;
932  BigReal scriptArg3;
933  BigReal scriptArg4;
934  BigReal scriptArg5;
935  int scriptIntArg1;
936  int scriptIntArg2;
937  char scriptStringArg1[128];
938  char scriptStringArg2[128];
939 
940  Bool useCompressedPsf;
941  Bool genCompressedPsf;
942 
943  Bool usePluginIO;
944 
945  Bool mallocTest;
946  Bool printExclusions;
947 
948  //default value is -1
949  int proxySendSpanningTree;
950  int proxyRecvSpanningTree;
951 
952  int proxyTreeBranchFactor;
953 
954 
955  //fields needed for Parallel IO Input
956  int numinputprocs;
957  char *binAtomFile;
958  char *binCoorFile;
959  char *binVelFile;
960  char *binRefFile;
961 
962  //fields needed for Parallel IO Output
963  int numoutputprocs;
964  int numoutputwrts;
965 
966  char computeMapFilename[128]; // store compute map
967  Bool storeComputeMap;
968  Bool loadComputeMap;
969 
970  // MIC-specific parameters
971  int mic_hostSplit;
972  int mic_numParts_self_p1;
973  int mic_numParts_pair_p1;
974  int mic_numParts_pair_p2;
975  int mic_unloadMICPEs;
976  int mic_deviceThreshold;
977  int mic_singleKernel;
978 
979 public:
980 
981  SimParameters() : mgridforcelist(), parseopts(0) {};
982  SimParameters(ConfigList *c, char *&cwd) : mgridforcelist(), parseopts(0) {
983  initialize_config_data(c,cwd);
984  };
985  ~SimParameters() {};
986 
987  void initialize_config_data(ConfigList *, char *&cwd);
988  // Initialize SimParameters data
989  // from the ConfigList object
990  void send_SimParameters(MOStream *);
991  // Used by the master process
992  // to send the paramters to
993  // the other processors
994  void receive_SimParameters(MIStream *);
995  // Used by the other processors
996  // to receive the data from the
997  // master process
998  void scriptSet(const char *, const char *);
999  // Set parameters at run time
1000  void close_dcdfile(); // *** implemented in Output.C ***
1001  void close_veldcdfile(); // *** implemented in Output.C ***
1002  static void nonbonded_select();
1003 
1004  int isSendSpanningTreeOn(){ return proxySendSpanningTree == 1; }
1005  int isSendSpanningTreeUnset() { return proxySendSpanningTree == -1; }
1006  int isRecvSpanningTreeOn(){ return proxyRecvSpanningTree == 1; }
1007  int isRecvSpanningTreeUnset() { return proxyRecvSpanningTree == -1; }
1008 
1009  char* getfromparseopts(const char* name, char *outbuf);
1010  int istrueinparseopts(const char* name);
1011  int issetinparseopts(const char* name);
1012 
1013  void readExtendedSystem(const char *filename, Lattice *latptr=0);
1014 private:
1015  ParseOptions *parseopts;
1016 
1017  void config_parser(ParseOptions &opts);
1018 
1019  void config_parser_basic(ParseOptions &opts);
1020  void config_parser_fileio(ParseOptions &opts);
1021  void config_parser_fullelect(ParseOptions &opts);
1022  void config_parser_methods(ParseOptions &opts);
1023  void config_parser_constraints(ParseOptions &opts);
1024 #ifdef OPENATOM_VERSION
1025  void config_parser_openatom(ParseOptions &opts);
1026 #endif //OPENATOM_VERSION
1027  /* BEGIN gf */
1028  void config_parser_gridforce(ParseOptions &opts);
1029  /* END gf */
1030  void config_parser_movdrag(ParseOptions &opts);
1031  void config_parser_rotdrag(ParseOptions &opts);
1032  void config_parser_constorque(ParseOptions &opts);
1033  void config_parser_boundary(ParseOptions &opts);
1034  void config_parser_misc(ParseOptions &opts);
1035  void config_parser_mgridforce(ParseOptions &opts);
1036  void parse_mgrid_string_param(ConfigList *config,
1037  const char *fieldname, char** dest);
1038  void parse_mgrid_params(ConfigList *config);
1039  void print_mgrid_params();
1040 
1041  void check_config(ParseOptions &opts, ConfigList *config, char *&cwd);
1042 
1043  void print_config(ParseOptions &opts, ConfigList *config, char *&cwd);
1044 
1045  void create_output_directories(const char *dirname);
1046 
1047  int fmaFrequency; // outdated parameter name
1048  char loadBalancer[64]; // Load balancer
1049  char loadStrategy[64]; // Load balancing strategy
1050 
1051 };
1052 
1053 #endif
1054 
Definition: SimParameters.h:100