Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
EvalFunction.h
Go to the documentation of this file.
1/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2 *
3 *
4 * MoDELib is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_EvalFunction_H_
9#define model_EvalFunction_H_
10
11//#include <utility> // for std::move
12//#include <Eigen/Dense>
13//#include <TypeTraits.h>
14//#include <TrialBase.h>
15
16
17namespace model
18{
19
20
21 // /**************************************************************************/
22 /**************************************************************************/
23 template<typename Derived>
25 {
26
27 /**********************************************************************/
28 Derived& derived()
29 {
31 return *static_cast<Derived*>(this);
32 }
33
34 /**********************************************************************/
35 Derived* p_derived()
36 {
38 return static_cast<Derived*>(this);
39 }
40
41 /**********************************************************************/
42 const Derived& derived() const
43 {
45 return *static_cast<const Derived*>(this);
46 }
47
48 /**********************************************************************/
49 const Derived* p_derived() const
50 {
52 return static_cast<const Derived*>(this);
53 }
54
55 /**********************************************************************/
56 operator const Derived&() const
57 {
59 return derived();
60 }
61
62 };
63
64} // close namespace
65#endif
66
67// /**********************************************************************/
68// const Derived& derived() const
69// {/*! A const reference to the Derived object
70// */
71// return *static_cast<const Derived*>(this);
72// }
const Derived & derived() const
Derived & derived()
const Derived * p_derived() const
Derived * p_derived()