STORMM Source Documentation
Loading...
Searching...
No Matches
soft_core_potentials.h
1// -*-c++-*-
2#ifndef STORMM_SOFT_CORE_POTENTIALS_H
3#define STORMM_SOFT_CORE_POTENTIALS_H
4
5#include <cmath>
6#include "copyright.h"
7#include "Accelerator/hybrid.h"
8#include "Constants/scaling.h"
9#include "DataTypes/common_types.h"
10#include "Math/matrix_ops.h"
11#include "Parsing/parse.h"
12#include "Parsing/polynumeric.h"
13#include "energy_enumerators.h"
14
15namespace stormm {
16namespace energy {
17
18using card::Hybrid;
19using parse::NumberFormat;
20using parse::realToString;
21using stmath::invertSquareMatrix;
22using stmath::matrixVectorMultiply;
23using stmath::qrSolver;
24
26constexpr int max_quartic_spline_count = 64;
27
42template <typename Tcalc>
43void linearCoreElectrostatics(const Tcalc r, const Tcalc clash_distance, const Tcalc qiqj,
44 Tcalc *ele_contrib, Tcalc *fmag = nullptr);
45
54template <typename Tcalc>
55void quadraticCoreElectrostatics(const Tcalc r, const Tcalc clash_distance, const Tcalc qiqj,
56 Tcalc *ele_contrib, Tcalc *fmag = nullptr);
57
62template <typename Tcalc>
63void cubicCoreElectrostatics(const Tcalc r, const Tcalc clash_distance, const Tcalc qiqj,
64 Tcalc *ele_contrib, Tcalc *fmag = nullptr);
65
81template <typename Tcalc>
82void cubicCoreLennardJones(const Tcalc r, const Tcalc clash_ratio, const Tcalc lja,
83 const Tcalc ljb, Tcalc *vdw_contrib, Tcalc *fmag = nullptr);
84
90template <typename Tcalc>
91void quarticCoreLennardJones(const Tcalc r, const Tcalc clash_ratio, const Tcalc lja,
92 const Tcalc ljb, Tcalc *vdw_contrib, Tcalc *fmag = nullptr);
93
106void adjustIntervalTarget(std::vector<double> *interval_targets, int index, double f_rswitch,
107 double target_zero, double move_increment);
108
114double evaluateQuarticFirstDerivative(const double4 coeffs, double r);
115
133template <typename Tcalc4>
134void cubicSoftCore(Tcalc4* abcd_coefficients, double rswitch, double f_rswitch, double df_rswitch,
135 double target_zero = 0.0);
136
151template <typename Tcalc4, typename Tcalc>
152void quarticSoftCore(Tcalc4* abcd_coefficients, Tcalc* e_coefficient, double rswitch,
153 double f_rswitch, double df_rswitch, double d2f_rswitch,
154 double target_zero = 0.0);
155
172template <typename Tcalc4, typename Tcalc2>
173void quinticSoftCore(Tcalc4* abcd_coefficients, Tcalc2* ef_coefficients, double rswitch,
174 double f_rswitch, double df_rswitch, double d2f_rswitch, double d3f_rswitch,
175 double target_zero = 0.0);
176
193template <typename Tcalc4>
194void exponentialSoftCore(Tcalc4 *abcd_coefficients, double v, double rswitch, double f_rswitch,
195 double df_rswitch, double d2f_rswitch, double d3f_rswitch);
196
197} // namespace energy
198} // namespace stormm
199
200#include "soft_core_potentials.tpp"
201
202#endif