28class NonLinearProblem :
public Problem<SC,LO,GO,NO> ,
public Thyra::StateFuncModelEvaluatorBase<SC> {
32 typedef Problem<SC,LO,GO,NO> Problem_Type;
33 typedef typename Problem_Type::CommConstPtr_Type CommConstPtr_Type;
34 typedef typename Problem_Type::MapConstPtr_Type MapConstPtr_Type;
35 typedef typename Problem_Type::MultiVector_Type MultiVector_Type;
36 typedef typename Problem_Type::MultiVectorPtr_Type MultiVectorPtr_Type;
37 typedef typename Problem_Type::MultiVectorConstPtr_Type MultiVectorConstPtr_Type;
38 typedef typename Problem_Type::BlockMultiVector_Type BlockMultiVector_Type;
39 typedef typename Problem_Type::BlockMultiVectorPtr_Type BlockMultiVectorPtr_Type;
41 typedef typename Problem_Type::Matrix_Type Matrix_Type;
42 typedef typename Problem_Type::MatrixPtr_Type MatrixPtr_Type;
44 typedef typename Problem_Type::BlockMatrix_Type BlockMatrix_Type;
45 typedef typename Problem_Type::BlockMatrixPtr_Type BlockMatrixPtr_Type;
48 typedef Tpetra::Map<LO,GO,NO> TpetraMap_Type;
49 typedef Teuchos::RCP<TpetraMap_Type> TpetraMapPtr_Type;
50 typedef Teuchos::RCP<const TpetraMap_Type> TpetraMapConstPtr_Type;
51 typedef const TpetraMapConstPtr_Type TpetraMapConstPtrConst_Type;
55 typedef Teuchos::RCP<BlockMap_Type> BlockMapPtr_Type;
56 typedef Teuchos::RCP<const BlockMap_Type> BlockMapConstPtr_Type;
57 typedef Teuchos::Array<BlockMultiVectorPtr_Type> BlockMultiVectorPtrArray_Type;
61 using ThyraVecSpace_Type =
typename ThyraTypes::ThyraVecSpace_Type;
62 typedef Teuchos::RCP<const ThyraVecSpace_Type> ThyraVecSpaceConstPtr_Type;
63 using ThyraVec_Type =
typename ThyraTypes::ThyraVec_Type;
64 using TpetraMatrix_Type =
typename TpetraTypes::TpetraMatrix_Type;
65 using ThyraOp_Type =
typename ThyraTypes::ThyraOp_Type;
66 using TpetraOp_Type =
typename TpetraTypes::TpetraOp_Type;
67 typedef Thyra::BlockedLinearOpBase<SC> ThyraBlockOp_Type;
80 virtual void info() = 0;
91 virtual void assemble( std::string type =
"" )
const = 0;
110 virtual void reAssemble( BlockMultiVectorPtr_Type previousSolution )
const = 0;
112 void reAssembleAndFill( BlockMatrixPtr_Type bMat, std::string type=
"FixedPoint" );
114 virtual void reAssembleExtrapolation(BlockMultiVectorPtrArray_Type previousSolutions) = 0;
140 virtual Thyra::ModelEvaluatorBase::InArgs<SC> getNominalValues()
const;
142 virtual Teuchos::RCP<const ::Thyra::VectorSpaceBase<SC> > get_x_space()
const;
144 virtual Teuchos::RCP<const ::Thyra::VectorSpaceBase<SC> > get_f_space()
const;
146 virtual ::Thyra::ModelEvaluatorBase::InArgs<SC> createInArgs()
const;
148 void initNOXParameters( );
150 void initVectorSpaces( );
152 void initVectorSpacesMonolithic( );
154 void initVectorSpacesBlock( );
156 virtual ::Thyra::ModelEvaluatorBase::OutArgs<SC> createOutArgsImpl()
const;
159 void setNonlinearIterationStep(
int newtonStep) { this->newtonStep_ = newtonStep;}
163 double nonLinearTolerance_;
164 BlockMultiVectorPtr_Type previousSolution_;
165 mutable BlockMultiVectorPtr_Type residualVec_;
168 mutable int newtonStep_;
171 Teuchos::RCP< Thyra::LinearOpBase<SC> > create_W_op_Monolithic()
const;
173 Teuchos::RCP< Thyra::LinearOpBase<SC> > create_W_op_Block()
const;
175 Teuchos::RCP<Thyra::PreconditionerBase<SC> > create_W_prec()
const;
179 mutable bool precInitOnly_;
185 Thyra::ModelEvaluatorBase::InArgs<SC> nominalValues_;
187 Thyra::ModelEvaluatorBase::InArgs<SC> prototypeInArgs_;
188 Thyra::ModelEvaluatorBase::OutArgs<SC> prototypeOutArgs_;
190 Teuchos::RCP<const ThyraVecSpace_Type> xSpace_;
191 Teuchos::RCP<const ThyraVecSpace_Type> fSpace_;
193 Teuchos::RCP<ThyraVec_Type> x0_;
195 virtual void evalModelImpl(
196 const ::Thyra::ModelEvaluatorBase::InArgs<SC> &inArgs,
197 const ::Thyra::ModelEvaluatorBase::OutArgs<SC> &outArgs
200 void evalModelImplMonolithic(const ::Thyra::ModelEvaluatorBase::InArgs<SC> &inArgs,
201 const ::Thyra::ModelEvaluatorBase::OutArgs<SC> &outArgs)
const;
204 void evalModelImplBlock(const ::Thyra::ModelEvaluatorBase::InArgs<SC> &inArgs,
205 const ::Thyra::ModelEvaluatorBase::OutArgs<SC> &outArgs)
const;