Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
TestExpression.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_TestExpression_H_
9#define model_TestExpression_H_
10
11#include <utility>
12#include <memory>
13#include <stdexcept>
14
15namespace model
16{
17
18 template<typename TrialExpressionType>
20 {
21
23 typedef typename TrialExpressionType::ShapeFunctionMatrixType ShapeFunctionMatrixType;
24 typedef typename TrialExpressionType::BaryType BaryType;
25 typedef typename TrialExpressionType::ElementType ElementType;
26
27 const std::shared_ptr<TrialExpressionType> trialExp;
28
29 explicit TestExpression(std::shared_ptr<TrialExpressionType> trialExp_in) : trialExp(std::move(trialExp_in))
30 {
31 if(!trialExp)
32 {
33 throw std::invalid_argument("Null FEM expression operand.");
34 }
35 }
36
38 const BaryType& bary) const
39 {
40 return trialExp->sfm(ele,bary);
41 }
42
43 const auto& field() const
44 {
45 return trialExp->field();
46 }
47
48 };
49
50}
51#endif
T1::ElementType ElementType
T1::ShapeFunctionMatrixType ShapeFunctionMatrixType
TestExpression< T1 > TestExpressionType
ShapeFunctionMatrixType sfm(const ElementType &ele, const BaryType &bary) const
const auto & field() const
const std::shared_ptr< T1 > trialExp
TestExpression(std::shared_ptr< TrialExpressionType > trialExp_in)