Public Member Functions | Static Public Member Functions | Private Attributes | Related Functions
Sundance::EvalContext Class Reference

Different contexts might require the same expression to be evaluated to different orders of functional differentiation; for example, in setting up a linear system, second-order derivatives are required, but in evaluating a functional only zeroth derivs are required. More...

List of all members.

Public Member Functions

 EvalContext ()
 Empty ctor.
 EvalContext (const RegionQuadCombo &rqc, const Set< int > &needsDiffOrder, int contextID)
 Construct with a region-quadrature combination and an identifier of the construcing context.
void setSetupVerbosity (int v)
 Set the verbosity level to be used during preprocessing of expressions in this context.
int setupVerbosity () const
 Return the verbosity level to be used during preprocessing of expressions in this context.
bool operator< (const EvalContext &other) const
 Comparison operator for use in maps.
std::string toString () const
 Write to a std::string.
std::string brief () const
 Write a short description to a std::string.
int topLevelDiffOrder () const
bool needsDerivOrder (int order) const
 Indicate whether or not a given order of differentiation is needed in this context.

Static Public Member Functions

static int nextID ()
 Return a unique context ID.

Private Attributes

int setupVerbosity_
int maxDiffOrder_
RCP< OrderedTriple< Set< int >
, int, RegionQuadCombo > > 
data_

Related Functions

(Note that these are not member functions.)

ostream & operator<< (std::ostream &os, const Sundance::EvalContext &c)
std::string toString (const Sundance::EvalContext &h)

Detailed Description

Different contexts might require the same expression to be evaluated to different orders of functional differentiation; for example, in setting up a linear system, second-order derivatives are required, but in evaluating a functional only zeroth derivs are required.

An EvaluationContext is used as a key to associate an evaluator and its corresponding set of functional derivatives with a context.

They key consists of three parts: first, an integer identifier indicating the caller, e.g., an assembler or functional evaluator, second, a set indicating which orders of differentiation are required by the top level caller, and third, a region-quadrature combination.

Definition at line 64 of file SundanceEvalContext.hpp.


Constructor & Destructor Documentation

Sundance::EvalContext::EvalContext ( ) [inline]

Empty ctor.

Definition at line 68 of file SundanceEvalContext.hpp.

Sundance::EvalContext::EvalContext ( const RegionQuadCombo rqc,
const Set< int > &  needsDiffOrder,
int  contextID 
) [inline]

Construct with a region-quadrature combination and an identifier of the construcing context.

Definition at line 72 of file SundanceEvalContext.hpp.


Member Function Documentation

std::string Sundance::EvalContext::brief ( ) const [inline]

Write a short description to a std::string.

Definition at line 101 of file SundanceEvalContext.hpp.

References data_, Teuchos::toString(), and toString().

Referenced by Sundance::Assembler::init().

bool Sundance::EvalContext::needsDerivOrder ( int  order) const [inline]

Indicate whether or not a given order of differentiation is needed in this context.

Definition at line 113 of file SundanceEvalContext.hpp.

References data_.

Referenced by Sundance::SymbPreprocessor::setupVariations().

static int Sundance::EvalContext::nextID ( ) [inline, static]

Return a unique context ID.

Definition at line 117 of file SundanceEvalContext.hpp.

Referenced by Sundance::EquationSet::init().

bool Sundance::EvalContext::operator< ( const EvalContext other) const [inline]

Comparison operator for use in maps.

Definition at line 89 of file SundanceEvalContext.hpp.

References data_.

void Sundance::EvalContext::setSetupVerbosity ( int  v) [inline]

Set the verbosity level to be used during preprocessing of expressions in this context.

Definition at line 82 of file SundanceEvalContext.hpp.

References setupVerbosity_.

Referenced by Sundance::EquationSet::init().

int Sundance::EvalContext::setupVerbosity ( ) const [inline]

Return the verbosity level to be used during preprocessing of expressions in this context.

Definition at line 86 of file SundanceEvalContext.hpp.

References setupVerbosity_.

