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 339 of file ExpressionBuilder.h.

Constructor & Destructor Documentation

◆ EBLogPlogSubstitution()

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

Definition at line 342 of file ExpressionBuilder.h.

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

◆ ~EBLogPlogSubstitution()

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

Definition at line 346 of file ExpressionBuilder.h.

Member Function Documentation

◆ apply()

Implements ExpressionBuilder::EBSubstitutionRule.

Definition at line 694 of file ExpressionBuilder.h.

696 {
697  const Node_T * match_node = dynamic_cast<const Node_T *>(node);
698  if (match_node == NULL)
699  return NULL;
700  else
701  return substitute(*match_node);
702 }
virtual EBTermNode * substitute(const EBUnaryFuncTermNode &) const=0

◆ 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 }
virtual EBTermNode * clone() const =0

Member Data Documentation

◆ _epsilon

EBTermNode* ExpressionBuilder::EBLogPlogSubstitution::_epsilon
protected

Definition at line 349 of file ExpressionBuilder.h.


The documentation for this class was generated from the following files: