Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ set(BASIC_LINK_LIBS
main
classes
kernels
potentials
neta
analyser
keywords
Expand Down
1 change: 0 additions & 1 deletion src/classes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ add_library(
configuration_box.cpp
configuration_contents.cpp
configuration_io.cpp
configuration_potentials.cpp
configuration_sites.cpp
configuration_upkeep.cpp
configurationAtom.cpp
Expand Down
22 changes: 0 additions & 22 deletions src/classes/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "classes/configurationAtom.h"
#include "classes/molecule.h"
#include "classes/siteStack.h"
#include "kernels/potentials/base.h"
#include <map>
#include <memory>
#include <vector>
Expand Down Expand Up @@ -177,27 +176,6 @@ class Configuration : public Serialisable<const CoreData &>
// Scale Box, Cells, and Molecule geometric centres according to current size factor
void applySizeFactor(const EnergyKernel *kernel);

/*
* External Potentials
*/
private:
// Defined global potentials
std::vector<std::unique_ptr<ExternalPotential>> globalPotentials_;
// Defined targeted potentials
std::vector<std::unique_ptr<ExternalPotential>> targetedPotentials_;

public:
// Add global potential
void addGlobalPotential(std::unique_ptr<ExternalPotential> potential);
// Return vector of defined global potentials
const std::vector<std::unique_ptr<ExternalPotential>> &globalPotentials() const;
// Add targeted potential
void addTargetedPotential(std::unique_ptr<ExternalPotential> potential);
// Return vector of defined targeted potentials
const std::vector<std::unique_ptr<ExternalPotential>> &targetedPotentials() const;
// Link targeted potentials to atoms
void linkTargetedPotentials();

/*
* Upkeep
*/
Expand Down
16 changes: 0 additions & 16 deletions src/classes/configurationAtom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,3 @@ SpeciesAtom::ScaledInteractionDefinition ConfigurationAtom::scaling(const Config

return speciesAtom_->scaling(j->speciesAtom());
}

/*
* Targeted Potentials
*/

// Add targeted potential to this atom
void ConfigurationAtom::addTargetedPotential(const ExternalPotential *potential)
{
targetedPotentials_.emplace_back(potential);
}

// Clear all targeted potentials from this Atom
void ConfigurationAtom::clearTargetedPotentials() { targetedPotentials_.clear(); }

// Return list of targeted potentials for this atom
const std::vector<const ExternalPotential *> &ConfigurationAtom::targetedPotentials() const { return targetedPotentials_; }
16 changes: 0 additions & 16 deletions src/classes/configurationAtom.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "classes/atom.h"
#include "classes/speciesAtom.h"
#include "classes/speciesBond.h"
#include "kernels/potentials/base.h"
#include <memory>
#include <vector>

Expand Down Expand Up @@ -48,19 +47,4 @@ class ConfigurationAtom : public Atom<SpeciesBond>
public:
// Return scaling type and factors (electrostatic, van der Waals) to employ with specified Atom
SpeciesAtom::ScaledInteractionDefinition scaling(const ConfigurationAtom *j) const;

/*
* Targeted External Potentials
*/
private:
// Vector of targeted potentials affecting this atom
std::vector<const ExternalPotential *> targetedPotentials_;

public:
// Add targeted potential to this atom
void addTargetedPotential(const ExternalPotential *potential);
// Clear all targeted potentials from this Atom
void clearTargetedPotentials();
// Return list of targeted potentials for this atom
const std::vector<const ExternalPotential *> &targetedPotentials() const;
};
2 changes: 0 additions & 2 deletions src/classes/configuration_contents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ void Configuration::empty()
atoms_.clear();
appliedSizeFactor_ = std::nullopt;
speciesPopulations_.clear();
globalPotentials_.clear();
targetedPotentials_.clear();
cells_.clear();

++version_;
Expand Down
91 changes: 0 additions & 91 deletions src/classes/configuration_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "classes/coreData.h"
#include "classes/pairPotential.h"
#include "classes/species.h"
#include "kernels/potentials/producer.h"
#include <algorithm>

// Write through specified LineParser
Expand Down Expand Up @@ -62,24 +61,6 @@ bool Configuration::serialise(LineParser &parser) const
return false;
}

