|
MDStressLab++
|
#include <Method.h>
Public Member Functions | |
| virtual | ~Method () |
| double | operator() (const Vector3d &vec) const |
| The pointwise weighting function \(w\). | |
| 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. The pointwise weighting function is also used for Cauchy mass density, momentum density, and kinetic 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 pointwise weighting function \(w\).
The pointwise weight is used directly for kinetic Cauchy stress and for the continuum fields \(\rho(\mathbf x)=\sum_i m_i w(\mathbf x-\mathbf x_i)\) and \(\mathbf p(\mathbf x)=\sum_i m_i\mathbf v_i w(\mathbf x-\mathbf x_i)\). It must therefore be normalized so that \(\int w(\mathbf r)d\mathbf r=1\). Potential stress uses bondFunction().
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 |