AutoPas  3.0.0
Loading...
Searching...
No Matches
Functions
LJPotential.h File Reference
#include "autopas/utils/ConstexprMath.h"
Include dependency graph for LJPotential.h:

Go to the source code of this file.

Functions

constexpr double calculateLJPotential (const std::array< double, 3 > &posI, const std::array< double, 3 > &posJ, double cutoff, double sigma, double epsilon)
 Calculates the potential energy between particle i and j using the Lennard Jones 12-6 potential.
 
constexpr std::array< double, 3 > calculateLJForce (const std::array< double, 3 > &posI, const std::array< double, 3 > &posJ, double cutoff, double sigma, double epsilon)
 Calculates the force exerted by particle j on particle i using the 12-6 potential of Lennard Jones.
 
constexpr std::array< double, 3 > calculateLJVirial (const std::array< double, 3 > &posI, const std::array< double, 3 > &posJ, double cutoff, double sigma, double epsilon)
 Calculates the virial between particle i and j using the Lennard Jones 12-6 potential.
 
constexpr double calculateLJVirialTotal (const std::array< double, 3 > &posI, const std::array< double, 3 > &posJ, double cutoff, double sigma, double epsilon)
 Calculates the sum of all components of the virial between particle i and j using the Lennard Jones 12-6 potential.
 

Detailed Description

Author
D. Martin
Date
13.05.23

A simple reference implementation of the lennard jones potential to calculate expected forces

Function Documentation

◆ calculateLJForce()

constexpr std::array< double, 3 > calculateLJForce ( const std::array< double, 3 > &  posI,
const std::array< double, 3 > &  posJ,
double  cutoff,
double  sigma,
double  epsilon 
)
constexpr

Calculates the force exerted by particle j on particle i using the 12-6 potential of Lennard Jones.

Parameters
posIcoordinate of the first particle
posJcoordinate of the second particle
cutoffthe cutoff distance in wich we consider interactions
sigmasigma value for particles
epsilonepsilon value for particles
Returns
The force exerted by particle j on particle i

◆ calculateLJPotential()

constexpr double calculateLJPotential ( const std::array< double, 3 > &  posI,
const std::array< double, 3 > &  posJ,
double  cutoff,
double  sigma,
double  epsilon 
)
constexpr

Calculates the potential energy between particle i and j using the Lennard Jones 12-6 potential.

Parameters
posIcoordinate of the first particle
posJcoordinate of the second particle
cutoffthe cutoff distance in wich we consider interactions
sigmasigma value for particles
epsilonepsilon value for particles
Returns
potential energy

◆ calculateLJVirial()

constexpr std::array< double, 3 > calculateLJVirial ( const std::array< double, 3 > &  posI,
const std::array< double, 3 > &  posJ,
double  cutoff,
double  sigma,
double  epsilon 
)
constexpr

Calculates the virial between particle i and j using the Lennard Jones 12-6 potential.

Parameters
posIcoordinate of the first particle
posJcoordinate of the second particle
cutoffthe cutoff distance in wich we consider interactions
sigmasigma value for particles
epsilonepsilon value for particles
Returns
virial

◆ calculateLJVirialTotal()

constexpr double calculateLJVirialTotal ( const std::array< double, 3 > &  posI,
const std::array< double, 3 > &  posJ,
double  cutoff,
double  sigma,
double  epsilon 
)
constexpr

Calculates the sum of all components of the virial between particle i and j using the Lennard Jones 12-6 potential.

Parameters
posIcoordinate of the first particle
posJcoordinate of the second particle
cutoffthe cutoff distance in wich we consider interactions
sigmasigma value for particles
epsilonepsilon value for particles
Returns
sum of all three components of the virial vector