eOn 3.2.0
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
ObjectiveFunction.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
14
#include "
Matter.h
"
15
16
#include <optional>
17
18
namespace
eonc
{
19
20
class
ObjectiveFunction
{
21
protected
:
22
const
Parameters
&
params
;
23
24
public
:
25
ObjectiveFunction
(
const
Parameters
¶msPassed) :
params
{paramsPassed} {}
26
virtual
~ObjectiveFunction
() {}
27
virtual
double
getEnergy
() = 0;
28
virtual
VectorXd
getGradient
(
bool
fdstep =
false
) = 0;
29
virtual
void
setPositions
(
const
VectorXd &x) = 0;
30
virtual
VectorXd
getPositions
() = 0;
31
virtual
int
degreesOfFreedom
() = 0;
32
virtual
bool
isConverged
() = 0;
33
virtual
double
getConvergence
() = 0;
34
virtual
VectorXd
difference
(
const
VectorXd &a,
const
VectorXd &b) = 0;
35
// Allow the initial finite-difference curvature estimate used by L-BFGS.
36
virtual
bool
supportsFiniteDifferenceCurvature
()
const
{
return
true
; }
37
// A curvature the objective already knows (eV / A^2, magnitude), so
38
// L-BFGS can seed H0 from it instead of spending a force call on the
39
// finite-difference probe. Empty when nothing is known.
40
virtual
std::optional<double>
knownCurvature
()
const
{
return
std::nullopt; }
41
// Packwood/Kermode pair preconditioner: MIC of one Cartesian pair.
42
// Default leaves dr unchanged (no cell).
43
virtual
void
minimumImage
(Eigen::Ref<Eigen::Vector3d>
/*dr*/
)
const
{}
44
// Per-atom masses of the free atoms (length N, not 3N). Empty if unknown.
45
virtual
VectorXd
getMasses
()
const
{
return
VectorXd(); }
46
// True when the geometry uses periodic boundaries (Sella proj_rot off).
47
virtual
bool
getPeriodic
()
const
{
return
false
; }
48
};
49
50
}
// namespace eonc
Matter.h
eonc::ObjectiveFunction::supportsFiniteDifferenceCurvature
virtual bool supportsFiniteDifferenceCurvature() const
Definition
ObjectiveFunction.h:36
eonc::ObjectiveFunction::~ObjectiveFunction
virtual ~ObjectiveFunction()
Definition
ObjectiveFunction.h:26
eonc::ObjectiveFunction::getGradient
virtual VectorXd getGradient(bool fdstep=false)=0
eonc::ObjectiveFunction::difference
virtual VectorXd difference(const VectorXd &a, const VectorXd &b)=0
eonc::ObjectiveFunction::ObjectiveFunction
ObjectiveFunction(const Parameters ¶msPassed)
Definition
ObjectiveFunction.h:25
eonc::ObjectiveFunction::getMasses
virtual VectorXd getMasses() const
Definition
ObjectiveFunction.h:45
eonc::ObjectiveFunction::getPeriodic
virtual bool getPeriodic() const
Definition
ObjectiveFunction.h:47
eonc::ObjectiveFunction::isConverged
virtual bool isConverged()=0
eonc::ObjectiveFunction::params
const Parameters & params
Definition
ObjectiveFunction.h:22
eonc::ObjectiveFunction::getPositions
virtual VectorXd getPositions()=0
eonc::ObjectiveFunction::knownCurvature
virtual std::optional< double > knownCurvature() const
Definition
ObjectiveFunction.h:40
eonc::ObjectiveFunction::setPositions
virtual void setPositions(const VectorXd &x)=0
eonc::ObjectiveFunction::getEnergy
virtual double getEnergy()=0
eonc::ObjectiveFunction::getConvergence
virtual double getConvergence()=0
eonc::ObjectiveFunction::degreesOfFreedom
virtual int degreesOfFreedom()=0
eonc::ObjectiveFunction::minimumImage
virtual void minimumImage(Eigen::Ref< Eigen::Vector3d >) const
Definition
ObjectiveFunction.h:43
eonc::Parameters
Definition
Parameters.h:35
eonc
RAII resource manager for the ARTn C library with global synchronization.
Definition
ARTnSaddleSearch.cpp:23
include
eon
ObjectiveFunction.h
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf