本文整理汇总了C++中EvalContext::needsDerivOrder方法的典型用法代码示例。如果您正苦于以下问题:C++ EvalContext::needsDerivOrder方法的具体用法?C++ EvalContext::needsDerivOrder怎么用?C++ EvalContext::needsDerivOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EvalContext
的用法示例。
在下文中一共展示了EvalContext::needsDerivOrder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupVariations
DerivSet SymbPreprocessor::setupVariations(const Expr& expr,
const Expr& vars,
const Expr& varEvalPts,
const Expr& unks,
const Expr& unkEvalPts,
const Expr& unkParams,
const Expr& unkParamEvalPts,
const Expr& fixedFields,
const Expr& fixedFieldEvalPts,
const Expr& fixedParams,
const Expr& fixedParamEvalPts,
const EvalContext& context,
const ComputationType& compType)
{
TimeMonitor t(preprocTimer());
Tabs tab;
const EvaluatableExpr* e
= dynamic_cast<const EvaluatableExpr*>(expr.ptr().get());
Array<Set<MultiSet<int> > > funcDerivs(3);
Array<Set<MultiIndex> > spatialDerivs(3);
int verb=context.setupVerbosity();
SUNDANCE_BANNER1(verb, tab, "in setupVariations()");
verbosity<EvaluatableExpr>() = verb;
SUNDANCE_MSG1(verb,
tab << "************ setting up variations of expr: "
<< expr
<< std::endl << tab << "context is " << context
<< std::endl << tab << "conp type is " << compType
<< std::endl << tab << "vars are " << vars
<< std::endl << tab << "unks are " << unks
<< std::endl << tab << "unk parameters " << unkParams
<< std::endl << tab << "fixed parameters " << fixedParams
<< std::endl << tab << "the eval points for the vars are "
<< varEvalPts
<< std::endl << tab << "the eval points for the unks are "
<< unkEvalPts
<< std::endl << tab
<< "the eval points for the unknown parameters are "
<< unkParamEvalPts
<< std::endl << tab
<< "the eval points for the fixed parameters are "
<< fixedParamEvalPts
<< tab << std::endl);
TEUCHOS_TEST_FOR_EXCEPTION(e==0, std::logic_error,
"Non-evaluatable expr " << expr.toString()
<< " given to SymbPreprocessor::setupExpr()");
/* make flat lists of variations, unknowns, parameters, and fixed fields */
Expr v = vars.flatten();
Expr v0 = varEvalPts.flatten();
Expr u = unks.flatten();
Expr u0 = unkEvalPts.flatten();
Expr alpha = unkParams.flatten();
Expr alpha0 = unkParamEvalPts.flatten();
Expr beta = fixedParams.flatten();
Expr beta0 = fixedParamEvalPts.flatten();
Expr f = fixedFields.flatten();
Expr f0 = fixedFieldEvalPts.flatten();
Set<int> varID = processInputFuncs<SymbolicFuncElement>(v, v0);
Set<int> unkID = processInputFuncs<UnknownFuncElement>(u, u0);
Set<int> fixedID = processInputFuncs<UnknownFuncElement>(f, f0);
Set<int> unkParamID
= processInputParams<UnknownParameterElement>(alpha, alpha0);
Set<int> fixedParamID
= processInputParams<UnknownParameterElement>(beta, beta0);
/* put together the set of functions that are active differentiation
* variables */
SUNDANCE_MSG2(verb, tab << "forming active set");
Array<Sundance::Set<MultiSet<int> > > activeFuncIDs(3);
if (context.needsDerivOrder(0)) activeFuncIDs[0].put(MultiSet<int>());
if (context.topLevelDiffOrder() >= 1)
{
for (Set<int>::const_iterator i=varID.begin(); i != varID.end(); i++)
{
if (context.needsDerivOrder(1)) activeFuncIDs[1].put(makeMultiSet<int>(*i));
if (context.topLevelDiffOrder()==2)
{
for (Set<int>::const_iterator j=unkID.begin(); j != unkID.end(); j++)
{
activeFuncIDs[2].put(makeMultiSet<int>(*i, *j));
}
if (compType==MatrixAndVector)
{
for (Set<int>::const_iterator
//.........这里部分代码省略.........