8#ifndef model_EvalExpression_H_
9#define model_EvalExpression_H_
19 template<
typename TrialExpressionType>
23 constexpr static int rows=TrialExpressionType::rows;
24 constexpr static int cols=TrialExpressionType::cols;
35 const std::shared_ptr<TrialExpressionType>
trialExp;
41 throw std::invalid_argument(
"Null FEM expression operand.");
54 const std::pair<bool,const ElementType*>
temp(
field().fe().searchWithGuess(P,guess));
57 auto bary(
temp.second->simplex.pos2bary(P));
58 for(
int d=0; d<
dim+1; d++)
74 std::cout<<
"WARNING: EVALUATING EXPRESSION OUTSIDE DOMAIN"<<std::endl;
75 return EvalMatrixType::Zero();
87 for(
const auto& ele : node)
89 const Eigen::Matrix<double,dim+1,1> bary(ele->simplex.pos2bary(node.P0));
92 return temp/node.size();
EvalMatrixType operator()(const NodeType &node) const
Eigen::Matrix< double, rows, 1 > EvalMatrixType
TypeTraits< TrialFunctionType >::BaryType BaryType
EvalMatrixType operator()(const Eigen::Matrix< double, dim, 1 > &P) const
TypeTraits< TrialFunctionType >::ElementType ElementType
TypeTraits< TrialFunctionType >::NodeType NodeType
TrialBase< TrialFunctionType > TrialBaseType
const auto & field() const
EvalExpression(std::shared_ptr< TrialExpressionType > te)
EvalMatrixType operator()(const Eigen::Matrix< double, dim, 1 > &P, const Simplex< dim, dim > *const guess) const
static constexpr int rows
EvalMatrixType operator()(const ElementType &ele, const BaryType &bary) const
ImmobileTrialFunctionType::TrialFunctionType TrialFunctionType
static constexpr int cols
const std::shared_ptr< ImmobileTrialFunctionType > trialExp