本文整理汇总了C++中meb::OutArgs::set_DgDx_dot方法的典型用法代码示例。如果您正苦于以下问题:C++ OutArgs::set_DgDx_dot方法的具体用法?C++ OutArgs::set_DgDx_dot怎么用?C++ OutArgs::set_DgDx_dot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meb::OutArgs
的用法示例。
在下文中一共展示了OutArgs::set_DgDx_dot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void ModelEvaluatorDefaultBase<Scalar>::evalModel(
const ModelEvaluatorBase::InArgs<Scalar> &inArgs,
const ModelEvaluatorBase::OutArgs<Scalar> &outArgs
) const
{
using Teuchos::outArg;
typedef ModelEvaluatorBase MEB;
lazyInitializeDefaultBase();
const int l_Np = outArgs.Np();
const int l_Ng = outArgs.Ng();
//
// A) Assert that the inArgs and outArgs object match this class!
//
#ifdef TEUCHOS_DEBUG
assertInArgsEvalObjects(*this,inArgs);
assertOutArgsEvalObjects(*this,outArgs,&inArgs);
#endif
//
// B) Setup the OutArgs object for the underlying implementation's
// evalModelImpl(...) function
//
MEB::OutArgs<Scalar> outArgsImpl = this->createOutArgsImpl();
Array<MultiVectorAdjointPair> DgDp_temp_adjoint_copies;
{
outArgsImpl.setArgs(outArgs,true);
// DfDp(l)
if (outArgsImpl.supports(MEB::OUT_ARG_f)) {
for ( int l = 0; l < l_Np; ++l ) {
const DefaultDerivLinearOpSupport defaultLinearOpSupport =
DfDp_default_op_support_[l];
if (defaultLinearOpSupport.provideDefaultLinearOp()) {
outArgsImpl.set_DfDp( l,
getOutArgImplForDefaultLinearOpSupport(
outArgs.get_DfDp(l), defaultLinearOpSupport
)
);
}
else {
// DfDp(l) already set by outArgsImpl.setArgs(...)!
}
}
}
// DgDx_dot(j)
for ( int j = 0; j < l_Ng; ++j ) {
const DefaultDerivLinearOpSupport defaultLinearOpSupport =
DgDx_dot_default_op_support_[j];
if (defaultLinearOpSupport.provideDefaultLinearOp()) {
outArgsImpl.set_DgDx_dot( j,
getOutArgImplForDefaultLinearOpSupport(
outArgs.get_DgDx_dot(j), defaultLinearOpSupport
)
);
}
else {
// DgDx_dot(j) already set by outArgsImpl.setArgs(...)!
}
}
// DgDx(j)
for ( int j = 0; j < l_Ng; ++j ) {
const DefaultDerivLinearOpSupport defaultLinearOpSupport =
DgDx_default_op_support_[j];
if (defaultLinearOpSupport.provideDefaultLinearOp()) {
outArgsImpl.set_DgDx( j,
getOutArgImplForDefaultLinearOpSupport(
outArgs.get_DgDx(j), defaultLinearOpSupport
)
);
}
else {
// DgDx(j) already set by outArgsImpl.setArgs(...)!
}
}
// DgDp(j,l)
for ( int j = 0; j < l_Ng; ++j ) {
const Array<DefaultDerivLinearOpSupport> &DgDp_default_op_support_j =
DgDp_default_op_support_[j];
const Array<DefaultDerivMvAdjointSupport> &DgDp_default_mv_support_j =
DgDp_default_mv_support_[j];
for ( int l = 0; l < l_Np; ++l ) {
const DefaultDerivLinearOpSupport defaultLinearOpSupport =
DgDp_default_op_support_j[l];
const DefaultDerivMvAdjointSupport defaultMvAdjointSupport =
DgDp_default_mv_support_j[l];
MEB::Derivative<Scalar> DgDp_j_l;
if (!outArgs.supports(MEB::OUT_ARG_DgDp,j,l).none())
DgDp_j_l = outArgs.get_DgDp(j,l);
if (
//.........这里部分代码省略.........