MDStressLab++
|
#include <Method.h>
Public Member Functions | |
virtual | ~Method () |
double | operator() (const Vector3d &vec) const |
The weighting function \(w\) used to compute stress. | |
double | bondFunction (const Vector3d &vec1, const Vector3d &vec2) const |
The bond function \(b(\boldsymbol v^1, \boldsymbol v^2)\) gives the weight associated to a bond formed by two atoms. | |
double | getAveragingDomainSize () const |
Gets the spatial size of the averaging domain, i.e. the support of the weighting function. | |
Protected Attributes | |
double | averagingDomainSize |
This class provides a polymorphic interface for defining a method
, which constitutes a weighting function and its associated bond function, to compute atomistic stress.
It is intended to be used as a CRTP (Curiously Recurring Template Pattern) base class: the actual implementation of the method should be provided in the derived class TMethod
, which will override the weighting function call operator and bondFunction
.
TMethod | The derived class implementing specific method logic. Examples of derived classes include MethodSphere , MethodLdad<Constant> , and MethodLdad<Trigonometric> . |
Definition at line 45 of file Method.cpp.
double Method< TMethod >::bondFunction | ( | const Vector3d & | vec1, |
const Vector3d & | vec2 | ||
) | const |
The bond function \(b(\boldsymbol v^1, \boldsymbol v^2)\) gives the weight associated to a bond formed by two atoms.
The function delegates the actual implementation to TMethod::bondFunction(vec1, vec2)
.
The bond function is defined as
\[ \begin{equation} b(\boldsymbol v^1, \boldsymbol v^2)= \int_{s=0}^1 w((1-s)\boldsymbol v^1 + s\boldsymbol v^2) \, ds \end{equation} \]
The actual implementation of the bondFunction is delegated to TMethod::bondFunction(vec1, vec2)
.
vec1 | first atomic position vector relative to a grid point |
vec2 | second atomic position vector relative to a grid point |
Definition at line 33 of file Method.cpp.
double Method< TMethod >::getAveragingDomainSize | ( | ) | const |
Gets the spatial size of the averaging domain, i.e. the support of the weighting function.
Definition at line 40 of file Method.cpp.
The weighting function \(w\) used to compute stress.
bondFunction()
and calculateStress
to see its usage in stress calculation.This weighting function operator delegates the implementation to the derived TMethod
class.
vec | A 3D vector |
Definition at line 26 of file Method.cpp.
|
protected |