Use proper doxygen tags in modular simulator
[gromacs.git] / api / include / gmxapi / md / mdmodule.h
blob6618b8c3787928a5f218f04b9034d2e82395fd10
1 /*
2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2018,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.
36 #ifndef GMXAPI_MDMODULE_H
37 #define GMXAPI_MDMODULE_H
38 /*! \file
39 * \brief Declare MDModule class for interacting with GROMACS library.
41 * \author M. Eric Irrgang <ericirrgang@gmail.com>
42 * \ingroup gmxapi_md
45 #include <memory>
47 #include "gmxapi/gromacsfwd.h"
49 namespace gmxapi
52 /*!
53 * \brief Base class for computational components of MD containers.
55 * Instances of this class and its descendents provide member functions that return
56 * GROMACS library objects that are not defined in this API, but which should be
57 * defined in the public part of the GROMACS library API. Forward declarations of the library
58 * classes are in gmxapi/gromacsfwd.h so that basic API clients only need to compile
59 * and link against the gmxapi target. To extend the API may require GROMACS library
60 * headers and possibly linking against `libgromacs`. Refer to the GROMACS developer
61 * documentation for details.
63 * gmxapi::MDModule participates in the binding protocol described for gmxapi::Session.
65 * For portability, a shared_ptr to MDModule can be passed within the
66 * gmxapi::MDHolder wrapper declared in gmxapi.h
68 * \ingroup gmxapi_md
70 class MDModule
72 public:
73 virtual ~MDModule();
75 /*!
76 * \brief Get a user-friendly identifier for an instance.
78 * \return see documentation for specific MDModule implementations.
80 virtual const char* name() const;
82 /*!
83 * \brief Allows module to provide a restraint implementation.
85 * To implement a restraint, override this function.
86 * \return shared ownership of a restraint implementation or nullptr if not implemented.
88 * With future maturation, this interface will presumably be revised to something
89 * more abstract, though I'm not sure what form that would take. We will probably
90 * still need to have a general set of possible module types defined with the API,
91 * in which case it does make sense to have clearly typed dispatching, and
92 * `bool hasRestraint = module->getRestraint() != nullptr;` might be the simplest thing.
94 * Implementing a restraint is explained in the GROMACS developer documentation,
95 * which is currently built separately from the GMXAPI documentation.
96 * Also, refer to the sample plugin in a repository hosted in the same
97 * place this git repository is found.
99 virtual std::shared_ptr<::gmx::IRestraintPotential> getRestraint();
103 } // end namespace gmxapi
105 #endif // GMXAPI_MDMODULE_H