diff --git a/src/base/version.h b/src/base/version.h index c243b17169..b0d90f6a7c 100644 --- a/src/base/version.h +++ b/src/base/version.h @@ -3,9 +3,6 @@ #pragma once -// Forward Declarations -class CoreData; - // Version Counter class VersionCounter { diff --git a/src/classes/configuration.h b/src/classes/configuration.h index 38fc39f518..c6f96de162 100644 --- a/src/classes/configuration.h +++ b/src/classes/configuration.h @@ -223,10 +223,6 @@ class Configuration : public Serialisable * Serialisation */ public: - // Write through specified LineParser - bool serialise(LineParser &parser) const; - // Read from specified LineParser - bool deserialise(LineParser &parser, const CoreData &coreData, bool hasPotentials); // Express as a serialisable value void serialise(std::string tag, SerialisedValue &target) const override; // Read values from a serialisable value diff --git a/src/classes/isotopologue.h b/src/classes/isotopologue.h index 706f667628..24bf78a39b 100644 --- a/src/classes/isotopologue.h +++ b/src/classes/isotopologue.h @@ -15,7 +15,6 @@ // Forward Declarations class AtomType; class Species; -class CoreData; /* * Isotopologue Definition diff --git a/src/classes/kVector.h b/src/classes/kVector.h index 43601a667c..eea830ac2c 100644 --- a/src/classes/kVector.h +++ b/src/classes/kVector.h @@ -8,7 +8,6 @@ // Forward Declarations class BraggReflection; -class CoreData; // K-Vector class KVector diff --git a/src/classes/speciesAtom.h b/src/classes/speciesAtom.h index 9c351e610f..a8cdc4efac 100644 --- a/src/classes/speciesAtom.h +++ b/src/classes/speciesAtom.h @@ -13,7 +13,6 @@ // Forward Declarations class AtomType; -class CoreData; class SpeciesAngle; class SpeciesBond; class SpeciesImproper; diff --git a/src/classes/speciesSite.h b/src/classes/speciesSite.h index fb2526f999..e0e9a2ee2d 100644 --- a/src/classes/speciesSite.h +++ b/src/classes/speciesSite.h @@ -187,7 +187,7 @@ class SpeciesSite : public Serialisable // Express as a serialisable value void serialise(std::string tag, SerialisedValue &target) const override; // Read values from a serialisable value - void deserialise(const SerialisedValue &node); + void deserialise(const SerialisedValue &node) override; }; template <> struct Context diff --git a/src/gui/getConfigurationNameDialog.h b/src/gui/getConfigurationNameDialog.h index 3a0df01f6b..4d15237c70 100644 --- a/src/gui/getConfigurationNameDialog.h +++ b/src/gui/getConfigurationNameDialog.h @@ -7,7 +7,6 @@ #include // Forward Declarations -class CoreData; class Configuration; // Get Configuration Name Dialog diff --git a/src/gui/getModuleLayerNameDialog.h b/src/gui/getModuleLayerNameDialog.h index 21b7ccba90..e0cecaa1d9 100644 --- a/src/gui/getModuleLayerNameDialog.h +++ b/src/gui/getModuleLayerNameDialog.h @@ -7,7 +7,6 @@ #include // Forward Declarations -class CoreData; class ModuleLayer; // Get Layer Name Dialog diff --git a/src/gui/getSpeciesNameDialog.h b/src/gui/getSpeciesNameDialog.h index 98a5bfefd2..7457e02562 100644 --- a/src/gui/getSpeciesNameDialog.h +++ b/src/gui/getSpeciesNameDialog.h @@ -7,7 +7,6 @@ #include // Forward Declarations -class CoreData; class Species; // Get Species Name Dialog diff --git a/src/gui/getTabNameDialog.h b/src/gui/getTabNameDialog.h index ec174ae804..f42928a1ad 100644 --- a/src/gui/getTabNameDialog.h +++ b/src/gui/getTabNameDialog.h @@ -7,7 +7,6 @@ #include // Forward Declarations -class CoreData; class MainTab; // Get MainTab Name Dialog diff --git a/src/math/sampledDouble.h b/src/math/sampledDouble.h index 91c65cc9ab..b2656275ff 100644 --- a/src/math/sampledDouble.h +++ b/src/math/sampledDouble.h @@ -6,7 +6,6 @@ #include "base/serialiser.h" // Forward Declarations -class CoreData; class LineParser; class ProcessPool; diff --git a/src/math/sampledVector.h b/src/math/sampledVector.h index c10bce4b5e..7e92524b70 100644 --- a/src/math/sampledVector.h +++ b/src/math/sampledVector.h @@ -7,7 +7,6 @@ #include // Forward Declarations -class CoreData; class LineParser; // Vector of double values with sampling diff --git a/src/nodes/md.cpp b/src/nodes/md.cpp index 88ce066458..1820021850 100644 --- a/src/nodes/md.cpp +++ b/src/nodes/md.cpp @@ -22,7 +22,6 @@ MDNode::MDNode(Graph *parentGraph) : Node(parentGraph) addOption("RandomVelocities", "Whether random velocities should always be assigned before beginning MD simulation", randomVelocities_); - addOption("RestrictToSpecies", "Restrict the calculation to the specified Species", restrictToSpecies_); addOption("OnlyWhenEnergyStable", "Only run MD when target Configuration energies are stable", onlyWhenEnergyStable_); addOption("EnergyFrequency", "Frequency at which to calculate total system energy", energyFrequency_); @@ -156,9 +155,6 @@ NodeConstants::ProcessResult MDNode::process() message("Summary will be written every {} step(s).\n", outputFrequency); else message("Summary will not be written.\n"); - if (!restrictToSpecies_.empty()) - message("Calculation will be restricted to species: {}\n", - joinStrings(restrictToSpecies_, " ", [](const auto &sp) { return sp->name(); })); message("\n"); // Create kernels @@ -195,22 +191,6 @@ NodeConstants::ProcessResult MDNode::process() double tInstant, ke, tScale; Kernel::EnergyResult pe; - // Determine target molecules from the restrictedSpecies vector (if any) - std::vector targetMolecules; - std::vector free(targetConfiguration_->nAtoms(), 0); - if (restrictToSpecies_.empty()) - { - std::fill(free.begin(), free.end(), 1); - } - else - for (const auto &mol : targetConfiguration_->molecules()) - if (std::find(restrictToSpecies_.begin(), restrictToSpecies_.end(), mol->species()) != restrictToSpecies_.end()) - { - targetMolecules.push_back(mol.get()); - auto offset = mol->globalAtomOffset(); - std::fill(free.begin() + offset, free.begin() + offset + mol->atoms().size(), 1); - } - /* * Calculation Begins */ @@ -227,12 +207,9 @@ NodeConstants::ProcessResult MDNode::process() Messenger::print("Random initial velocities will be assigned.\n"); velocities.resize(targetConfiguration_->nAtoms(), Vector3()); - for (auto &&[v, iFree] : zip(velocities, free)) + for (auto &v : velocities) { - if (iFree) - v.set(exp(DissolveMath::random() - 0.5), exp(DissolveMath::random() - 0.5), exp(DissolveMath::random() - 0.5)); - else - v.zero(); + v.set(exp(DissolveMath::random() - 0.5), exp(DissolveMath::random() - 0.5), exp(DissolveMath::random() - 0.5)); v /= sqrt(2.0 * M_PI); } } @@ -256,10 +233,8 @@ NodeConstants::ProcessResult MDNode::process() // Calculate total velocity and mass over all atoms Vector3 vCom; auto massSum = 0.0; - for (auto &&[v, m, iFree] : zip(velocities, mass, free)) + for (auto &&[v, m] : zip(velocities, mass)) { - if (!iFree) - continue; vCom += v * m; massSum += m; } @@ -267,12 +242,9 @@ NodeConstants::ProcessResult MDNode::process() // Finalise initial velocities (unless considering intramolecular forces only) if (!intramolecularForcesOnly_) { - // Remove any velocity shift, and re-zero velocities on fixed atoms + // Remove any velocity shift vCom /= massSum; std::transform(velocities.begin(), velocities.end(), velocities.begin(), [vCom](auto vel) { return vel - vCom; }); - for (auto &&[v, iFree] : zip(velocities, free)) - if (!iFree) - v.zero(); // Calculate instantaneous temperature ke = 0.0; @@ -313,17 +285,11 @@ NodeConstants::ProcessResult MDNode::process() // If we're not using a fixed timestep the forces need to be available immediately if (timestepType_ != TimestepType::Fixed) { - // Calculate forces - if (targetMolecules.empty()) - { - if (intramolecularForcesOnly_) - forceKernel->totalForces(pairPotentialForces, geometryForces, - {Kernel::ExcludeInterMolecularPairPotential, Kernel::ExcludeExtended}); - else - forceKernel->totalForces(pairPotentialForces, geometryForces); - } + if (intramolecularForcesOnly_) + forceKernel->totalForces(pairPotentialForces, geometryForces, + {Kernel::ExcludeInterMolecularPairPotential, Kernel::ExcludeExtended}); else - throw(std::runtime_error("Forces calculation on a set of molecules is currently not available.\n")); + forceKernel->totalForces(pairPotentialForces, geometryForces); // Check for suitable timestep if (!determineTimeStep(timestepType_, fixedTimestep, pairPotentialForces, geometryForces)) @@ -365,16 +331,12 @@ NodeConstants::ProcessResult MDNode::process() targetConfiguration_->updateAtomLocations(); // Calculate forces - if (targetMolecules.empty()) - { - if (intramolecularForcesOnly_) - forceKernel->totalForces(pairPotentialForces, geometryForces, - {Kernel::ExcludeInterMolecularPairPotential, Kernel::ExcludeExtended}); - else - forceKernel->totalForces(pairPotentialForces, geometryForces); - } + if (intramolecularForcesOnly_) + forceKernel->totalForces(pairPotentialForces, geometryForces, + {Kernel::ExcludeInterMolecularPairPotential, Kernel::ExcludeExtended}); else - throw(std::runtime_error("Forces calculation on a set of molecules is currently not available.\n")); + forceKernel->totalForces(pairPotentialForces, geometryForces); + // Cap forces if (capForces_) nCapped = capForces(maxForce, pairPotentialForces, geometryForces); diff --git a/src/nodes/md.h b/src/nodes/md.h index 922ee0dd86..dfff130701 100644 --- a/src/nodes/md.h +++ b/src/nodes/md.h @@ -63,8 +63,6 @@ class MDNode : public Node std::optional outputFrequency_{5}; // Whether random velocities should always be assigned before beginning MD simulation bool randomVelocities_{false}; - // Species to restrict calculation to - std::vector restrictToSpecies_; // Write frequency for trajectory file std::optional trajectoryFrequency_; // Velocities diff --git a/src/nodes/parameter.h b/src/nodes/parameter.h index a925056362..2fb57ca779 100644 --- a/src/nodes/parameter.h +++ b/src/nodes/parameter.h @@ -562,10 +562,6 @@ template class SerialisableParameter : public Parameter struct is_ptr_vector> : std::true_type - { - }; - /* * Serialisation */ @@ -587,8 +583,6 @@ template class SerialisableParameter : public Parameter::data_) result["data"] = *Parameter::data_; } - else if constexpr (serialisablePointer) - Parameter::data_->serialise("data", result); else result["data"] = Parameter::data_; @@ -629,11 +623,6 @@ template class SerialisableParameter : public Parameter::data_ = {}; } - else if constexpr (serialisablePointer) - { - CoreData coreData; // Temporary patch until we fix up the deserialisation - Parameter::data_->deserialise(node.at("data"), coreData); - } else { Parameter::data_ = toml::find(node, "data"); diff --git a/tests/gui/optionalDoubleKeyword.cpp b/tests/gui/optionalDoubleKeyword.cpp deleted file mode 100644 index 0b4c44db2e..0000000000 --- a/tests/gui/optionalDoubleKeyword.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// Copyright (c) 2026 Team Dissolve and contributors - -#include "gui/keywordWidgets/optionalDouble.h" -#include - -namespace UnitTest -{ - -TEST(OptionalDoubleTest, Widget) -{ - char arg0[] = "OptionalDoubleTest"; - char arg1[] = "-platform"; - char arg2[] = "offscreen"; - char *argv[] = {arg0, arg1, arg2}; - int argc{3}; - QApplication app(argc, argv); - - // Minimum at -50.0, maximum at 50.0 - std::optional value_; - OptionalDoubleKeyword keyword(value_, -50.0, 50.0, 0.8, "Null Text"); - CoreData coreData_; - OptionalDoubleKeywordWidget widget(nullptr, &keyword, coreData_); - - // Null value_ to start with - EXPECT_TRUE(!value_); - // Step the spinbox up - widget.stepBy(10); - EXPECT_NEAR(value_.value(), -42.0, 1.0e-8); - // Direct set - widget.setValue(1.2345); - EXPECT_NEAR(value_.value(), 1.2345, 1.0e-8); - // Step the spinbox down - widget.stepBy(-10); - EXPECT_NEAR(value_.value(), 1.2345 - 8.0, 1.0e-8); - // Up to above the maximum - widget.stepBy(1.0e3); - EXPECT_NEAR(value_.value(), 50.0, 1.0e-8); - // And back down, far enough to hit the minimum and nullify the value - widget.stepBy(-1.0e6); - EXPECT_TRUE(!value_); - // Check the text in the spinbox - EXPECT_STREQ("Null Text", qPrintable(widget.text())); -} - -} // namespace UnitTest diff --git a/tests/gui/optionalIntegerKeyword.cpp b/tests/gui/optionalIntegerKeyword.cpp deleted file mode 100644 index 529f4bc5cb..0000000000 --- a/tests/gui/optionalIntegerKeyword.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later -// Copyright (c) 2026 Team Dissolve and contributors - -#include "gui/keywordWidgets/optionalInt.h" -#include - -namespace UnitTest -{ - -TEST(OptionalIntegerTest, Widget) -{ - char arg0[] = "OptionalIntegerTest"; - char arg1[] = "-platform"; - char arg2[] = "offscreen"; - char *argv[] = {arg0, arg1, arg2}; - int argc{3}; - QApplication app(argc, argv); - - // Minimum at -50, maximum at 50 - std::optional value_; - OptionalIntegerKeyword keyword(value_, -50, 50, 1, "Null Text"); - CoreData coreData_; - OptionalIntegerKeywordWidget widget(nullptr, &keyword, coreData_); - - // Null value_ to start with - EXPECT_TRUE(!value_); - // Step the spinbox up - widget.stepBy(10); - EXPECT_EQ(value_.value(), -40); - // Direct set - widget.setValue(12); - EXPECT_EQ(value_.value(), 12); - // Step the spinbox down - widget.stepBy(-10); - EXPECT_EQ(value_.value(), 2); - // Up to above the maximum - widget.stepBy(1e3); - EXPECT_EQ(value_.value(), 50); - // And back down, far enough to hit the minimum and nullify the value - widget.stepBy(-1e6); - EXPECT_TRUE(!value_); - // Check the text in the spinbox - EXPECT_STREQ("Null Text", qPrintable(widget.text())); -} - -} // namespace UnitTest diff --git a/tests/nodes/graph.cpp b/tests/nodes/graph.cpp index a363148aa9..d160f1d8a4 100644 --- a/tests/nodes/graph.cpp +++ b/tests/nodes/graph.cpp @@ -56,7 +56,6 @@ class GraphCoreTest : public ::testing::Test } protected: - // We need a CoreData and Dissolve definition to properly instantiate DissolveGraph at present. DissolveGraph root_; AddNode *x_{nullptr}, *y_{nullptr}, *z_{nullptr}; }; diff --git a/tests/nodes/loop.cpp b/tests/nodes/loop.cpp index 21ccf88364..c7a9d8791c 100644 --- a/tests/nodes/loop.cpp +++ b/tests/nodes/loop.cpp @@ -64,7 +64,6 @@ class IterableGraphTest : public ::testing::Test } protected: - // We need a CoreData and Dissolve definition to properly instantiate DissolveGraph at present. DissolveGraph root_; NumberNode *i_{nullptr}; AddNode *x_{nullptr}, *y_{nullptr}; diff --git a/tests/nodes/subGraph.cpp b/tests/nodes/subGraph.cpp index b1d6f29aaf..07d367338c 100644 --- a/tests/nodes/subGraph.cpp +++ b/tests/nodes/subGraph.cpp @@ -74,7 +74,6 @@ class SubGraphTest : public ::testing::Test } protected: - // We need a CoreData and Dissolve definition to properly instantiate DissolveGraph at present. DissolveGraph root_; Graph *graphA_{nullptr}; AddNode *x_{nullptr}, *y_{nullptr}, *z_{nullptr}, *w_{nullptr}; @@ -83,24 +82,6 @@ class SubGraphTest : public ::testing::Test std::shared_ptr wB_{nullptr}; }; -TEST_F(SubGraphTest, Serialisation){ - // createGraph(); - // - // CoreData cd; - // Dissolve d(cd); - // DissolveGraph copy(d); - // auto serialised = root_.serialise(); - // - // SerialisedValue contents = toml::parse("dissolve/input/simple_addition_graph.toml" - // UnitTest::compareToml("", serialised, contents); - // - // std::cout << serialised << std::endl; - // copy.deserialise(serialised); - // auto repeat = copy.serialise(); - // - // UnitTest::compareToml("", repeat, contents); -}; - TEST_F(SubGraphTest, Connections) { createGraph();