Update instructions in containers.rst
[gromacs.git] / src / gromacs / coordinateio / enums.h
blobb1b10033b34263e71d7728c7642b8a48ff17925b
1 /*
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.
35 /*! \file
36 * \brief
37 * Enum class defining the different requirements that outputadapters
38 * have for the output file type. OutputManager objects can only be built
39 * with OutputAdapters whose requirements can be implemented with the available input.
41 * \author Paul Bauer <paul.bauer.q@gmail.com>
42 * \libinternal
43 * \ingroup module_coordinateio
45 #ifndef GMX_COORDINATEIO_ENUMS_H
46 #define GMX_COORDINATEIO_ENUMS_H
48 namespace gmx
51 /*!\brief
52 * The enums here define the flags specifying the requirements
53 * of different outputadapter modules.
55 * When building the object for deciding on the output to a new coordinate file,
56 * the CoordinateFile object needs to be able to validate that the dependencies of
57 * attached IOutputAdapters are fulfilled. Classes and interfaces that use
58 * the enum can check their dependencies against the information encoded in the
59 * flags and can then perform an appropriate reaction if there is a mismatch.
60 * \todo Use std::bitset<16> for the entries.
62 * \libinternal
63 * \ingroup module_coordinateio
66 enum class CoordinateFileFlags : unsigned long
68 /*! \brief
69 * Base setting that says that the module has no requirements.
71 * Sets the flags to default setting to make sure all output methods
72 * are supported.
74 Base = 1 << 0,
75 /*! \brief
76 * Requires output method to support force output.
78 * If set, only output methods supporting writing of forces will work,
79 * others will generate an invalid input error.
81 RequireForceOutput = 1 << 1,
82 /*! \brief
83 * Requires output method to support velocity output.
85 * If set, only writing to files that support velocity output will succeed.
86 * Other writing methods will generate an error.
88 RequireVelocityOutput = 1 << 2,
89 /*! \brief
90 * Requires support for connection information in output format.
92 * If set, only file output that supports writing of connection information will succeed.
93 * This means for now that only PDB and TNG files can be written. Other file writing
94 * methods will fail.
96 RequireAtomConnections = 1 << 3,
97 /*! \brief
98 * Requires that output format supports the writing of atom information to the file.
100 * If set, files will only be written if they can output the information from t_atoms
101 * and otherwise create an error while writing.
103 RequireAtomInformation = 1 << 4,
104 /*! \brief
105 * Requires that output format supports writing user-specified output precision.
107 * If set, output will only be written if the format supports the writing
108 * of custom precision of the included data.
110 RequireChangedOutputPrecision = 1 << 5,
111 /*! \brief
112 * Requires that output format supports writing time to the file.
114 RequireNewFrameStartTime = 1 << 6,
115 /*! \brief
116 * Requires that output format supports writing time to the file.
118 RequireNewFrameTimeStep = 1 << 7,
119 /*! \brief
120 * Requires that output format supports writing box information.
122 RequireNewBox = 1 << 8,
123 /*! \brief
124 * Requires output to support changes to selection of coordinates.
126 * Default for most methods, will need to be able to write coordinates to
127 * output file or generate an error.
129 RequireCoordinateSelection = 1 << 9,
130 //! Needed for enumeration array.
131 Count
134 //! Conversion of flag to its corresponding unsigned long value.
135 inline unsigned long convertFlag(CoordinateFileFlags flag)
137 return static_cast<unsigned long>(flag);
140 //! Enum class for setting basic flags in a t_trxframe
141 enum class ChangeSettingType : int
143 PreservedIfPresent,
144 Always,
145 Never,
146 Count
149 //! Enum class for t_atoms settings
150 enum class ChangeAtomsType
152 PreservedIfPresent,
153 AlwaysFromStructure,
154 Never,
155 Always,
156 Count
159 //! Enum class for setting fields new or not.
160 enum class ChangeFrameInfoType
162 PreservedIfPresent,
163 Always,
164 Count
167 //! Enum class for setting frame time from user input.
168 enum class ChangeFrameTimeType
170 PreservedIfPresent,
171 StartTime,
172 TimeStep,
173 Both,
174 Count
177 } // namespace gmx
179 #endif