MDStressLab++
Loading...
Searching...
No Matches
Method.cpp
Go to the documentation of this file.
1/*
2 * Method.cpp
3 *
4 * Created on: Aug 26, 2022
5 * Author: Nikhil
6 */
7
8#include "typedef.h"
9#include <Method.h>
10
11template<typename TMethod>
12Method<TMethod>::Method() : averagingDomainSize(0)
13{ }
14
15template<typename TMethod>
16Method<TMethod>::Method(double averagingDomainSize) : averagingDomainSize(averagingDomainSize)
17{ }
18
19template<typename TMethod>
21{
22 *this = method;
23}
24
25template<typename TMethod>
26double Method<TMethod>::operator()(const Vector3d& vec) const
27{
28 const TMethod& tMethod= static_cast<const TMethod&>(*this);
29 return tMethod(vec);
30}
31
32template<typename TMethod>
33double Method<TMethod>::bondFunction(const Vector3d& vec1, const Vector3d& vec2) const
34{
35 const TMethod& tMethod= static_cast<const TMethod&>(*this);
36 return tMethod.bondFunction(vec1, vec2);
37}
38
39template<typename TMethod>
41{
42 return averagingDomainSize;
43}
44template<typename TMethod>
double getAveragingDomainSize() const
Gets the spatial size of the averaging domain, i.e. the support of the weighting function.
Definition Method.cpp:40
double bondFunction(const Vector3d &vec1, const Vector3d &vec2) const
The bond function gives the weight associated to a bond formed by two atoms.
Definition Method.cpp:33
virtual ~Method()
Definition Method.cpp:45
double operator()(const Vector3d &vec) const
The weighting function used to compute stress.
Definition Method.cpp:26
Eigen::Matrix< double, 1, DIM, Eigen::RowMajor > Vector3d
Definition typedef.h:60