Skip to content

Commit a3afea0

Browse files
trisyoungsTristan Youngs
andauthored
chore: Remove original I/O - part 2 (#2534)
Co-authored-by: Tristan Youngs <trisyoungs@googlemail.com>
1 parent 8914c8c commit a3afea0

41 files changed

Lines changed: 19 additions & 2390 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ set(BASIC_LINK_LIBS
293293
main
294294
classes
295295
kernels
296-
potentials
297296
neta
298297
analyser
299298
keywords

src/classes/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ add_library(
1313
configuration_box.cpp
1414
configuration_contents.cpp
1515
configuration_io.cpp
16-
configuration_potentials.cpp
1716
configuration_sites.cpp
1817
configuration_upkeep.cpp
1918
configurationAtom.cpp
@@ -49,7 +48,6 @@ add_library(
4948
species_atomic.cpp
5049
species_common.cpp
5150
species_intra.cpp
52-
species_io.cpp
5351
species_isotopologues.cpp
5452
species_site.cpp
5553
species_transform.cpp

src/classes/configuration.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "classes/configurationAtom.h"
1111
#include "classes/molecule.h"
1212
#include "classes/siteStack.h"
13-
#include "kernels/potentials/base.h"
1413
#include <map>
1514
#include <memory>
1615
#include <vector>
@@ -177,27 +176,6 @@ class Configuration : public Serialisable<const CoreData &>
177176
// Scale Box, Cells, and Molecule geometric centres according to current size factor
178177
void applySizeFactor(const EnergyKernel *kernel);
179178

180-
/*
181-
* External Potentials
182-
*/
183-
private:
184-
// Defined global potentials
185-
std::vector<std::unique_ptr<ExternalPotential>> globalPotentials_;
186-
// Defined targeted potentials
187-
std::vector<std::unique_ptr<ExternalPotential>> targetedPotentials_;
188-
189-
public:
190-
// Add global potential
191-
void addGlobalPotential(std::unique_ptr<ExternalPotential> potential);
192-
// Return vector of defined global potentials
193-
const std::vector<std::unique_ptr<ExternalPotential>> &globalPotentials() const;
194-
// Add targeted potential
195-
void addTargetedPotential(std::unique_ptr<ExternalPotential> potential);
196-
// Return vector of defined targeted potentials
197-
const std::vector<std::unique_ptr<ExternalPotential>> &targetedPotentials() const;
198-
// Link targeted potentials to atoms
199-
void linkTargetedPotentials();
200-
201179
/*
202180
* Upkeep
203181
*/

src/classes/configurationAtom.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,3 @@ SpeciesAtom::ScaledInteractionDefinition ConfigurationAtom::scaling(const Config
4242

4343
return speciesAtom_->scaling(j->speciesAtom());
4444
}
45-
46-
/*
47-
* Targeted Potentials
48-
*/
49-
50-
// Add targeted potential to this atom
51-
void ConfigurationAtom::addTargetedPotential(const ExternalPotential *potential)
52-
{
53-
targetedPotentials_.emplace_back(potential);
54-
}
55-
56-
// Clear all targeted potentials from this Atom
57-
void ConfigurationAtom::clearTargetedPotentials() { targetedPotentials_.clear(); }
58-
59-
// Return list of targeted potentials for this atom
60-
const std::vector<const ExternalPotential *> &ConfigurationAtom::targetedPotentials() const { return targetedPotentials_; }

src/classes/configurationAtom.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include "classes/atom.h"
77
#include "classes/speciesAtom.h"
88
#include "classes/speciesBond.h"
9-
#include "kernels/potentials/base.h"
109
#include <memory>
1110
#include <vector>
1211

@@ -48,19 +47,4 @@ class ConfigurationAtom : public Atom<SpeciesBond>
4847
public:
4948
// Return scaling type and factors (electrostatic, van der Waals) to employ with specified Atom
5049
SpeciesAtom::ScaledInteractionDefinition scaling(const ConfigurationAtom *j) const;
51-
52-
/*
53-
* Targeted External Potentials
54-
*/
55-
private:
56-
// Vector of targeted potentials affecting this atom
57-
std::vector<const ExternalPotential *> targetedPotentials_;
58-
59-
public:
60-
// Add targeted potential to this atom
61-
void addTargetedPotential(const ExternalPotential *potential);
62-
// Clear all targeted potentials from this Atom
63-
void clearTargetedPotentials();
64-
// Return list of targeted potentials for this atom
65-
const std::vector<const ExternalPotential *> &targetedPotentials() const;
6650
};

src/classes/configuration_contents.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ void Configuration::empty()
4141
atoms_.clear();
4242
appliedSizeFactor_ = std::nullopt;
4343
speciesPopulations_.clear();
44-
globalPotentials_.clear();
45-
targetedPotentials_.clear();
4644
cells_.clear();
4745

4846
++version_;

src/classes/configuration_io.cpp

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "classes/coreData.h"
99
#include "classes/pairPotential.h"
1010
#include "classes/species.h"
11-
#include "kernels/potentials/producer.h"
1211
#include <algorithm>
1312

1413
// Write through specified LineParser
@@ -62,24 +61,6 @@ bool Configuration::serialise(LineParser &parser) const
6261
return false;
6362
}
6463

65-
// If there are no defined external potentials we are done
66-
if (globalPotentials_.empty() && targetedPotentials_.empty())
67-
return true;
68-
69-
// Write global potentials
70-
if (!parser.writeLineF("{} # nGlobalPotentials\n", globalPotentials_.size()))
71-
return false;
72-
for (auto &pot : globalPotentials_)
73-
if (!pot->serialise(parser, ""))
74-
return false;
75-
76-
// Write targeted potentials
77-
if (!parser.writeLineF("{} # nTargetedPotentials\n", targetedPotentials_.size()))
78-
return false;
79-
for (auto &pot : targetedPotentials_)
80-
if (!pot->serialise(parser, ""))
81-
return false;
82-
8364
return true;
8465
}
8566

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

171-
// Read in global potentials
172-
if (parser.getArgsDelim(LineParser::Defaults) != LineParser::Success)
173-
return false;
174-
globalPotentials_.resize(parser.argi(0));
175-
for (auto &pot : globalPotentials_)
176-
{
177-
// First line contains potential type
178-
if (parser.getArgsDelim(LineParser::Defaults) != LineParser::Success)
179-
return false;
180-
auto potentialType = ExternalPotentialTypes::isType(parser.argsv(0));
181-
if (!potentialType)
182-
return Messenger::error("Unrecognised external potential type '{}' found in Configuration '{}' in restart file.\n",
183-
parser.argsv(0), name());
184-
185-
// Create new external potential
186-
pot = ExternalPotentialProducer::create(*potentialType);
187-
if (!pot->deserialise(parser, coreData))
188-
return false;
189-
}
190-
191-
// Get atom types present in configuration
192-
auto atomTypes = atomTypeVector();
193-
194-
// Read in targeted potentials
195-
if (parser.getArgsDelim(LineParser::Defaults) != LineParser::Success)
196-
return false;
197-
targetedPotentials_.resize(parser.argi(0));
198-
for (auto &pot : targetedPotentials_)
199-
{
200-
// First line contains potential type
201-
if (parser.getArgsDelim(LineParser::Defaults) != LineParser::Success)
202-
return false;
203-
auto potentialType = ExternalPotentialTypes::isType(parser.argsv(0));
204-
if (!potentialType)
205-
return Messenger::error("Unrecognised external potential type '{}' found in Configuration '{}' in restart file.\n",
206-
parser.argsv(0), name());
207-
208-
// Create new external potential
209-
pot = ExternalPotentialProducer::create(*potentialType);
210-
211-
// Additional arguments after the potential type correspond to targets for the potential
212-
for (auto n = 1; n < parser.nArgs(); ++n)
213-
{
214-
// Plain number - corresponds to a specific atom in the configuration
215-
if (DissolveSys::isNumber(parser.args(n)))
216-
{
217-
auto i = parser.argi(n);
218-
if (i < 0 || i >= atoms_.size())
219-
Messenger::exception("Atom index {} for targeted potential is out of range.\n", i);
220-
pot->addTargetAtomIndex(i);
221-
}
222-
else if (std::ranges::find_if(atomTypes, [&](const auto at)
223-
{ return DissolveSys::sameString(at->name(), parser.args(n)); }) != atomTypes.end())
224-
{
225-
auto it = std::ranges::find_if(atomTypes, [&](const auto at)
226-
{ return DissolveSys::sameString(at->name(), parser.args(n)); });
227-
pot->addTargetAtomType(*it);
228-
}
229-
else if (coreData.findSpecies(DissolveSys::niceName(parser.args(n))))
230-
pot->addTargetSpecies(coreData.findSpecies(DissolveSys::niceName(parser.args(n))));
231-
else
232-
Messenger::exception("Unrecognised target '{}' for potential.\n", parser.args(n));
233-
}
234-
235-
// Read in the rest of the potential
236-
if (!pot->deserialise(parser, coreData))
237-
return false;
238-
}
239-
240-
// Link targeted potentials to atoms
241-
linkTargetedPotentials();
242-
243152
return true;
244153
}

