From 264bd0b3e03be2f3f503a8fdf8eabb095c17a373 Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 12 Aug 2026 22:03:27 +0200 Subject: [PATCH 1/2] cleanup: add fuchsia clang-tidy warnings (important ones) especially no default arguments -- leads us to many many problems --- .clang-tidy | 24 ++++++++++------- apps/capabilities.cpp | 11 +++++++- apps/validation.cpp | 5 ++++ apps/validation.hpp | 6 ++++- benchmarks/.clang-tidy | 8 ++++-- benchmarks/src/box/benchmarkBox.cpp | 2 -- .../src/math/benchmarkLinearAlgebra.cpp | 2 -- .../src/potential/benchmarkPairPotentials.cpp | 2 -- .../src/simulationBox/benchmarkKinetics.cpp | 2 -- include/QM/external/externalQMRunner.hpp | 10 +++---- include/config/atomMassMap.hpp | 2 +- include/config/atomNumberMap.hpp | 2 +- include/exceptions/exceptions.hpp | 3 ++- .../input/inputFileParser/QMInputParser.hpp | 6 ++--- .../inputFileParser/filesInputParser.hpp | 6 ++--- include/input/inputFileReader.hpp | 5 ++-- include/settings/qmSettings.hpp | 3 ++- src/QM/external/externalQMRunner.cpp | 14 +++------- src/exceptions/exceptions.cpp | 10 +++++++ src/input/inputFileParser/QMInputParser.cpp | 14 ++++++++++ .../inputFileParser/filesInputParser.cpp | 18 +++++++++++++ src/input/inputFileReader.cpp | 18 +++++++++++++ src/settings/qmSettings.cpp | 25 ++++++++++++----- tests/src/input/testInputValidation.cpp | 1 - tests/src/opt/testAdam.cpp | 10 ++++++- tests/src/opt/testConvergence.cpp | 4 ++- tests/src/opt/testHessianBuilder.cpp | 6 ++++- tests/src/opt/testSteepestDescent.cpp | 18 ++++++++++++- tests/src/setup/testWaterModelSetup.cpp | 7 ++++- tests/src/waterModels/testWaterModels.cpp | 27 ++++++++++++++++--- 30 files changed, 206 insertions(+), 65 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 1cc9ea3b8..a8bca7b25 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -3,6 +3,9 @@ # altera-struct-pack-align: does not affect the code for non FPGA targets -- gets interesting for OpenCL kernels # boost-use-ranges: we do not want to use boost at all, to not increase our dependencies even more!!! # bugprone-suspicious-include: flags more or less only false positives +# fuchsia-default-arguments-calls: there is a second check that disallows default arguments in function definitions, which is more important to us than this check (this for example triggers for simple std::vector constructors) +# fuchsia-overloaded-operator: we actually WANT to overload operators, so this check is not useful for us +# fuchsia-trailing-return: we actually WANT to use trailing return types, very useful for template functions, so this check is not useful for us # Checks to be absolutely enabled: # cert-env33-c: ::system is not available on all platforms, and we do not want to use it anyway @@ -14,6 +17,9 @@ # cppcoreguidelines-pro-type-union-access: should be possible to avoid this warning for Vector3D, but needs a rework of the code base # cppcoreguidelines-pro-type-member-init: needs a rework of the code base, but should be possible to fix it for all classes # cppcoreguidelines-owning-memory: needs a rework of the code base, but should be possible to fix it for all classes +# fuchsia-statically-constructed-objects: needs a rework of the global const maps like atomMassMap, atomNumberMap, hubbardDerivMap3ob, etc. to avoid this warning +# fuchsia-virtual-inheritance: needs a huge rework of the engine code base, but should be possible to fix it for all classes +# fuchsia-multiple-inheritance: needs a huge rework of the engine code base, but should be possible to fix it for all classes --- Checks: ' @@ -26,6 +32,7 @@ Checks: concurrency*, cppcoreguidelines*, darwin*, + fuchsia*, -cppcoreguidelines-owning-memory, -cppcoreguidelines-pro-type-member-init, -cppcoreguidelines-pro-type-union-access, @@ -35,9 +42,16 @@ Checks: -bugprone-easily-swappable-parameters, -cert-env33-c, -cert-err58-cpp, + -fuchsia-statically-constructed-objects, + -fuchsia-virtual-inheritance, + -fuchsia-multiple-inheritance, -altera-struct-pack-align, -altera-unroll-loops, - -bugprone-suspicious-include + -boost-use-ranges, + -bugprone-suspicious-include, + -fuchsia-default-arguments-calls, + -fuchsia-overloaded-operator, + -fuchsia-trailing-return, ' WarningsAsErrors: '' HeaderFileExtensions: @@ -91,14 +105,6 @@ CheckOptions: ... ### TO BE INCLUDED IN THE FUTURE - # fuchsia-default-arguments-calls, - # fuchsia-default-arguments-declarations, - # fuchsia-header-anon-namespaces, - # fuchsia-multiple-inheritance, - # fuchsia-overloaded-operator, - # fuchsia-statically-constructed-objects, - # fuchsia-trailing-return, - # fuchsia-virtual-inheritance, # google-build-explicit-make-pair, # google-build-namespaces, # google-build-using-namespace, diff --git a/apps/capabilities.cpp b/apps/capabilities.cpp index b2aad279c..2f4f7d5d4 100644 --- a/apps/capabilities.cpp +++ b/apps/capabilities.cpp @@ -63,7 +63,7 @@ namespace cli::JsonWriter &json, const std::string_view name, const std::string_view type, - const std::string_view unit = "" + const std::string_view unit ) { json.beginObject(name); @@ -72,6 +72,15 @@ namespace json.value("unit", unit); } + void beginParameter( + cli::JsonWriter &json, + const std::string_view name, + const std::string_view type + ) + { + beginParameter(json, name, type, ""); + } + void writeBuildCapabilities(cli::JsonWriter &json) { json.beginObject("build"); diff --git a/apps/validation.cpp b/apps/validation.cpp index 68800fec9..0f4f49a7a 100644 --- a/apps/validation.cpp +++ b/apps/validation.cpp @@ -423,6 +423,11 @@ namespace } } // namespace +cli::ValidationResult cli::validateInputFile(std::string_view inputFile) +{ + return validateInputFile(inputFile, ValidationScope::INSTALLED); +} + cli::ValidationResult cli::validateInputFile( const std::string_view inputFile, const ValidationScope scope diff --git a/apps/validation.hpp b/apps/validation.hpp index d28af4da8..d272f4fdf 100644 --- a/apps/validation.hpp +++ b/apps/validation.hpp @@ -58,7 +58,11 @@ namespace cli [[nodiscard]] ValidationResult validateInputFile( std::string_view inputFile, - ValidationScope scope = ValidationScope::INSTALLED + ValidationScope scope + ); + + [[nodiscard]] ValidationResult validateInputFile( + std::string_view inputFile ); void writeValidationJson( diff --git a/benchmarks/.clang-tidy b/benchmarks/.clang-tidy index c04077baf..42de45017 100644 --- a/benchmarks/.clang-tidy +++ b/benchmarks/.clang-tidy @@ -1,3 +1,7 @@ InheritParentConfig: true -Checks: > - -cppcoreguidelines-avoid-magic-numbers +Checks: + ' + -cppcoreguidelines-avoid-magic-numbers, + -fuchsia-statically-constructed-objects, + -cert-err58-cpp + ' diff --git a/benchmarks/src/box/benchmarkBox.cpp b/benchmarks/src/box/benchmarkBox.cpp index d4df1d239..439c33280 100644 --- a/benchmarks/src/box/benchmarkBox.cpp +++ b/benchmarks/src/box/benchmarkBox.cpp @@ -157,7 +157,6 @@ namespace } } - // NOLINTBEGIN(cert-err58-cpp) BENCHMARK(BM_OrthorhombicShiftVector); BENCHMARK(BM_TriclinicShiftVector); BENCHMARK(BM_OrthorhombicWrapPosition); @@ -166,6 +165,5 @@ namespace BENCHMARK(BM_TriclinicToOrthoSpace); BENCHMARK(BM_TriclinicToSimSpace); BENCHMARK(BM_TriclinicTensorRoundTrip); - // NOLINTEND(cert-err58-cpp) } // namespace diff --git a/benchmarks/src/math/benchmarkLinearAlgebra.cpp b/benchmarks/src/math/benchmarkLinearAlgebra.cpp index 7215c19fc..109168eb7 100644 --- a/benchmarks/src/math/benchmarkLinearAlgebra.cpp +++ b/benchmarks/src/math/benchmarkLinearAlgebra.cpp @@ -184,7 +184,6 @@ namespace } } - // NOLINTBEGIN(cert-err58-cpp) BENCHMARK(BM_VectorArithmetic); BENCHMARK(BM_DotProduct); BENCHMARK(BM_CrossProduct); @@ -195,5 +194,4 @@ namespace BENCHMARK(BM_MatrixProduct); BENCHMARK(BM_MatrixTranspose); BENCHMARK(BM_MatrixDeterminant); - // NOLINTEND(cert-err58-cpp) } // namespace diff --git a/benchmarks/src/potential/benchmarkPairPotentials.cpp b/benchmarks/src/potential/benchmarkPairPotentials.cpp index 9f2a006c3..be9cd60ef 100644 --- a/benchmarks/src/potential/benchmarkPairPotentials.cpp +++ b/benchmarks/src/potential/benchmarkPairPotentials.cpp @@ -101,7 +101,6 @@ namespace runCoulombBenchmark(state, potential); } - // NOLINTBEGIN(cert-err58-cpp) BENCHMARK(BM_LennardJones) ->ArgName("distance_milliangstrom") ->Arg(1500) @@ -132,5 +131,4 @@ namespace ->Arg(1500) ->Arg(3000) ->Arg(6000); - // NOLINTEND(cert-err58-cpp) } // namespace diff --git a/benchmarks/src/simulationBox/benchmarkKinetics.cpp b/benchmarks/src/simulationBox/benchmarkKinetics.cpp index 44775da9c..d5340746c 100644 --- a/benchmarks/src/simulationBox/benchmarkKinetics.cpp +++ b/benchmarks/src/simulationBox/benchmarkKinetics.cpp @@ -99,7 +99,6 @@ namespace setItemsProcessed(state, simBox); } - // NOLINTBEGIN(cert-err58-cpp) BENCHMARK(BM_Temperature) ->ArgName("cells_per_side") ->Arg(5) @@ -116,5 +115,4 @@ namespace ->Arg(5) ->Arg(8) ->Arg(12); - // NOLINTEND(cert-err58-cpp) } // namespace diff --git a/include/QM/external/externalQMRunner.hpp b/include/QM/external/externalQMRunner.hpp index cbf582fa2..fdce7170f 100644 --- a/include/QM/external/externalQMRunner.hpp +++ b/include/QM/external/externalQMRunner.hpp @@ -51,9 +51,9 @@ namespace QM class ExternalQMRunner : public QMRunner { protected: - std::string _scriptPath = SCRIPT_PATH_; - const static inline std::string _singularity = SINGULARITY_; - const static inline std::string _staticBuild = STATIC_BUILD_; + std::string _scriptPath = SCRIPT_PATH_; + constexpr static auto *_singularity = SINGULARITY_; + constexpr static auto *_staticBuild = STATIC_BUILD_; [[nodiscard]] std::string resolveScriptPath( std::string_view script @@ -91,8 +91,8 @@ namespace QM *******************************/ [[nodiscard]] const std::string &getScriptPath() const; - [[nodiscard]] const std::string &getSingularity() const; - [[nodiscard]] const std::string &getStaticBuild() const; + [[nodiscard]] std::string getSingularity() const; + [[nodiscard]] std::string getStaticBuild() const; void setScriptPath(const std::string_view &scriptPath); }; diff --git a/include/config/atomMassMap.hpp b/include/config/atomMassMap.hpp index 829446d86..a76d8b5a3 100644 --- a/include/config/atomMassMap.hpp +++ b/include/config/atomMassMap.hpp @@ -85,4 +85,4 @@ namespace constants } // namespace constants -#endif // _ATOM_MASS_MAP_HPP_ \ No newline at end of file +#endif // _ATOM_MASS_MAP_HPP_ diff --git a/include/config/atomNumberMap.hpp b/include/config/atomNumberMap.hpp index 2729248e6..87a0752ee 100644 --- a/include/config/atomNumberMap.hpp +++ b/include/config/atomNumberMap.hpp @@ -70,4 +70,4 @@ namespace constants } // namespace constants -#endif // _ATOM_NUMBER_MAP_HPP_ \ No newline at end of file +#endif // _ATOM_NUMBER_MAP_HPP_ diff --git a/include/exceptions/exceptions.hpp b/include/exceptions/exceptions.hpp index 9c5a42137..90985a242 100644 --- a/include/exceptions/exceptions.hpp +++ b/include/exceptions/exceptions.hpp @@ -81,8 +81,9 @@ namespace customException public: explicit CustomException( const std::string_view message, - std::optional lineNumber = std::nullopt + std::optional lineNumber ); + explicit CustomException(const std::string_view message); void colorfulOutput(const Color::Code, const std::string_view) const; void setLineNumber(const size_t lineNumber) noexcept; diff --git a/include/input/inputFileParser/QMInputParser.hpp b/include/input/inputFileParser/QMInputParser.hpp index 6b86af70e..6a183c9d1 100644 --- a/include/input/inputFileParser/QMInputParser.hpp +++ b/include/input/inputFileParser/QMInputParser.hpp @@ -42,10 +42,8 @@ namespace input bool _resolveBuiltInSlakosPath; public: - explicit QMInputParser( - engine::Engine &, - bool resolveBuiltInSlakosPath = true - ); + explicit QMInputParser(engine::Engine &, bool resolveBuiltInSlakosPath); + explicit QMInputParser(engine::Engine &); void parseQMMethod(const std::vector &, const size_t); void parseQMScript(const std::vector &, const size_t); diff --git a/include/input/inputFileParser/filesInputParser.hpp b/include/input/inputFileParser/filesInputParser.hpp index dde429661..5baf91f10 100644 --- a/include/input/inputFileParser/filesInputParser.hpp +++ b/include/input/inputFileParser/filesInputParser.hpp @@ -42,10 +42,8 @@ namespace input bool _validateFilePaths; public: - explicit FilesInputParser( - engine::Engine &, - bool validateFilePaths = true - ); + explicit FilesInputParser(engine::Engine &, bool validateFilePaths); + explicit FilesInputParser(engine::Engine &); void parseIntraNonBondedFile( const std::vector &, diff --git a/include/input/inputFileReader.hpp b/include/input/inputFileReader.hpp index b2b8d82b5..8259152e6 100644 --- a/include/input/inputFileReader.hpp +++ b/include/input/inputFileReader.hpp @@ -76,9 +76,10 @@ namespace input explicit InputFileReader( const std::string_view &, engine::Engine &, - bool validateFilePaths = true, - bool resolveBuiltInSlakosPath = true + bool validateFilePaths, + bool resolveBuiltInSlakosPath ); + explicit InputFileReader(const std::string_view &, engine::Engine &); void read(); void addKeywords(); diff --git a/include/settings/qmSettings.hpp b/include/settings/qmSettings.hpp index a2905db0a..234eb439c 100644 --- a/include/settings/qmSettings.hpp +++ b/include/settings/qmSettings.hpp @@ -180,8 +180,9 @@ namespace settings static void setSlakosType(const std::string_view &slakos); static void setSlakosType( const SlakosType slakos, - bool resolveBuiltInPath = true + bool resolveBuiltInPath ); + static void setSlakosType(const SlakosType slakos); static void setSlakosPath(const std::string_view &path); static void setUseDispersionCorrection(const bool use); diff --git a/src/QM/external/externalQMRunner.cpp b/src/QM/external/externalQMRunner.cpp index 4ebdd1c85..1d1679151 100644 --- a/src/QM/external/externalQMRunner.cpp +++ b/src/QM/external/externalQMRunner.cpp @@ -279,22 +279,16 @@ const std::string &ExternalQMRunner::getScriptPath() const /** * @brief getter for the singularity path * - * @return const std::string& + * @return std::string */ -const std::string &ExternalQMRunner::getSingularity() const -{ - return _singularity; -} +std::string ExternalQMRunner::getSingularity() const { return _singularity; } /** * @brief getter for the static build path * - * @return const std::string& + * @return std::string */ -const std::string &ExternalQMRunner::getStaticBuild() const -{ - return _staticBuild; -} +std::string ExternalQMRunner::getStaticBuild() const { return _staticBuild; } /** * @brief setter for the script path diff --git a/src/exceptions/exceptions.cpp b/src/exceptions/exceptions.cpp index 2ab61afc3..674c93bf3 100644 --- a/src/exceptions/exceptions.cpp +++ b/src/exceptions/exceptions.cpp @@ -39,6 +39,16 @@ CustomException::CustomException( { } +/** + * @brief Construct a new Custom Exception:: Custom Exception object + * + * @param message + */ +CustomException::CustomException(const std::string_view message) + : CustomException(message, std::nullopt) +{ +} + /** * @brief Adds a source line if the exception has no line yet. * diff --git a/src/input/inputFileParser/QMInputParser.cpp b/src/input/inputFileParser/QMInputParser.cpp index e37557939..7e644bb79 100644 --- a/src/input/inputFileParser/QMInputParser.cpp +++ b/src/input/inputFileParser/QMInputParser.cpp @@ -44,6 +44,20 @@ using namespace engine; using namespace references; using namespace constants; +/** + * @brief Construct a new QMInputParser:: QMInputParser object + * + * @details following keywords are added to the _keywordFuncMap, + * _keywordRequiredMap and _keywordCountMap: 1) qm_prog 2) qm_script + * + * + * @param engine + */ +QMInputParser::QMInputParser(engine::Engine &engine) + : QMInputParser(engine, true) +{ +} + /** * @brief Construct a new QMInputParser:: QMInputParser object * diff --git a/src/input/inputFileParser/filesInputParser.cpp b/src/input/inputFileParser/filesInputParser.cpp index 43536b370..5252c813b 100644 --- a/src/input/inputFileParser/filesInputParser.cpp +++ b/src/input/inputFileParser/filesInputParser.cpp @@ -37,6 +37,24 @@ using namespace customException; using namespace settings; using namespace utilities; +/** + * @brief Construct a new Input File Parser Non Coulomb Type:: Input File Parser + * Non Coulomb Type object + * + * @details following keywords are added to the _keywordFuncMap, + * _keywordRequiredMap and _keywordCountMap: 1) intra-nonBonded_file 2) + * topology_file 3) parameter_file 4) start_file + * (required) 5) rpmd_start_file 6) moldescriptor_file + * 7) guff_path (deprecated) 8) guff_file + * 9) mshake_file 10) dftb_file 11) turbomole_file + * + * @param engine + */ +FilesInputParser::FilesInputParser(Engine &engine) + : FilesInputParser(engine, true) +{ +} + /** * @brief Construct a new Input File Parser Non Coulomb Type:: Input File Parser * Non Coulomb Type object diff --git a/src/input/inputFileReader.cpp b/src/input/inputFileReader.cpp index 11d0058a6..9a8c5888f 100644 --- a/src/input/inputFileReader.cpp +++ b/src/input/inputFileReader.cpp @@ -59,6 +59,24 @@ using namespace utilities; using namespace customException; using std::make_unique; +/** + * @brief Construct a new Input File Reader:: Input File Reader object + * + * @details adds all parsers to the _parsers vector and calls addKeywords() to + * add all keywords to the _keywordFuncMap, _keywordRequiredMap and + * _keywordCountMap + * + * @param fileName + * @param engine + */ +InputFileReader::InputFileReader( + const std::string_view &fileName, + engine::Engine &engine +) + : InputFileReader(fileName, engine, true, true) +{ +} + /** * @brief Construct a new Input File Reader:: Input File Reader object * diff --git a/src/settings/qmSettings.cpp b/src/settings/qmSettings.cpp index 8ccf47dfd..af1ae3fec 100644 --- a/src/settings/qmSettings.cpp +++ b/src/settings/qmSettings.cpp @@ -25,7 +25,7 @@ #include #include // for std::format -#include "exceptions.hpp" // for customException +#include "exceptions.hpp" // for customException #include "executablePath.hpp" #include "stringUtilities.hpp" // for toLowerCopy @@ -402,11 +402,14 @@ void QMSettings::setMaceMode(const std::string_view &mode) _maceMode = FAST; else - throw UserInputException(std::format( - "Unknown mace_mode \"{}\". Valid values are \"accurate\" (exact " - "e3nn reference) or \"fast\" (cuequivariance-accelerated).", - mode - )); + throw UserInputException( + std::format( + "Unknown mace_mode \"{}\". Valid values are \"accurate\" " + "(exact " + "e3nn reference) or \"fast\" (cuequivariance-accelerated).", + mode + ) + ); } /** @@ -514,6 +517,16 @@ void QMSettings::setSlakosType(const std::string_view &slakos) ); } +/** + * @brief sets the slakosType to enum in settings + * + * @param slakos + */ +void QMSettings::setSlakosType(const SlakosType slakos) +{ + setSlakosType(slakos, true); +} + /** * @brief sets the slakosType to enum in settings * diff --git a/tests/src/input/testInputValidation.cpp b/tests/src/input/testInputValidation.cpp index 0058dbb2d..7060994f2 100644 --- a/tests/src/input/testInputValidation.cpp +++ b/tests/src/input/testInputValidation.cpp @@ -26,7 +26,6 @@ #include // for make_unique, unique_ptr #include // for string -#include "celllist.hpp" // for CellList #include "defaults.hpp" // for default settings #include "exceptions.hpp" // for InputFileException #include "hessianSettings.hpp" // for HessianSettings diff --git a/tests/src/opt/testAdam.cpp b/tests/src/opt/testAdam.cpp index d4656b154..c7f0a87b2 100644 --- a/tests/src/opt/testAdam.cpp +++ b/tests/src/opt/testAdam.cpp @@ -39,7 +39,7 @@ namespace std::shared_ptr makeBoxWithOneAtom( const linearAlgebra::Vec3D &pos, const linearAlgebra::Vec3D &force, - const linearAlgebra::Vec3D &boxDims = {100.0, 100.0, 100.0} + const linearAlgebra::Vec3D &boxDims ) { auto box = std::make_shared(); @@ -52,6 +52,14 @@ namespace return box; } + + std::shared_ptr makeBoxWithOneAtom( + const linearAlgebra::Vec3D &pos, + const linearAlgebra::Vec3D &force + ) + { + return makeBoxWithOneAtom(pos, force, {100.0, 100.0, 100.0}); + } } // namespace /* ---------- constructors ---------- */ diff --git a/tests/src/opt/testConvergence.cpp b/tests/src/opt/testConvergence.cpp index 58fc7b0bf..edf233baf 100644 --- a/tests/src/opt/testConvergence.cpp +++ b/tests/src/opt/testConvergence.cpp @@ -38,7 +38,7 @@ namespace constexpr double _maxThresh = 1.0e-3; constexpr double _rmsThresh = 1.0e-3; - Convergence makeConv(ConvStrategy strat = ConvStrategy::RIGOROUS) + Convergence makeConv(ConvStrategy strat) { return Convergence( _enableAll, @@ -51,6 +51,8 @@ namespace strat ); } + + Convergence makeConv() { return makeConv(ConvStrategy::RIGOROUS); } } // namespace /* ---------- constructor and getters ---------- */ diff --git a/tests/src/opt/testHessianBuilder.cpp b/tests/src/opt/testHessianBuilder.cpp index 6bd9f29ca..08c28193c 100644 --- a/tests/src/opt/testHessianBuilder.cpp +++ b/tests/src/opt/testHessianBuilder.cpp @@ -47,12 +47,16 @@ namespace public: explicit HarmonicEvaluator( std::vector forceConstants, - const bool analyticSupported = false + const bool analyticSupported ) : _forceConstants(std::move(forceConstants)), _analyticSupported(analyticSupported) { } + explicit HarmonicEvaluator(std::vector forceConstants) + : HarmonicEvaluator(std::move(forceConstants), false) + { + } std::shared_ptr clone() const override { diff --git a/tests/src/opt/testSteepestDescent.cpp b/tests/src/opt/testSteepestDescent.cpp index 2e3032fda..f55f9b9e6 100644 --- a/tests/src/opt/testSteepestDescent.cpp +++ b/tests/src/opt/testSteepestDescent.cpp @@ -40,7 +40,7 @@ namespace const linearAlgebra::Vec3D &pos1, const linearAlgebra::Vec3D &force0, const linearAlgebra::Vec3D &force1, - const linearAlgebra::Vec3D &boxDims = {100.0, 100.0, 100.0} + const linearAlgebra::Vec3D &boxDims ) { auto box = std::make_shared(); @@ -58,6 +58,22 @@ namespace return box; } + + std::shared_ptr makeBoxWithTwoAtoms( + const linearAlgebra::Vec3D &pos0, + const linearAlgebra::Vec3D &pos1, + const linearAlgebra::Vec3D &force0, + const linearAlgebra::Vec3D &force1 + ) + { + return makeBoxWithTwoAtoms( + pos0, + pos1, + force0, + force1, + {100.0, 100.0, 100.0} + ); + } } // namespace /* ---------- single update step ---------- */ diff --git a/tests/src/setup/testWaterModelSetup.cpp b/tests/src/setup/testWaterModelSetup.cpp index e9470f58e..3939cd90b 100644 --- a/tests/src/setup/testWaterModelSetup.cpp +++ b/tests/src/setup/testWaterModelSetup.cpp @@ -57,7 +57,7 @@ namespace void addWaterSystem( engine::MDEngine &engine, - const std::vector &atomNames = {"O", "H", "H"} + const std::vector &atomNames ) { auto &simBox = engine.getSimulationBox(); @@ -84,6 +84,11 @@ namespace simBox.addMolecule(water); } + void addWaterSystem(engine::MDEngine &engine) + { + addWaterSystem(engine, {"O", "H", "H"}); + } + template void setupInterModel(engine::MDEngine &engine, const WaterInterModel model) { diff --git a/tests/src/waterModels/testWaterModels.cpp b/tests/src/waterModels/testWaterModels.cpp index 642e02ee6..66f049b6b 100644 --- a/tests/src/waterModels/testWaterModels.cpp +++ b/tests/src/waterModels/testWaterModels.cpp @@ -89,9 +89,9 @@ namespace SimulationBox &simBox, const Vec3D &origin, const WaterGeometry &geometry, - const HybridZone zone = HybridZone::NOT_HYBRID, - const bool active = true, - const size_t molType = kWaterType + const HybridZone zone, + const bool active, + const size_t molType ) { const auto oxygen = std::make_shared(); @@ -147,6 +147,27 @@ namespace simBox.addMolecule(water); } + void addWater( + SimulationBox &simBox, + const Vec3D &origin, + const WaterGeometry &geometry, + const HybridZone zone + ) + { + addWater(simBox, origin, geometry, zone, true, kWaterType); + } + + void addWater( + SimulationBox &simBox, + const Vec3D &origin, + const WaterGeometry &geometry, + const HybridZone zone, + bool active + ) + { + addWater(simBox, origin, geometry, zone, active, kWaterType); + } + SimulationBox makeIntraWaterBox(const WaterGeometry &geometry) { SimulationBox simBox; From 698633da57f082c0c19f5a79c08e3d3cdd7f327f Mon Sep 17 00:00:00 2001 From: Jakob Gamper <97gamjak@gmail.com> Date: Wed, 12 Aug 2026 22:04:08 +0200 Subject: [PATCH 2/2] chore: update changes file --- changes/developer/internal.clangd.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changes/developer/internal.clangd.md b/changes/developer/internal.clangd.md index dd9f8fafe..5b9c7447d 100644 --- a/changes/developer/internal.clangd.md +++ b/changes/developer/internal.clangd.md @@ -1,2 +1,3 @@ - fix a lot of more small clang-tidy warnings (larger one will be handled in separate PRs) - address all cppcoreguidline clang-tidy checks and all darwin checks +- add most important fuchsia clang-tidy warnings (especially no default arguments)