File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88#include " main/dissolve.h"
99#include " math/mathFunc.h"
1010#include " nodes/atomicMC/atomicMC.h"
11+ #include " nodes/dissolve.h"
1112
1213// Run main processing
1314NodeConstants::ProcessResult AtomicMCNode::process ()
@@ -30,8 +31,11 @@ NodeConstants::ProcessResult AtomicMCNode::process()
3031 message (" Target acceptance rate is {}.\n " , targetAcceptanceRate);
3132 message (" \n " );
3233
33- auto kernel =
34- KernelProducer::energyKernel (targetConfiguration_, dissolve ().potentialMap (), dissolve ().pairPotentialRange ());
34+ // Prepare for energy calculation, generate kernel
35+ auto dissolveNode = parentGraph ()->node (" Dissolve" );
36+ auto kernel = static_cast <DissolveGraph*>(dissolveNode)->prepareEnergyCalculation (targetConfiguration_);
37+
38+ targetConfiguration_->updateCells (kernel.get ()->potentialMap ().range ());
3539
3640 auto nAttempts = 0 , nAccepted = 0 ;
3741 bool accept;
Original file line number Diff line number Diff line change @@ -200,17 +200,6 @@ NodeConstants::ProcessResult InsertNode::process()
200200 }
201201 }
202202
203- // Prepare for energy calculation, generate kernel
204- std::vector<std::shared_ptr<AtomType>> atomTypes;
205- auto atomTypePop = species_->atomTypePopulations ();
206- atomTypes.reserve (atomTypePop.size ());
207- for (const auto &at : atomTypePop)
208- atomTypes.push_back (std::make_shared<AtomType>(at.first ->Z (), at.first ->name ()));
209-
210- auto kernel = DissolveGraph::prepareEnergyCalculation (dissolve (), {}, configuration_);
211-
212- configuration_->updateCells (kernel.get ()->potentialMap ().range ());
213-
214203 Messenger::print (" [InsertRandom] New box density is {:e} atoms/Angstrom**3 ({} g/cm3).\n " ,
215204 configuration_->atomicDensity ().value_or (0.0 ), configuration_->chemicalDensity ().value_or (0.0 ));
216205
You can’t perform that action at this time.
0 commit comments