3 #ifndef DUNE_DGF_PROJECTIONBLOCK_HH
4 #define DUNE_DGF_PROJECTIONBLOCK_HH
25 friend std::ostream &
operator<< ( std::ostream &,
const Token & );
30 defaultKeyword, functionKeyword, segmentKeyword,
31 sqrtKeyword, sinKeyword, cosKeyword, piKeyword,
34 openingParen, closingParen, openingBracket, closingBracket, normDelim,
35 additiveOperator, multiplicativeOperator, powerOperator,
44 void setSymbol (
const Type &t,
char c )
51 friend std::ostream &
operator<< ( std::ostream &,
const Token & );
57 template<
int dimworld >
63 template<
int dimworld >
77 const std::vector< unsigned int > &
boundaryFace (
const size_t i )
const
83 template<
int dimworld >
90 const Expression *
function (
const std::string &name )
const
92 const FunctionMap::const_iterator it =
functions_.find( name );
93 return (it !=
functions_.end() ? it->second : 0);
97 void parseFunction ();
98 const Expression *parseBasicExpression (
const std::string &variableName );
99 const Expression *parsePostfixExpression (
const std::string &variableName );
100 const Expression *parseUnaryExpression (
const std::string &variableName );
101 const Expression *parsePowerExpression (
const std::string &variableName );
102 const Expression *parseMultiplicativeExpression (
const std::string &variableName );
103 const Expression *parseExpression (
const std::string &variableName );
104 void parseDefault ();
105 void parseSegment ();
107 void matchToken (
const Token::Type &type,
const std::string &message );
110 static char lowerCase (
char c )
112 return ((c >=
'A') && (c <=
'Z') ? c + (
'a' -
'A') : c);
128 std::ostream &
operator<< ( std::ostream &out,
const ProjectionBlock::Token &token );
142 template<
int dimworld >
152 : expression_( expression )
157 std::vector< double > x( dimworld );
158 for(
int i = 0; i < dimworld; ++i )
159 x[ i ] = global[ i ];
160 std::vector< double > y;
163 for(
int i = 0; i < dimworld; ++i )
164 result[ i ] = y[ i ];
176 #endif // #ifndef DUNE_DGF_PROJECTIONBLOCK_HH