Update instructions in containers.rst
[gromacs.git] / src / gromacs / mdlib / tests / leapfrogtestdata.h
blob56305dcfcbac86fc2ed984a56a7325f86ba396cb
1 /*
2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2019, 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.
35 /*! \internal \file
36 * \brief Tests for the Leap-Frog integrator
38 * \todo Add anisotropic Parrinello-Rahman and other pressure coupling schemes
39 * \todo Add PBC handling test.
40 * \todo Reference values tests.
42 * \author Artem Zhmurov <zhmurov@gmail.com>
43 * \ingroup module_mdlib
46 #ifndef GMX_MDLIB_TESTS_LEAPFROGTESTDATA_H
47 #define GMX_MDLIB_TESTS_LEAPFROGTESTDATA_H
49 #include <vector>
51 #include "gromacs/gpu_utils/gpu_utils.h"
52 #include "gromacs/math/vec.h"
53 #include "gromacs/math/vectypes.h"
54 #include "gromacs/mdlib/update.h"
55 #include "gromacs/mdtypes/fcdata.h"
56 #include "gromacs/mdtypes/group.h"
57 #include "gromacs/mdtypes/inputrec.h"
58 #include "gromacs/mdtypes/mdatom.h"
59 #include "gromacs/mdtypes/state.h"
60 #include "gromacs/utility/stringutil.h"
62 namespace gmx
64 namespace test
67 /* \brief Declares the class to accumulate the data needed for the Leap-Frog integrator tests
70 class LeapFrogTestData
72 public:
73 //! Number of atoms in the system
74 int numAtoms_;
75 //! Integration timestep
76 real timestep_;
78 //! Initial coordinates
79 PaddedVector<RVec> x0_;
80 //! Current coordinates
81 PaddedVector<RVec> x_;
82 //! Coordinates after integrator update
83 PaddedVector<RVec> xPrime_;
84 //! Initial velocities
85 PaddedVector<RVec> v0_;
86 //! Current velocities
87 PaddedVector<RVec> v_;
88 //! External forces
89 PaddedVector<RVec> f_;
90 //! Inverse masses of the particles
91 PaddedVector<real> inverseMasses_;
92 //! Inverse masses of the particles per dimension
93 PaddedVector<RVec> inverseMassesPerDim_;
95 //! MD atoms structure in which inverse masses will be passed to the integrator
96 t_mdatoms mdAtoms_;
97 //! Input record (to get integrator type, temperature and pressure coupling)
98 t_inputrec inputRecord_;
99 //! System state
100 t_state state_;
101 //! Force calculation data
102 t_fcdata forceCalculationData_;
103 //! Kinetic energy data (to disable non-equilibrium MD integration)
104 gmx_ekindata_t kineticEnergyData_;
105 //! Update data
106 std::unique_ptr<Update> update_;
108 //! Number of temperature coupling groups
109 int numTCoupleGroups_;
111 //! If the pressure coupling is enabled
112 bool doPressureCouple_;
113 //! Period between pressure coupling steps
114 float dtPressureCouple_;
115 //! Matrix for Parrinello-Rahman velocity scaling
116 matrix velocityScalingMatrix_;
118 /*! \brief Constructor.
120 * \param[in] numAtoms Number of atoms in the system
121 * \param[in] timestep Integration timestep
122 * \param[in] v0 Initial velocity (same for all particles)
123 * \param[in] f0 External constant force, acting on all particles
124 * \param[in] numTCoupleGroups Number of temperature coupling groups (zero for no temperature coupling)
125 * \param[in] nstpcouple Number of steps between pressure coupling steps (zero for no pressure coupling)
127 LeapFrogTestData(int numAtoms, real timestep, const rvec v0, const rvec f0, int numTCoupleGroups, int nstpcouple);
129 ~LeapFrogTestData();
132 } // namespace test
133 } // namespace gmx
135 #endif // GMX_MDLIB_TESTS_LEAPFROGTESTDATA_H