www.mooseframework.org
Functions
ExpressionBuilder.C File Reference

Go to the source code of this file.

Functions

ExpressionBuilder::EBTermList operator, (const ExpressionBuilder::EBTerm &larg, const ExpressionBuilder::EBTerm &rarg)
 
ExpressionBuilder::EBTermList operator, (const ExpressionBuilder::EBTerm &larg, const ExpressionBuilder::EBTermList &rargs)
 
ExpressionBuilder::EBTermList operator, (const ExpressionBuilder::EBTermList &largs, const ExpressionBuilder::EBTerm &rarg)
 
std::ostream & operator<< (std::ostream &os, const ExpressionBuilder::EBTerm &term)
 
 UNARY_FUNC_IMPLEMENT (sin, SIN)
 
 BINARY_FUNC_IMPLEMENT (min, MIN)
 
 TERNARY_FUNC_IMPLEMENT (conditional, CONDITIONAL)
 

Function Documentation

BINARY_FUNC_IMPLEMENT ( min  ,
MIN   
)

Definition at line 268 of file ExpressionBuilder.C.

277 {
278  mooseAssert(left._root != NULL, "Empty term for base of pow()");
279  mooseAssert(right._root != NULL, "Empty term for exponent of pow()");
281  left.cloneRoot(), right.cloneRoot(), ExpressionBuilder::EBBinaryOpTermNode::POW));
282 }
User facing host object for an expression tree.
Node representing a binary operator.

Definition at line 10 of file ExpressionBuilder.C.

Referenced by ExpressionBuilder::EBTerm::EBTerm().

11 {
12  return {larg, rarg};
13 }

Definition at line 16 of file ExpressionBuilder.C.

17 {
18  ExpressionBuilder::EBTermList list = {larg};
19  list.insert(list.end(), rargs.begin(), rargs.end());
20  return list;
21 }
std::vector< EBTerm > EBTermList

Definition at line 24 of file ExpressionBuilder.C.

25 {
26  ExpressionBuilder::EBTermList list = largs;
27  list.push_back(rarg);
28  return list;
29 }
std::vector< EBTerm > EBTermList
std::ostream& operator<< ( std::ostream &  os,
const ExpressionBuilder::EBTerm term 
)

Definition at line 32 of file ExpressionBuilder.C.

33 {
34  if (term._root != NULL)
35  return os << *term._root;
36  else
37  return os << "[NULL]";
38 }
TERNARY_FUNC_IMPLEMENT ( conditional  ,
CONDITIONAL   
)

Definition at line 301 of file ExpressionBuilder.C.

305 {
306  unsigned int nrule = rules.size();
307 
308  for (unsigned int i = 0; i < nrule; ++i)
309  {
310  EBTermNode * replace = rules[i]->apply(_subnode);
311  if (replace != NULL)
312  {
313  delete _subnode;
314  _subnode = replace;
315  return 1;
316  }
317  }
318 
319  return _subnode->substitute(rules);
320 }
UNARY_FUNC_IMPLEMENT ( sin  ,
SIN   
)

Definition at line 246 of file ExpressionBuilder.C.

260  { \
261  mooseAssert(left._root != NULL, \
262  "Empty term provided as first argument of function " #op "()"); \
263  mooseAssert(right._root != NULL, \
264  "Empty term provided as second argument of function " #op "()"); \
266  left.cloneRoot(), right.cloneRoot(), ExpressionBuilder::EBBinaryFuncTermNode::OP)); \
267  }
User facing host object for an expression tree.
Node representing a function with two arguments.