ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
TabulatedPotential Struct Reference

Evaluate forces and energies using a custom potential profile. More...

#include <TabulatedPotential.hpp>

+ Collaboration diagram for TabulatedPotential:

Public Member Functions

 TabulatedPotential ()=default
 
 TabulatedPotential (double minval, double maxval, std::vector< double > const &force, std::vector< double > const &energy)
 
double force (double x) const
 Evaluate the force at position x.
 
double energy (double x) const
 Evaluate the energy at position x.
 
double cutoff () const
 

Public Attributes

double minval = -1.0
 Position on the x-axis of the first tabulated value.
 
double maxval = -1.0
 Position on the x-axis of the last tabulated value.
 
double invstepsize = 0.0
 Distance on the x-axis between tabulated values.
 
std::vector< double > force_tab
 Tabulated forces.
 
std::vector< double > energy_tab
 Tabulated energies.
 

Detailed Description

Evaluate forces and energies using a custom potential profile.

Forces and energies are evaluated by linear interpolation. The curves force_tab and energy_tab must be sampled uniformly between minval and maxval.

Definition at line 36 of file TabulatedPotential.hpp.

Constructor & Destructor Documentation

◆ TabulatedPotential() [1/2]

TabulatedPotential::TabulatedPotential ( )
default

◆ TabulatedPotential() [2/2]

TabulatedPotential::TabulatedPotential ( double  minval,
double  maxval,
std::vector< double > const &  force,
std::vector< double > const &  energy 
)

Definition at line 27 of file TabulatedPotential.cpp.

References energy(), energy_tab, force, force_tab, invstepsize, maxval, and minval.

Member Function Documentation

◆ cutoff()

double TabulatedPotential::cutoff ( ) const
inline

◆ energy()

double TabulatedPotential::energy ( double  x) const
inline

Evaluate the energy at position x.

Parameters
xBond length/angle
Returns
Interpolated energy.

Definition at line 66 of file TabulatedPotential.hpp.

References energy_tab, invstepsize, Utils::linear_interpolation(), maxval, and minval.

Referenced by tabulated_pair_energy(), and TabulatedPotential().

◆ force()

double TabulatedPotential::force ( double  x) const
inline

Evaluate the force at position x.

Parameters
xBond length/angle
Returns
Interpolated force.

Definition at line 57 of file TabulatedPotential.hpp.

References force_tab, invstepsize, Utils::linear_interpolation(), maxval, and minval.

Referenced by tabulated_pair_force_factor().

Member Data Documentation

◆ energy_tab

std::vector<double> TabulatedPotential::energy_tab

◆ force_tab

std::vector<double> TabulatedPotential::force_tab

◆ invstepsize

double TabulatedPotential::invstepsize = 0.0

Distance on the x-axis between tabulated values.

Definition at line 42 of file TabulatedPotential.hpp.

Referenced by energy(), force(), and TabulatedPotential().

◆ maxval

double TabulatedPotential::maxval = -1.0

Position on the x-axis of the last tabulated value.

Definition at line 40 of file TabulatedPotential.hpp.

Referenced by cutoff(), energy(), force(), ScriptInterface::Interactions::InteractionTabulated::InteractionTabulated(), and TabulatedPotential().

◆ minval

double TabulatedPotential::minval = -1.0

Position on the x-axis of the first tabulated value.

Definition at line 38 of file TabulatedPotential.hpp.

Referenced by energy(), force(), ScriptInterface::Interactions::InteractionTabulated::InteractionTabulated(), and TabulatedPotential().


The documentation for this struct was generated from the following files: