本文整理汇总了C++中meb::OutArgs::Ng方法的典型用法代码示例。如果您正苦于以下问题:C++ OutArgs::Ng方法的具体用法?C++ OutArgs::Ng怎么用?C++ OutArgs::Ng使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meb::OutArgs
的用法示例。
在下文中一共展示了OutArgs::Ng方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
ModelEvaluatorBase::OutArgs<Scalar>
DefaultModelEvaluatorWithSolveFactory<Scalar>::createOutArgsImpl() const
{
typedef ModelEvaluatorBase MEB;
const RCP<const ModelEvaluator<Scalar> >
thyraModel = this->getUnderlyingModel();
const MEB::OutArgs<Scalar> wrappedOutArgs = thyraModel->createOutArgs();
MEB::OutArgsSetup<Scalar> outArgs;
outArgs.setModelEvalDescription(this->description());
outArgs.set_Np_Ng(wrappedOutArgs.Np(),wrappedOutArgs.Ng());
outArgs.setSupports(wrappedOutArgs);
outArgs.setSupports(MEB::OUT_ARG_W,
wrappedOutArgs.supports(MEB::OUT_ARG_W_op)&&W_factory_.get()!=NULL);
return outArgs;
}
示例2:
ModelEvaluatorBase::OutArgs<Scalar>
DefaultStateEliminationModelEvaluator<Scalar>::createOutArgsImpl() const
{
typedef ModelEvaluatorBase MEB;
const Teuchos::RCP<const ModelEvaluator<Scalar> >
thyraModel = this->getUnderlyingModel();
const MEB::OutArgs<Scalar> wrappedOutArgs = thyraModel->createOutArgs();
const int Np = wrappedOutArgs.Np(), Ng = wrappedOutArgs.Ng();
MEB::OutArgsSetup<Scalar> outArgs;
outArgs.setModelEvalDescription(this->description());
outArgs.set_Np_Ng(Np,Ng);
outArgs.setSupports(wrappedOutArgs);
outArgs.setUnsupportsAndRelated(MEB::IN_ARG_x); // wipe out DgDx ...
outArgs.setUnsupportsAndRelated(MEB::OUT_ARG_f); // wipe out f, W, DfDp ...
return outArgs;
}
示例3: assertInArgsOutArgsSetup
void ModelEvaluatorDefaultBase<Scalar>::initializeDefaultBase()
{
typedef ModelEvaluatorBase MEB;
// In case we throw half way thorugh, set to uninitialized
isInitialized_ = false;
default_W_support_ = false;
//
// A) Get the InArgs and OutArgs from the subclass
//
const MEB::InArgs<Scalar> inArgs = this->createInArgs();
const MEB::OutArgs<Scalar> outArgsImpl = this->createOutArgsImpl();
//
// B) Validate the subclasses InArgs and OutArgs
//
#ifdef TEUCHOS_DEBUG
assertInArgsOutArgsSetup( this->description(), inArgs, outArgsImpl );
#endif // TEUCHOS_DEBUG
//
// C) Set up support for default derivative objects and prototype OutArgs
//
const int l_Ng = outArgsImpl.Ng();
const int l_Np = outArgsImpl.Np();
// Set support for all outputs supported in the underly implementation
MEB::OutArgsSetup<Scalar> outArgs;
outArgs.setModelEvalDescription(this->description());
outArgs.set_Np_Ng(l_Np,l_Ng);
outArgs.setSupports(outArgsImpl);
// DfDp
DfDp_default_op_support_.clear();
if (outArgs.supports(MEB::OUT_ARG_f)) {
for ( int l = 0; l < l_Np; ++l ) {
const MEB::DerivativeSupport DfDp_l_impl_support =
outArgsImpl.supports(MEB::OUT_ARG_DfDp,l);
const DefaultDerivLinearOpSupport DfDp_l_op_support =
determineDefaultDerivLinearOpSupport(DfDp_l_impl_support);
DfDp_default_op_support_.push_back(DfDp_l_op_support);
outArgs.setSupports(
MEB::OUT_ARG_DfDp, l,
updateDefaultLinearOpSupport(
DfDp_l_impl_support, DfDp_l_op_support
)
);
}
}
// DgDx_dot
DgDx_dot_default_op_support_.clear();
for ( int j = 0; j < l_Ng; ++j ) {
const MEB::DerivativeSupport DgDx_dot_j_impl_support =
outArgsImpl.supports(MEB::OUT_ARG_DgDx_dot,j);
const DefaultDerivLinearOpSupport DgDx_dot_j_op_support =
determineDefaultDerivLinearOpSupport(DgDx_dot_j_impl_support);
DgDx_dot_default_op_support_.push_back(DgDx_dot_j_op_support);
outArgs.setSupports(
MEB::OUT_ARG_DgDx_dot, j,
updateDefaultLinearOpSupport(
DgDx_dot_j_impl_support, DgDx_dot_j_op_support
)
);
}
// DgDx
DgDx_default_op_support_.clear();
for ( int j = 0; j < l_Ng; ++j ) {
const MEB::DerivativeSupport DgDx_j_impl_support =
outArgsImpl.supports(MEB::OUT_ARG_DgDx,j);
const DefaultDerivLinearOpSupport DgDx_j_op_support =
determineDefaultDerivLinearOpSupport(DgDx_j_impl_support);
DgDx_default_op_support_.push_back(DgDx_j_op_support);
outArgs.setSupports(
MEB::OUT_ARG_DgDx, j,
updateDefaultLinearOpSupport(
DgDx_j_impl_support, DgDx_j_op_support
)
);
}
// DgDp
DgDp_default_op_support_.clear();
DgDp_default_mv_support_.clear();
for ( int j = 0; j < l_Ng; ++j ) {
DgDp_default_op_support_.push_back(Array<DefaultDerivLinearOpSupport>());
DgDp_default_mv_support_.push_back(Array<DefaultDerivMvAdjointSupport>());
for ( int l = 0; l < l_Np; ++l ) {
const MEB::DerivativeSupport DgDp_j_l_impl_support =
outArgsImpl.supports(MEB::OUT_ARG_DgDp,j,l);
// LinearOpBase support
const DefaultDerivLinearOpSupport DgDp_j_l_op_support =
determineDefaultDerivLinearOpSupport(DgDp_j_l_impl_support);
DgDp_default_op_support_[j].push_back(DgDp_j_l_op_support);
//.........这里部分代码省略.........