Loading...
Searching...
No Matches
BasinHoppingJob.h
Go to the documentation of this file.
1/*
2** This file is part of eOn.
3**
4** SPDX-License-Identifier: BSD-3-Clause
5**
6** Copyright (c) 2010--present, eOn Development Team
7** All rights reserved.
8**
9** Repo:
10** https://github.com/TheochemUI/eOn
11*/
12#pragma once
13#include "EonLogger.h"
14#include "Job.h"
15#include "Matter.h"
16#include "Parameters.h"
17
18namespace eonc {
19
20class BasinHoppingJob : public Job {
21public:
22 BasinHoppingJob(std::unique_ptr<Parameters> parameters)
23 : Job(std::move(parameters)),
24 current{std::make_shared<Matter>(pot, params)},
25 trial{std::make_shared<Matter>(pot, params)},
26 fcalls{0} {}
27 ~BasinHoppingJob(void) = default;
28
29 std::vector<std::string> run(void) override;
30
31private:
32 VectorXd calculateDistanceFromCenter(Matter *matter);
33 AtomMatrix displaceRandom(double maxDisplacement);
34 void randomSwap(Matter *matter);
35 std::shared_ptr<Matter> current;
36 std::shared_ptr<Matter> trial; // initial configuration
37 std::vector<long> getElements(Matter *matter);
38 std::vector<std::string> returnFiles;
39 int jump_count{0}; // count of jump moves
40 int disp_count{0}; // count of displacement moves
41 int swap_count{0}; // count of swap moves
42 int fcalls{0};
43
44 std::vector<std::shared_ptr<Matter>> uniqueStructures;
45 std::vector<double> uniqueEnergies;
47};
48
49} // namespace eonc
50
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
Definition Eigen.h:37
The job class is used to serve as an abstract class for all jobs, as well as to call a job at runtime...
BasinHoppingJob(std::unique_ptr< Parameters > parameters)
std::vector< std::string > run(void) override
Virtual run; used solely for dynamic dispatch.
std::vector< std::string > returnFiles
VectorXd calculateDistanceFromCenter(Matter *matter)
std::vector< std::shared_ptr< Matter > > uniqueStructures
std::shared_ptr< Matter > current
void randomSwap(Matter *matter)
AtomMatrix displaceRandom(double maxDisplacement)
std::vector< double > uniqueEnergies
eonc::log::Scoped log
std::shared_ptr< Matter > trial
BasinHoppingJob(std::unique_ptr< Parameters > parameters)
~BasinHoppingJob(void)=default
std::vector< long > getElements(Matter *matter)
Job(std::unique_ptr< Parameters > parameters)
Definition Job.h:58
std::shared_ptr< Potential > pot
Definition Job.h:55
Parameters params
Definition Job.h:54
RAII resource manager for the ARTn C library with global synchronization.
RAII helper for class-scoped logging.
Definition EonLogger.h:171