*/
void buildMdpOutput(KeyValueTreeObjectBuilder *builder) const override
{
- builder->addValue<bool>(inputSectionName_ + "-" + c_activeTag_,
+ builder->addValue<bool>(DensityFittingModuleInfo::name_ + "-" + c_activeTag_,
active_);
}
*/
void initMdpOptions(IOptionsContainerWithSections *options) override
{
- auto section = options->addSection(OptionSection(inputSectionName_.c_str()));
+ auto section = options->addSection(OptionSection(DensityFittingModuleInfo::name_.c_str()));
section.addOption(
BooleanOption(c_activeTag_.c_str()).store(&active_));
}
private:
//! The name of the density-fitting module
- const std::string inputSectionName_ = "density-guided-simulation";
const std::string c_activeTag_ = "active";
bool active_ = false;
} // namespace
-std::unique_ptr<IMDModule> createDensityFittingModule()
+std::unique_ptr<IMDModule> DensityFittingModuleInfo::create()
{
return std::unique_ptr<IMDModule>(new DensityFitting());
}
+const std::string DensityFittingModuleInfo::name_ = "density-guided-simulation";
+
} // namespace gmx
#define GMX_APPLIED_FORCES_DENSITYFITTING_H
#include <memory>
+#include <string>
namespace gmx
{
class IMDModule;
-/*! \brief
- * Creates a module for applying forces to fit a given density.
+/*! \libinternal \brief Information about the density fitting module.
*
- * Fitting an all-atom structure into an experimental cryo-EM density map is a
- * typical application.
+ * Provides name and method to create a density fitting module.
*/
-std::unique_ptr<IMDModule> createDensityFittingModule();
+struct DensityFittingModuleInfo
+{
+ /*! \brief
+ * Creates a module for applying forces to fit a given density.
+ *
+ * Fitting an all-atom structure into an experimental cryo-EM density map is a
+ * typical application.
+ */
+ static std::unique_ptr<IMDModule> create();
+ //! The name of the module
+ static const std::string name_;
+};
} // namespace gmx
TEST(DensityFittingTest, Options)
{
- auto densityFittingModule(gmx::createDensityFittingModule());
+ auto densityFittingModule(gmx::DensityFittingModuleInfo::create());
// Prepare MDP inputs
gmx::KeyValueTreeBuilder mdpValueBuilder;