Skip to content

Parser #2130

Answered by WeiqunZhang
rsiddu0511 asked this question in Q&A
Discussion options

You must be logged in to vote

Parser is not a member of amrex

Is there #include <AMReX_Parser.H>?

I used the following lines in my GNUMakeFile.

I assume this is a typo. Parser is for C++ code, not for make.

amrex::Parser parser("a=(b*c)/(d*d)");

This is not a valid code for the parser. What do you want to compute? (b*c)/(d*d)? Assignment like a=...; can be used to define a local variable that's internal to the parser. But the parser expression must have an expression as the last statement, and that will be its return value when ParserExecutor<N>::operator() is called. a=(b*c)/(d*d); a is valid, but then a is not a variable to be registered with registerVariables. Parser is usually used to evaluate a runtime stri…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rsiddu0511
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants