From b4e8bef8d3195409a0c24300a3406c0fe30e8cf8 Mon Sep 17 00:00:00 2001 From: ejjordan Date: Tue, 21 Sep 2021 15:49:30 +0200 Subject: [PATCH] Various minor nblib updates A small selection of miscellaneous changes that don't fit in as part of any larger MR. --- api/nblib/CMakeLists.txt | 2 ++ api/nblib/exception.h | 2 +- api/nblib/kerneloptions.h | 6 ------ api/nblib/samples/CMakeLists.txt | 14 ++------------ api/nblib/samples/argon-forces-integration.cpp | 3 --- api/nblib/samples/methane-water-integration.cpp | 3 --- api/nblib/tests/topology.cpp | 6 +----- api/nblib/util/CMakeLists.txt | 2 ++ api/nblib/util/traits.hpp | 6 +++--- 9 files changed, 11 insertions(+), 33 deletions(-) diff --git a/api/nblib/CMakeLists.txt b/api/nblib/CMakeLists.txt index be3cfb6e18..2b1b0b70fb 100644 --- a/api/nblib/CMakeLists.txt +++ b/api/nblib/CMakeLists.txt @@ -138,10 +138,12 @@ if(GMX_INSTALL_NBLIB_API) molecules.h kerneloptions.h nblib.h + nbnxmsetuphelpers.h particlesequencer.h particletype.h simulationstate.h topology.h + vector.h DESTINATION include/nblib) endif() diff --git a/api/nblib/exception.h b/api/nblib/exception.h index e99dad8d57..ebe46a17d8 100644 --- a/api/nblib/exception.h +++ b/api/nblib/exception.h @@ -77,7 +77,7 @@ private: * * The message should give users some hint as to how to remedy the error. */ -class InputException final : NbLibException +class InputException final : public NbLibException { public: using NbLibException::NbLibException; diff --git a/api/nblib/kerneloptions.h b/api/nblib/kerneloptions.h index 86ee4325c7..3ec6b605b7 100644 --- a/api/nblib/kerneloptions.h +++ b/api/nblib/kerneloptions.h @@ -93,20 +93,14 @@ struct NBKernelOptions final SimdKernels nbnxmSimd = SimdKernels::SimdAuto; //! The LJ combination rule CombinationRule ljCombinationRule = CombinationRule::Geometric; - //! Use i-cluster half-LJ optimization for clusters with <= half LJ - bool useHalfLJOptimization = false; //! The pairlist and interaction cut-off real pairlistCutoff = 1.0; - //! Whether to compute energies (shift forces for virial are always computed on CPU) - bool computeVirialAndEnergy = false; //! The Coulomb interaction function CoulombType coulombType = CoulombType::Pme; //! Whether to use tabulated PME grid correction instead of analytical, not applicable with simd=no bool useTabulatedEwaldCorr = false; //! The number of iterations for each kernel int numIterations = 100; - //! Print cycles/pair instead of pairs/cycle - bool cyclesPerPair = false; //! The time step real timestep = 0.001; }; diff --git a/api/nblib/samples/CMakeLists.txt b/api/nblib/samples/CMakeLists.txt index 610571b1a4..42a44a1e5a 100644 --- a/api/nblib/samples/CMakeLists.txt +++ b/api/nblib/samples/CMakeLists.txt @@ -39,22 +39,12 @@ # set(argon "argon-forces-integration") -add_executable(${argon} "") - -target_sources(${argon} - PRIVATE - argon-forces-integration.cpp - ) +add_executable(${argon} argon-forces-integration.cpp) target_link_libraries(${argon} PRIVATE nblib) set(methane "methane-water-integration") -add_executable(${methane} "") - -target_sources(${methane} - PRIVATE - methane-water-integration.cpp - ) +add_executable(${methane} methane-water-integration.cpp) target_link_libraries(${methane} PRIVATE nblib) diff --git a/api/nblib/samples/argon-forces-integration.cpp b/api/nblib/samples/argon-forces-integration.cpp index 75416ea5df..47895d33da 100644 --- a/api/nblib/samples/argon-forces-integration.cpp +++ b/api/nblib/samples/argon-forces-integration.cpp @@ -50,9 +50,6 @@ // can be included via their respective headers. #include "nblib/nblib.h" -// Main function to write the MD program. -int main(); // Keep the compiler happy - int main() { // Create an argon particle with a name and a mass. diff --git a/api/nblib/samples/methane-water-integration.cpp b/api/nblib/samples/methane-water-integration.cpp index 127433d232..a5a02c325d 100644 --- a/api/nblib/samples/methane-water-integration.cpp +++ b/api/nblib/samples/methane-water-integration.cpp @@ -52,9 +52,6 @@ using namespace nblib; -// Main function to write the MD program. -int main(); // Keep the compiler happy - int main() { // Create the particles diff --git a/api/nblib/tests/topology.cpp b/api/nblib/tests/topology.cpp index 3e8d73e116..08ac421eaf 100644 --- a/api/nblib/tests/topology.cpp +++ b/api/nblib/tests/topology.cpp @@ -64,9 +64,7 @@ namespace using ::testing::Eq; using ::testing::Pointwise; -//! Compares all element between two lists of lists -//! Todo: unify this with the identical function in nbkernelsystem test make this a method -//! of ListOfLists<> +//! \brief Compares all element between two lists of lists template void compareLists(const gmx::ListOfLists& list, const std::vector>& v) { @@ -354,8 +352,6 @@ TEST(NBlibTest, TopologyListedInteractions) TEST(NBlibTest, TopologyListedInteractionsMultipleTypes) { - // Todo: add an angle type here - Molecule water = WaterMoleculeBuilder{}.waterMolecule(); Molecule methanol = MethanolMoleculeBuilder{}.methanolMolecule(); diff --git a/api/nblib/util/CMakeLists.txt b/api/nblib/util/CMakeLists.txt index 933dc5a317..fe58e0af7a 100644 --- a/api/nblib/util/CMakeLists.txt +++ b/api/nblib/util/CMakeLists.txt @@ -47,6 +47,8 @@ target_sources(nblib if(GMX_INSTALL_NBLIB_API) install(FILES setup.h + traits.hpp + util.hpp DESTINATION include/nblib/util) endif() diff --git a/api/nblib/util/traits.hpp b/api/nblib/util/traits.hpp index d77c219f0c..d736ccca32 100644 --- a/api/nblib/util/traits.hpp +++ b/api/nblib/util/traits.hpp @@ -292,9 +292,9 @@ struct Contains /*! \brief implementation of the Contains trait to look for T in TL * - * @tparam T type to look for in TL - * @tparam TL a variadic type, such as std::tuple or TypeList - * @tparam Ts the template parameters of TL + * \tparam T type to look for in TL + * \tparam TL a variadic type, such as std::tuple or TypeList + * \tparam Ts the template parameters of TL * * Note that this clang-format enforced formatting is unfortunate, it should be: * struct Contains> : std::bool_constant>{} < sizeof...(Ts)> -- 2.22.0