MDStressLab++
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 
11 template<typename TMethod>
12 Method<TMethod>::Method() : averagingDomainSize(0)
13 { }
14 
15 template<typename TMethod>
16 Method<TMethod>::Method(double averagingDomainSize) : averagingDomainSize(averagingDomainSize)
17 { }
18 
19 template<typename TMethod>
21 {
22  *this = method;
23 }
24 
25 template<typename TMethod>
26 double Method<TMethod>::operator()(const Vector3d& vec) const
27 {
28  const TMethod& tMethod= static_cast<const TMethod&>(*this);
29  return tMethod(vec);
30 }
31 
32 template<typename TMethod>
33 double 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 
39 template<typename TMethod>
41 {
42  return averagingDomainSize;
43 }
44 template<typename TMethod>
46 {
47 }
double getAveragingDomainSize() const
Definition: Method.cpp:40
double bondFunction(const Vector3d &vec1, const Vector3d &vec2) const
Definition: Method.cpp:33
double operator()(const Vector3d &vec) const
Definition: Method.cpp:26
Definition: Method.h:14
Eigen::Matrix< double, 1, DIM, Eigen::RowMajor > Vector3d
Definition: typedef.h:60
virtual ~Method()
Definition: Method.cpp:45