// If there are no defined external potentials we are done
if (globalPotentials_.empty() && targetedPotentials_.empty())
return true;

// Write global potentials
if (!parser.writeLineF("{} # nGlobalPotentials\n", globalPotentials_.size()))
return false;
for (auto &pot : globalPotentials_)
if (!pot->serialise(parser, ""))
return false;

// Write targeted potentials
if (!parser.writeLineF("{} # nTargetedPotentials\n", targetedPotentials_.size()))
return false;
for (auto &pot : targetedPotentials_)
if (!pot->serialise(parser, ""))
return false;

return true;
}

Expand Down Expand Up @@ -168,77 +149,5 @@ bool Configuration::deserialise(LineParser &parser, const CoreData &coreData, bo
if (!hasPotentials)
return true;

// Read in global potentials
if (parser.getArgsDelim(LineParser::Defaults) != LineParser::Success)
return false;
globalPotentials_.resize(parser.argi(0));
for (auto &pot : globalPotentials_)
{
// First line contains potential type
if (parser.getArgsDelim(LineParser::Defaults) != LineParser::Success)
return false;
auto potentialType = ExternalPotentialTypes::isType(parser.argsv(0));
if (!potentialType)
return Messenger::error("Unrecognised external potential type '{}' found in Configuration '{}' in restart file.\n",
parser.argsv(0), name());

// Create new external potential
pot = ExternalPotentialProducer::create(*potentialType);
if (!pot->deserialise(parser, coreData))
return false;
}

// Get atom types present in configuration
auto atomTypes = atomTypeVector();

// Read in targeted potentials
if (parser.getArgsDelim(LineParser::Defaults) != LineParser::Success)
return false;
targetedPotentials_.resize(parser.argi(0));
for (auto &pot : targetedPotentials_)
{
// First line contains potential type
if (parser.getArgsDelim(LineParser::Defaults) != LineParser::Success)
return false;
auto potentialType = ExternalPotentialTypes::isType(parser.argsv(0));
if (!potentialType)
return Messenger::error("Unrecognised external potential type '{}' found in Configuration '{}' in restart file.\n",
parser.argsv(0), name());

// Create new external potential
pot = ExternalPotentialProducer::create(*potentialType);

// Additional arguments after the potential type correspond to targets for the potential
for (auto n = 1; n < parser.nArgs(); ++n)
{
// Plain number - corresponds to a specific atom in the configuration
if (DissolveSys::isNumber(parser.args(n)))
{
auto i = parser.argi(n);
if (i < 0 || i >= atoms_.size())
Messenger::exception("Atom index {} for targeted potential is out of range.\n", i);
pot->addTargetAtomIndex(i);
}
else if (std::ranges::find_if(atomTypes, [&](const auto at)
{ return DissolveSys::sameString(at->name(), parser.args(n)); }) != atomTypes.end())
{
auto it = std::ranges::find_if(atomTypes, [&](const auto at)
{ return DissolveSys::sameString(at->name(), parser.args(n)); });
pot->addTargetAtomType(*it);
}
else if (coreData.findSpecies(DissolveSys::niceName(parser.args(n))))
pot->addTargetSpecies(coreData.findSpecies(DissolveSys::niceName(parser.args(n))));
else
Messenger::exception("Unrecognised target '{}' for potential.\n", parser.args(n));
}

// Read in the rest of the potential
if (!pot->deserialise(parser, coreData))
return false;
}

// Link targeted potentials to atoms
linkTargetedPotentials();

return true;
}
52 changes: 0 additions & 52 deletions src/classes/configuration_potentials.cpp

This file was deleted.

1 change: 0 additions & 1 deletion src/gui/models/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ set(models_SRCS
dissolveModel.cpp
dissolveModelImageProvider.cpp
dissolveModelImageProvider.h
externalPotentialModel.cpp
ffSortFilterModel.cpp
forcefieldModel.cpp
globalPotentialFilterProxy.cpp
Expand Down
93 changes: 0 additions & 93 deletions src/gui/models/externalPotentialModel.cpp

This file was deleted.

Loading
Loading