1 #ifndef DUNE_DGF_PROJECTIONBLOCK_HH
2 #define DUNE_DGF_PROJECTIONBLOCK_HH
23 friend std::ostream &
operator<< ( std::ostream &,
const Token & );
28 defaultKeyword, functionKeyword, segmentKeyword,
29 sqrtKeyword, sinKeyword, cosKeyword, piKeyword,
32 openingParen, closingParen, openingBracket, closingBracket, normDelim,
33 additiveOperator, multiplicativeOperator, powerOperator,
42 void setSymbol (
const Type &t,
char c )
49 friend std::ostream &
operator<< ( std::ostream &,
const Token & );
55 template<
int dimworld >
61 template<
int dimworld >
75 const std::vector< unsigned int > &
boundaryFace (
const size_t i )
const
81 template<
int dimworld >
88 const Expression *
function (
const std::string &name )
const
90 const FunctionMap::const_iterator it =
functions_.find( name );
91 return (it !=
functions_.end() ? it->second : 0);
95 void parseFunction ();
96 const Expression *parseBasicExpression (
const std::string &variableName );
97 const Expression *parsePostfixExpression (
const std::string &variableName );
98 const Expression *parseUnaryExpression (
const std::string &variableName );
99 const Expression *parsePowerExpression (
const std::string &variableName );
100 const Expression *parseMultiplicativeExpression (
const std::string &variableName );
101 const Expression *parseExpression (
const std::string &variableName );
102 void parseDefault ();
103 void parseSegment ();
105 void matchToken (
const Token::Type &type,
const std::string &message );
108 static char lowerCase (
char c )
110 return ((c >=
'A') && (c <=
'Z') ? c + (
'a' -
'A') : c);
126 std::ostream &
operator<< ( std::ostream &out,
const ProjectionBlock::Token &token );
140 template<
int dimworld >
150 : expression_( expression )
155 std::vector< double > x( dimworld );
156 for(
int i = 0; i < dimworld; ++i )
157 x[ i ] = global[ i ];
158 std::vector< double > y;
161 for(
int i = 0; i < dimworld; ++i )
162 result[ i ] = y[ i ];
174 #endif // #ifndef DUNE_DGF_PROJECTIONBLOCK_HH