24class NonLinearProblem :
public Problem<SC,LO,GO,NO> ,
public Thyra::StateFuncModelEvaluatorBase<SC> {
28 typedef Problem<SC,LO,GO,NO> Problem_Type;
29 typedef typename Problem_Type::CommConstPtr_Type CommConstPtr_Type;
30 typedef typename Problem_Type::MapConstPtr_Type MapConstPtr_Type;
31 typedef typename Problem_Type::MultiVector_Type MultiVector_Type;
32 typedef typename Problem_Type::MultiVectorPtr_Type MultiVectorPtr_Type;
33 typedef typename Problem_Type::MultiVectorConstPtr_Type MultiVectorConstPtr_Type;
34 typedef typename Problem_Type::BlockMultiVector_Type BlockMultiVector_Type;
35 typedef typename Problem_Type::BlockMultiVectorPtr_Type BlockMultiVectorPtr_Type;
37 typedef typename Problem_Type::Matrix_Type Matrix_Type;
38 typedef typename Problem_Type::MatrixPtr_Type MatrixPtr_Type;
40 typedef typename Problem_Type::BlockMatrix_Type BlockMatrix_Type;
41 typedef typename Problem_Type::BlockMatrixPtr_Type BlockMatrixPtr_Type;
44 typedef Tpetra::Map<LO,GO,NO> TpetraMap_Type;
45 typedef Teuchos::RCP<TpetraMap_Type> TpetraMapPtr_Type;
46 typedef Teuchos::RCP<const TpetraMap_Type> TpetraMapConstPtr_Type;
47 typedef const TpetraMapConstPtr_Type TpetraMapConstPtrConst_Type;
51 typedef Teuchos::RCP<BlockMap_Type> BlockMapPtr_Type;
52 typedef Teuchos::RCP<const BlockMap_Type> BlockMapConstPtr_Type;
53 typedef Teuchos::Array<BlockMultiVectorPtr_Type> BlockMultiVectorPtrArray_Type;
55 typedef Thyra::VectorSpaceBase<SC> ThyraVecSpace_Type;
56 typedef Teuchos::RCP<const ThyraVecSpace_Type> ThyraVecSpaceConstPtr_Type;
57 typedef Thyra::VectorBase<SC> ThyraVec_Type;
58 typedef Tpetra::CrsMatrix<SC, LO, GO, NO> TpetraMatrix_Type;
59 typedef Thyra::LinearOpBase<SC> ThyraOp_Type;
60 typedef Tpetra::Operator<SC,LO,GO,NO> TpetraOp_Type;
62 NonLinearProblem(CommConstPtr_Type comm);
64 NonLinearProblem(ParameterListPtr_Type ¶meterList, CommConstPtr_Type comm);
68 virtual void info() = 0;
70 void infoNonlinProblem();
72 void initializeProblem(
int nmbVectors=1);
74 virtual void assemble( std::string type =
"" )
const = 0;
76 virtual void getValuesOfInterest( vec_dbl_Type& values ) = 0;
78 int solveAndUpdate(
const std::string& criterion ,
double& criterionValue );
84 virtual void reAssemble( BlockMultiVectorPtr_Type previousSolution )
const = 0;
86 void reAssembleAndFill( BlockMatrixPtr_Type bMat, std::string type=
"FixedPoint" );
88 virtual void reAssembleExtrapolation(BlockMultiVectorPtrArray_Type previousSolutions) = 0;
92 void initializeVectorsNonLinear(
int nmbVectors=1);
94 double calculateResidualNorm()
const;
96 virtual void calculateNonLinResidualVec(std::string type=
"standard",
double time=0.)
const = 0;
99 virtual void calculateNonLinResidualVec(
SmallMatrix<double>& coeff, std::string type=
"standard",
double time=0.);
101 BlockMultiVectorPtr_Type getResidualVector()
const;
103 BlockMultiVectorPtr_Type getPreviousSolution()
const{
return previousSolution_; };
105 virtual Thyra::ModelEvaluatorBase::InArgs<SC> getNominalValues()
const;
107 virtual Teuchos::RCP<const ::Thyra::VectorSpaceBase<SC> > get_x_space()
const;
109 virtual Teuchos::RCP<const ::Thyra::VectorSpaceBase<SC> > get_f_space()
const;
111 virtual ::Thyra::ModelEvaluatorBase::InArgs<SC> createInArgs()
const;
113 void initNOXParameters( );
115 void initVectorSpaces( );
117 void initVectorSpacesMonolithic( );
119 void initVectorSpacesBlock( );
121 virtual void evalModelImpl(const ::Thyra::ModelEvaluatorBase::InArgs<SC> &inArgs,
122 const ::Thyra::ModelEvaluatorBase::OutArgs<SC> &outArgs)
const = 0;
124 virtual ::Thyra::ModelEvaluatorBase::OutArgs<SC> createOutArgsImpl()
const;
126 double nonLinearTolerance_;
127 BlockMultiVectorPtr_Type previousSolution_;
128 mutable BlockMultiVectorPtr_Type residualVec_;
133 Thyra::ModelEvaluatorBase::InArgs<SC> nominalValues_;
135 ::Thyra::ModelEvaluatorBase::InArgs<SC> prototypeInArgs_;
136 ::Thyra::ModelEvaluatorBase::OutArgs<SC> prototypeOutArgs_;
138 Teuchos::RCP<const ThyraVecSpace_Type> xSpace_;
139 Teuchos::RCP<const ThyraVecSpace_Type> fSpace_;
141 Teuchos::RCP<ThyraVec_Type> x0_;