www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ExpressionBuilder::EBLogPlogSubstitution Class Reference

Substitution rule to replace all occurences of log(x) with plog(x, epsilon) with a user defined term for epsilon. More...

#include <ExpressionBuilder.h>

Inheritance diagram for ExpressionBuilder::EBLogPlogSubstitution:
[legend]

Public Member Functions

 EBLogPlogSubstitution (const EBTerm &epsilon)
 
virtual ~EBLogPlogSubstitution ()
 
virtual EBTermNodeapply (const EBTermNode *) const
 

Protected Member Functions

virtual EBTermNodesubstitute (const EBUnaryFuncTermNode &) const
 

Protected Attributes

EBTermNode_epsilon
 

Detailed Description

Substitution rule to replace all occurences of log(x) with plog(x, epsilon) with a user defined term for epsilon.

Definition at line 338 of file ExpressionBuilder.h.

Constructor & Destructor Documentation

◆ EBLogPlogSubstitution()

ExpressionBuilder::EBLogPlogSubstitution::EBLogPlogSubstitution ( const EBTerm epsilon)
inline

Definition at line 341 of file ExpressionBuilder.h.

341  : _epsilon(epsilon.cloneRoot())
342  {
343  mooseAssert(_epsilon != NULL, "Epsilon must not be an empty term in EBLogPlogSubstitution");
344  }

◆ ~EBLogPlogSubstitution()

virtual ExpressionBuilder::EBLogPlogSubstitution::~EBLogPlogSubstitution ( )
inlinevirtual

Definition at line 345 of file ExpressionBuilder.h.

345 { delete _epsilon; }

Member Function Documentation

◆ apply()

Implements ExpressionBuilder::EBSubstitutionRule.

Definition at line 693 of file ExpressionBuilder.h.

695 {
696  const Node_T * match_node = dynamic_cast<const Node_T *>(node);
697  if (match_node == NULL)
698  return NULL;
699  else
700  return substitute(*match_node);
701 }

◆ substitute()

ExpressionBuilder::EBTermNode * ExpressionBuilder::EBLogPlogSubstitution::substitute ( const EBUnaryFuncTermNode node) const
protectedvirtual

Implements ExpressionBuilder::EBSubstitutionRuleTyped< EBUnaryFuncTermNode >.

Definition at line 469 of file ExpressionBuilder.C.

470 {
471  if (node._type == EBUnaryFuncTermNode::LOG)
472  return new EBBinaryFuncTermNode(
473  node.getSubnode()->clone(), _epsilon->clone(), EBBinaryFuncTermNode::PLOG);
474  else
475  return NULL;
476 }

Member Data Documentation

◆ _epsilon

EBTermNode* ExpressionBuilder::EBLogPlogSubstitution::_epsilon
protected

Definition at line 348 of file ExpressionBuilder.h.


The documentation for this class was generated from the following files:
ExpressionBuilder::EBLogPlogSubstitution::_epsilon
EBTermNode * _epsilon
Definition: ExpressionBuilder.h:348
ExpressionBuilder::EBUnaryFuncTermNode::LOG
Definition: ExpressionBuilder.h:144
ExpressionBuilder::EBSubstitutionRuleTyped< EBUnaryFuncTermNode >::substitute
virtual EBTermNode * substitute(const EBUnaryFuncTermNode &) const=0
ExpressionBuilder::EBTermNode::clone
virtual EBTermNode * clone() const =0
ExpressionBuilder::EBBinaryFuncTermNode::PLOG
Definition: ExpressionBuilder.h:246