Referenced by Sundance::CellDiameterExprEvaluator::CellDiameterExprEvaluator(), Sundance::CellVectorEvaluator::CellVectorEvaluator(), Sundance::ChainRuleEvaluator::ChainRuleEvaluator(), Sundance::EvaluatableExpr::computeInputR(), Sundance::ConstantEvaluator::ConstantEvaluator(), Sundance::CoordExprEvaluator::CoordExprEvaluator(), Sundance::CurveNormEvaluator::CurveNormEvaluator(), Sundance::DerivOfSymbFuncEvaluator::DerivOfSymbFuncEvaluator(), Sundance::DiffOpEvaluator::DiffOpEvaluator(), Sundance::EvaluatableExpr::findDerivSubset(), Sundance::ExprWithChildren::findQ_W(), Sundance::ChainRuleEvaluator::init(), Sundance::SymbolicFuncElement::internalDetermineR(), Sundance::ExprWithChildren::internalDetermineR(), Sundance::ExplicitFunctionalDerivativeElement::internalDetermineR(), Sundance::DiscreteFuncElement::internalDetermineR(), Sundance::DiffOp::internalDetermineR(), Sundance::ZeroExpr::internalFindC(), Sundance::UnknownParameterElement::internalFindC(), Sundance::SymbolicFuncElement::internalFindC(), Sundance::ExprWithChildren::internalFindC(), Sundance::ExplicitFunctionalDerivativeElement::internalFindC(), Sundance::DiscreteFuncElement::internalFindC(), Sundance::DiffOp::internalFindC(), Sundance::ConstantExpr::internalFindC(), Sundance::ProductExpr::internalFindQ_V(), Sundance::ExprWithChildren::internalFindQ_V(), Sundance::UnaryMinus::internalFindQ_W(), Sundance::ProductExpr::internalFindQ_W(), Sundance::ExprWithChildren::internalFindQ_W(), Sundance::UnknownParameterElement::internalFindV(), Sundance::SymbolicFuncElement::internalFindV(), Sundance::ExprWithChildren::internalFindV(), Sundance::ExplicitFunctionalDerivativeElement::internalFindV(), Sundance::DiscreteFuncElement::internalFindV(), Sundance::DiffOp::internalFindV(), Sundance::ConstantExpr::internalFindV(), Sundance::ZeroExpr::internalFindW(), Sundance::UnknownParameterElement::internalFindW(), Sundance::SymbolicFuncElement::internalFindW(), Sundance::ExprWithChildren::internalFindW(), Sundance::ExplicitFunctionalDerivativeElement::internalFindW(), Sundance::DiscreteFuncElement::internalFindW(), Sundance::DiffOp::internalFindW(), Sundance::ConstantExpr::internalFindW(), Sundance::ProductEvaluator::ProductEvaluator(), Sundance::DiffOp::requestMultiIndexAtEvalPoint(), Sundance::ExprWithChildren::setupEval(), Sundance::EvaluatableExpr::setupEval(), Sundance::SymbPreprocessor::setupVariations(), and Sundance::EvaluatableExpr::sparsitySuperset().

int Sundance::EvalContext::topLevelDiffOrder ( ) const [inline]
std::string Sundance::EvalContext::toString ( ) const [inline]

Write to a std::string.

Definition at line 93 of file SundanceEvalContext.hpp.

References data_, and Teuchos::toString().

Referenced by brief(), operator<<(), and toString().


Friends And Related Function Documentation

ostream & operator<< ( std::ostream &  os,
const Sundance::EvalContext c 
) [related]

Definition at line 130 of file SundanceEvalContext.hpp.

References toString().

std::string toString ( const Sundance::EvalContext h) [related]

Definition at line 141 of file SundanceEvalContext.hpp.

References toString().


Member Data Documentation

Definition at line 121 of file SundanceEvalContext.hpp.

Referenced by brief(), needsDerivOrder(), operator<(), and toString().

Definition at line 120 of file SundanceEvalContext.hpp.

Referenced by topLevelDiffOrder().

Definition at line 119 of file SundanceEvalContext.hpp.

Referenced by setSetupVerbosity(), and setupVerbosity().

Site Contact