14 #include "EpetraExt_BlockUtility.h"
15 #include "EpetraExt_BlockMultiVector.h"
30 bool onlyUseLinear_,
int kExpOrder_,
33 sg_basis(am->getMasterStochasticBasis()),
34 sg_row_dof_basis(am->getRowStochasticBasis()),
38 num_sg_blocks(sg_basis->size()),
39 num_W_blocks(sg_basis->size()),
40 num_p_blocks(sg_basis->size()),
42 x_map(me->get_x_map()),
43 f_map(me->get_f_map()),
44 sg_parallel_data(sg_parallel_data_),
45 sg_comm(sg_parallel_data->getMultiComm()),
46 epetraCijk(sg_parallel_data->getEpetraCijk()),
48 Cijk(epetraCijk->getParallelCijk()),
67 kExpOrder(kExpOrder_),
68 onlyUseLinear(onlyUseLinear_),
69 scaleOP(am->isScaled()),
80 stoch_row_map =
epetraCijk->getStochasticRowMap();
135 std::string W_expansion_type =
136 params->
get(
"Jacobian Expansion Type",
"Full");
137 if (W_expansion_type ==
"Linear")
151 W_sg_blocks->setCoeffPtr(i,
me->create_W());
159 InArgs me_inargs =
me->createInArgs();
160 OutArgs me_outargs =
me->createOutArgs();
161 num_p = me_inargs.Np();
164 for (
int i=0; i<
num_p; i++) {
165 if (me_inargs.supports(IN_ARG_p_sg, i))
175 std::string p_expansion_type =
176 params->
get(
"Parameter Expansion Type",
"Full");
177 if (p_expansion_type ==
"Linear")
198 for (
int j=0;
j<p_names->size();
j++) {
199 std::stringstream ss;
200 ss << (*p_names)[
j] <<
" -- SG Coefficient " << i;
212 num_g = me_outargs.Ng();
215 for (
int i=0; i<
num_g; i++) {
216 if (me_outargs.supports(OUT_ARG_g_sg, i))
261 bool onlyUseLinear_,
int kExpOrder_,
266 sg_row_dof_basis(sg_row_dof_basis_),
270 num_sg_blocks(sg_basis->size()),
271 num_W_blocks(sg_basis->size()),
272 num_p_blocks(sg_basis->size()),
274 x_map(me->get_x_map()),
275 f_map(me->get_f_map()),
276 sg_parallel_data(sg_parallel_data_),
277 sg_comm(sg_parallel_data->getMultiComm()),
278 epetraCijk(sg_parallel_data->getEpetraCijk()),
280 Cijk(epetraCijk->getParallelCijk()),
294 dgdx_dot_sg_blocks(),
298 eval_W_with_f(false),
299 kExpOrder(kExpOrder_),
300 onlyUseLinear(onlyUseLinear_),
314 stoch_row_map =
epetraCijk->getStochasticRowMap();
369 std::string W_expansion_type =
370 params->
get(
"Jacobian Expansion Type",
"Full");
371 if (W_expansion_type ==
"Linear")
385 W_sg_blocks->setCoeffPtr(i,
me->create_W());
393 InArgs me_inargs =
me->createInArgs();
394 OutArgs me_outargs =
me->createOutArgs();
395 num_p = me_inargs.Np();
398 for (
int i=0; i<
num_p; i++) {
399 if (me_inargs.supports(IN_ARG_p_sg, i))
409 std::string p_expansion_type =
410 params->
get(
"Parameter Expansion Type",
"Full");
411 if (p_expansion_type ==
"Linear")
432 for (
int j=0;
j<p_names->size();
j++) {
433 std::stringstream ss;
434 ss << (*p_names)[
j] <<
" -- SG Coefficient " << i;
446 num_g = me_outargs.Ng();
449 for (
int i=0; i<
num_g; i++) {
450 if (me_outargs.supports(OUT_ARG_g_sg, i))
493 return adapted_x_map;
499 return adapted_f_map;
506 "Error! Invalid p map index " << l);
508 return me->get_p_map(l);
510 return sg_p_map[l-num_p];
519 "Error! Invalid g map index " << l);
527 "Error! Invalid p map index " << l);
529 return me->get_p_names(l);
531 return sg_p_names[l-num_p];
541 adaptMngr->copyToAdaptiveVector(*get_x_sg_init(),*x_init);
550 "Error! Invalid p map index " << l);
552 return me->get_p_init(l);
554 return sg_p_init[l-num_p]->getBlockVector();
570 adaptMngr->setupWithGraph(W_graph,onlyUseLinear,kExpOrder);
571 my_W = adaptMngr->buildMatrixFromGraph();
572 adaptMngr->setupOperator(*my_W,*Cijk,*W_sg_blocks);
580 EpetraExt::ModelEvaluator::InArgs
584 InArgs me_inargs = me->createInArgs();
586 inArgs.setModelEvalDescription(this->description());
587 inArgs.set_Np(num_p + num_p_sg);
588 inArgs.setSupports(IN_ARG_x_dot, me_inargs.supports(IN_ARG_x_dot_sg));
589 inArgs.setSupports(IN_ARG_x, me_inargs.supports(IN_ARG_x_sg));
590 inArgs.setSupports(IN_ARG_t, me_inargs.supports(IN_ARG_t));
591 inArgs.setSupports(IN_ARG_alpha, me_inargs.supports(IN_ARG_alpha));
592 inArgs.setSupports(IN_ARG_beta, me_inargs.supports(IN_ARG_beta));
593 inArgs.setSupports(IN_ARG_sg_basis, me_inargs.supports(IN_ARG_sg_basis));
594 inArgs.setSupports(IN_ARG_sg_quadrature,
595 me_inargs.supports(IN_ARG_sg_quadrature));
596 inArgs.setSupports(IN_ARG_sg_expansion,
597 me_inargs.supports(IN_ARG_sg_expansion));
602 EpetraExt::ModelEvaluator::OutArgs
605 OutArgsSetup outArgs;
606 OutArgs me_outargs = me->createOutArgs();
608 outArgs.setModelEvalDescription(this->description());
609 outArgs.set_Np_Ng(num_p+num_p_sg, num_g_sg);
611 outArgs.setSupports(OUT_ARG_f, me_outargs.supports(OUT_ARG_f_sg));
612 outArgs.setSupports(OUT_ARG_W, me_outargs.supports(OUT_ARG_W_sg));
613 outArgs.setSupports(OUT_ARG_WPrec,
false);
614 for (
int j=0;
j<num_p;
j++)
615 outArgs.setSupports(OUT_ARG_DfDp,
j,
616 me_outargs.supports(OUT_ARG_DfDp_sg,
j));
618 for (
int i=0; i<num_g_sg; i++) {
619 int ii = sg_g_index_map[i];
624 for (
int j=0;
j<num_p;
j++)
625 outArgs.setSupports(OUT_ARG_DgDp, i,
j,
626 me_outargs.supports(OUT_ARG_DgDp_sg, ii,
j));
637 const OutArgs& outArgs)
const
641 if (inArgs.supports(IN_ARG_x)) {
647 if (inArgs.supports(IN_ARG_x_dot))
648 x_dot = inArgs.get_x_dot();
651 EpetraExt::ModelEvaluator::Evaluation<Epetra_Vector> f_out;
652 if (outArgs.supports(OUT_ARG_f))
653 f_out = outArgs.get_f();
655 if (outArgs.supports(OUT_ARG_W))
656 W_out = outArgs.get_W();
659 InArgs me_inargs = me->createInArgs();
662 adaptMngr->copyFromAdaptiveVector(*x,*x_sg_blocks);
663 me_inargs.set_x_sg(x_sg_blocks);
667 adaptMngr->copyFromAdaptiveVector(*x_dot,*x_dot_sg_blocks);
668 me_inargs.set_x_dot_sg(x_dot_sg_blocks);
670 if (me_inargs.supports(IN_ARG_alpha))
671 me_inargs.set_alpha(inArgs.get_alpha());
672 if (me_inargs.supports(IN_ARG_beta))
673 me_inargs.set_beta(inArgs.get_beta());
674 if (me_inargs.supports(IN_ARG_t))
675 me_inargs.set_t(inArgs.get_t());
676 if (me_inargs.supports(IN_ARG_sg_basis)) {
678 me_inargs.set_sg_basis(inArgs.get_sg_basis());
680 me_inargs.set_sg_basis(sg_basis);
682 if (me_inargs.supports(IN_ARG_sg_quadrature)) {
684 me_inargs.set_sg_quadrature(inArgs.get_sg_quadrature());
686 me_inargs.set_sg_quadrature(sg_quad);
688 if (me_inargs.supports(IN_ARG_sg_expansion)) {
690 me_inargs.set_sg_expansion(inArgs.get_sg_expansion());
692 me_inargs.set_sg_expansion(sg_exp);
696 for (
int i=0; i<num_p; i++)
697 me_inargs.set_p(i, inArgs.get_p(i));
698 for (
int i=0; i<num_p_sg; i++) {
704 p = sg_p_init[i]->getBlockVector();
708 create_p_sg(sg_p_index_map[i],
View, p.
get());
709 me_inargs.set_p_sg(sg_p_index_map[i], p_sg);
713 OutArgs me_outargs = me->createOutArgs();
717 me_outargs.set_f_sg(f_sg_blocks);
719 me_outargs.set_W_sg(W_sg_blocks);
724 me_outargs.set_W_sg(W_sg_blocks);
727 for (
int i=0; i<num_p; i++) {
728 if (!outArgs.supports(OUT_ARG_DfDp, i).none()) {
729 Derivative dfdp = outArgs.get_DfDp(i);
732 if (dfdp.getMultiVectorOrientation() == DERIV_MV_BY_COL)
735 sg_basis, overlapped_stoch_row_map,
736 me->get_f_map(), sg_comm,
737 me->get_p_map(i)->NumMyElements()));
738 else if (dfdp.getMultiVectorOrientation() == DERIV_TRANS_MV_BY_ROW)
741 sg_basis, overlapped_stoch_row_map,
742 me->get_p_map(i), sg_comm,
743 me->get_f_map()->NumMyElements()));
744 me_outargs.set_DfDp_sg(i,
745 SGDerivative(dfdp_sg,
746 dfdp.getMultiVectorOrientation()));
749 "Error! Stokhos::SGModelEvaluator_Adaptive::evalModel " <<
750 "cannot handle operator form of df/dp!");
755 for (
int i=0; i<num_g_sg; i++) {
756 int ii = sg_g_index_map[i];
762 create_g_sg(sg_g_index_map[i],
View, g.
get());
763 me_outargs.set_g_sg(ii, g_sg);
767 if (outArgs.supports(OUT_ARG_DgDx_dot, i).supports(DERIV_LINEAR_OP)) {
768 Derivative dgdx_dot = outArgs.get_DgDx_dot(i);
772 dgdx_dot.getLinearOp(),
true);
775 if (me_outargs.supports(OUT_ARG_DgDx, ii).supports(DERIV_LINEAR_OP))
776 me_outargs.set_DgDx_dot_sg(ii, sg_blocks);
778 for (
unsigned int k=0; k<num_sg_blocks; k++) {
781 sg_blocks->getCoeffPtr(k),
true)->getMultiVector();
782 dgdx_dot_sg_blocks[i]->setCoeffPtr(k, mv);
784 if (me_outargs.supports(OUT_ARG_DgDx_dot_sg, ii).supports(DERIV_MV_BY_COL))
785 me_outargs.set_DgDx_dot_sg(ii, SGDerivative(dgdx_dot_sg_blocks[i],
788 me_outargs.set_DgDx_dot_sg(ii, SGDerivative(dgdx_dot_sg_blocks[i],
789 DERIV_TRANS_MV_BY_ROW));
793 dgdx_dot.isEmpty() ==
false,
795 "Error! Stokhos::SGModelEvaluator_Adaptive::evalModel: " <<
796 "Operator form of dg/dxdot is required!");
800 if (outArgs.supports(OUT_ARG_DgDx, i).supports(DERIV_LINEAR_OP)) {
801 Derivative dgdx = outArgs.get_DgDx(i);
805 dgdx.getLinearOp(),
true);
808 if (me_outargs.supports(OUT_ARG_DgDx, ii).supports(DERIV_LINEAR_OP))
809 me_outargs.set_DgDx_sg(ii, sg_blocks);
811 for (
unsigned int k=0; k<num_sg_blocks; k++) {
814 sg_blocks->getCoeffPtr(k),
true)->getMultiVector();
815 dgdx_sg_blocks[i]->setCoeffPtr(k, mv);
817 if (me_outargs.supports(OUT_ARG_DgDx_sg, ii).supports(DERIV_MV_BY_COL))
818 me_outargs.set_DgDx_sg(ii, SGDerivative(dgdx_sg_blocks[i],
821 me_outargs.set_DgDx_sg(ii, SGDerivative(dgdx_sg_blocks[i],
822 DERIV_TRANS_MV_BY_ROW));
826 dgdx.isEmpty() ==
false,
828 "Error! Stokhos::SGModelEvaluator_Adaptive::evalModel: " <<
829 "Operator form of dg/dxdot is required!");
834 for (
int j=0;
j<num_p;
j++) {
835 if (!outArgs.supports(OUT_ARG_DgDp, i,
j).none()) {
836 Derivative dgdp = outArgs.get_DgDp(i,
j);
839 if (dgdp.getMultiVectorOrientation() == DERIV_MV_BY_COL)
842 sg_basis, overlapped_stoch_row_map,
843 me->get_g_map(ii), sg_g_map[i], sg_comm,
844 View, *(dgdp.getMultiVector())));
845 else if (dgdp.getMultiVectorOrientation() == DERIV_TRANS_MV_BY_ROW) {
850 sg_basis, overlapped_stoch_row_map,
851 me->get_p_map(
j), product_map, sg_comm,
852 View, *(dgdp.getMultiVector())));
854 me_outargs.set_DgDp_sg(ii,
j,
855 SGDerivative(dgdp_sg,
856 dgdp.getMultiVectorOrientation()));
860 "Error! Stokhos::SGModelEvaluator_Adaptive::evalModel " <<
861 "cannot handle operator form of dg/dp!");
868 me->evalModel(me_inargs, me_outargs);
880 adaptMngr->setupOperator(*W_sg,*Cijk,*W_sg_blocks);
886 for (
int i=0; i<sg_basis->size(); i++)
887 (*f_sg_blocks)[i].
Scale(sg_basis->norm_squared(i));
889 adaptMngr->copyToAdaptiveVector(*f_sg_blocks,*f_out);
893 for (
int i=0; i<num_p; i++) {
894 if (!outArgs.supports(OUT_ARG_DfDp, i).none()) {
895 Derivative dfdp = outArgs.get_DfDp(i);
896 SGDerivative dfdp_sg = me_outargs.get_DfDp_sg(i);
899 dfdp.getMultiVector()->Export(
900 *(dfdp_sg.getMultiVector()->getBlockMultiVector()),
901 *adapted_overlapped_f_exporter,
Insert);
911 *sg_x_init = x_sg_in;
924 *sg_p_init[i] = p_sg_in;
936 return sg_p_index_map;
942 return sg_g_index_map;
949 for (
int i=0; i<num_g; i++)
950 base_maps[i] = me->get_g_map(i);
957 return overlapped_stoch_row_map;
963 return adapted_overlapped_x_map;
969 return adapted_overlapped_x_importer;
979 sg_basis, stoch_row_map, x_map, sg_x_map, sg_comm));
982 sg_basis, stoch_row_map, x_map, sg_x_map, sg_comm,
994 sg_basis, overlapped_stoch_row_map, x_map,
995 sg_overlapped_x_map, sg_comm));
998 sg_basis, overlapped_stoch_row_map, x_map,
999 sg_overlapped_x_map, sg_comm, CV, *v));
1010 sg_basis, stoch_row_map, x_map, sg_x_map, sg_comm,
1014 sg_basis, stoch_row_map, x_map, sg_x_map, sg_comm,
1028 sg_basis, overlapped_stoch_row_map, x_map,
1029 sg_overlapped_x_map, sg_comm, num_vecs));
1032 sg_basis, overlapped_stoch_row_map, x_map,
1033 sg_overlapped_x_map, sg_comm, CV, *v));
1043 sg_p_index_map.end(),
1046 "Error! Invalid p map index " << l);
1047 int ll = it - sg_p_index_map.
begin();
1050 sg_basis, overlapped_stoch_p_map, me->get_p_map(l),
1051 sg_p_map[ll], sg_comm));
1054 sg_basis, overlapped_stoch_p_map, me->get_p_map(l),
1055 sg_p_map[ll], sg_comm, CV, *v));
1066 sg_basis, stoch_row_map, f_map, sg_f_map, sg_comm));
1069 sg_basis, stoch_row_map, f_map, sg_f_map, sg_comm,
1081 sg_basis, overlapped_stoch_row_map, f_map,
1082 sg_overlapped_f_map, sg_comm));
1085 sg_basis, overlapped_stoch_row_map, f_map,
1086 sg_overlapped_f_map, sg_comm, CV, *v));
1099 sg_basis, stoch_row_map, f_map, sg_f_map, sg_comm,
1103 sg_basis, stoch_row_map, f_map, sg_f_map, sg_comm,
1117 sg_basis, overlapped_stoch_row_map, f_map,
1118 sg_overlapped_f_map, sg_comm, num_vecs));
1121 sg_basis, overlapped_stoch_row_map, f_map,
1122 sg_overlapped_f_map, sg_comm, CV, *v));
1132 sg_g_index_map.end(),
1135 "Error! Invalid g map index " << l);
1136 int ll = it - sg_g_index_map.
begin();
1139 sg_basis, overlapped_stoch_row_map,
1141 sg_g_map[ll], sg_comm));
1144 sg_basis, overlapped_stoch_row_map,
1146 sg_g_map[ll], sg_comm, CV, *v));
1157 sg_g_index_map.end(),
1160 "Error! Invalid g map index " << l);
1161 int ll = it - sg_g_index_map.
begin();
1164 sg_basis, overlapped_stoch_row_map,
1166 sg_g_map[ll], sg_comm, num_vecs));
1169 sg_basis, overlapped_stoch_row_map,
1171 sg_g_map[ll], sg_comm, CV, *v));
Teuchos::RCP< const Epetra_Import > get_x_sg_importer() const
Return x sg importer.
Teuchos::Array< int > get_g_sg_map_indices() const
Get indices of SG responses.
Teuchos::RCP< const Epetra_Map > get_p_map(int l) const
Return parameter vector map.
bool eval_W_with_f
Whether to always evaluate W with f.
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.
int num_g_sg
Number of stochastic response vectors.
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 myGID(int i) const
Return whether global index i resides on this processor.
Teuchos::RCP< const Epetra_Map > sg_f_map
Block SG residual map.
Teuchos::RCP< const Teuchos::Array< std::string > > get_p_names(int l) const
Return array of parameter names.
Teuchos::RCP< const Epetra_BlockMap > stoch_row_map
Map for stochastic blocks.
Teuchos::RCP< const Stokhos::EpetraVectorOrthogPoly > get_p_sg_init(int l) const
Return initial SG parameters.
Teuchos::RCP< const Stokhos::EpetraSparse3Tensor > serialCijk
Serial Epetra Cijk for dgdx*.
T & get(ParameterList &l, const std::string &name)
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::Array< Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > > dgdx_sg_blocks
dg/dx stochastic Galerkin components
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
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.
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::RCP< Epetra_Export > adapted_overlapped_f_exporter
Exporter from SG-overlapped to SG maps.
Teuchos::Array< Teuchos::RCP< Teuchos::Array< std::string > > > sg_p_names
SG coefficient parameter names.
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< const Epetra_Map > sg_x_map
Block SG unknown map.
Teuchos::Array< Teuchos::RCP< Stokhos::EpetraMultiVectorOrthogPoly > > dgdx_dot_sg_blocks
dg/dxdot stochastic Galerkin components
void set_p_sg_init(int i, const Stokhos::EpetraVectorOrthogPoly &p_sg_in)
Set initial parameter polynomial.
Teuchos::RCP< const Epetra_Map > x_map
Underlying unknown map.
Teuchos::RCP< const Epetra_Map > get_f_map() const
Return residual vector map.
Teuchos::RCP< const Stokhos::ParallelData > sg_parallel_data
Parallel SG data.
Teuchos::RCP< const Epetra_Map > adapted_overlapped_x_map
Adapated block SG overlapped unknown map.
Teuchos::RCP< const Epetra_BlockMap > get_x_sg_overlap_map() const
Return x sg overlap map.
virtual ordinal_type dimension() const =0
Return dimension of basis.
int num_g
Number of response vectors of underlying model evaluator.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > sg_x_init
SG initial x.
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::RCP< const Epetra_Map > get_g_map(int l) const
Return response map.
Teuchos::RCP< const Stokhos::EpetraSparse3Tensor > epetraCijk
Epetra Cijk.
Abstract base class for orthogonal polynomial-based expansions.
unsigned int num_W_blocks
Number of W stochastic blocks (may be smaller than num_sg_blocks)
Teuchos::Array< int > get_p_sg_map_indices() const
Get indices of SG parameters.
std::vector< Teuchos::RCP< const Stokhos::ProductBasis< int, double > > > sg_row_dof_basis
Teuchos::RCP< EpetraExt::ModelEvaluator > me
Underlying model evaluator.
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< 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.
bool supports_x
Whether we support x (and thus f and W)
int num_p
Number of parameter vectors of underlying model evaluator.
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_p_sg(int l, Epetra_DataAccess CV=Copy, const Epetra_Vector *v=0) const
Create vector orthog poly using p map.
Teuchos::RCP< const Epetra_Map > sg_overlapped_x_map
Block SG overlapped unknown map.
virtual Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getSGPolynomial()=0
Get SG polynomial.
void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const
Evaluate model on InArgs.
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > x_dot_sg_blocks
x_dot stochastic Galerkin components
Teuchos::RCP< const Epetra_Map > adapted_overlapped_f_map
Adapted block SG overlapped residual map.
Teuchos::RCP< const Epetra_BlockMap > overlapped_stoch_row_map
Overlapped map for stochastic blocks (local map)
Teuchos::RCP< const Stokhos::EpetraVectorOrthogPoly > get_x_sg_init() const
Return initial SG x.
Teuchos::RCP< const Epetra_Map > adapted_f_map
Adapted block SG residual map.
std::vector< T >::const_iterator const_iterator
Teuchos::RCP< const Epetra_Map > adapted_x_map
Adapted lock SG unknown map.
Teuchos::Array< Teuchos::RCP< const Epetra_Map > > sg_p_map
Block SG parameter map.
Teuchos::Array< Teuchos::RCP< const Epetra_Map > > get_g_sg_base_maps() const
Get base maps of SG responses.
OutArgs createOutArgs() const
Create OutArgs.
void push_back(const value_type &x)
Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > W_sg_blocks
W stochastic Galerkin components.
Teuchos::RCP< Epetra_Import > adapted_overlapped_x_importer
Importer from SG to SG-overlapped maps.
Teuchos::RCP< const Epetra_BlockMap > get_overlap_stochastic_map() const
Return overlap stochastic map.
Teuchos::RCP< const Epetra_Map > get_x_map() const
Return solution vector map.
Teuchos::Array< int > sg_p_index_map
Index map between block-p and p_sg maps.
int num_p_sg
Number of stochastic parameter vectors.
void set_x_sg_init(const Stokhos::EpetraVectorOrthogPoly &x_sg_in)
Set initial solution polynomial.
unsigned int num_sg_blocks
Number of stochastic blocks.
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::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< const Epetra_Vector > get_p_init(int l) const
Return initial parameters.
const Epetra_CrsGraph & Graph() const
Teuchos::Array< int > sg_g_index_map
Index map between block-g and g_sg maps.
int Scale(double ScalarConstant)
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 EpetraExt::MultiComm > sg_comm
Parallel SG communicator.
Teuchos::RCP< Epetra_Vector > my_x
x pointer for evaluating preconditioner
Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > sg_basis
Stochastic Galerkin basis.
Teuchos::RCP< Teuchos::ParameterList > params
Algorithmic parameters.
unsigned int num_p_blocks
Number of p stochastic blocks (may be smaller than num_sg_blocks)
Teuchos::RCP< Stokhos::AdaptivityManager > adaptMngr
Teuchos::RCP< const Epetra_Map > sg_overlapped_f_map
Block SG overlapped residual map.
ScalarType g(const Teuchos::Array< ScalarType > &x, const ScalarType &y)
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > f_sg_blocks
f stochastic Galerkin components
Teuchos::RCP< const Epetra_Vector > get_x_init() const
Return initial solution.
Teuchos::RCP< const Epetra_BlockMap > overlapped_stoch_p_map
Overlapped map for p stochastic blocks (local map)
InArgs createInArgs() const
Create InArgs.
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.
SGModelEvaluator_Adaptive(const Teuchos::RCP< EpetraExt::ModelEvaluator > &me_, const Teuchos::RCP< Stokhos::AdaptivityManager > &am, 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_, bool onlyUseLinear_, int kExpOrder_, const Teuchos::RCP< Teuchos::ParameterList > ¶ms_)
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< Stokhos::EpetraVectorOrthogPoly > > sg_p_init
SG initial p.
Teuchos::RCP< const Epetra_Map > f_map
Underlying residual map.