本文整理汇总了C++中teuchos::RCP::ApplyAdjointHessian22ToVec方法的典型用法代码示例。如果您正苦于以下问题:C++ RCP::ApplyAdjointHessian22ToVec方法的具体用法?C++ RCP::ApplyAdjointHessian22ToVec怎么用?C++ RCP::ApplyAdjointHessian22ToVec使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类teuchos::RCP
的用法示例。
在下文中一共展示了RCP::ApplyAdjointHessian22ToVec方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void applyAdjointHessian_22(ROL::Vector<Real> &ahwv, const ROL::Vector<Real> &w, const ROL::Vector<Real> &v,
const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol) {
Teuchos::RCP<Tpetra::MultiVector<> > ahwvp = (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real> >(ahwv)).getVector();
Teuchos::RCP<const Tpetra::MultiVector<> > wp = (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real> >(w)).getVector();
Teuchos::RCP<const Tpetra::MultiVector<> > vp = (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real> >(v)).getVector();
Teuchos::RCP<const Tpetra::MultiVector<> > up = (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real> >(u)).getVector();
Teuchos::RCP<const Tpetra::MultiVector<> > zp = (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real> >(z)).getVector();
data_->updateMaterialDensity (zp);
data_->ApplyAdjointHessian22ToVec (ahwvp, up, vp, wp);
}
示例2:
void hessVec_22(ROL::Vector<Real> &hv, const ROL::Vector<Real> &v,
const ROL::Vector<Real> &u, const ROL::Vector<Real> &z, Real &tol) {
Teuchos::RCP<Tpetra::MultiVector<> > hvp = (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real> >(hv)).getVector();
Teuchos::RCP<const Tpetra::MultiVector<> > vp = (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real> >(v)).getVector();
Teuchos::RCP<const Tpetra::MultiVector<> > up = (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real> >(u)).getVector();
Teuchos::RCP<const Tpetra::MultiVector<> > zp = (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real> >(z)).getVector();
data_->updateMaterialDensity (zp);
data_->ApplyAdjointHessian22ToVec (hvp, up, vp, up);
hvp->update(alpha_, *vp, 0.5);
}
示例3:
void hessVec_22(ROL::Vector<Real> &hv,
const ROL::Vector<Real> &v,
const ROL::Vector<Real> &u,
const ROL::Vector<Real> &z,
Real &tol) {
Teuchos::RCP<Tpetra::MultiVector<> > hvp
= (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real> >(hv)).getVector();
Teuchos::RCP<const Tpetra::MultiVector<> > vp
= (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real> >(v)).getVector();
if ( useFU_ ) {
hv.zero();
}
else {
Teuchos::RCP<const Tpetra::MultiVector<> > up
= (Teuchos::dyn_cast<const ROL::TpetraMultiVector<Real> >(u)).getVector();
Teuchos::RCP<Tpetra::MultiVector<> > Fvp
= Teuchos::rcp(new Tpetra::MultiVector<>(vp->getMap(), 1));
filter_->apply(Fvp, vp);
Teuchos::RCP<Tpetra::MultiVector<> > tmp
= Teuchos::rcp(new Tpetra::MultiVector<>(hvp->getMap(), 1));
data_->ApplyAdjointHessian22ToVec (tmp, up, Fvp, up);
filter_->apply(hvp, tmp);
}
}