Loading...
Searching...
No Matches
EigenmodeStrategy.cpp
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
14#include "eon/Davidson.h"
15#include "eon/Dimer.h"
16#include "eon/ImprovedDimer.h"
17#include "eon/Lanczos.h"
18#include "eon/Parameters.h"
19#include <stdexcept>
20
21#ifdef WITH_RGSADDLE
22#include "eon/XtsciMinMode.h"
23#endif
24
25#ifdef WITH_GPRD
26#include "eon/AtomicGPDimer.h"
27#endif
28
29namespace eonc {
30
31std::shared_ptr<LowestEigenmode>
32buildEigenmodeStrategy(std::shared_ptr<Matter> matter, const Parameters &params,
33 std::shared_ptr<Potential> pot) {
36#ifdef WITH_RGSADDLE
37 return std::make_shared<XtsciMinMode>(matter, params, pot);
38#else
39 if (params.dimer_options().improved) {
40 return std::make_shared<ImprovedDimer>(matter, params, pot);
41 }
42 return std::make_shared<Dimer>(matter, params, pot);
43#endif
44 }
47#ifdef WITH_RGSADDLE
48 return std::make_shared<XtsciMinMode>(matter, params, pot);
49#else
50 return std::make_shared<Lanczos>(matter, params, pot);
51#endif
52 }
55 return std::make_shared<Davidson>(matter, params, pot);
56 }
59#ifdef WITH_RGSADDLE
60 return std::make_shared<XtsciMinMode>(matter, params, pot);
61#else
62 throw std::runtime_error(
63 "min_mode_method=xtsci requires -Dwith_rgsaddle=true");
64#endif
65 }
68#ifdef WITH_GPRD
69 return std::make_shared<AtomicGPDimer>(matter, params, pot);
70#else
71 throw std::runtime_error(
72 "min_mode_method=gprdimer needs a -Dwith_gprd build with the private "
73 "gpr_optim repository checked out in subprojects/gpr_optim "
74 "(rsync -a ../gpr_optim/ subprojects/gpr_optim/, then reconfigure)");
75#endif
76 }
77 return std::make_shared<ImprovedDimer>(matter, params, pot);
78}
79
80} // namespace eonc
static const char MINMODE_GPRDIMER[]
static const char MINMODE_DIMER[]
static const char MINMODE_LANCZOS[]
static const char MINMODE_DAVIDSON[]
static const char MINMODE_XTSCI[]
const dimer_options_t & dimer_options() const
const saddle_search_options_t & saddle_search_options() const
RAII resource manager for the ARTn C library with global synchronization.
std::shared_ptr< LowestEigenmode > buildEigenmodeStrategy(std::shared_ptr< Matter > matter, const Parameters &params, std::shared_ptr< Potential > pot)