14 #include "EpetraExt_BlockUtility.h"
15 #include "EpetraExt_BlockMultiVector.h"
37 num_sg_blocks(sg_basis->size()),
38 num_W_blocks(sg_basis->size()),
39 num_p_blocks(sg_basis->size()),
41 x_map(me->get_x_map()),
42 f_map(me->get_f_map()),
43 sg_parallel_data(sg_parallel_data_),
44 sg_comm(sg_parallel_data->getMultiComm()),
45 epetraCijk(sg_parallel_data->getEpetraCijk()),
75 stoch_row_map =
epetraCijk->getStochasticRowMap();
116 std::string W_expansion_type =
117 params->
get(
"Jacobian Expansion Type",
"Full");
118 if (W_expansion_type ==
"Linear")
132 W_sg_blocks->setCoeffPtr(i,
me->create_W());
140 InArgs me_inargs =
me->createInArgs();
141 OutArgs me_outargs =
me->createOutArgs();
142 num_p = me_inargs.Np();
145 for (
int i=0; i<
num_p; i++) {
146 if (me_inargs.supports(IN_ARG_p_sg, i))
156 std::string p_expansion_type =
157 params->
get(
"Parameter Expansion Type",
"Full");
158 if (p_expansion_type ==
"Linear")
179 for (
int j=0;
j<p_names->size();
j++) {
180 std::stringstream ss;
181 ss << (*p_names)[
j] <<
" -- SG Coefficient " << i;
195 num_g = me_outargs.Ng();
198 for (
int i=0; i<
num_g; i++) {
199 if (me_outargs.supports(OUT_ARG_g_sg, i))
242 return interlace_x_map;
248 return interlace_f_map;
255 "Error! Invalid p map index " << l);
257 return me->get_p_map(l);
259 return sg_p_map[l-num_p];
268 "Error! Invalid g map index " << l);
276 "Error! Invalid p map index " << l);
278 return me->get_p_names(l);
280 return sg_p_names[l-num_p];
288 return sg_x_init->getBlockVector();
295 "Error! Invalid p map index " << l);
297 return me->get_p_init(l);
299 return sg_p_init[l-num_p]->getBlockVector();
316 my_W->setupOperator(W_sg_blocks);
324 EpetraExt::ModelEvaluator::InArgs
328 InArgs me_inargs = me->createInArgs();
330 inArgs.setModelEvalDescription(this->description());
331 inArgs.set_Np(num_p + num_p_sg);
332 inArgs.setSupports(IN_ARG_x_dot, me_inargs.supports(IN_ARG_x_dot_sg));
333 inArgs.setSupports(IN_ARG_x, me_inargs.supports(IN_ARG_x_sg));
334 inArgs.setSupports(IN_ARG_t, me_inargs.supports(IN_ARG_t));
335 inArgs.setSupports(IN_ARG_alpha, me_inargs.supports(IN_ARG_alpha));
336 inArgs.setSupports(IN_ARG_beta, me_inargs.supports(IN_ARG_beta));
337 inArgs.setSupports(IN_ARG_sg_basis, me_inargs.supports(IN_ARG_sg_basis));
338 inArgs.setSupports(IN_ARG_sg_quadrature,
339 me_inargs.supports(IN_ARG_sg_quadrature));
340 inArgs.setSupports(IN_ARG_sg_expansion,
341 me_inargs.supports(IN_ARG_sg_expansion));
346 EpetraExt::ModelEvaluator::OutArgs
349 OutArgsSetup outArgs;
350 OutArgs me_outargs = me->createOutArgs();
352 outArgs.setModelEvalDescription(this->description());
353 outArgs.set_Np_Ng(num_p+num_p_sg, num_g_sg);
354 outArgs.setSupports(OUT_ARG_f, me_outargs.supports(OUT_ARG_f_sg));
355 outArgs.setSupports(OUT_ARG_W, me_outargs.supports(OUT_ARG_W_sg));
356 outArgs.setSupports(OUT_ARG_WPrec,
false);
357 for (
int j=0;
j<num_p;
j++)
358 outArgs.setSupports(OUT_ARG_DfDp,
j,
359 me_outargs.supports(OUT_ARG_DfDp_sg,
j));
360 for (
int i=0; i<num_g_sg; i++) {
361 int ii = sg_g_index_map[i];
366 for (
int j=0;
j<num_p;
j++)
367 outArgs.setSupports(OUT_ARG_DgDp, i,
j,
368 me_outargs.supports(OUT_ARG_DgDp_sg, ii,
j));
379 const OutArgs& outArgs)
const
383 if (inArgs.supports(IN_ARG_x)) {
389 if (inArgs.supports(IN_ARG_x_dot))
390 x_dot = inArgs.get_x_dot();
393 EpetraExt::ModelEvaluator::Evaluation<Epetra_Vector> f_out;
394 if (outArgs.supports(OUT_ARG_f))
395 f_out = outArgs.get_f();
397 if (outArgs.supports(OUT_ARG_W))
398 W_out = outArgs.get_W();
401 InArgs me_inargs = me->createInArgs();
405 overlapped_x->Import(*x,*interlace_overlapped_x_importer,
Insert);
410 copyToPolyOrthogVector(*overlapped_x,*x_sg_blocks);
411 me_inargs.set_x_sg(x_sg_blocks);
416 overlapped_x_dot->Import(*x_dot,*interlace_overlapped_x_importer,
Insert);
421 copyToPolyOrthogVector(*overlapped_x_dot,*x_dot_sg_blocks);
422 me_inargs.set_x_dot_sg(x_dot_sg_blocks);
424 if (me_inargs.supports(IN_ARG_alpha))
425 me_inargs.set_alpha(inArgs.get_alpha());
426 if (me_inargs.supports(IN_ARG_beta))
427 me_inargs.set_beta(inArgs.get_beta());
428 if (me_inargs.supports(IN_ARG_t))
429 me_inargs.set_t(inArgs.get_t());
430 if (me_inargs.supports(IN_ARG_sg_basis)) {
432 me_inargs.set_sg_basis(inArgs.get_sg_basis());
434 me_inargs.set_sg_basis(sg_basis);
436 if (me_inargs.supports(IN_ARG_sg_quadrature)) {
438 me_inargs.set_sg_quadrature(inArgs.get_sg_quadrature());
440 me_inargs.set_sg_quadrature(sg_quad);
442 if (me_inargs.supports(IN_ARG_sg_expansion)) {
444 me_inargs.set_sg_expansion(inArgs.get_sg_expansion());
446 me_inargs.set_sg_expansion(sg_exp);
450 for (
int i=0; i<num_p; i++)
451 me_inargs.set_p(i, inArgs.get_p(i));
452 for (
int i=0; i<num_p_sg; i++) {
458 p = sg_p_init[i]->getBlockVector();
462 create_p_sg(sg_p_index_map[i],
View, p.
get());
463 me_inargs.set_p_sg(sg_p_index_map[i], p_sg);
467 OutArgs me_outargs = me->createOutArgs();
471 me_outargs.set_f_sg(f_sg_blocks);
473 me_outargs.set_W_sg(W_sg_blocks);
478 me_outargs.set_W_sg(W_sg_blocks);
481 for (
int i=0; i<outArgs.Np(); i++) {
482 if (!outArgs.supports(OUT_ARG_DfDp, i).none()) {
483 Derivative dfdp = outArgs.get_DfDp(i);
486 if (dfdp.getMultiVectorOrientation() == DERIV_MV_BY_COL)
489 sg_basis, overlapped_stoch_row_map,
490 me->get_f_map(), interlace_overlapped_f_map, sg_comm,
491 me->get_p_map(i)->NumMyElements()));
492 else if (dfdp.getMultiVectorOrientation() == DERIV_TRANS_MV_BY_ROW)
495 sg_basis, overlapped_stoch_row_map,
496 me->get_p_map(i), sg_comm,
497 me->get_f_map()->NumMyElements()));
498 me_outargs.set_DfDp_sg(i,
499 SGDerivative(dfdp_sg,
500 dfdp.getMultiVectorOrientation()));
503 "Error! Stokhos::SGModelEvaluator_Interlaced::evalModel " <<
504 "cannot handle operator form of df/dp!");
509 for (
int i=0; i<num_g_sg; i++) {
510 int ii = sg_g_index_map[i];
516 create_g_sg(sg_g_index_map[i],
View, g.
get());
517 me_outargs.set_g_sg(i, g_sg);
521 if (outArgs.supports(OUT_ARG_DgDx_dot, i).supports(DERIV_LINEAR_OP)) {
522 Derivative dgdx_dot = outArgs.get_DgDx_dot(i);
526 dgdx_dot.getLinearOp(),
true);
529 if (me_outargs.supports(OUT_ARG_DgDx, ii).supports(DERIV_LINEAR_OP))
530 me_outargs.set_DgDx_dot_sg(ii, sg_blocks);
532 for (
unsigned int k=0; k<num_sg_blocks; k++) {
535 sg_blocks->getCoeffPtr(k),
true)->getMultiVector();
536 dgdx_dot_sg_blocks[i]->setCoeffPtr(k, mv);
538 if (me_outargs.supports(OUT_ARG_DgDx_dot_sg, ii).supports(DERIV_MV_BY_COL))
539 me_outargs.set_DgDx_dot_sg(ii, SGDerivative(dgdx_dot_sg_blocks[i],
542 me_outargs.set_DgDx_dot_sg(ii, SGDerivative(dgdx_dot_sg_blocks[i],
543 DERIV_TRANS_MV_BY_ROW));
547 dgdx_dot.isEmpty() ==
false,
549 "Error! Stokhos::SGModelEvaluator_Interlaced::evalModel: " <<
550 "Operator form of dg/dxdot is required!");
554 if (outArgs.supports(OUT_ARG_DgDx, i).supports(DERIV_LINEAR_OP)) {
555 Derivative dgdx = outArgs.get_DgDx(i);
559 dgdx.getLinearOp(),
true);
562 if (me_outargs.supports(OUT_ARG_DgDx, ii).supports(DERIV_LINEAR_OP))
563 me_outargs.set_DgDx_sg(i, sg_blocks);
565 for (
unsigned int k=0; k<num_sg_blocks; k++) {
568 sg_blocks->getCoeffPtr(k),
true)->getMultiVector();
569 dgdx_sg_blocks[i]->setCoeffPtr(k, mv);
571 if (me_outargs.supports(OUT_ARG_DgDx_sg, ii).supports(DERIV_MV_BY_COL))
572 me_outargs.set_DgDx_sg(ii, SGDerivative(dgdx_sg_blocks[i],
575 me_outargs.set_DgDx_sg(ii, SGDerivative(dgdx_sg_blocks[i],
576 DERIV_TRANS_MV_BY_ROW));
580 dgdx.isEmpty() ==
false,
582 "Error! Stokhos::SGModelEvaluator_Interlaced::evalModel: " <<
583 "Operator form of dg/dxdot is required!");
588 for (
int j=0;
j<num_p;
j++) {
589 if (!outArgs.supports(OUT_ARG_DgDp, i,
j).none()) {
590 Derivative dgdp = outArgs.get_DgDp(i,
j);
593 if (dgdp.getMultiVectorOrientation() == DERIV_MV_BY_COL)
596 sg_basis, overlapped_stoch_row_map,
597 me->get_g_map(ii), sg_g_map[i], sg_comm,
598 View, *(dgdp.getMultiVector())));
599 else if (dgdp.getMultiVectorOrientation() == DERIV_TRANS_MV_BY_ROW) {
604 sg_basis, overlapped_stoch_row_map,
605 me->get_p_map(
j), product_map, sg_comm,
606 View, *(dgdp.getMultiVector())));
608 me_outargs.set_DgDp_sg(ii,
j,
609 SGDerivative(dgdp_sg,
610 dgdp.getMultiVectorOrientation()));
614 "Error! Stokhos::SGModelEvaluator_Interlaced::evalModel " <<
615 "cannot handle operator form of dg/dp!");
622 me->evalModel(me_inargs, me_outargs);
640 for (
int i=0; i<sg_basis->size(); i++)
641 (*f_sg_blocks)[i].Scale(sg_basis->norm_squared(i));
645 copyToInterlacedVector(*f_sg_blocks,*overlapped_f);
646 f_out->Export(*overlapped_f,*interlace_overlapped_f_exporter,
Insert);
650 for (
int i=0; i<num_p; i++) {
651 if (!outArgs.supports(OUT_ARG_DfDp, i).none()) {
652 Derivative dfdp = outArgs.get_DfDp(i);
653 SGDerivative dfdp_sg = me_outargs.get_DfDp_sg(i);
655 dfdp.getMultiVector()->Export(
656 *(dfdp_sg.getMultiVector()->getBlockMultiVector()),
657 *interlace_overlapped_f_exporter,
Insert);
667 *sg_x_init = x_sg_in;
680 *sg_p_init[i] = p_sg_in;
692 return sg_p_index_map;
698 return sg_g_index_map;
705 for (
int i=0; i<num_g; i++)
706 base_maps[i] = me->get_g_map(i);
713 return overlapped_stoch_row_map;
719 return interlace_overlapped_x_map;
725 return interlace_overlapped_x_importer;
735 sg_basis, stoch_row_map, x_map, get_x_map(), sg_comm));
738 sg_basis, stoch_row_map, x_map, get_x_map(), sg_comm,
750 sg_basis, overlapped_stoch_row_map, x_map,
751 get_x_sg_overlap_map(), sg_comm));
754 sg_basis, overlapped_stoch_row_map, x_map,
755 get_x_sg_overlap_map(), sg_comm, CV, *v));
766 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,
784 sg_basis, overlapped_stoch_row_map, x_map,
785 get_x_sg_overlap_map(), sg_comm, num_vecs));
788 sg_basis, overlapped_stoch_row_map, x_map,
789 get_x_sg_overlap_map(), sg_comm, CV, *v));
799 sg_p_index_map.end(),
802 "Error! Invalid p map index " << l);
803 int ll = it - sg_p_index_map.
begin();
806 sg_basis, overlapped_stoch_p_map, me->get_p_map(l),
807 sg_p_map[ll], sg_comm));
810 sg_basis, overlapped_stoch_p_map, me->get_p_map(l),
811 sg_p_map[ll], sg_comm, CV, *v));
822 sg_basis, stoch_row_map, f_map, interlace_f_map, sg_comm));
825 sg_basis, stoch_row_map, f_map, interlace_f_map, sg_comm,
837 sg_basis, overlapped_stoch_row_map, f_map,
838 interlace_overlapped_f_map, sg_comm));
841 sg_basis, overlapped_stoch_row_map, f_map,
842 interlace_overlapped_f_map, sg_comm, CV, *v));
855 sg_basis, stoch_row_map, f_map, interlace_f_map, sg_comm,
859 sg_basis, stoch_row_map, f_map, interlace_f_map, sg_comm,
873 sg_basis, overlapped_stoch_row_map, f_map,
874 interlace_overlapped_f_map, sg_comm, num_vecs));
877 sg_basis, overlapped_stoch_row_map, f_map,
878 interlace_overlapped_f_map, sg_comm, CV, *v));
888 sg_g_index_map.end(),
891 "Error! Invalid g map index " << l);
892 int ll = it - sg_g_index_map.
begin();
895 sg_basis, overlapped_stoch_row_map,
897 sg_g_map[ll], sg_comm));
900 sg_basis, overlapped_stoch_row_map,
902 sg_g_map[ll], sg_comm, CV, *v));
913 sg_g_index_map.end(),
916 "Error! Invalid g map index " << l);
917 int ll = it - sg_g_index_map.
begin();
920 sg_basis, overlapped_stoch_row_map,
922 sg_g_map[ll], sg_comm, num_vecs));
925 sg_basis, overlapped_stoch_row_map,
927 sg_g_map[ll], sg_comm, CV, *v));
941 std::vector<int> interlacedUnks(stochaUnks*determUnks);
943 for(
int d=0;d<determUnks;d++)
944 for(
int s=0;s<stochaUnks;s++,i++)
945 interlacedUnks[i] = determ_map.
GID(d)*stochaUnks+s;
953 std::size_t numBlocks = x_sg.
size();
957 for(std::size_t blk=0;blk<numBlocks;blk++) {
960 for(
int dof=0;dof<v.MyLength();dof++)
961 x[dof*numBlocks+blk] = v[dof];
968 std::size_t numBlocks = x_sg.
size();
972 for(std::size_t blk=0;blk<numBlocks;blk++) {
975 for(
int dof=0;dof<v.MyLength();dof++)
976 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.