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.
37 * Storage object for requirements to build coordinate file writer.
39 * \author Paul Bauer <paul.bauer.q@gmail.com>
40 * \ingroup module_coordinateio
43 #ifndef GMX_COORDINATEIO_OUTPUTREQUIREMENTS_H
44 #define GMX_COORDINATEIO_OUTPUTREQUIREMENTS_H
48 #include "gromacs/coordinateio/enums.h"
49 #include "gromacs/math/vec.h"
50 #include "gromacs/options/ioptionscontainer.h"
56 * Container for the user input values that will be used by the builder
57 * to determine which OutputAdapters should/could/will be registered
58 * to the coordinate file writer.
60 class OutputRequirementOptionDirector
64 * Populate requirements from option interface.
66 * \param[in] options Pointer to global options framework.
68 void initOptions(IOptionsContainer
*options
);
71 * Provide processed requirements to create on coordinate file writing method.
73 struct OutputRequirements
process() const;
79 //! Should velocities be written.
80 ChangeSettingType velocity_
= ChangeSettingType::PreservedIfPresent
;
81 //! Should forces be written.
82 ChangeSettingType force_
= ChangeSettingType::PreservedIfPresent
;
83 //! Precision used in output file.
85 //! If a new precision value has been set.
86 bool setNewPrecision_
= false;
87 //! Time for first frame to start.
88 real startTimeValue_
= 0;
89 //! Time step to use between frames.
90 real timeStepValue_
= 0;
91 //! If start time value has been assigned.
92 bool setNewStartTime_
= false;
93 //! If a new time step value has been assigned.
94 bool setNewTimeStep_
= false;
95 //! User supplied diagonal box vector.
96 std::vector
<real
> newBoxVector_
;
97 //! If a new box vector has been set.
98 bool setNewBox_
= false;
99 //! Should frame atom setting be changed.
100 ChangeAtomsType atoms_
= ChangeAtomsType::PreservedIfPresent
;
104 * Finalized version of requirements after processing.
106 struct OutputRequirements
{
107 //! Should velocities be written.
108 ChangeSettingType velocity
= ChangeSettingType::PreservedIfPresent
;
109 //! Should forces be written.
110 ChangeSettingType force
= ChangeSettingType::PreservedIfPresent
;
111 //! Should precision be changed.
112 ChangeFrameInfoType precision
= ChangeFrameInfoType::PreservedIfPresent
;
113 //! Precision used in output file.
115 //! Should frame start time be changed.
116 ChangeFrameTimeType frameTime
= ChangeFrameTimeType::PreservedIfPresent
;
117 //! Time for first frame to start.
118 real startTimeValue
= 0;
119 //! Time step to use between frames.
120 real timeStepValue
= 0;
121 //! Box vector converted to matrix format.
122 matrix newBox
= {{0}};
123 //! Should frame box be changed.
124 ChangeFrameInfoType box
= ChangeFrameInfoType::PreservedIfPresent
;
125 //! Should frame atom setting be changed.
126 ChangeAtomsType atoms
= ChangeAtomsType::PreservedIfPresent
;