Reimplement constant acceleration groups
[alexxy/gromacs.git] / src / gromacs / mdtypes / inputrec.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team.
6  * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
7  * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
8  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
9  * and including many others, as listed in the AUTHORS file in the
10  * top-level source directory and at http://www.gromacs.org.
11  *
12  * GROMACS is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public License
14  * as published by the Free Software Foundation; either version 2.1
15  * of the License, or (at your option) any later version.
16  *
17  * GROMACS is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with GROMACS; if not, see
24  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
26  *
27  * If you want to redistribute modifications to GROMACS, please
28  * consider that scientific software is very special. Version
29  * control is crucial - bugs must be traceable. We will be happy to
30  * consider code for inclusion in the official distribution, but
31  * derived work must not be called official GROMACS. Details are found
32  * in the README & COPYING files - if they are missing, get the
33  * official version at http://www.gromacs.org.
34  *
35  * To help us fund GROMACS development, we humbly ask that you cite
36  * the research papers on the package. Check out http://www.gromacs.org.
37  */
38 #ifndef GMX_MDTYPES_INPUTREC_H
39 #define GMX_MDTYPES_INPUTREC_H
40
41 #include <cstdio>
42
43 #include <memory>
44 #include <vector>
45
46 #include "gromacs/math/vectypes.h"
47 #include "gromacs/mdtypes/md_enums.h"
48 #include "gromacs/utility/enumerationhelpers.h"
49 #include "gromacs/utility/real.h"
50
51 #define EGP_EXCL (1 << 0)
52 #define EGP_TABLE (1 << 1)
53
54 struct gmx_enfrot;
55 struct gmx_enfrotgrp;
56 struct pull_params_t;
57
58 namespace gmx
59 {
60 class Awh;
61 class AwhParams;
62 class KeyValueTreeObject;
63 struct MtsLevel;
64 } // namespace gmx
65
66 struct t_grpopts
67 {
68     //! Number of T-Coupl groups
69     int ngtc = 0;
70     //! Number of of Nose-Hoover chains per group
71     int nhchainlength = 0;
72     //! Number of Accelerate groups
73     int ngacc;
74     //! Number of Freeze groups
75     int ngfrz = 0;
76     //! Number of Energy groups
77     int ngener = 0;
78     //! Number of degrees of freedom in a group
79     real* nrdf = nullptr;
80     //! Coupling temperature    per group
81     real* ref_t = nullptr;
82     //! No/simple/periodic simulated annealing for each group
83     SimulatedAnnealing* annealing = nullptr;
84     //! Number of annealing time points per group
85     int* anneal_npoints = nullptr;
86     //! For each group: Time points
87     real** anneal_time = nullptr;
88     //! For each group: Temperature at these times. Final temp after all intervals is ref_t
89     real** anneal_temp = nullptr;
90     //! Tau coupling time
91     real* tau_t = nullptr;
92     //! Acceleration per group
93     rvec* acceleration = nullptr;
94     //! Whether the group will be frozen in each direction
95     ivec* nFreeze = nullptr;
96     //! Exclusions/tables of energy group pairs
97     int* egp_flags = nullptr;
98
99     /* QMMM stuff */
100     //! Number of QM groups
101     int ngQM = 0;
102 };
103
104 struct t_simtemp
105 {
106     //! Simulated temperature scaling; linear or exponential
107     SimulatedTempering eSimTempScale = SimulatedTempering::Default;
108     //! The low temperature for simulated tempering
109     real simtemp_low = 0;
110     //! The high temperature for simulated tempering
111     real simtemp_high = 0;
112     //! The range of temperatures used for simulated tempering
113     std::vector<real> temperatures;
114 };
115
116 struct t_lambda
117 {
118     //! The frequency for calculating dhdl
119     int nstdhdl = 0;
120     //! Fractional value of lambda (usually will use init_fep_state, this will only be for slow growth, and for legacy free energy code. Only has a valid value if positive)
121     double init_lambda = 0;
122     //! The initial number of the state
123     int init_fep_state = 0;
124     //! Change of lambda per time step (fraction of (0.1)
125     double delta_lambda = 0;
126     //! Print no, total or potential energies in dhdl
127     FreeEnergyPrintEnergy edHdLPrintEnergy = FreeEnergyPrintEnergy::Default;
128     //! The number of foreign lambda points
129     int n_lambda = 0;
130     //! The array of all lambda values
131     gmx::EnumerationArray<FreeEnergyPerturbationCouplingType, std::vector<double>> all_lambda;
132     //! The number of neighboring lambda states to calculate the energy for in up and down directions (-1 for all)
133     int lambda_neighbors = 0;
134     //! The first lambda to calculate energies for
135     int lambda_start_n = 0;
136     //! The last lambda +1 to calculate energies for
137     int lambda_stop_n = 0;
138     //! Free energy soft-core parameter
139     real sc_alpha = 0;
140     //! Lambda power for soft-core interactions
141     int sc_power = 0;
142     //! R power for soft-core interactions
143     real sc_r_power = 0;
144     //! Free energy soft-core sigma when c6 or c12=0
145     real sc_sigma = 0;
146     //! Free energy soft-core sigma for ?????
147     real sc_sigma_min = 0;
148     //! Use softcore for the coulomb portion as well (default FALSE)
149     bool bScCoul = false;
150     //! The specific soft-core function to use
151     SoftcoreType softcoreFunction = SoftcoreType::Beutler;
152     //! scale for the linearization point for the vdw interaction with gapsys soft-core
153     real scGapsysScaleLinpointLJ = 0.85;
154     //! scale for the linearization point for the coulomb interaction with gapsys soft-core
155     real scGapsysScaleLinpointQ = 0.3;
156     //! lower bound for c12/c6 in gapsys soft-core
157     real scGapsysSigmaLJ = 0.3;
158     //! Whether to print the dvdl term associated with this term; if it is not specified as separate, it is lumped with the FEP term
159     gmx::EnumerationArray<FreeEnergyPerturbationCouplingType, bool> separate_dvdl;
160     //! Whether to write a separate dhdl.xvg file note: NOT a gmx_bool, but an enum
161     SeparateDhdlFile separate_dhdl_file = SeparateDhdlFile::Default;
162     //! Whether to calculate+write dhdl derivatives note: NOT a gmx_bool, but an enum
163     DhDlDerivativeCalculation dhdl_derivatives = DhDlDerivativeCalculation::Default;
164     //! The maximum table size for the dH histogram
165     int dh_hist_size = 0;
166     //! The spacing for the dH histogram
167     double dh_hist_spacing = 0;
168 };
169
170 struct t_expanded
171 {
172     //! The frequency of expanded ensemble state changes
173     int nstexpanded = 0;
174     //! Which type of move updating do we use for lambda monte carlo (or no for none)
175     LambdaWeightCalculation elamstats = LambdaWeightCalculation::Default;
176     //! What move set will be we using for state space moves
177     LambdaMoveCalculation elmcmove = LambdaMoveCalculation::Default;
178     //! The method we use to decide of we have equilibrated the weights
179     LambdaWeightWillReachEquilibrium elmceq = LambdaWeightWillReachEquilibrium::Default;
180     //! The minumum number of samples at each lambda for deciding whether we have reached a minimum
181     int equil_n_at_lam = 0;
182     //! Wang-Landau delta at which we stop equilibrating weights
183     real equil_wl_delta = 0;
184     //! Use the ratio of weights (ratio of minimum to maximum) to decide when to stop equilibrating
185     real equil_ratio = 0;
186     //! After equil_steps steps we stop equilibrating the weights
187     int equil_steps = 0;
188     //! After equil_samples total samples (steps/nstfep), we stop equilibrating the weights
189     int equil_samples = 0;
190     //! Random number seed for lambda mc switches
191     int lmc_seed = 0;
192     //! Whether to use minumum variance weighting
193     bool minvar = false;
194     //! The number of samples needed before kicking into minvar routine
195     int minvarmin = 0;
196     //! The offset for the variance in MinVar
197     real minvar_const = 0;
198     //! Range of cvalues used for BAR
199     int c_range = 0;
200     //! Whether to print symmetrized matrices
201     bool bSymmetrizedTMatrix = false;
202     //! How frequently to print the transition matrices
203     int nstTij = 0;
204     //! Number of repetitions in the MC lambda jumps MRS -- VERIFY THIS
205     int lmc_repeats = 0;
206     //! Minimum number of samples for each state before free sampling MRS -- VERIFY THIS!
207     int lmc_forced_nstart = 0;
208     //! Distance in lambda space for the gibbs interval
209     int gibbsdeltalam = 0;
210     //! Scaling factor for Wang-Landau
211     real wl_scale = 0;
212     //! Ratio between largest and smallest number for freezing the weights
213     real wl_ratio = 0;
214     //! Starting delta for Wang-Landau
215     real init_wl_delta = 0;
216     //! Use one over t convergence for Wang-Landau when the delta get sufficiently small
217     bool bWLoneovert = false;
218     //! Did we initialize the weights? TODO: REMOVE FOR 5.0, no longer needed with new logic
219     bool bInit_weights = false;
220     //! To override the main temperature, or define it if it's not defined
221     real mc_temp = 0;
222     //! User-specified initial weights to start with
223     std::vector<real> init_lambda_weights;
224 };
225
226 struct t_rotgrp
227 {
228     //! Rotation type for this group
229     EnforcedRotationGroupType eType;
230     //! Use mass-weighed positions?
231     bool bMassW;
232     //! Number of atoms in the group
233     int nat;
234     //! The global atoms numbers
235     int* ind;
236     //! The reference positions
237     rvec* x_ref;
238     //! The normalized rotation vector
239     rvec inputVec;
240     //! Rate of rotation (degree/ps)
241     real rate;
242     //! Force constant (kJ/(mol nm^2)
243     real k;
244     //! Pivot point of rotation axis (nm)
245     rvec pivot;
246     //! Type of fit to determine actual group angle
247     RotationGroupFitting eFittype;
248     //! Number of angles around the reference angle for which the rotation potential is also evaluated (for fit type 'potential' only)
249     int PotAngle_nstep;
250     //! Distance between two angles in degrees (for fit type 'potential' only)
251     real PotAngle_step;
252     //! Slab distance (nm)
253     real slab_dist;
254     //! Minimum value the gaussian must have so that the force is actually evaluated
255     real min_gaussian;
256     //! Additive constant for radial motion2 and flexible2 potentials (nm^2)
257     real eps;
258 };
259
260 struct t_rot
261 {
262     //! Number of rotation groups
263     int ngrp;
264     //! Output frequency for main rotation outfile
265     int nstrout;
266     //! Output frequency for per-slab data
267     int nstsout;
268     //! Groups to rotate
269     t_rotgrp* grp;
270 };
271
272 struct t_IMD
273 {
274     //! Number of interactive atoms
275     int nat;
276     //! The global indices of the interactive atoms
277     int* ind;
278 };
279
280 struct t_swapGroup
281 {
282     //! Name of the swap group, e.g. NA, CL, SOL
283     char* molname;
284     //! Number of atoms in this group
285     int nat;
286     //! The global ion group atoms numbers
287     int* ind;
288     //! Requested number of molecules of this type per compartment
289     gmx::EnumerationArray<Compartment, int> nmolReq;
290 };
291
292 struct t_swapcoords
293 {
294     //! Period between when a swap is attempted
295     int nstswap;
296     //! Use mass-weighted positions in split group
297     bool massw_split[2];
298     /*! \brief Split cylinders defined by radius, upper and lower
299      * extension. The split cylinders define the channels and are
300      * each anchored in the center of the split group */
301     /**@{*/
302     real cyl0r, cyl1r;
303     real cyl0u, cyl1u;
304     real cyl0l, cyl1l;
305     /**@}*/
306     //! Coupling constant (number of swap attempt steps)
307     int nAverage;
308     //! Ion counts may deviate from the requested values by +-threshold before a swap is done
309     real threshold;
310     //! Offset of the swap layer (='bulk') with respect to the compartment-defining layers
311     gmx::EnumerationArray<Compartment, real> bulkOffset;
312     //! Number of groups to be controlled
313     int ngrp;
314     //! All swap groups, including split and solvent
315     t_swapGroup* grp;
316 };
317
318 struct t_inputrec // NOLINT (clang-analyzer-optin.performance.Padding)
319 {
320     t_inputrec();
321     explicit t_inputrec(const t_inputrec&) = delete;
322     t_inputrec& operator=(const t_inputrec&) = delete;
323     ~t_inputrec();
324
325     //! Integration method
326     IntegrationAlgorithm eI = IntegrationAlgorithm::Default;
327     //! Number of steps to be taken
328     int64_t nsteps = 0;
329     //! Used in checkpointing to separate chunks
330     int simulation_part = 0;
331     //! Start at a stepcount >0 (used w. convert-tpr)
332     int64_t init_step = 0;
333     //! Frequency of energy calc. and T/P coupl. upd.
334     int nstcalcenergy = 0;
335     //! Group or verlet cutoffs
336     CutoffScheme cutoff_scheme = CutoffScheme::Default;
337     //! Number of steps before pairlist is generated
338     int nstlist = 0;
339     //! Number of steps after which center of mass motion is removed
340     int nstcomm = 0;
341     //! Center of mass motion removal algorithm
342     ComRemovalAlgorithm comm_mode = ComRemovalAlgorithm::Default;
343     //! Number of steps after which print to logfile
344     int nstlog = 0;
345     //! Number of steps after which X is output
346     int nstxout = 0;
347     //! Number of steps after which V is output
348     int nstvout = 0;
349     //! Number of steps after which F is output
350     int nstfout = 0;
351     //! Number of steps after which energies printed
352     int nstenergy = 0;
353     //! Number of steps after which compressed trj (.xtc,.tng) is output
354     int nstxout_compressed = 0;
355     //! Initial time (ps)
356     double init_t = 0;
357     //! Time step (ps)
358     double delta_t = 0;
359     //! Whether we use multiple time stepping
360     bool useMts = false;
361     //! The multiple time stepping levels
362     std::vector<gmx::MtsLevel> mtsLevels;
363     //! Precision of x in compressed trajectory file
364     real x_compression_precision = 0;
365     //! Requested fourier_spacing, when nk? not set
366     real fourier_spacing = 0;
367     //! Number of k vectors in x dimension for fourier methods for long range electrost.
368     int nkx = 0;
369     //! Number of k vectors in y dimension for fourier methods for long range electrost.
370     int nky = 0;
371     //! Number of k vectors in z dimension for fourier methods for long range electrost.
372     int nkz = 0;
373     //! Interpolation order for PME
374     int pme_order = 0;
375     //! Real space tolerance for Ewald, determines the real/reciprocal space relative weight
376     real ewald_rtol = 0;
377     //! Real space tolerance for LJ-Ewald
378     real ewald_rtol_lj = 0;
379     //! Normal/3D ewald, or pseudo-2D LR corrections
380     EwaldGeometry ewald_geometry = EwaldGeometry::Default;
381     //! Epsilon for PME dipole correction
382     real epsilon_surface = 0;
383     //! Type of combination rule in LJ-PME
384     LongRangeVdW ljpme_combination_rule = LongRangeVdW::Default;
385     //! Type of periodic boundary conditions
386     PbcType pbcType = PbcType::Default;
387     //! Periodic molecules
388     bool bPeriodicMols = false;
389     //! Continuation run: starting state is correct (ie. constrained)
390     bool bContinuation = false;
391     //! Temperature coupling
392     TemperatureCoupling etc = TemperatureCoupling::Default;
393     //! Interval in steps for temperature coupling
394     int nsttcouple = 0;
395     //! Whether to print nose-hoover chains
396     bool bPrintNHChains = false;
397     //! Pressure coupling
398     PressureCoupling epc = PressureCoupling::Default;
399     //! Pressure coupling type
400     PressureCouplingType epct = PressureCouplingType::Default;
401     //! Interval in steps for pressure coupling
402     int nstpcouple = 0;
403     //! Pressure coupling time (ps)
404     real tau_p = 0;
405     //! Reference pressure (kJ/(mol nm^3))
406     tensor ref_p = { { 0 } };
407     //! Compressibility ((mol nm^3)/kJ)
408     tensor compress = { { 0 } };
409     //! How to scale absolute reference coordinates
410     RefCoordScaling refcoord_scaling = RefCoordScaling::Default;
411     //! The COM of the posres atoms
412     rvec posres_com = { 0, 0, 0 };
413     //! The B-state COM of the posres atoms
414     rvec posres_comB = { 0, 0, 0 };
415     //! Random seed for Andersen thermostat (obsolete)
416     int andersen_seed = 0;
417     //! Per atom pair energy drift tolerance (kJ/mol/ps/atom) for list buffer
418     real verletbuf_tol = 0;
419     //! Short range pairlist cut-off (nm)
420     real rlist = 0;
421     //! Radius for test particle insertion
422     real rtpi = 0;
423     //! Type of electrostatics treatment
424     CoulombInteractionType coulombtype = CoulombInteractionType::Default;
425     //! Modify the Coulomb interaction
426     InteractionModifiers coulomb_modifier = InteractionModifiers::Default;
427     //! Coulomb switch range start (nm)
428     real rcoulomb_switch = 0;
429     //! Coulomb cutoff (nm)
430     real rcoulomb = 0;
431     //! Relative dielectric constant
432     real epsilon_r = 0;
433     //! Relative dielectric constant of the RF
434     real epsilon_rf = 0;
435     //! Always false (no longer supported)
436     bool implicit_solvent = false;
437     //! Type of Van der Waals treatment
438     VanDerWaalsType vdwtype = VanDerWaalsType::Default;
439     //! Modify the Van der Waals interaction
440     InteractionModifiers vdw_modifier = InteractionModifiers::Default;
441     //! Van der Waals switch range start (nm)
442     real rvdw_switch = 0;
443     //! Van der Waals cutoff (nm)
444     real rvdw = 0;
445     //! Perform Long range dispersion corrections
446     DispersionCorrectionType eDispCorr = DispersionCorrectionType::Default;
447     //! Extension of the table beyond the cut-off, as well as the table length for 1-4 interac.
448     real tabext = 0;
449     //! Tolerance for shake
450     real shake_tol = 0;
451     //! Free energy calculations
452     FreeEnergyPerturbationType efep = FreeEnergyPerturbationType::Default;
453     //! Data for the FEP state
454     std::unique_ptr<t_lambda> fepvals;
455     //! Whether to do simulated tempering
456     bool bSimTemp = false;
457     //! Variables for simulated tempering
458     std::unique_ptr<t_simtemp> simtempvals;
459     //! Whether expanded ensembles are used
460     bool bExpanded = false;
461     //! Expanded ensemble parameters
462     std::unique_ptr<t_expanded> expandedvals;
463     //! Type of distance restraining
464     DistanceRestraintRefinement eDisre = DistanceRestraintRefinement::Default;
465     //! Force constant for time averaged distance restraints
466     real dr_fc = 0;
467     //! Type of weighting of pairs in one restraints
468     DistanceRestraintWeighting eDisreWeighting = DistanceRestraintWeighting::Default;
469     //! Use combination of time averaged and instantaneous violations
470     bool bDisreMixed = false;
471     //! Frequency of writing pair distances to enx
472     int nstdisreout = 0;
473     //! Time constant for memory function in disres
474     real dr_tau = 0;
475     //! Force constant for orientational restraints
476     real orires_fc = 0;
477     //! Time constant for memory function in orires
478     real orires_tau = 0;
479     //! Frequency of writing tr(SD) to energy output
480     int nstorireout = 0;
481     //! The stepsize for updating
482     real em_stepsize = 0;
483     //! The tolerance
484     real em_tol = 0;
485     //! Number of iterations for convergence of steepest descent in relax_shells
486     int niter = 0;
487     //! Stepsize for directional minimization in relax_shells
488     real fc_stepsize = 0;
489     //! Number of steps after which a steepest descents step is done while doing cg
490     int nstcgsteep = 0;
491     //! Number of corrections to the Hessian to keep
492     int nbfgscorr = 0;
493     //! Type of constraint algorithm
494     ConstraintAlgorithm eConstrAlg = ConstraintAlgorithm::Default;
495     //! Order of the LINCS Projection Algorithm
496     int nProjOrder = 0;
497     //! Warn if any bond rotates more than this many degrees
498     real LincsWarnAngle = 0;
499     //! Number of iterations in the final LINCS step
500     int nLincsIter = 0;
501     //! Use successive overrelaxation for shake
502     bool bShakeSOR = false;
503     //! Friction coefficient for BD (amu/ps)
504     real bd_fric = 0;
505     //! Random seed for SD and BD
506     int64_t ld_seed = 0;
507     //! The number of walls
508     int nwall = 0;
509     //! The type of walls
510     WallType wall_type = WallType::Default;
511     //! The potentail is linear for r<=wall_r_linpot
512     real wall_r_linpot = 0;
513     //! The atom type for walls
514     int wall_atomtype[2] = { 0, 0 };
515     //! Number density for walls
516     real wall_density[2] = { 0, 0 };
517     //! Scaling factor for the box for Ewald
518     real wall_ewald_zfac = 0;
519
520     /* COM pulling data */
521     //! Do we do COM pulling?
522     bool bPull = false;
523     //! The data for center of mass pulling
524     std::unique_ptr<pull_params_t> pull;
525
526     /* AWH bias data */
527     //! Whether to use AWH biasing for PMF calculations
528     bool bDoAwh = false;
529     //! AWH biasing parameters
530     std::unique_ptr<gmx::AwhParams> awhParams;
531
532     /* Enforced rotation data */
533     //! Whether to calculate enforced rotation potential(s)
534     bool bRot = false;
535     //! The data for enforced rotation potentials
536     t_rot* rot = nullptr;
537
538     //! Whether to do ion/water position exchanges (CompEL)
539     SwapType eSwapCoords = SwapType::Default;
540     //! Swap data structure.
541     t_swapcoords* swap = nullptr;
542
543     //! Whether the tpr makes an interactive MD session possible.
544     bool bIMD = false;
545     //! Interactive molecular dynamics
546     t_IMD* imd = nullptr;
547
548     //! Acceleration for viscosity calculation
549     real cos_accel = 0;
550     //! Triclinic deformation velocities (nm/ps)
551     tensor deform = { { 0 } };
552     /*! \brief User determined parameters */
553     /**@{*/
554     int  userint1  = 0;
555     int  userint2  = 0;
556     int  userint3  = 0;
557     int  userint4  = 0;
558     real userreal1 = 0;
559     real userreal2 = 0;
560     real userreal3 = 0;
561     real userreal4 = 0;
562     /**@}*/
563     //! Group options
564     t_grpopts opts;
565     //! QM/MM calculation
566     bool bQMMM = false;
567
568     /* Fields for removed features go here (better caching) */
569     //! Whether AdResS is enabled - always false if a valid .tpr was read
570     bool bAdress = false;
571     //! Whether twin-range scheme is active - always false if a valid .tpr was read
572     bool useTwinRange = false;
573     //! Whether we have constant acceleration
574     bool useConstantAcceleration = false;
575
576     //! KVT object that contains input parameters converted to the new style.
577     gmx::KeyValueTreeObject* params = nullptr;
578
579     //! KVT for storing simulation parameters that are not part of the mdp file.
580     std::unique_ptr<gmx::KeyValueTreeObject> internalParameters;
581 };
582
583 int ir_optimal_nstcalcenergy(const t_inputrec* ir);
584
585 int tcouple_min_integration_steps(TemperatureCoupling etc);
586
587 int ir_optimal_nsttcouple(const t_inputrec* ir);
588
589 int pcouple_min_integration_steps(PressureCoupling epc);
590
591 int ir_optimal_nstpcouple(const t_inputrec* ir);
592
593 /* Returns if the Coulomb force or potential is switched to zero */
594 bool ir_coulomb_switched(const t_inputrec* ir);
595
596 /* Returns if the Coulomb interactions are zero beyond the rcoulomb.
597  * Note: always returns TRUE for the Verlet cut-off scheme.
598  */
599 bool ir_coulomb_is_zero_at_cutoff(const t_inputrec* ir);
600
601 /* As ir_coulomb_is_zero_at_cutoff, but also returns TRUE for user tabulated
602  * interactions, since these might be zero beyond rcoulomb.
603  */
604 bool ir_coulomb_might_be_zero_at_cutoff(const t_inputrec* ir);
605
606 /* Returns if the Van der Waals force or potential is switched to zero */
607 bool ir_vdw_switched(const t_inputrec* ir);
608
609 /* Returns if the Van der Waals interactions are zero beyond the rvdw.
610  * Note: always returns TRUE for the Verlet cut-off scheme.
611  */
612 bool ir_vdw_is_zero_at_cutoff(const t_inputrec* ir);
613
614 /* As ir_vdw_is_zero_at_cutoff, but also returns TRUE for user tabulated
615  * interactions, since these might be zero beyond rvdw.
616  */
617 bool ir_vdw_might_be_zero_at_cutoff(const t_inputrec* ir);
618
619 /*! \brief Free memory from input record.
620  *
621  * All arrays and pointers will be freed.
622  *
623  * \param[in] ir The data structure
624  */
625 void done_inputrec(t_inputrec* ir);
626
627 void pr_inputrec(FILE* fp, int indent, const char* title, const t_inputrec* ir, bool bMDPformat);
628
629 void cmp_inputrec(FILE* fp, const t_inputrec* ir1, const t_inputrec* ir2, real ftol, real abstol);
630
631 void comp_pull_AB(FILE* fp, const pull_params_t& pull, real ftol, real abstol);
632
633
634 bool inputrecDeform(const t_inputrec* ir);
635
636 bool inputrecDynamicBox(const t_inputrec* ir);
637
638 bool inputrecPreserveShape(const t_inputrec* ir);
639
640 bool inputrecNeedMutot(const t_inputrec* ir);
641
642 bool inputrecTwinRange(const t_inputrec* ir);
643
644 bool inputrecExclForces(const t_inputrec* ir);
645
646 bool inputrecNptTrotter(const t_inputrec* ir);
647
648 bool inputrecNvtTrotter(const t_inputrec* ir);
649
650 bool inputrecNphTrotter(const t_inputrec* ir);
651
652 /*! \brief Return true if the simulation is 2D periodic with two walls. */
653 bool inputrecPbcXY2Walls(const t_inputrec* ir);
654
655 //! \brief Return true if the simulation has frozen atoms (non-trivial freeze groups).
656 bool inputrecFrozenAtoms(const t_inputrec* ir);
657
658 /*! \brief Returns true for MD integator with T and/or P-coupling that supports
659  * calculating a conserved energy quantity.
660  *
661  * Note that dynamical integrators without T and P coupling (ie NVE)
662  * return false, i.e. the return value refers to whether there
663  * is a conserved quantity different than the total energy.
664  */
665 bool integratorHasConservedEnergyQuantity(const t_inputrec* ir);
666
667 /*! \brief Returns true when temperature is coupled or constant. */
668 bool integratorHasReferenceTemperature(const t_inputrec* ir);
669
670 /*! \brief Return the number of bounded dimensions
671  *
672  * \param[in] ir The input record with MD parameters
673  * \return the number of dimensions in which
674  * the coordinates of the particles are bounded, starting at X.
675  */
676 int inputrec2nboundeddim(const t_inputrec* ir);
677
678 /*! \brief Returns the number of degrees of freedom in center of mass motion
679  *
680  * \param[in] ir  The inputrec structure
681  * \return the number of degrees of freedom of the center of mass
682  */
683 int ndof_com(const t_inputrec* ir);
684
685 /*! \brief Returns the maximum reference temperature over all coupled groups
686  *
687  * Returns 0 for energy minimization and normal mode computation.
688  * Returns -1 for MD without temperature coupling.
689  *
690  * \param[in] ir  The inputrec structure
691  */
692 real maxReferenceTemperature(const t_inputrec& ir);
693
694 /*! \brief Returns whether there is an Ewald surface contribution
695  */
696 bool haveEwaldSurfaceContribution(const t_inputrec& ir);
697
698 /*! \brief Check if calculation of the specific FEP type was requested.
699  *
700  * \param[in] ir       Input record.
701  * \param[in] fepType  Free-energy perturbation type to check for.
702  *
703  * \returns If the \p fepType is perturbed in this run.
704  */
705 bool haveFreeEnergyType(const t_inputrec& ir, int fepType);
706
707 #endif /* GMX_MDTYPES_INPUTREC_H */