Loading...
Searching...
No Matches
HessianRange.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
22
23#include <cmath>
24
25#include "rgpot/LennardJones/LJClusterPot.hpp"
26#include "rgpot/LennardJones/LJPot.hpp"
27#include "rgpot/Morse/MorsePot.hpp"
28#include "rgpot/ZBL/ZBLPot.hpp"
29#include "rgpot/fortran/FortranPots.hpp"
30
31#if defined(__has_include) && __has_include("rgpot/UmaPot/UmaPot.hpp")
32#include "rgpot/UmaPot/UmaPot.hpp"
33#endif
34#if defined(__has_include) && __has_include("rgpot/Water/WaterPots.hpp")
35#include "rgpot/Water/WaterPots.hpp"
36#endif
37#if defined(__has_include) && __has_include("rgpot/EAM/EAMPot.hpp")
38#include "rgpot/EAM/EAMPot.hpp"
39#endif
40#if defined(__has_include) && __has_include("rgpot/EMT/EMTPot.hpp")
41#include "rgpot/EMT/EMTPot.hpp"
42#endif
43
44namespace eonc {
45
63
69template <class RPot> struct HessianRangeOf {
74 static constexpr double interactionCutoff = 0.0;
75 static constexpr double range(const RPot &) noexcept { return 0.0; }
76};
77
79[[nodiscard]] inline double acceptedHessianRange(double range) noexcept {
80 if (!(range > 0.0) || !std::isfinite(range)) {
81 return 0.0;
82 }
83 return range;
84}
85
86template <> struct HessianRangeOf<rgpot::LJPot> {
90 static constexpr double interactionCutoff = 0.0;
91 static double range(const rgpot::LJPot &pot) noexcept {
92 return pot.config().cutoff;
93 }
94};
95
96template <> struct HessianRangeOf<rgpot::LJClusterPot> {
100 static constexpr double interactionCutoff = 0.0;
101 static double range(const rgpot::LJClusterPot &pot) noexcept {
102 return pot.config().cutoff;
103 }
104};
105
106template <> struct HessianRangeOf<rgpot::MorsePot> {
110 static constexpr double interactionCutoff = 0.0;
111 static double range(const rgpot::MorsePot &pot) noexcept {
112 return pot.config().cutoff;
113 }
114};
115
118template <> struct HessianRangeOf<rgpot::ZBLPot> {
121 static constexpr double interactionCutoff = 0.0;
122 static double range(const rgpot::ZBLPot &pot) noexcept {
123 return pot.config().cut_global;
124 }
125};
126
130template <> struct HessianRangeOf<rgpot::fortranpots::EAMAlPot> {
132 static constexpr double interactionCutoff = 7.1;
133 static constexpr double range(const rgpot::fortranpots::EAMAlPot &) noexcept {
134 return 2.0 * interactionCutoff;
135 }
136};
137
141template <> struct HessianRangeOf<rgpot::fortranpots::SWPot> {
143 static constexpr double kSigma = 2.0951;
144 static constexpr double kAlpha = 1.8;
145 static constexpr double interactionCutoff = kAlpha * kSigma;
146 static constexpr double range(const rgpot::fortranpots::SWPot &) noexcept {
147 return 2.0 * interactionCutoff;
148 }
149};
150
153template <> struct HessianRangeOf<rgpot::fortranpots::TersoffPot> {
155 static constexpr double interactionCutoff = 3.0;
156 static constexpr double
157 range(const rgpot::fortranpots::TersoffPot &) noexcept {
158 return 2.0 * interactionCutoff;
159 }
160};
161
165template <> struct HessianRangeOf<rgpot::fortranpots::EDIPPot> {
167 static constexpr double interactionCutoff = 3.1213820;
168 static constexpr double range(const rgpot::fortranpots::EDIPPot &) noexcept {
169 return 2.0 * interactionCutoff;
170 }
171};
172
175template <> struct HessianRangeOf<rgpot::fortranpots::LenoskyPot> {
177 static constexpr double interactionCutoff = 4.5;
178 static constexpr double
179 range(const rgpot::fortranpots::LenoskyPot &) noexcept {
180 return 2.0 * interactionCutoff;
181 }
182};
183
189template <> struct HessianRangeOf<rgpot::fortranpots::FeHePot> {
191 static constexpr double kMaxPair = 5.4;
192 static constexpr double kMaxDensity = 4.2;
194 static constexpr double interactionCutoff = kMaxPair;
195 static constexpr double range(const rgpot::fortranpots::FeHePot &) noexcept {
196 return kMaxPair > 2.0 * kMaxDensity ? kMaxPair : 2.0 * kMaxDensity;
197 }
198};
199
202template <> struct HessianRangeOf<rgpot::fortranpots::CuH2Pot> {
204 static constexpr double interactionCutoff = 6.1;
205 static constexpr double range(const rgpot::fortranpots::CuH2Pot &) noexcept {
206 return 2.0 * interactionCutoff;
207 }
208};
209
212template <> struct HessianRangeOf<rgpot::fortranpots::WaterHPot> {
214 static constexpr double interactionCutoff = 0.0;
215 static constexpr double
216 range(const rgpot::fortranpots::WaterHPot &) noexcept {
217 return 0.0;
218 }
219};
220
221#if defined(__has_include) && __has_include("rgpot/UmaPot/UmaPot.hpp")
225template <> struct HessianRangeOf<rgpot::UmaPot> {
227 static constexpr double interactionCutoff = 0.0;
228 static constexpr double range(const rgpot::UmaPot &) noexcept { return 0.0; }
229};
230#endif
231
232#if defined(__has_include) && __has_include("rgpot/Water/WaterPots.hpp")
239template <> struct HessianRangeOf<rgpot::TIP4PPot> {
241 static constexpr double interactionCutoff = 0.0;
242 static constexpr double range(const rgpot::TIP4PPot &) noexcept {
243 return 0.0;
244 }
245};
246
247template <> struct HessianRangeOf<rgpot::SPCEPot> {
249 static constexpr double interactionCutoff = 0.0;
250 static constexpr double range(const rgpot::SPCEPot &) noexcept {
251 return 0.0;
252 }
253};
254
255template <> struct HessianRangeOf<rgpot::TIP4PPtPot> {
257 static constexpr double interactionCutoff = 0.0;
258 static constexpr double range(const rgpot::TIP4PPtPot &) noexcept {
259 return 0.0;
260 }
261};
262#endif
263
264#if defined(__has_include) && __has_include("rgpot/EAM/EAMPot.hpp")
268template <> struct HessianRangeOf<rgpot::EAMPot> {
270 static constexpr double interactionCutoff = 5.555;
271 static constexpr double range(const rgpot::EAMPot &) noexcept {
272 return 2.0 * interactionCutoff;
273 }
274};
275#endif
276
277#if defined(__has_include) && __has_include("rgpot/EMT/EMTPot.hpp")
282template <> struct HessianRangeOf<rgpot::EMTPot> {
284 static constexpr double interactionCutoff = 0.0;
285 static constexpr double range(const rgpot::EMTPot &) noexcept { return 0.0; }
286};
287#endif
288
289} // namespace eonc
RAII resource manager for the ARTn C library with global synchronization.
double acceptedHessianRange(double range) noexcept
Drop a non-positive or non-finite range so coloring stays off.
HessianLocality
How a kernel's energy couples atoms, which fixes the Hessian range.
@ Unknown
No proven finite range. Coloring stays off.
@ AtomCentred
Atom-centred many-body (EAM, Gupta, bond order, three-body).
@ MolecularSite
Molecular site model.
@ Pair
Pair potential. Blocks vanish beyond the interaction cutoff.
@ MessagePassing
Message passing.
static double range(const rgpot::LJClusterPot &pot) noexcept
static constexpr double interactionCutoff
config().cutoff is chosen per potential, so there is no compile-time cutoff.
static constexpr HessianLocality locality
static constexpr HessianLocality locality
static constexpr double interactionCutoff
config().cutoff is chosen per potential, so there is no compile-time cutoff.
static double range(const rgpot::LJPot &pot) noexcept
static constexpr HessianLocality locality
static double range(const rgpot::MorsePot &pot) noexcept
static constexpr double interactionCutoff
config().cutoff is chosen per potential, so there is no compile-time cutoff.
static double range(const rgpot::ZBLPot &pot) noexcept
static constexpr HessianLocality locality
static constexpr double interactionCutoff
cut_global is a config field. range() returns that runtime value.
static constexpr double range(const rgpot::fortranpots::CuH2Pot &) noexcept
static constexpr double range(const rgpot::fortranpots::EAMAlPot &) noexcept
static constexpr double range(const rgpot::fortranpots::EDIPPot &) noexcept
static constexpr double range(const rgpot::fortranpots::FeHePot &) noexcept
static constexpr double interactionCutoff
Neighbour-table cutoff, fehe_cutoff(). The block range is wider.
static constexpr double range(const rgpot::fortranpots::LenoskyPot &) noexcept
static constexpr double range(const rgpot::fortranpots::SWPot &) noexcept
static constexpr HessianLocality locality
static constexpr double range(const rgpot::fortranpots::TersoffPot &) noexcept
static constexpr double range(const rgpot::fortranpots::WaterHPot &) noexcept
Reported Hessian range for one rgpot kernel type.
static constexpr double range(const RPot &) noexcept
static constexpr HessianLocality locality
static constexpr double interactionCutoff
Interaction cutoff the range is built from.