예제 #1
0
  void applyJacobian_2(ROL::Vector<Real> &jv, const ROL::Vector<Real> &v, const ROL::Vector<Real> &u,
                       const ROL::Vector<Real> &z, Real &tol) {
    Teuchos::RCP<Tpetra::MultiVector<> > jvp = (Teuchos::dyn_cast<ROL::TpetraMultiVector<Real> >(jv)).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_->ApplyJacobian2ToVec (jvp, up, vp);
  }
예제 #2
0
 void hessVec_12(ROL::Vector<Real> &hv,
           const ROL::Vector<Real> &v,
           const ROL::Vector<Real> &u,
           const ROL::Vector<Real> &z,
                 Real &tol) {
   if ( useFU_ ) {
     hv.zero();
   }
   else {
     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<Tpetra::MultiVector<> > Fvp
       = Teuchos::rcp(new Tpetra::MultiVector<>(vp->getMap(), 1));
     filter_->apply(Fvp, vp);
     data_->ApplyJacobian2ToVec (hvp, up, Fvp);
     Real two(2);
     hvp->scale(two*scale_);
   }
 }