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()

BINARY_FUNC_IMPLEMENT ( min  ,
MIN   
)

Definition at line 271 of file ExpressionBuilder.C.

280 {
281  mooseAssert(left._root != NULL, "Empty term for base of pow()");
282  mooseAssert(right._root != NULL, "Empty term for exponent of pow()");
284  left.cloneRoot(), right.cloneRoot(), ExpressionBuilder::EBBinaryOpTermNode::POW));
285 }

◆ operator,() [1/3]

Definition at line 13 of file ExpressionBuilder.C.

14 {
15  return {larg, rarg};
16 }

◆ operator,() [2/3]

Definition at line 19 of file ExpressionBuilder.C.

20 {
21  ExpressionBuilder::EBTermList list = {larg};
22  list.insert(list.end(), rargs.begin(), rargs.end());
23  return list;
24 }

◆ operator,() [3/3]

Definition at line 27 of file ExpressionBuilder.C.

28 {
29  ExpressionBuilder::EBTermList list = largs;
30  list.push_back(rarg);
31  return list;
32 }

◆ operator<<()

std::ostream& operator<< ( std::ostream &  os,
const ExpressionBuilder::EBTerm term 
)

Definition at line 35 of file ExpressionBuilder.C.

36 {
37  if (term._root != NULL)
38  return os << *term._root;
39  else
40  return os << "[NULL]";
41 }

◆ TERNARY_FUNC_IMPLEMENT()

TERNARY_FUNC_IMPLEMENT ( conditional  ,
CONDITIONAL   
)

Definition at line 304 of file ExpressionBuilder.C.

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

◆ UNARY_FUNC_IMPLEMENT()

UNARY_FUNC_IMPLEMENT ( sin  ,
SIN   
)

Definition at line 249 of file ExpressionBuilder.C.

263  { \
264  mooseAssert(left._root != NULL, \
265  "Empty term provided as first argument of function " #op "()"); \
266  mooseAssert(right._root != NULL, \
267  "Empty term provided as second argument of function " #op "()"); \
269  left.cloneRoot(), right.cloneRoot(), ExpressionBuilder::EBBinaryFuncTermNode::OP)); \
270  }
ExpressionBuilder::EBBinaryOpTermNode
Node representing a binary operator.
Definition: ExpressionBuilder.h:203
ExpressionBuilder::EBTermList
std::vector< EBTerm > EBTermList
Definition: ExpressionBuilder.h:56
ExpressionBuilder::EBTerm::_root
EBTermNode * _root
Definition: ExpressionBuilder.h:407
ExpressionBuilder::EBBinaryFuncTermNode
Node representing a function with two arguments.
Definition: ExpressionBuilder.h:237
ExpressionBuilder::EBBinaryOpTermNode::POW
Definition: ExpressionBuilder.h:213
ExpressionBuilder::EBTerm
User facing host object for an expression tree.
Definition: ExpressionBuilder.h:357