2#ifndef STORMM_PPI_TABLE_H
3#define STORMM_PPI_TABLE_H
7#include "Constants/behavior.h"
8#include "Constants/symbol_values.h"
9#include "DataTypes/common_types.h"
10#include "Math/log_scale_spline.h"
11#include "Math/math_enumerators.h"
12#include "Parsing/parsing_enumerators.h"
13#include "energy_enumerators.h"
19using constants::ExceptionResponse;
20using constants::PrecisionModel;
21using symbols::amber_ancient_bioq;
23using card::HybridKind;
24using card::HybridTargetLevel;
25using parse::NumberFormat;
26using stmath::BasisFunctions;
27using stmath::LogScaleSpline;
28using stmath::LogSplineForm;
29using stmath::LogSplineTable;
30using stmath::TableIndexing;
31using stmath::doublePrecisionSplineDetailMask;
32using stmath::singlePrecisionSplineDetailMask;
37template <
typename T,
typename T4>
struct PPIKit {
40 PPIKit(NonbondedTheme theme_in, BasisFunctions basis_in, TableIndexing lookup_in,
41 int index_bound_in,
int excl_offset_in,
int index_shift_bits_in, ullint dp_detail_mask_in,
42 uint sp_detail_mask_in, T arg_offset_in,
const T4* energy_in,
const T4* force_in,
43 const T4* energy_excl_in,
const T4* force_excl_in);
93 PPIeKit(NonbondedTheme theme_in, BasisFunctions basis_in, TableIndexing lookup_in,
94 int index_bound_in,
int excl_offset_in,
int index_shift_bits_in,
95 ullint dp_detail_mask_in, uint sp_detail_mask_in, T arg_offset_in,
const T* energy_x_in,
96 const T* energy_y_in,
const T* energy_z_in,
const T* energy_w_in,
const T* force_x_in,
97 const T* force_y_in,
const T* force_z_in,
const T* force_w_in,
const T* energy_excl_x_in,
98 const T* energy_excl_y_in,
const T* energy_excl_z_in,
const T* energy_excl_w_in,
99 const T* force_excl_x_in,
const T* force_excl_y_in,
const T* force_excl_z_in,
100 const T* force_excl_w_in);
170 PPITable(NonbondedTheme theme_in = NonbondedTheme::ELECTROSTATIC,
171 BasisFunctions basis_set_in = BasisFunctions::POLYNOMIAL,
172 TableIndexing indexing_method_in = TableIndexing::SQUARED_ARG,
173 double cutoff_in = default_pme_cutoff,
double argument_offset_in = 0.0,
174 double dsum_tol_in = default_dsum_tol,
int mantissa_bits_in = 5,
175 double coulomb_in = amber_ancient_bioq,
double min_range_in = 0.015625);
177 template <
typename T4>
180 double cutoff_in = default_pme_cutoff);
182 template <
typename T4>
186 template <
typename T4>
189 template <
typename T4>
234 int getTableIndex(
double arg, PrecisionModel prec = PrecisionModel::SINGLE)
const;
256 double evaluate(
double arg, LogSplineForm kind, PrecisionModel prec = PrecisionModel::SINGLE,
257 bool use_elemental_tables =
false)
const;
263 PrecisionModel prec = PrecisionModel::SINGLE,
264 bool use_elemental_tables =
false)
const;
300 NonbondedTheme theme;
302 BasisFunctions basis_set;
303 TableIndexing indexing_method;
312 double argument_offset;
323 int dp_exclusion_offset;
326 int sp_exclusion_offset;
329 ullint dp_detail_bitmask;
331 uint sp_detail_bitmask;
461 template <
typename T4> std::vector<LogScaleSpline<T4>> buildAllSplineTables()
const;
469 template <
typename T4>
477 template <
typename T4>
485 template <
typename T4>
493 template <
typename T4>
517 LogSplineForm findMissingForm(
const uint holdings)
const;
529 template <
typename T4>
534 template <
typename T4>
538 template <
typename T4>
549 template <
typename T4>
557#include "ppitable.tpp"
An evolution of GpuBuffer in pmemd.cuda, the Composite array has elements that are accessible from ei...
Definition hybrid.h:202
const PPIeKit< float > speData(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the single-precision abstract for use of the splines in a C programming style,...
Definition ppitable.cpp:356
double getMaximumRange() const
Get the maximum range of the spline.
Definition ppitable.cpp:103
double getEwaldCoefficient() const
Get the Ewald coefficient used to perform the switching between short- and long-ranged potentials.
Definition ppitable.cpp:123
double getIndexingOffset() const
Get the indexing argument offset, consistent across all tables.
Definition ppitable.cpp:108
const PPIKit< double, double4 > dpData(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the double-precision abstract for use of the splines in a C programming style.
Definition ppitable.cpp:319
const PPIeKit< double > dpeData(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the double-precision abstract for use of the splines in a C programming style,...
Definition ppitable.cpp:341
int getTableIndexByRealArg(double arg, PrecisionModel prec=PrecisionModel::SINGLE) const
Get the spline index that would be accessed in order to evaluate a given argument.
Definition ppitable.cpp:304
const PPIKit< float, float4 > spData(HybridTargetLevel tier=HybridTargetLevel::HOST) const
Get the single-precision abstract for use of the splines in a C programming style.
Definition ppitable.cpp:330
int getTableIndex(double arg, PrecisionModel prec=PrecisionModel::SINGLE) const
Get the spline index that would be accessed in order to evaluate a given argument.
Definition ppitable.cpp:284
PPITable(NonbondedTheme theme_in=NonbondedTheme::ELECTROSTATIC, BasisFunctions basis_set_in=BasisFunctions::POLYNOMIAL, TableIndexing indexing_method_in=TableIndexing::SQUARED_ARG, double cutoff_in=default_pme_cutoff, double argument_offset_in=0.0, double dsum_tol_in=default_dsum_tol, int mantissa_bits_in=5, double coulomb_in=amber_ancient_bioq, double min_range_in=0.015625)
The constuctor can accept all of the arguments that might be useful for making a LosScaleSpline,...
Definition ppitable.cpp:11
PPITable(const PPITable &original)
The presence of POINTER-kind Hybrid objects implies pointer repairs that require the copy and move co...
double getGaussianWidth() const
Get the Gaussian RMS sigma parameter (one half the inverse of the Ewald coefficient) used to perform ...
Definition ppitable.cpp:128
double evaluate(double arg, LogSplineForm kind, PrecisionModel prec=PrecisionModel::SINGLE, bool use_elemental_tables=false) const
Evaluate the spline table at a given inter-particle distance expressed in the manner used for the cla...
Definition ppitable.cpp:133
int getBitStride() const
Get the number of bits of the mantissa used for table indexing.
Definition ppitable.cpp:118
double getDirectSumTolerance() const
Get the direct sum tolerance.
Definition ppitable.cpp:113
double evaluateByRealArg(double arg, LogSplineForm kind, PrecisionModel prec=PrecisionModel::SINGLE, bool use_elemental_tables=false) const
Evaluate the spline table at a given inter-particle distance expressed as the absolute value of the d...
Definition ppitable.cpp:266
NonbondedTheme getTheme() const
Get the non-bonded potential described by an object of this class.
Definition ppitable.cpp:93
double getCutoff() const
Get the cutoff on particle-particle interactions.
Definition ppitable.cpp:98
A logarithmic spline can be very useful for interpolating functions that are steepest at low values o...
Definition log_scale_spline.h:139
Abstract for the particle-particle interaction table, with pointers to energies and forces and sizing...
Definition ppitable.h:37
const T4 * energy_excl
Table of excluded energy coefficients.
Definition ppitable.h:83
const uint sp_detail_mask
Definition ppitable.h:71
const NonbondedTheme theme
Definition ppitable.h:54
PPIKit(NonbondedTheme theme_in, BasisFunctions basis_in, TableIndexing lookup_in, int index_bound_in, int excl_offset_in, int index_shift_bits_in, ullint dp_detail_mask_in, uint sp_detail_mask_in, T arg_offset_in, const T4 *energy_in, const T4 *force_in, const T4 *energy_excl_in, const T4 *force_excl_in)
The constructor takes the customary list of pointers and critical constants.
PPIKit(const PPIKit &original)=default
With all const members, the copy and move assignment operators are implicitly deleted,...
const int index_shift_bits
Definition ppitable.h:65
const TableIndexing lookup
Definition ppitable.h:58
const int index_bound
Definition ppitable.h:60
const T4 * force_excl
Table of excluded force coefficients.
Definition ppitable.h:84
const T4 * energy
Definition ppitable.h:76
const T4 * force
Definition ppitable.h:80
const ullint dp_detail_mask
Definition ppitable.h:68
const T arg_offset
Definition ppitable.h:74
const BasisFunctions basis
Definition ppitable.h:56
const int excl_offset
Definition ppitable.h:62
An equivalent abstract which delivers the tabulated data with all tuples broken into separate arrays ...
Definition ppitable.h:90
const T * force_x
Definition ppitable.h:140
const int excl_offset
Definition ppitable.h:119
const T * force_z
Table of force function spline z coefficients.
Definition ppitable.h:144
const T * force_excl_x
Excluded interation energy function spline x coefficients.
Definition ppitable.h:150
const T * energy_excl_x
Excluded interation energy function spline x coefficients.
Definition ppitable.h:146
const T * force_excl_z
Excluded interation energy function spline z coefficients.
Definition ppitable.h:152
const T * energy_excl_z
Excluded interation energy function spline z coefficients.
Definition ppitable.h:148
const T * energy_w
Table of energy function spline w coefficients.
Definition ppitable.h:139
const T * force_w
Table of force function spline w coefficients.
Definition ppitable.h:145
const T * energy_z
Table of energy function spline z coefficients.
Definition ppitable.h:138
const T * energy_y
Table of energy function spline y coefficients.
Definition ppitable.h:137
const T * energy_excl_w
Excluded interation energy function spline w coefficients.
Definition ppitable.h:149
PPIeKit(const PPIeKit &original)=default
With all const members, the copy and move assignment operators are implicitly deleted,...
const T * energy_x
Definition ppitable.h:133
const int index_shift_bits
Definition ppitable.h:122
const T * force_excl_y
Excluded interation energy function spline y coefficients.
Definition ppitable.h:151
const ullint dp_detail_mask
Definition ppitable.h:125
const T arg_offset
Definition ppitable.h:131
const T * energy_excl_y
Excluded interation energy function spline y coefficients.
Definition ppitable.h:147
const BasisFunctions basis
Definition ppitable.h:113
const TableIndexing lookup
Definition ppitable.h:115
const NonbondedTheme theme
Definition ppitable.h:111
const T * force_excl_w
Excluded interation energy function spline w coefficients.
Definition ppitable.h:153
const T * force_y
Table of force function spline y coefficients.
Definition ppitable.h:143
const uint sp_detail_mask
Definition ppitable.h:128
PPIeKit(NonbondedTheme theme_in, BasisFunctions basis_in, TableIndexing lookup_in, int index_bound_in, int excl_offset_in, int index_shift_bits_in, ullint dp_detail_mask_in, uint sp_detail_mask_in, T arg_offset_in, const T *energy_x_in, const T *energy_y_in, const T *energy_z_in, const T *energy_w_in, const T *force_x_in, const T *force_y_in, const T *force_z_in, const T *force_w_in, const T *energy_excl_x_in, const T *energy_excl_y_in, const T *energy_excl_z_in, const T *energy_excl_w_in, const T *force_excl_x_in, const T *force_excl_y_in, const T *force_excl_z_in, const T *force_excl_w_in)
The constructor takes the customary list of pointers and critical constants.
const int index_bound
Definition ppitable.h:117