42#ifndef STOKHOS_SGMODELEVALUATOR_INTERLACED_HPP
43#define STOKHOS_SGMODELEVALUATOR_INTERLACED_HPP
47#include "EpetraExt_ModelEvaluator.h"
48#include "EpetraExt_MultiComm.h"
49#include "EpetraExt_BlockVector.h"
52#include "Teuchos_RCP.hpp"
53#include "Teuchos_Array.hpp"
54#include "Teuchos_ParameterList.hpp"
87 const Teuchos::RCP<EpetraExt::ModelEvaluator>&
me,
92 const Teuchos::RCP<Teuchos::ParameterList>&
params,
102 Teuchos::RCP<const Epetra_Map>
get_x_map()
const;
105 Teuchos::RCP<const Epetra_Map>
get_p_map(
int l)
const;
108 Teuchos::RCP<const Teuchos::Array<std::string> >
112 Teuchos::RCP<const Epetra_Vector>
get_x_init()
const;
115 Teuchos::RCP<const Epetra_Vector>
get_p_init(
int l)
const;
121 Teuchos::RCP<const Epetra_Map>
get_f_map()
const;
124 Teuchos::RCP<const Epetra_Map>
get_g_map(
int l)
const;
127 Teuchos::RCP<Epetra_Operator>
create_W()
const;
139 void evalModel(
const InArgs& inArgs,
const OutArgs& outArgs)
const;
150 Teuchos::RCP<const Stokhos::EpetraVectorOrthogPoly>
get_x_sg_init()
const;
156 Teuchos::RCP<const Stokhos::EpetraVectorOrthogPoly>
get_p_sg_init(
int l)
const;
183 Teuchos::RCP<Stokhos::EpetraVectorOrthogPoly>
188 Teuchos::RCP<Stokhos::EpetraVectorOrthogPoly>
193 Teuchos::RCP<Stokhos::EpetraMultiVectorOrthogPoly>
199 Teuchos::RCP<Stokhos::EpetraMultiVectorOrthogPoly>
205 Teuchos::RCP<Stokhos::EpetraVectorOrthogPoly>
210 Teuchos::RCP<Stokhos::EpetraVectorOrthogPoly>
215 Teuchos::RCP<Stokhos::EpetraVectorOrthogPoly>
220 Teuchos::RCP<Stokhos::EpetraMultiVectorOrthogPoly>
225 Teuchos::RCP<Stokhos::EpetraMultiVectorOrthogPoly>
230 Teuchos::RCP<Stokhos::EpetraVectorOrthogPoly>
235 Teuchos::RCP<Stokhos::EpetraMultiVectorOrthogPoly>
244 static Teuchos::RCP<Epetra_Map>
260 Teuchos::RCP<EpetraExt::ModelEvaluator>
me;
263 Teuchos::RCP<const Stokhos::OrthogPolyBasis<int, double> >
sg_basis;
266 Teuchos::RCP<const Stokhos::Quadrature<int,double> >
sg_quad;
269 Teuchos::RCP<Stokhos::OrthogPolyExpansion<int,double> >
sg_exp;
272 Teuchos::RCP<Teuchos::ParameterList>
params;
287 Teuchos::RCP<const Epetra_Map>
x_map;
290 Teuchos::RCP<const Epetra_Map>
f_map;
296 Teuchos::RCP<const EpetraExt::MultiComm>
sg_comm;
341 Teuchos::Array< Teuchos::RCP<const Epetra_Map> >
sg_p_map;
344 Teuchos::Array< Teuchos::RCP< Teuchos::Array<std::string> > >
sg_p_names;
356 Teuchos::Array< Teuchos::RCP<const Epetra_Map> >
sg_g_map;
365 mutable Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly >
f_sg_blocks;
368 mutable Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly >
W_sg_blocks;
370 mutable Teuchos::Array< Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > >
dfdp_sg_blocks;
376 mutable Teuchos::Array< Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > >
dgdx_sg_blocks;
379 Teuchos::RCP<Stokhos::EpetraVectorOrthogPoly>
sg_x_init;
382 Teuchos::Array< Teuchos::RCP<Stokhos::EpetraVectorOrthogPoly> >
sg_p_init;
388 mutable Teuchos::RCP<Stokhos::SGOperator>
my_W;
391 mutable Teuchos::RCP<Epetra_Vector>
my_x;
A container class storing an orthogonal polynomial whose coefficients are vectors,...
Abstract base class for multivariate orthogonal polynomials.
Abstract base class for orthogonal polynomial-based expansions.
Abstract base class for quadrature methods.
Base class for stochastic Galerkin model evaluators.
Nonlinear, stochastic Galerkin ModelEvaluator that constructs a interlaced Jacobian.
Teuchos::RCP< const Epetra_Map > get_p_map(int l) const
Return parameter vector map.
Teuchos::RCP< const Epetra_Vector > get_p_init(int l) const
Return initial parameters.
Teuchos::RCP< const Stokhos::Quadrature< int, double > > sg_quad
Stochastic Galerkin quadrature.
Teuchos::Array< Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > > dfdp_sg_blocks
Teuchos::RCP< const Stokhos::EpetraVectorOrthogPoly > get_p_sg_init(int l) const
Return initial SG parameters.
Teuchos::RCP< Epetra_Operator > create_W() const
Create W = alpha*M + beta*J matrix.
Teuchos::RCP< const Teuchos::Array< std::string > > get_p_names(int l) const
Return array of parameter names.
Teuchos::RCP< Epetra_Import > interlace_overlapped_x_importer
Importer from SG to SG-overlapped maps.
Teuchos::RCP< const Epetra_BlockMap > get_x_sg_overlap_map() const
Return x sg overlap map.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > create_x_sg_overlap(Epetra_DataAccess CV=Copy, const Epetra_Vector *v=NULL) const
Create vector orthog poly using x map and overlap sg map.
static Teuchos::RCP< Epetra_Map > buildInterlaceMap(const Epetra_BlockMap &determ_map, const Epetra_BlockMap &stocha_map)
Teuchos::RCP< const Epetra_Map > get_g_map(int l) const
Return response map.
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > create_x_mv_sg(int num_vecs, Epetra_DataAccess CV=Copy, const Epetra_MultiVector *v=NULL) const
Create vector orthog poly using x map and owned sg map.
static void copyToPolyOrthogVector(const Epetra_Vector &x, Stokhos::EpetraVectorOrthogPoly &x_sg)
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > create_g_sg(int l, Epetra_DataAccess CV=Copy, const Epetra_Vector *v=NULL) const
Create vector orthog poly using g map.
Teuchos::RCP< const Stokhos::EpetraSparse3Tensor > serialCijk
Serial Epetra Cijk for dgdx*.
Teuchos::RCP< Stokhos::SGOperator > my_W
W pointer for evaluating W with f.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > x_dot_sg_blocks
x_dot stochastic Galerkin components
Teuchos::Array< Teuchos::RCP< const Epetra_Map > > get_g_sg_base_maps() const
Get base maps of SG responses.
Teuchos::Array< Teuchos::RCP< Teuchos::Array< std::string > > > sg_p_names
SG coefficient parameter names.
Teuchos::Array< Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > > dgdx_sg_blocks
dg/dx stochastic Galerkin components
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > create_f_sg(Epetra_DataAccess CV=Copy, const Epetra_Vector *v=NULL) const
Create vector orthog poly using f map and owned sg map.
bool eval_W_with_f
Whether to always evaluate W with f.
static void copyToInterlacedVector(const Stokhos::EpetraVectorOrthogPoly &x_sg, Epetra_Vector &x)
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > sg_x_init
SG initial x.
Teuchos::RCP< Stokhos::OrthogPolyExpansion< int, double > > sg_exp
Stochastic Galerkin expansion.
Teuchos::Array< int > sg_p_index_map
Index map between block-p and p_sg maps.
Teuchos::RCP< const Epetra_BlockMap > overlapped_stoch_row_map
Overlapped map for stochastic blocks (local map)
unsigned int num_p_blocks
Number of p stochastic blocks (may be smaller than num_sg_blocks)
Teuchos::RCP< const Stokhos::EpetraSparse3Tensor > epetraCijk
Epetra Cijk.
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > create_f_mv_sg(int num_vecs, Epetra_DataAccess CV=Copy, const Epetra_MultiVector *v=NULL) const
Create multi-vector orthog poly using f map and owned sg map.
void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const
Evaluate model on InArgs.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > create_x_sg(Epetra_DataAccess CV=Copy, const Epetra_Vector *v=NULL) const
Create vector orthog poly using x map and owned sg map.
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > create_f_mv_sg_overlap(int num_vecs, Epetra_DataAccess CV=Copy, const Epetra_MultiVector *v=NULL) const
Create multi-vector orthog poly using f map and overlap sg map.
bool supports_x
Whether we support x (and thus f and W)
Teuchos::RCP< const Epetra_BlockMap > overlapped_stoch_p_map
Overlapped map for p stochastic blocks (local map)
int num_p_sg
Number of stochastic parameter vectors.
Teuchos::RCP< const Epetra_BlockMap > stoch_row_map
Map for stochastic blocks.
Teuchos::RCP< EpetraExt::ModelEvaluator > me
Underlying model evaluator.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > f_sg_blocks
f stochastic Galerkin components
int num_p
Number of parameter vectors of underlying model evaluator.
Teuchos::RCP< Epetra_Vector > my_x
x pointer for evaluating preconditioner
unsigned int num_sg_blocks
Number of stochastic blocks.
Teuchos::Array< int > get_p_sg_map_indices() const
Get indices of SG parameters.
Teuchos::RCP< const Epetra_Map > interlace_f_map
Block SG residual map.
Teuchos::RCP< const Epetra_Vector > get_x_init() const
Return initial solution.
Teuchos::Array< Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > > sg_p_init
SG initial p.
int num_g_sg
Number of stochastic response vectors.
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > create_x_mv_sg_overlap(int num_vecs, Epetra_DataAccess CV=Copy, const Epetra_MultiVector *v=NULL) const
Create vector orthog poly using x map and overlap sg map.
Teuchos::RCP< Epetra_Export > interlace_overlapped_f_exporter
Exporter from SG-overlapped to SG maps.
Teuchos::RCP< const Epetra_Import > get_x_sg_importer() const
Return x sg importer.
Teuchos::RCP< const Epetra_Map > f_map
Underlying residual map.
Teuchos::RCP< const EpetraExt::MultiComm > sg_comm
Parallel SG communicator.
Teuchos::RCP< const Epetra_Map > get_f_map() const
Return residual vector map.
Teuchos::Array< Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > > dgdx_dot_sg_blocks
dg/dxdot stochastic Galerkin components
Teuchos::RCP< const Stokhos::EpetraVectorOrthogPoly > get_x_sg_init() const
Return initial SG x.
Teuchos::Array< int > sg_g_index_map
Index map between block-g and g_sg maps.
InArgs createInArgs() const
Create InArgs.
Teuchos::RCP< const Epetra_Map > interlace_overlapped_f_map
Block SG overlapped residual map.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > create_p_sg(int l, Epetra_DataAccess CV=Copy, const Epetra_Vector *v=NULL) const
Create vector orthog poly using p map.
void set_x_sg_init(const Stokhos::EpetraVectorOrthogPoly &x_sg_in)
Set initial solution polynomial.
Teuchos::Array< Teuchos::RCP< const Epetra_Map > > sg_g_map
Block SG response map.
Teuchos::Array< Teuchos::RCP< const Epetra_Map > > sg_p_map
Block SG parameter map.
Teuchos::RCP< Teuchos::ParameterList > params
Algorithmic parameters.
void set_p_sg_init(int i, const Stokhos::EpetraVectorOrthogPoly &p_sg_in)
Set initial parameter polynomial.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > create_f_sg_overlap(Epetra_DataAccess CV=Copy, const Epetra_Vector *v=NULL) const
Create vector orthog poly using f map and overlap sg map.
Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > sg_basis
Stochastic Galerkin basis.
Teuchos::RCP< const Epetra_Map > interlace_overlapped_x_map
Block SG overlapped unknown map.
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > W_sg_blocks
W stochastic Galerkin components.
Teuchos::RCP< const Epetra_BlockMap > get_overlap_stochastic_map() const
Return overlap stochastic map.
Teuchos::RCP< const Epetra_Map > x_map
Underlying unknown map.
Teuchos::RCP< const Stokhos::ParallelData > sg_parallel_data
Parallel SG data.
int num_g
Number of response vectors of underlying model evaluator.
Teuchos::Array< int > get_g_sg_map_indices() const
Get indices of SG responses.
Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > create_g_mv_sg(int l, int num_vecs, Epetra_DataAccess CV=Copy, const Epetra_MultiVector *v=NULL) const
Create multi-vector orthog poly using g map.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > x_sg_blocks
x stochastic Galerkin components
unsigned int num_W_blocks
Number of W stochastic blocks (may be smaller than num_sg_blocks)
Teuchos::RCP< const Epetra_Map > interlace_x_map
Block SG unknown map.
OutArgs createOutArgs() const
Create OutArgs.
Teuchos::RCP< const Epetra_Map > get_x_map() const
Return solution vector map.
Top-level namespace for Stokhos classes and functions.