2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2019,2020, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
37 * Declares parameters needed to evaluate forces and energies for density fitting
39 * \author Christian Blau <blau@kth.se>
40 * \ingroup module_applied_forces
42 #ifndef GMX_APPLIED_FORCES_DENSITYFITTINGPARAMETERS_H
43 #define GMX_APPLIED_FORCES_DENSITYFITTINGPARAMETERS_H
47 #include "gromacs/math/densityfit.h"
48 #include "gromacs/utility/basedefinitions.h"
50 #include "densityfittingamplitudelookup.h"
56 * \brief Holding all directly user-provided parameters for density fitting.
58 * Also used for setting all default parameters.
60 struct DensityFittingParameters
62 //! Indicate if density fitting is active
64 //! Indices of the atoms that shall be fit to the density
65 std::vector<index> indices_;
66 //! Determines how to measure similarity between simulated and reference density
67 DensitySimilarityMeasureMethod similarityMeasureMethod_ = DensitySimilarityMeasureMethod::innerProduct;
68 //! Determines with what weight atoms are spread
69 DensityFittingAmplitudeMethod amplitudeLookupMethod_ = DensityFittingAmplitudeMethod::Unity;
70 //! The force constant to be used for the density fitting
71 real forceConstant_ = 1e9;
72 //! The spreading width used for the gauss transform of atoms onto the density grid
73 real gaussianTransformSpreadingWidth_ = 0.2;
74 //! The spreading range for spreading atoms onto the grid in multiples of the spreading width
75 real gaussianTransformSpreadingRangeInMultiplesOfWidth_ = 4.0;
76 //! Apply density fitting forces only every n-steps
77 std::int64_t calculationIntervalInSteps_ = 1;
78 //! Normalize reference and simulated densities
79 bool normalizeDensities_ = true;
80 //! Perform adaptive force scaling during the simulation
81 bool adaptiveForceScaling_ = false;
82 //! The time constant for the adaptive force scaling in ps
83 real adaptiveForceScalingTimeConstant_ = 4;
84 //! Translation of the structure, so that the coordinates that are fitted are x+translation
85 std::string translationString_ = "";
88 /*!\brief Check if two structs holding density fitting parameters are equal.
90 * \param[in] lhs left hand side to be compared
91 * \param[in] rhs right hand side to be compared
92 * \returns true if all elements in DensityFittingParameters are equal, else false
94 bool operator==(const DensityFittingParameters& lhs, const DensityFittingParameters& rhs);
96 /*!\brief Check if two structs holding density fitting parameters are not equal.
98 * \param[in] lhs left hand side to be compared
99 * \param[in] rhs right hand side to be compared
100 * \returns true if lhs is not equal rhs
102 bool operator!=(const DensityFittingParameters& lhs, const DensityFittingParameters& rhs);
106 #endif // GMX_APPLIED_FORCES_DENSITYFITTINGPARAMETERS_H