src/classes/configuration_potentials.cpp

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/classes/species.h

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -304,40 +304,6 @@ class Species : public Serialisable<>
304304
* Serialisation
305305
*/
306306
public:
307-
// Species Block Keyword Enum
308-
enum class SpeciesKeyword
309-
{
310-
Angle, /* 'Angle' - Defines an Angle joining three atoms */
311-
Atom, /* 'Atom' - Specifies an Atom in the Species */
312-
Bond, /* 'Bond' - Defines a Bond joining two atoms */
313-
BondType, /* 'BondType' - Sets the type of a specific bond */
314-
BoxAngles, /* 'BoxAngles' - Specify unit cell angles for the species */
315-
BoxLengths, /* 'BoxLengths' - Specify unit cell lengths for the species */
316-
Charge, /* 'Charge' - Specifies the atomic charge for an individual atom */
317-
CommonAngle, /* 'CommonAngle' - Define a common angle (added for transition to Dissolve2) */
318-
CommonBond, /* 'CommonBond' - Define a common angle (added for transition to Dissolve2) */
319-
CommonImproper, /* 'CommonImproper' - Define a common angle (added for transition to Dissolve2) */
320-
CommonTorsion, /* 'CommonTorsion' - Define a common angle (added for transition to Dissolve2) */
321-
EndSpecies, /* 'EndSpecies' - Signals the end of the current Species */
322-
Forcefield, /* 'Forcefield' - Sets the Forcefield from which to (re)generate or set terms */
323-
Improper, /* 'Improper' - Define an Improper interaction between four atoms */
324-
Isotopologue, /* 'Isotopologue' - Add an isotopologue to the Species */
325-
NAngles, /* 'NAngles' - Hint at the total number of angles in the Species */
326-
NAtoms, /* 'NAtoms' - Hint at the total number of atoms in the Species */
327-
NBonds, /* 'NBonds' - Hint at the total number of bonds in the Species */
328-
NImpropers, /* 'NImpropers' - Hint at the total number of impropers in the Species */
329-
NTorsions, /* 'NTorsions' - Hint at the total number of torsions in the Species */
330-
Scaling14, /* 'Scaling14' - Specify 1-4 scaling factors for torsion terms */
331-
Site, /* 'Site' - Define an analysis site within the Species */
332-
Torsion /* 'Torsion' - Define a Torsion interaction between four atoms */
333-
};
334-
// Return enum option info for SpeciesKeyword
335-
static EnumOptions<Species::SpeciesKeyword> keywords();
336-
// Read Species definition from specified LineParser
337-
bool read(LineParser &parser, CoreData &coreData);
338-
// Write Species definition to specified LineParser
339-
bool write(LineParser &parser, std::string_view prefix);
340-
341307
// Express as a serialisable value
342308
void serialise(std::string tag, SerialisedValue &target) const override;
343309
// Read values from a serialisable value

0 commit comments

Comments
 (0)