Loading...
Searching...
No Matches
NEBSplineExtrema.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 "ConFileIO.h"
15#include "Eigen.h"
16#include "EigenmodeStrategy.h"
17#include "EonLogger.h"
18#include "Matter.h"
19#include <filesystem>
20#include <limits>
21#include <memory>
22#include <optional>
23#include <readcon-core.hpp>
24#include <string>
25#include <vector>
26
27namespace eonc::tunneling {
28struct BandWalls;
29}
30
31namespace eonc::neb {
32
34 long numExtrema{0};
35 std::vector<double> positions;
36 std::vector<double> energies;
37 std::vector<double> curvatures;
38};
39
42findSplineExtrema(const std::vector<std::shared_ptr<Matter>> &path,
43 const std::vector<std::shared_ptr<AtomMatrix>> &tangent,
44 long numImages);
45
48[[nodiscard]] AtomMatrix
49interpolatedPeakMode(const std::vector<std::shared_ptr<Matter>> &path,
50 const std::vector<std::shared_ptr<AtomMatrix>> &tangent,
51 long numImages, double posFraction);
52
55 const std::vector<std::shared_ptr<Matter>> &path,
56 const std::vector<std::shared_ptr<AtomMatrix>> &tangent,
57 const std::vector<std::shared_ptr<EigenmodeStrategy>> &eigenmode_solvers,
58 long numImages, bool estimateEigenvalues, bool writeToFile, size_t idx,
60 double referenceEnergy = std::numeric_limits<double>::quiet_NaN());
61
69[[nodiscard]] std::vector<readcon::ConFrame> pathToConFrames(
70 const std::vector<std::shared_ptr<Matter>> &path,
71 const std::vector<std::shared_ptr<AtomMatrix>> &tangent,
72 const std::vector<std::shared_ptr<EigenmodeStrategy>> &eigenmode_solvers,
73 long numImages, bool estimateEigenvalues,
74 std::optional<size_t> bandIndex = std::nullopt,
75 double referenceEnergy = std::numeric_limits<double>::quiet_NaN(),
76 const std::vector<double> *quantumFreeEnergy = nullptr,
77 const eonc::tunneling::BandWalls *walls = nullptr);
78
81 const std::vector<std::shared_ptr<Matter>> &path,
82 const std::vector<std::shared_ptr<AtomMatrix>> &tangent,
83 const std::vector<std::shared_ptr<EigenmodeStrategy>> &eigenmode_solvers,
84 long numImages, bool estimateEigenvalues, std::string filename,
85 std::optional<size_t> bandIndex = std::nullopt,
86 double referenceEnergy = std::numeric_limits<double>::quiet_NaN(),
87 const std::vector<double> *quantumFreeEnergy = nullptr,
88 const eonc::tunneling::BandWalls *walls = nullptr);
89
90} // namespace eonc::neb
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
Definition Eigen.h:37
IoStatus
Structured I/O result for the client surface (nanobind-friendly).
Definition ConFileIO.h:29
std::vector< readcon::ConFrame > pathToConFrames(const std::vector< std::shared_ptr< Matter > > &path, const std::vector< std::shared_ptr< AtomMatrix > > &tangent, const std::vector< std::shared_ptr< EigenmodeStrategy > > &eigenmode_solvers, long numImages, bool estimateEigenvalues, std::optional< size_t > bandIndex, double referenceEnergy, const std::vector< double > *quantumFreeEnergy, const eonc::tunneling::BandWalls *walls)
Build stamped ConFrames for a NEB band (same metadata as writePathCon).
AtomMatrix interpolatedPeakMode(const std::vector< std::shared_ptr< Matter > > &path, const std::vector< std::shared_ptr< AtomMatrix > > &tangent, long numImages, double posFraction)
Unit tangent at a fractional image index.
eonc::io::IoStatus writePathCon(const std::vector< std::shared_ptr< Matter > > &path, const std::vector< std::shared_ptr< AtomMatrix > > &tangent, const std::vector< std::shared_ptr< EigenmodeStrategy > > &eigenmode_solvers, long numImages, bool estimateEigenvalues, std::string filename, std::optional< size_t > bandIndex, double referenceEnergy, const std::vector< double > *quantumFreeEnergy, const eonc::tunneling::BandWalls *walls)
Write a NEB band as a multi-frame .con via readcon ConFrameBuilder::clone().
void printImageData(const std::vector< std::shared_ptr< Matter > > &path, const std::vector< std::shared_ptr< AtomMatrix > > &tangent, const std::vector< std::shared_ptr< EigenmodeStrategy > > &eigenmode_solvers, long numImages, bool estimateEigenvalues, bool writeToFile, size_t idx, eonc::log::Scoped log, double referenceEnergy)
Print NEB image data to log and optionally to file.
ExtremaResult findSplineExtrema(const std::vector< std::shared_ptr< Matter > > &path, const std::vector< std::shared_ptr< AtomMatrix > > &tangent, long numImages)
Find extrema along the MEP using cubic spline interpolation.
RAII helper for class-scoped logging.
Definition EonLogger.h:238
std::vector< double > energies
std::vector< double > curvatures
std::vector< double > positions