apoCHARMM 1.0.0
High-performance molecular dynamics simulations on GPUs
 
Loading...
Searching...
No Matches
VdwParamsAndTypes Struct Reference

Stores host-side Lennard-Jones pair tables and per-atom type indices. More...

#include <CharmmParameters.h>

Public Member Functions

 VdwParamsAndTypes (const std::vector< float > &vdwParams, const std::vector< float > &vdw14Params, const std::vector< int > &vdwTypes, const std::vector< int > &vdw14Types)
 Constructs packed Lennard-Jones data by copying all inputs.
 

Public Attributes

std::vector< float > vdwParams
 
std::vector< int > vdwTypes
 

Detailed Description

Stores host-side Lennard-Jones pair tables and per-atom type indices.

For N distinct PSF atom types, both coefficient arrays contain N * (N + 1) floats. Distinct types are assigned ascending lexicographic indices. Pair (i, j), where 0 <= j <= i < N, starts at float offset 2 * (i * (i + 1) / 2 + j) and stores [C6, C12], with units [kcal mol^-1 angstrom^6, kcal mol^-1 angstrom^12]. vdwTypes and vdw14Types contain one zero-based type index per PSF atom; the current implementation produces identical type-index arrays.

All storage is owned host memory. ForceManager later copies these arrays to the direct-space CUDA force object.

Constructor & Destructor Documentation

◆ VdwParamsAndTypes()

VdwParamsAndTypes::VdwParamsAndTypes ( const std::vector< float > &  vdwParams,
const std::vector< float > &  vdw14Params,
const std::vector< int > &  vdwTypes,
const std::vector< int > &  vdw14Types 
)
inline

Constructs packed Lennard-Jones data by copying all inputs.

Parameters
[in]vdwParamsFlattened regular [C6, C12] pair table in [kcal mol^-1 angstrom^6, kcal mol^-1 angstrom^12] units.
[in]vdw14ParamsFlattened 1-4 [C6, C12] pair table in the same units.
[in]vdwTypesPer-atom regular type indices.
[in]vdw14TypesPer-atom 1-4 type indices.
Postcondition
The object owns independent copies of all four inputs.
Exceptions
std::bad_allocIf copying the host arrays requires an allocation that fails.
Note
The constructor does not validate lengths or type indices.

Member Data Documentation

◆ vdwParams

std::vector<float> VdwParamsAndTypes::vdwParams

Stores regular and 1-4 flattened pair coefficients in [C6, C12] order.

◆ vdwTypes

std::vector<int> VdwParamsAndTypes::vdwTypes

Stores regular and 1-4 zero-based type indices for every PSF atom.