221cdf2e4f465ec0f742175b4273822221fa21be
[alexxy/gromacs.git] / src / gromacs / tools / report-methods.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2018, 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.
8  *
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.
13  *
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.
18  *
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.
23  *
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.
31  *
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.
34  */
35 #ifndef GMX_TOOLS_REPORT_METHODS_H
36 #define GMX_TOOLS_REPORT_METHODS_H
37
38 #include "gromacs/commandline/cmdlineoptionsmodule.h"
39 #include "gromacs/mdtypes/inputrec.h"
40 #include "gromacs/topology/topology.h"
41 #include "gromacs/utility/filestream.h"
42 #include "gromacs/utility/textwriter.h"
43
44 namespace gmx
45 {
46
47 class ReportMethodsInfo
48 {
49     public:
50         static const char name[];
51         static const char shortDescription[];
52         static ICommandLineOptionsModulePointer create();
53 };
54
55 // Helper functions of the class
56
57 /*! \brief
58  * Write appropiate Header to output stream.
59  *
60  * \param[in] writer TextWriter object for writing information.
61  * \param[in] text String with the header before writing.
62  * \param[in] section String with section text for header.
63  * \param[in] writeFormattedText If we need to format the text for LaTeX output or not
64  */
65 void writeHeader(TextWriter *writer, const std::string &text, const std::string &section, bool writeFormattedText);
66
67 /*! \brief
68  * Write information about the molecules in the system.
69  *
70  * This method should write all possible information about
71  * the molecular composition of the system.
72  *
73  * \param[in] writer TextWriter object for writing information.
74  * \param[in] top Local topology used to derive the information to write out.
75  * \param[in] writeFormattedText Decide if we want formatted text output or not.
76  *
77  */
78 void writeSystemInformation(TextWriter *writer, const gmx_mtop_t &top, bool writeFormattedText);
79
80 /*! \brief
81  * Write information about system parameters.
82  *
83  * This method writes the basic information for the system parameters
84  * and simulation settings as reported in the \p ir.
85  *
86  * \param[in] writer TextWriter object for writing information.
87  * \param[in] ir Reference to inputrec of the run input.
88  * \param[in] writeFormattedText Decide if we want formatted text output or not.
89  */
90 void writeParameterInformation(TextWriter *writer, const t_inputrec &ir, bool writeFormattedText);
91
92 /*! \brief
93  * Wrapper for writing out information.
94  *
95  * This function is actual called from within the run method
96  * to write the information to the terminal or to file.
97  * New write out methods should be added to it instead of adding them in run.
98  *
99  * \param[in] outputStream The filestream used to write the information to.
100  * \param[in] ir Reference to inputrec of the run input.
101  * \param[in] top Local topology used to derive the information to write out.
102  * \param[in] writeFormattedText Decide if we want formatted text output or not.
103  * \param[in] notStdout Bool to see if we can close the file after writing or not in case of stdout.
104  */
105 void writeInformation(TextOutputFile *outputStream, const t_inputrec &ir,
106                       const gmx_mtop_t &top, bool writeFormattedText, bool notStdout);
107
108 } // namespace gmx
109
110 #endif