Introduce SimulatorBuilder
[gromacs.git] / src / gromacs / coordinateio / requirements.h
blob309248755dc082f740dddfd34189a571b979318c
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 /*!\file
36 * \brief
37 * Storage object for requirements to build coordinate file writer.
39 * \author Paul Bauer <paul.bauer.q@gmail.com>
40 * \ingroup module_coordinateio
41 * \inlibraryapi
43 #ifndef GMX_COORDINATEIO_OUTPUTREQUIREMENTS_H
44 #define GMX_COORDINATEIO_OUTPUTREQUIREMENTS_H
46 #include <vector>
48 #include "gromacs/coordinateio/enums.h"
49 #include "gromacs/math/vec.h"
50 #include "gromacs/options/ioptionscontainer.h"
52 namespace gmx
55 /*!\brief
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
62 public:
63 /*! \brief
64 * Populate requirements from option interface.
66 * \param[in] options Pointer to global options framework.
68 void initOptions(IOptionsContainer *options);
70 /*! \brief
71 * Provide processed requirements to create on coordinate file writing method.
73 struct OutputRequirements process() const;
75 private:
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.
84 int prec_ = 3;
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;
103 /*! \brief
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.
114 int prec = 3;
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;
129 } // namespace gmx
131 #endif