44 #ifndef NOX_EPETRA_LINEARSYSTEMSGJACOBI_H 45 #define NOX_EPETRA_LINEARSYSTEMSGJACOBI_H 49 #ifdef HAVE_STOKHOS_NOX 51 #include "NOX_Common.H" 53 #include "NOX_Epetra_LinearSystem.H" 54 #include "NOX_Utils.H" 82 class LinearSystemSGJacobi :
public virtual NOX::Epetra::LinearSystem {
88 Teuchos::ParameterList& printingParams,
89 Teuchos::ParameterList& linearSolverParams,
90 const Teuchos::RCP<NOX::Epetra::LinearSystem>& detsolve,
91 const Teuchos::RCP<NOX::Epetra::Interface::Required>& iReq,
92 const Teuchos::RCP<NOX::Epetra::Interface::Jacobian>& iJac,
94 const Teuchos::RCP<const Stokhos::ParallelData>& sg_parallel_data,
95 const Teuchos::RCP<Epetra_Operator>& J,
96 const Teuchos::RCP<const Epetra_Map>& base_map,
97 const Teuchos::RCP<const Epetra_Map>& sg_map,
98 const Teuchos::RCP<NOX::Epetra::Scaling> scalingObject =
102 virtual ~LinearSystemSGJacobi();
108 virtual bool applyJacobian(
const NOX::Epetra::Vector& input,
109 NOX::Epetra::Vector& result)
const;
115 virtual bool applyJacobianTranspose(
const NOX::Epetra::Vector& input,
116 NOX::Epetra::Vector& result)
const;
122 virtual bool applyJacobianInverse(Teuchos::ParameterList ¶ms,
123 const NOX::Epetra::Vector &input,
124 NOX::Epetra::Vector &result);
127 virtual bool applyRightPreconditioning(
bool useTranspose,
128 Teuchos::ParameterList& params,
129 const NOX::Epetra::Vector& input,
130 NOX::Epetra::Vector& result)
const;
133 virtual Teuchos::RCP<NOX::Epetra::Scaling> getScaling();
136 virtual void resetScaling(
const Teuchos::RCP<NOX::Epetra::Scaling>& s);
139 virtual bool computeJacobian(
const NOX::Epetra::Vector&
x);
142 virtual bool createPreconditioner(
const NOX::Epetra::Vector&
x,
143 Teuchos::ParameterList& p,
144 bool recomputeGraph)
const;
147 virtual bool destroyPreconditioner()
const;
150 virtual bool recomputePreconditioner(
const NOX::Epetra::Vector&
x,
151 Teuchos::ParameterList& linearSolverParams)
const;
154 virtual PreconditionerReusePolicyType
155 getPreconditionerPolicy(
bool advanceReuseCounter=
true);
158 virtual bool isPreconditionerConstructed()
const;
161 virtual bool hasPreconditioner()
const;
164 virtual Teuchos::RCP<const Epetra_Operator>
165 getJacobianOperator()
const;
168 virtual Teuchos::RCP<Epetra_Operator> getJacobianOperator();
171 virtual Teuchos::RCP<const Epetra_Operator>
172 getGeneratedPrecOperator()
const;
175 virtual Teuchos::RCP<Epetra_Operator> getGeneratedPrecOperator();
178 virtual void setJacobianOperatorForSolve(
const Teuchos::RCP<const Epetra_Operator>& solveJacOp);
181 virtual void setPrecOperatorForSolve(
const Teuchos::RCP<const Epetra_Operator>& solvePrecOp);
186 Teuchos::RCP<NOX::Epetra::LinearSystem> det_solver;
189 Teuchos::RCP<const Stokhos::EpetraSparse3Tensor> epetraCijk;
192 Teuchos::RCP<NOX::Epetra::Interface::Jacobian> jacInterfacePtr;
195 mutable Teuchos::RCP<Stokhos::SGOperator> sg_op;
198 mutable Teuchos::RCP<Stokhos::EpetraOperatorOrthogPoly > sg_poly;
201 Teuchos::RCP<const Epetra_Map> base_map;
204 Teuchos::RCP<const Epetra_Map> sg_map;
207 Teuchos::RCP<NOX::Epetra::Scaling> scaling;
213 mutable Teuchos::RCP<EpetraExt::BlockVector> sg_df_block;
216 mutable Teuchos::RCP<Epetra_Vector> kx;
219 Teuchos::RCP<Stokhos::SGOperator> mat_free_op;
const IndexType const IndexType const IndexType const IndexType const ValueType const ValueType * x