3 #include "mpicontroller.h" 4 #include "externalpotential.h" 5 #include "reactioncoordinate.h" 6 #include "aux/table_1d.h" 21 std::string penalty_function_filename;
22 std::string histogram_filename;
23 bool overwrite_penalty =
true;
24 void loadPenaltyFunction(
const std::string& filename);
26 void initializePenaltyFunction(
const json& j);
27 void to_json(
json& j)
const override;
28 virtual void updatePenalty(
const std::vector<double>& coordinate);
31 typedef typename std::shared_ptr<ReactionCoordinate::ReactionCoordinateBase> Tcoord;
37 size_t penalty_function_exchange_counter = 0;
56 void streamHistogram(std::ostream& stream)
const;
63 class PenaltyMPI :
public Penalty 66 const MPI::Controller& mpi;
67 Eigen::VectorXi weights;
68 Eigen::VectorXd buffer;
69 void updatePenalty(
const std::vector<double>& coordinate)
71 void averagePenaltyFunctions();
73 PenaltyMPI(
const json& j,
Space& spc,
const MPI::Controller& mpi);
nlohmann::json json
JSON object.
Definition: json_support.h:10
size_t number_of_reaction_coordinates
number of reaction coordinate
Definition: penalty.h:34
bool avoid_energy_drift
avoid energy drift when upgrading penalty function
Definition: penalty.h:33
sum_of_energy_increments is the total change of updating the energy function.
Definition: penalty.h:17
Table< double > penalty_energy
penalty energy as a function of coordinates
Definition: penalty.h:47
Table< unsigned int > histogram
count how often a reaction coordinate is visited
Definition: penalty.h:46
size_t number_of_steps_between_updates
update frequency [steps]
Definition: penalty.h:36
~Penalty() override
destruct and save to disk (!)
Definition: penalty.cpp:78
double sum_of_energy_increments
total energy change of updating penalty function
Definition: penalty.h:39
std::vector< double > latest_coordinate
latest reaction coordinate (length = 1 or 2)
Definition: penalty.h:44
std::vector< Tcoord > reaction_coordinates_functions
vector of reaction coordinate functions (length = 1 or 2)
Definition: penalty.h:42
void logBarrierInformation() const
Add barrier information to output log.
Definition: penalty.cpp:176
void sync(EnergyTerm *other, const Change &change) override
Called when a move is accepted or rejected, as well as when initializing the system.
Definition: penalty.cpp:187
void streamPenaltyFunction(std::ostream &stream) const
Stream penalty function, offset with the minimum observed energy.
Definition: penalty.cpp:86
All energies inherit from this class.
Definition: externalpotential.h:21
Specify changes made to a system.
Definition: space.h:29
double energy_increment_scaling_factor
scaling factor for f0
Definition: penalty.h:40
double energy(const Change &change) override
energy due to change
Definition: penalty.cpp:129
Placeholder for atoms and molecules.
Definition: space.h:92
bool verbose
kæft op?
Definition: penalty.h:32
double energy_increment
penalty increment
Definition: penalty.h:41
size_t update_counter
number of calls to sync()
Definition: penalty.h:35