Skip to content
Merged
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 @@ -296,7 +296,6 @@ set(BASIC_LINK_LIBS
potentials
neta
analyser
generator
keywords
expression
items
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ add_subdirectory(classes)
add_subdirectory(data)
add_subdirectory(expression)
add_subdirectory(items)
add_subdirectory(generator)
add_subdirectory(kernels)
add_subdirectory(keywords)
add_subdirectory(main)
Expand Down
68 changes: 1 addition & 67 deletions src/classes/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "classes/species.h"
#include "main/dissolve.h"

Configuration::Configuration() : generator_("Generator"), box_(Box::BoxType::Cubic, {1.0, 1.0, 1.0}, {90.0, 90.0, 90.0}) {}
Configuration::Configuration() : box_(Box::BoxType::Cubic, {1.0, 1.0, 1.0}, {90.0, 90.0, 90.0}) {}

Configuration::~Configuration() { clear(); }

Expand All @@ -30,7 +30,6 @@ void Configuration::clear()

// Reset definition
temperature_ = 300.0;
generator_.clear();
}

/*
Expand All @@ -43,68 +42,6 @@ void Configuration::setName(std::string_view name) { name_ = DissolveSys::niceNa
// Return name of the Configuration
std::string_view Configuration::name() const { return name_; }

// Return the current generator
Generator &Configuration::generator() { return generator_; }

// Create the Configuration according to its generator
bool Configuration::generate(const GeneratorContext &generatorContext)
{
// Empty the current contents
empty();

// Generate the contents
Messenger::print("\nExecuting generator procedure for Configuration '{}'...\n\n", name_);
auto result = generator_.execute({generatorContext, this});
if (!result)
return Messenger::error("Failed to generate Configuration '{}'.\n", name_);
Messenger::print("\n");

// Set-up Cells for the Box
cells_.generate(box_, requestedCellDivisionLength_);

// Make sure all objects know about each other
updateObjectRelationships();

// Link targeted potentials to atoms
linkTargetedPotentials();

++version_;

// Sanity check the contents - if we have zero atoms then there's a problem!
if (nAtoms() == 0)
return Messenger::error("Generated contents for Configuration '{}' contains no atoms!\n", name());

return true;
}

// Initialise (generate or load) the basic contents of the Configuration
bool Configuration::initialiseContent(const GeneratorContext &generatorContext)
{
// Clear existing content
empty();

appliedSizeFactor_ = std::nullopt;
requestedSizeFactor_ = defaultSizeFactor_;

// Run the generator Generator
if (!generate(generatorContext))
return false;

updateAtomLocations(true);

// If there are still no atoms, complain.
if (nAtoms() == 0)
return false;

// Create cell array
updateCells();

// Apply size factor scaling if required
// applySizeFactor(generatorContext.potentialMap());

return true;
}

// Set configuration temperature
void Configuration::setTemperature(double t) { temperature_ = t; }

Expand All @@ -122,8 +59,6 @@ void Configuration::serialise(std::string tag, SerialisedValue &target) const
configuration["sizeFactor"] = requestedSizeFactor_.value();
if (temperature_ != defaultTemperature_)
configuration["temperature"] = temperature_;

generator_.serialise("generator", configuration);
}

// Read values from a serialisable value
Expand All @@ -132,5 +67,4 @@ void Configuration::deserialise(const SerialisedValue &node, const CoreData &dat
setTemperature(toml::find_or<double>(node, "temperature", defaultTemperature_));
requestedSizeFactor_ = toml::find_or<double>(node, "sizeFactor", defaultSizeFactor_);
requestedCellDivisionLength_ = toml::find_or<double>(node, "cellDivisionLength", defaultCellDivisionLength_);
generator_.deserialise(node.at("generator"), data);
}
9 changes: 0 additions & 9 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 "generator/generator.h"
#include "kernels/potentials/base.h"
#include <map>
#include <memory>
Expand Down Expand Up @@ -41,8 +40,6 @@ class Configuration : public Serialisable<const CoreData &>
private:
// Name of the Configuration
std::string name_;
// Generator for the Configuration
Generator generator_;
// Temperature of this configuration (K)
static constexpr double defaultTemperature_ = 300.0;
double temperature_{defaultTemperature_};
Expand All @@ -52,12 +49,6 @@ class Configuration : public Serialisable<const CoreData &>
void setName(std::string_view name);
// Return name of the Configuration
std::string_view name() const;
// Return the generator for the Configuration
Generator &generator();
// Create the Configuration according to its generator
bool generate(const GeneratorContext &generatorContext);
// Initialise (generate or load) the basic contents of the Configuration
bool initialiseContent(const GeneratorContext &generatorContext);
// Set configuration temperature
void setTemperature(double t);
// Return configuration temperature
Expand Down
73 changes: 0 additions & 73 deletions src/generator/CMakeLists.txt

This file was deleted.

Loading
Loading