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 273 of file ExpressionBuilder.C.

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

◆ 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 }
std::vector< EBTerm > EBTermList

◆ 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 }
std::vector< EBTerm > EBTermList

◆ 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 }
std::basic_ostream< charT, traits > * os

◆ TERNARY_FUNC_IMPLEMENT()

TERNARY_FUNC_IMPLEMENT ( conditional  ,
CONDITIONAL   
)

Definition at line 306 of file ExpressionBuilder.C.

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

◆ UNARY_FUNC_IMPLEMENT()

UNARY_FUNC_IMPLEMENT ( sin  ,
SIN   
)

Definition at line 250 of file ExpressionBuilder.C.

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