46 #include "EpetraExt_BlockUtility.h"
47 #include "EpetraExt_BlockMultiVector.h"
69 num_sg_blocks(sg_basis->size()),
70 num_W_blocks(sg_basis->size()),
71 num_p_blocks(sg_basis->size()),
73 x_map(me->get_x_map()),
74 f_map(me->get_f_map()),
75 sg_parallel_data(sg_parallel_data_),
76 sg_comm(sg_parallel_data->getMultiComm()),
77 epetraCijk(sg_parallel_data->getEpetraCijk()),
107 stoch_row_map =
epetraCijk->getStochasticRowMap();
148 std::string W_expansion_type =
149 params->
get(
"Jacobian Expansion Type",
"Full");
150 if (W_expansion_type ==
"Linear")
164 W_sg_blocks->setCoeffPtr(i,
me->create_W());
172 InArgs me_inargs =
me->createInArgs();
173 OutArgs me_outargs =
me->createOutArgs();
174 num_p = me_inargs.Np();
177 for (
int i=0; i<
num_p; i++) {
178 if (me_inargs.supports(IN_ARG_p_sg, i))
188 std::string p_expansion_type =
189 params->
get(
"Parameter Expansion Type",
"Full");
190 if (p_expansion_type ==
"Linear")
211 for (
int j=0;
j<p_names->size();
j++) {
212 std::stringstream ss;
213 ss << (*p_names)[
j] <<
" -- SG Coefficient " << i;
227 num_g = me_outargs.Ng();
230 for (
int i=0; i<
num_g; i++) {
231 if (me_outargs.supports(OUT_ARG_g_sg, i))
274 return interlace_x_map;
280 return interlace_f_map;
287 "Error! Invalid p map index " << l);
289 return me->get_p_map(l);
291 return sg_p_map[l-num_p];
300 "Error! Invalid g map index " << l);
308 "Error! Invalid p map index " << l);
310 return me->get_p_names(l);
312 return sg_p_names[l-num_p];
320 return sg_x_init->getBlockVector();
327 "Error! Invalid p map index " << l);
329 return me->get_p_init(l);
331 return sg_p_init[l-num_p]->getBlockVector();
348 my_W->setupOperator(W_sg_blocks);
356 EpetraExt::ModelEvaluator::InArgs
360 InArgs me_inargs = me->createInArgs();
362 inArgs.setModelEvalDescription(this->description());
363 inArgs.set_Np(num_p + num_p_sg);
364 inArgs.setSupports(IN_ARG_x_dot, me_inargs.supports(IN_ARG_x_dot_sg));
365 inArgs.setSupports(IN_ARG_x, me_inargs.supports(IN_ARG_x_sg));
366 inArgs.setSupports(IN_ARG_t, me_inargs.supports(IN_ARG_t));
367 inArgs.setSupports(IN_ARG_alpha, me_inargs.supports(IN_ARG_alpha));
368 inArgs.setSupports(IN_ARG_beta, me_inargs.supports(IN_ARG_beta));
369 inArgs.setSupports(IN_ARG_sg_basis, me_inargs.supports(IN_ARG_sg_basis));
370 inArgs.setSupports(IN_ARG_sg_quadrature,
371 me_inargs.supports(IN_ARG_sg_quadrature));
372 inArgs.setSupports(IN_ARG_sg_expansion,
373 me_inargs.supports(IN_ARG_sg_expansion));
378 EpetraExt::ModelEvaluator::OutArgs
381 OutArgsSetup outArgs;
382 OutArgs me_outargs = me->createOutArgs();
384 outArgs.setModelEvalDescription(this->description());
385 outArgs.set_Np_Ng(num_p+num_p_sg, num_g_sg);
386 outArgs.setSupports(OUT_ARG_f, me_outargs.supports(OUT_ARG_f_sg));
387 outArgs.setSupports(OUT_ARG_W, me_outargs.supports(OUT_ARG_W_sg));
388 outArgs.setSupports(OUT_ARG_WPrec,
false);
389 for (
int j=0;
j<num_p;
j++)
390 outArgs.setSupports(OUT_ARG_DfDp,
j,
391 me_outargs.supports(OUT_ARG_DfDp_sg,
j));
392 for (
int i=0; i<num_g_sg; i++) {
393 int ii = sg_g_index_map[i];
398 for (
int j=0;
j<num_p;
j++)
399 outArgs.setSupports(OUT_ARG_DgDp, i,
j,
400 me_outargs.supports(OUT_ARG_DgDp_sg, ii,
j));
411 const OutArgs& outArgs)
const
415 if (inArgs.supports(IN_ARG_x)) {
421 if (inArgs.supports(IN_ARG_x_dot))
422 x_dot = inArgs.get_x_dot();
425 EpetraExt::ModelEvaluator::Evaluation<Epetra_Vector> f_out;
426 if (outArgs.supports(OUT_ARG_f))
427 f_out = outArgs.get_f();
429 if (outArgs.supports(OUT_ARG_W))
430 W_out = outArgs.get_W();
433 InArgs me_inargs = me->createInArgs();
437 overlapped_x->Import(*x,*interlace_overlapped_x_importer,
Insert);
442 copyToPolyOrthogVector(*overlapped_x,*x_sg_blocks);
443 me_inargs.set_x_sg(x_sg_blocks);
448 overlapped_x_dot->Import(*x_dot,*interlace_overlapped_x_importer,
Insert);
453 copyToPolyOrthogVector(*overlapped_x_dot,*x_dot_sg_blocks);
454 me_inargs.set_x_dot_sg(x_dot_sg_blocks);
456 if (me_inargs.supports(IN_ARG_alpha))
457 me_inargs.set_alpha(inArgs.get_alpha());
458 if (me_inargs.supports(IN_ARG_beta))
459 me_inargs.set_beta(inArgs.get_beta());
460 if (me_inargs.supports(IN_ARG_t))
461 me_inargs.set_t(inArgs.get_t());
462 if (me_inargs.supports(IN_ARG_sg_basis)) {
464 me_inargs.set_sg_basis(inArgs.get_sg_basis());
466 me_inargs.set_sg_basis(sg_basis);
468 if (me_inargs.supports(IN_ARG_sg_quadrature)) {
470 me_inargs.set_sg_quadrature(inArgs.get_sg_quadrature());
472 me_inargs.set_sg_quadrature(sg_quad);
474 if (me_inargs.supports(IN_ARG_sg_expansion)) {
476 me_inargs.set_sg_expansion(inArgs.get_sg_expansion());
478 me_inargs.set_sg_expansion(sg_exp);
482 for (
int i=0; i<num_p; i++)
483 me_inargs.set_p(i, inArgs.get_p(i));
484 for (
int i=0; i<num_p_sg; i++) {
490 p = sg_p_init[i]->getBlockVector();
494 create_p_sg(sg_p_index_map[i],
View, p.
get());
495 me_inargs.set_p_sg(sg_p_index_map[i], p_sg);
499 OutArgs me_outargs = me->createOutArgs();
503 me_outargs.set_f_sg(f_sg_blocks);
505 me_outargs.set_W_sg(W_sg_blocks);
510 me_outargs.set_W_sg(W_sg_blocks);
513 for (
int i=0; i<outArgs.Np(); i++) {
514 if (!outArgs.supports(OUT_ARG_DfDp, i).none()) {
515 Derivative dfdp = outArgs.get_DfDp(i);
518 if (dfdp.getMultiVectorOrientation() == DERIV_MV_BY_COL)
521 sg_basis, overlapped_stoch_row_map,
522 me->get_f_map(), interlace_overlapped_f_map, sg_comm,
523 me->get_p_map(i)->NumMyElements()));
524 else if (dfdp.getMultiVectorOrientation() == DERIV_TRANS_MV_BY_ROW)
527 sg_basis, overlapped_stoch_row_map,
528 me->get_p_map(i), sg_comm,
529 me->get_f_map()->NumMyElements()));
530 me_outargs.set_DfDp_sg(i,
531 SGDerivative(dfdp_sg,
532 dfdp.getMultiVectorOrientation()));
535 "Error! Stokhos::SGModelEvaluator_Interlaced::evalModel " <<
536 "cannot handle operator form of df/dp!");
541 for (
int i=0; i<num_g_sg; i++) {
542 int ii = sg_g_index_map[i];
548 create_g_sg(sg_g_index_map[i],
View, g.
get());
549 me_outargs.set_g_sg(i, g_sg);
553 if (outArgs.supports(OUT_ARG_DgDx_dot, i).supports(DERIV_LINEAR_OP)) {
554 Derivative dgdx_dot = outArgs.get_DgDx_dot(i);
558 dgdx_dot.getLinearOp(),
true);
561 if (me_outargs.supports(OUT_ARG_DgDx, ii).supports(DERIV_LINEAR_OP))
562 me_outargs.set_DgDx_dot_sg(ii, sg_blocks);
564 for (
unsigned int k=0; k<num_sg_blocks; k++) {
567 sg_blocks->getCoeffPtr(k),
true)->getMultiVector();
568 dgdx_dot_sg_blocks[i]->setCoeffPtr(k, mv);
570 if (me_outargs.supports(OUT_ARG_DgDx_dot_sg, ii).supports(DERIV_MV_BY_COL))
571 me_outargs.set_DgDx_dot_sg(ii, SGDerivative(dgdx_dot_sg_blocks[i],
574 me_outargs.set_DgDx_dot_sg(ii, SGDerivative(dgdx_dot_sg_blocks[i],
575 DERIV_TRANS_MV_BY_ROW));
579 dgdx_dot.isEmpty() ==
false,
581 "Error! Stokhos::SGModelEvaluator_Interlaced::evalModel: " <<
582 "Operator form of dg/dxdot is required!");
586 if (outArgs.supports(OUT_ARG_DgDx, i).supports(DERIV_LINEAR_OP)) {
587 Derivative dgdx = outArgs.get_DgDx(i);
591 dgdx.getLinearOp(),
true);
594 if (me_outargs.supports(OUT_ARG_DgDx, ii).supports(DERIV_LINEAR_OP))
595 me_outargs.set_DgDx_sg(i, sg_blocks);
597 for (
unsigned int k=0; k<num_sg_blocks; k++) {
600 sg_blocks->getCoeffPtr(k),
true)->getMultiVector();
601 dgdx_sg_blocks[i]->setCoeffPtr(k, mv);
603 if (me_outargs.supports(OUT_ARG_DgDx_sg, ii).supports(DERIV_MV_BY_COL))
604 me_outargs.set_DgDx_sg(ii, SGDerivative(dgdx_sg_blocks[i],
607 me_outargs.set_DgDx_sg(ii, SGDerivative(dgdx_sg_blocks[i],
608 DERIV_TRANS_MV_BY_ROW));
612 dgdx.isEmpty() ==
false,
614 "Error! Stokhos::SGModelEvaluator_Interlaced::evalModel: " <<
615 "Operator form of dg/dxdot is required!");
620 for (
int j=0;
j<num_p;
j++) {
621 if (!outArgs.supports(OUT_ARG_DgDp, i,
j).none()) {
622 Derivative dgdp = outArgs.get_DgDp(i,
j);
625 if (dgdp.getMultiVectorOrientation() == DERIV_MV_BY_COL)
628 sg_basis, overlapped_stoch_row_map,
629 me->get_g_map(ii), sg_g_map[i], sg_comm,
630 View, *(dgdp.getMultiVector())));
631 else if (dgdp.getMultiVectorOrientation() == DERIV_TRANS_MV_BY_ROW) {
636 sg_basis, overlapped_stoch_row_map,
637 me->get_p_map(
j), product_map, sg_comm,
638 View, *(dgdp.getMultiVector())));
640 me_outargs.set_DgDp_sg(ii,
j,
641 SGDerivative(dgdp_sg,
642 dgdp.getMultiVectorOrientation()));
646 "Error! Stokhos::SGModelEvaluator_Interlaced::evalModel " <<
647 "cannot handle operator form of dg/dp!");
654 me->evalModel(me_inargs, me_outargs);
672 for (
int i=0; i<sg_basis->size(); i++)
673 (*f_sg_blocks)[i].Scale(sg_basis->norm_squared(i));
677 copyToInterlacedVector(*f_sg_blocks,*overlapped_f);
678 f_out->Export(*overlapped_f,*interlace_overlapped_f_exporter,
Insert);
682 for (
int i=0; i<num_p; i++) {
683 if (!outArgs.supports(OUT_ARG_DfDp, i).none()) {
684 Derivative dfdp = outArgs.get_DfDp(i);
685 SGDerivative dfdp_sg = me_outargs.get_DfDp_sg(i);
687 dfdp.getMultiVector()->Export(
688 *(dfdp_sg.getMultiVector()->getBlockMultiVector()),
689 *interlace_overlapped_f_exporter,
Insert);
699 *sg_x_init = x_sg_in;
712 *sg_p_init[i] = p_sg_in;
724 return sg_p_index_map;
730 return sg_g_index_map;
737 for (
int i=0; i<num_g; i++)
738 base_maps[i] = me->get_g_map(i);
745 return overlapped_stoch_row_map;
751 return interlace_overlapped_x_map;
757 return interlace_overlapped_x_importer;
767 sg_basis, stoch_row_map, x_map, get_x_map(), sg_comm));
770 sg_basis, stoch_row_map, x_map, get_x_map(), sg_comm,
782 sg_basis, overlapped_stoch_row_map, x_map,
783 get_x_sg_overlap_map(), sg_comm));
786 sg_basis, overlapped_stoch_row_map, x_map,
787 get_x_sg_overlap_map(), sg_comm, CV, *v));
798 sg_basis, stoch_row_map, x_map, get_x_map(), sg_comm,
802 sg_basis, stoch_row_map, x_map, get_x_map(), sg_comm,
816 sg_basis, overlapped_stoch_row_map, x_map,
817 get_x_sg_overlap_map(), sg_comm, num_vecs));
820 sg_basis, overlapped_stoch_row_map, x_map,
821 get_x_sg_overlap_map(), sg_comm, CV, *v));
831 sg_p_index_map.end(),
834 "Error! Invalid p map index " << l);
835 int ll = it - sg_p_index_map.
begin();
838 sg_basis, overlapped_stoch_p_map, me->get_p_map(l),
839 sg_p_map[ll], sg_comm));
842 sg_basis, overlapped_stoch_p_map, me->get_p_map(l),
843 sg_p_map[ll], sg_comm, CV, *v));
854 sg_basis, stoch_row_map, f_map, interlace_f_map, sg_comm));
857 sg_basis, stoch_row_map, f_map, interlace_f_map, sg_comm,
869 sg_basis, overlapped_stoch_row_map, f_map,
870 interlace_overlapped_f_map, sg_comm));
873 sg_basis, overlapped_stoch_row_map, f_map,
874 interlace_overlapped_f_map, sg_comm, CV, *v));
887 sg_basis, stoch_row_map, f_map, interlace_f_map, sg_comm,
891 sg_basis, stoch_row_map, f_map, interlace_f_map, sg_comm,
905 sg_basis, overlapped_stoch_row_map, f_map,
906 interlace_overlapped_f_map, sg_comm, num_vecs));
909 sg_basis, overlapped_stoch_row_map, f_map,
910 interlace_overlapped_f_map, sg_comm, CV, *v));
920 sg_g_index_map.end(),
923 "Error! Invalid g map index " << l);
924 int ll = it - sg_g_index_map.
begin();
927 sg_basis, overlapped_stoch_row_map,
929 sg_g_map[ll], sg_comm));
932 sg_basis, overlapped_stoch_row_map,
934 sg_g_map[ll], sg_comm, CV, *v));
945 sg_g_index_map.end(),
948 "Error! Invalid g map index " << l);
949 int ll = it - sg_g_index_map.
begin();
952 sg_basis, overlapped_stoch_row_map,
954 sg_g_map[ll], sg_comm, num_vecs));
957 sg_basis, overlapped_stoch_row_map,
959 sg_g_map[ll], sg_comm, CV, *v));
973 std::vector<int> interlacedUnks(stochaUnks*determUnks);
975 for(
int d=0;d<determUnks;d++)
976 for(
int s=0;s<stochaUnks;s++,i++)
977 interlacedUnks[i] = determ_map.
GID(d)*stochaUnks+s;
985 std::size_t numBlocks = x_sg.
size();
989 for(std::size_t blk=0;blk<numBlocks;blk++) {
992 for(
int dof=0;dof<v.MyLength();dof++)
993 x[dof*numBlocks+blk] = v[dof];
1000 std::size_t numBlocks = x_sg.
size();
1004 for(std::size_t blk=0;blk<numBlocks;blk++) {
1007 for(
int dof=0;dof<v.MyLength();dof++)
1008 v[dof] = x[dof*numBlocks+blk];
int NumGlobalElements() const
Teuchos::RCP< const Epetra_Map > get_x_map() const
Return solution vector map.
Teuchos::RCP< const Epetra_Map > get_g_map(int l) const
Return response map.
virtual void setupOperator(const Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > &poly)=0
Setup operator.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > x_sg_blocks
x stochastic Galerkin components
A container class storing an orthogonal polynomial whose coefficients are vectors, operators, or in general any type that would have an expensive copy constructor.
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 > x_map
Underlying unknown map.
bool supports_x
Whether we support x (and thus f and W)
bool myGID(int i) const
Return whether global index i resides on this processor.
OutArgs createOutArgs() const
Create OutArgs.
Teuchos::RCP< const Stokhos::EpetraSparse3Tensor > serialCijk
Serial Epetra Cijk for dgdx*.
Teuchos::RCP< const Epetra_Map > interlace_x_map
Block SG unknown map.
unsigned int num_sg_blocks
Number of stochastic blocks.
T & get(ParameterList &l, const std::string &name)
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > x_dot_sg_blocks
x_dot stochastic Galerkin components
Teuchos::RCP< const Epetra_Vector > get_x_init() const
Return initial solution.
Teuchos::RCP< EpetraExt::BlockVector > getBlockVector()
Get block vector.
int num_g_sg
Number of stochastic response vectors.
Teuchos::RCP< Epetra_Import > interlace_overlapped_x_importer
Importer from SG to SG-overlapped maps.
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.
int num_g
Number of response vectors of underlying model evaluator.
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > W_sg_blocks
W stochastic Galerkin components.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::Array< Teuchos::RCP< const Epetra_Map > > get_g_sg_base_maps() const
Get base maps of SG responses.
Teuchos::RCP< const Epetra_Map > interlace_overlapped_f_map
Block SG overlapped residual map.
Teuchos::RCP< const Stokhos::EpetraVectorOrthogPoly > get_p_sg_init(int l) const
Return initial SG parameters.
SGModelEvaluator_Interlaced(const Teuchos::RCP< EpetraExt::ModelEvaluator > &me, const Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > &sg_basis, const Teuchos::RCP< const Stokhos::Quadrature< int, double > > &sg_quad, const Teuchos::RCP< Stokhos::OrthogPolyExpansion< int, double > > &sg_exp, const Teuchos::RCP< const Stokhos::ParallelData > &sg_parallel_data, const Teuchos::RCP< Teuchos::ParameterList > ¶ms, bool scaleOP=true)
Teuchos::RCP< const Stokhos::EpetraSparse3Tensor > epetraCijk
Epetra Cijk.
Teuchos::Array< int > get_g_sg_map_indices() const
Get indices of SG responses.
InArgs createInArgs() const
Create InArgs.
Teuchos::RCP< const Epetra_BlockMap > get_overlap_stochastic_map() const
Return overlap stochastic map.
virtual ordinal_type dimension() const =0
Return dimension of basis.
Teuchos::RCP< const Epetra_Vector > get_p_init(int l) const
Return initial parameters.
Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > sg_basis
Stochastic Galerkin basis.
Teuchos::Array< Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > > dgdx_sg_blocks
dg/dx stochastic Galerkin components
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.
Teuchos::Array< int > get_p_sg_map_indices() const
Get indices of SG parameters.
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 Epetra_BlockMap > get_x_sg_overlap_map() const
Return x sg overlap map.
Abstract base class for orthogonal polynomial-based expansions.
Teuchos::RCP< const Epetra_Map > get_f_map() const
Return residual vector map.
Teuchos::RCP< const Epetra_Map > get_p_map(int l) const
Return parameter vector map.
int NumMyElements() const
static void copyToPolyOrthogVector(const Epetra_Vector &x, Stokhos::EpetraVectorOrthogPoly &x_sg)
void set_x_sg_init(const Stokhos::EpetraVectorOrthogPoly &x_sg_in)
Set initial solution polynomial.
An adaptor that supplies the operator interface to a multi-vector.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
An abstract class to represent a generic stochastic Galerkin operator as an Epetra_Operator.
Teuchos::RCP< const Epetra_BlockMap > overlapped_stoch_row_map
Overlapped map for stochastic blocks (local map)
int num_p
Number of parameter vectors of underlying model evaluator.
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.
A container class storing an orthogonal polynomial whose coefficients are vectors, operators, or in general any type that would have an expensive copy constructor.
Teuchos::Array< Teuchos::RCP< Teuchos::Array< std::string > > > sg_p_names
SG coefficient parameter names.
Teuchos::RCP< const EpetraExt::MultiComm > sg_comm
Parallel SG communicator.
virtual Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getSGPolynomial()=0
Get SG polynomial.
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.
Teuchos::RCP< const Stokhos::ParallelData > sg_parallel_data
Parallel SG data.
Teuchos::RCP< Epetra_Operator > create_W() const
Create W = alpha*M + beta*J matrix.
Teuchos::Array< Teuchos::RCP< const Epetra_Map > > sg_g_map
Block SG response map.
Teuchos::Array< Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > > dgdx_dot_sg_blocks
dg/dxdot stochastic Galerkin components
Teuchos::RCP< const Epetra_BlockMap > stoch_row_map
Map for stochastic blocks.
Teuchos::RCP< Epetra_Vector > my_x
x pointer for evaluating preconditioner
Teuchos::RCP< const Epetra_Map > interlace_overlapped_x_map
Block SG overlapped unknown map.
Teuchos::RCP< const Epetra_Import > get_x_sg_importer() const
Return x sg importer.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > sg_x_init
SG initial x.
unsigned int num_p_blocks
Number of p stochastic blocks (may be smaller than num_sg_blocks)
const Epetra_Comm & Comm() const
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.
void set_p_sg_init(int i, const Stokhos::EpetraVectorOrthogPoly &p_sg_in)
Set initial parameter polynomial.
std::vector< T >::const_iterator const_iterator
Teuchos::RCP< Epetra_Export > interlace_overlapped_f_exporter
Exporter from SG-overlapped to SG maps.
Teuchos::RCP< const Epetra_Map > interlace_f_map
Block SG residual map.
void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const
Evaluate model on InArgs.
An Epetra operator representing the block stochastic Galerkin operator generated by fully assembling ...
bool eval_W_with_f
Whether to always evaluate W with f.
void push_back(const value_type &x)
Teuchos::RCP< const Epetra_BlockMap > overlapped_stoch_p_map
Overlapped map for p stochastic blocks (local map)
unsigned int num_W_blocks
Number of W stochastic blocks (may be smaller than num_sg_blocks)
Teuchos::RCP< Teuchos::ParameterList > params
Algorithmic parameters.
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.
Teuchos::RCP< const Stokhos::EpetraVectorOrthogPoly > get_x_sg_init() const
Return initial SG x.
Teuchos::Array< Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > > sg_p_init
SG initial p.
Teuchos::RCP< const Epetra_Map > f_map
Underlying residual map.
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.
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.
const Epetra_CrsGraph & Graph() const
#define TEUCHOS_ASSERT(assertion_test)
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< EpetraExt::ModelEvaluator > me
Underlying model evaluator.
ordinal_type size() const
Return size.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > f_sg_blocks
f stochastic Galerkin components
Teuchos::RCP< const Teuchos::Array< std::string > > get_p_names(int l) const
Return array of parameter names.
int num_p_sg
Number of stochastic parameter vectors.
ScalarType g(const Teuchos::Array< ScalarType > &x, const ScalarType &y)
Teuchos::Array< Teuchos::RCP< const Epetra_Map > > sg_p_map
Block SG parameter map.
Teuchos::Array< int > sg_p_index_map
Index map between block-p and p_sg maps.
A container class storing an orthogonal polynomial whose coefficients are vectors, operators, or in general any type that would have an expensive copy constructor.
static void copyToInterlacedVector(const Stokhos::EpetraVectorOrthogPoly &x_sg, Epetra_Vector &x)
Teuchos::Array< int > sg_g_index_map
Index map between block-g and g_sg maps.