46 #include "EpetraExt_BlockUtility.h"
47 #include "EpetraExt_BlockMultiVector.h"
62 bool onlyUseLinear_,
int kExpOrder_,
65 sg_basis(am->getMasterStochasticBasis()),
66 sg_row_dof_basis(am->getRowStochasticBasis()),
70 num_sg_blocks(sg_basis->size()),
71 num_W_blocks(sg_basis->size()),
72 num_p_blocks(sg_basis->size()),
74 x_map(me->get_x_map()),
75 f_map(me->get_f_map()),
76 sg_parallel_data(sg_parallel_data_),
77 sg_comm(sg_parallel_data->getMultiComm()),
78 epetraCijk(sg_parallel_data->getEpetraCijk()),
80 Cijk(epetraCijk->getParallelCijk()),
99 kExpOrder(kExpOrder_),
100 onlyUseLinear(onlyUseLinear_),
101 scaleOP(am->isScaled()),
112 stoch_row_map =
epetraCijk->getStochasticRowMap();
167 std::string W_expansion_type =
168 params->
get(
"Jacobian Expansion Type",
"Full");
169 if (W_expansion_type ==
"Linear")
183 W_sg_blocks->setCoeffPtr(i,
me->create_W());
191 InArgs me_inargs =
me->createInArgs();
192 OutArgs me_outargs =
me->createOutArgs();
193 num_p = me_inargs.Np();
196 for (
int i=0; i<
num_p; i++) {
197 if (me_inargs.supports(IN_ARG_p_sg, i))
207 std::string p_expansion_type =
208 params->
get(
"Parameter Expansion Type",
"Full");
209 if (p_expansion_type ==
"Linear")
230 for (
int j=0;
j<p_names->size();
j++) {
231 std::stringstream ss;
232 ss << (*p_names)[
j] <<
" -- SG Coefficient " << i;
244 num_g = me_outargs.Ng();
247 for (
int i=0; i<
num_g; i++) {
248 if (me_outargs.supports(OUT_ARG_g_sg, i))
293 bool onlyUseLinear_,
int kExpOrder_,
298 sg_row_dof_basis(sg_row_dof_basis_),
302 num_sg_blocks(sg_basis->size()),
303 num_W_blocks(sg_basis->size()),
304 num_p_blocks(sg_basis->size()),
306 x_map(me->get_x_map()),
307 f_map(me->get_f_map()),
308 sg_parallel_data(sg_parallel_data_),
309 sg_comm(sg_parallel_data->getMultiComm()),
310 epetraCijk(sg_parallel_data->getEpetraCijk()),
312 Cijk(epetraCijk->getParallelCijk()),
326 dgdx_dot_sg_blocks(),
330 eval_W_with_f(false),
331 kExpOrder(kExpOrder_),
332 onlyUseLinear(onlyUseLinear_),
346 stoch_row_map =
epetraCijk->getStochasticRowMap();
401 std::string W_expansion_type =
402 params->
get(
"Jacobian Expansion Type",
"Full");
403 if (W_expansion_type ==
"Linear")
417 W_sg_blocks->setCoeffPtr(i,
me->create_W());
425 InArgs me_inargs =
me->createInArgs();
426 OutArgs me_outargs =
me->createOutArgs();
427 num_p = me_inargs.Np();
430 for (
int i=0; i<
num_p; i++) {
431 if (me_inargs.supports(IN_ARG_p_sg, i))
441 std::string p_expansion_type =
442 params->
get(
"Parameter Expansion Type",
"Full");
443 if (p_expansion_type ==
"Linear")
464 for (
int j=0;
j<p_names->size();
j++) {
465 std::stringstream ss;
466 ss << (*p_names)[
j] <<
" -- SG Coefficient " << i;
478 num_g = me_outargs.Ng();
481 for (
int i=0; i<
num_g; i++) {
482 if (me_outargs.supports(OUT_ARG_g_sg, i))
525 return adapted_x_map;
531 return adapted_f_map;
538 "Error! Invalid p map index " << l);
540 return me->get_p_map(l);
542 return sg_p_map[l-num_p];
551 "Error! Invalid g map index " << l);
559 "Error! Invalid p map index " << l);
561 return me->get_p_names(l);
563 return sg_p_names[l-num_p];
573 adaptMngr->copyToAdaptiveVector(*get_x_sg_init(),*x_init);
582 "Error! Invalid p map index " << l);
584 return me->get_p_init(l);
586 return sg_p_init[l-num_p]->getBlockVector();
602 adaptMngr->setupWithGraph(W_graph,onlyUseLinear,kExpOrder);
603 my_W = adaptMngr->buildMatrixFromGraph();
604 adaptMngr->setupOperator(*my_W,*Cijk,*W_sg_blocks);
612 EpetraExt::ModelEvaluator::InArgs
616 InArgs me_inargs = me->createInArgs();
618 inArgs.setModelEvalDescription(this->description());
619 inArgs.set_Np(num_p + num_p_sg);
620 inArgs.setSupports(IN_ARG_x_dot, me_inargs.supports(IN_ARG_x_dot_sg));
621 inArgs.setSupports(IN_ARG_x, me_inargs.supports(IN_ARG_x_sg));
622 inArgs.setSupports(IN_ARG_t, me_inargs.supports(IN_ARG_t));
623 inArgs.setSupports(IN_ARG_alpha, me_inargs.supports(IN_ARG_alpha));
624 inArgs.setSupports(IN_ARG_beta, me_inargs.supports(IN_ARG_beta));
625 inArgs.setSupports(IN_ARG_sg_basis, me_inargs.supports(IN_ARG_sg_basis));
626 inArgs.setSupports(IN_ARG_sg_quadrature,
627 me_inargs.supports(IN_ARG_sg_quadrature));
628 inArgs.setSupports(IN_ARG_sg_expansion,
629 me_inargs.supports(IN_ARG_sg_expansion));
634 EpetraExt::ModelEvaluator::OutArgs
637 OutArgsSetup outArgs;
638 OutArgs me_outargs = me->createOutArgs();
640 outArgs.setModelEvalDescription(this->description());
641 outArgs.set_Np_Ng(num_p+num_p_sg, num_g_sg);
643 outArgs.setSupports(OUT_ARG_f, me_outargs.supports(OUT_ARG_f_sg));
644 outArgs.setSupports(OUT_ARG_W, me_outargs.supports(OUT_ARG_W_sg));
645 outArgs.setSupports(OUT_ARG_WPrec,
false);
646 for (
int j=0;
j<num_p;
j++)
647 outArgs.setSupports(OUT_ARG_DfDp,
j,
648 me_outargs.supports(OUT_ARG_DfDp_sg,
j));
650 for (
int i=0; i<num_g_sg; i++) {
651 int ii = sg_g_index_map[i];
656 for (
int j=0;
j<num_p;
j++)
657 outArgs.setSupports(OUT_ARG_DgDp, i,
j,
658 me_outargs.supports(OUT_ARG_DgDp_sg, ii,
j));
669 const OutArgs& outArgs)
const
673 if (inArgs.supports(IN_ARG_x)) {
679 if (inArgs.supports(IN_ARG_x_dot))
680 x_dot = inArgs.get_x_dot();
683 EpetraExt::ModelEvaluator::Evaluation<Epetra_Vector> f_out;
684 if (outArgs.supports(OUT_ARG_f))
685 f_out = outArgs.get_f();
687 if (outArgs.supports(OUT_ARG_W))
688 W_out = outArgs.get_W();
691 InArgs me_inargs = me->createInArgs();
694 adaptMngr->copyFromAdaptiveVector(*x,*x_sg_blocks);
695 me_inargs.set_x_sg(x_sg_blocks);
699 adaptMngr->copyFromAdaptiveVector(*x_dot,*x_dot_sg_blocks);
700 me_inargs.set_x_dot_sg(x_dot_sg_blocks);
702 if (me_inargs.supports(IN_ARG_alpha))
703 me_inargs.set_alpha(inArgs.get_alpha());
704 if (me_inargs.supports(IN_ARG_beta))
705 me_inargs.set_beta(inArgs.get_beta());
706 if (me_inargs.supports(IN_ARG_t))
707 me_inargs.set_t(inArgs.get_t());
708 if (me_inargs.supports(IN_ARG_sg_basis)) {
710 me_inargs.set_sg_basis(inArgs.get_sg_basis());
712 me_inargs.set_sg_basis(sg_basis);
714 if (me_inargs.supports(IN_ARG_sg_quadrature)) {
716 me_inargs.set_sg_quadrature(inArgs.get_sg_quadrature());
718 me_inargs.set_sg_quadrature(sg_quad);
720 if (me_inargs.supports(IN_ARG_sg_expansion)) {
722 me_inargs.set_sg_expansion(inArgs.get_sg_expansion());
724 me_inargs.set_sg_expansion(sg_exp);
728 for (
int i=0; i<num_p; i++)
729 me_inargs.set_p(i, inArgs.get_p(i));
730 for (
int i=0; i<num_p_sg; i++) {
736 p = sg_p_init[i]->getBlockVector();
740 create_p_sg(sg_p_index_map[i],
View, p.
get());
741 me_inargs.set_p_sg(sg_p_index_map[i], p_sg);
745 OutArgs me_outargs = me->createOutArgs();
749 me_outargs.set_f_sg(f_sg_blocks);
751 me_outargs.set_W_sg(W_sg_blocks);
756 me_outargs.set_W_sg(W_sg_blocks);
759 for (
int i=0; i<num_p; i++) {
760 if (!outArgs.supports(OUT_ARG_DfDp, i).none()) {
761 Derivative dfdp = outArgs.get_DfDp(i);
764 if (dfdp.getMultiVectorOrientation() == DERIV_MV_BY_COL)
767 sg_basis, overlapped_stoch_row_map,
768 me->get_f_map(), sg_comm,
769 me->get_p_map(i)->NumMyElements()));
770 else if (dfdp.getMultiVectorOrientation() == DERIV_TRANS_MV_BY_ROW)
773 sg_basis, overlapped_stoch_row_map,
774 me->get_p_map(i), sg_comm,
775 me->get_f_map()->NumMyElements()));
776 me_outargs.set_DfDp_sg(i,
777 SGDerivative(dfdp_sg,
778 dfdp.getMultiVectorOrientation()));
781 "Error! Stokhos::SGModelEvaluator_Adaptive::evalModel " <<
782 "cannot handle operator form of df/dp!");
787 for (
int i=0; i<num_g_sg; i++) {
788 int ii = sg_g_index_map[i];
794 create_g_sg(sg_g_index_map[i],
View, g.
get());
795 me_outargs.set_g_sg(ii, g_sg);
799 if (outArgs.supports(OUT_ARG_DgDx_dot, i).supports(DERIV_LINEAR_OP)) {
800 Derivative dgdx_dot = outArgs.get_DgDx_dot(i);
804 dgdx_dot.getLinearOp(),
true);
807 if (me_outargs.supports(OUT_ARG_DgDx, ii).supports(DERIV_LINEAR_OP))
808 me_outargs.set_DgDx_dot_sg(ii, sg_blocks);
810 for (
unsigned int k=0; k<num_sg_blocks; k++) {
813 sg_blocks->getCoeffPtr(k),
true)->getMultiVector();
814 dgdx_dot_sg_blocks[i]->setCoeffPtr(k, mv);
816 if (me_outargs.supports(OUT_ARG_DgDx_dot_sg, ii).supports(DERIV_MV_BY_COL))
817 me_outargs.set_DgDx_dot_sg(ii, SGDerivative(dgdx_dot_sg_blocks[i],
820 me_outargs.set_DgDx_dot_sg(ii, SGDerivative(dgdx_dot_sg_blocks[i],
821 DERIV_TRANS_MV_BY_ROW));
825 dgdx_dot.isEmpty() ==
false,
827 "Error! Stokhos::SGModelEvaluator_Adaptive::evalModel: " <<
828 "Operator form of dg/dxdot is required!");
832 if (outArgs.supports(OUT_ARG_DgDx, i).supports(DERIV_LINEAR_OP)) {
833 Derivative dgdx = outArgs.get_DgDx(i);
837 dgdx.getLinearOp(),
true);
840 if (me_outargs.supports(OUT_ARG_DgDx, ii).supports(DERIV_LINEAR_OP))
841 me_outargs.set_DgDx_sg(ii, sg_blocks);
843 for (
unsigned int k=0; k<num_sg_blocks; k++) {
846 sg_blocks->getCoeffPtr(k),
true)->getMultiVector();
847 dgdx_sg_blocks[i]->setCoeffPtr(k, mv);
849 if (me_outargs.supports(OUT_ARG_DgDx_sg, ii).supports(DERIV_MV_BY_COL))
850 me_outargs.set_DgDx_sg(ii, SGDerivative(dgdx_sg_blocks[i],
853 me_outargs.set_DgDx_sg(ii, SGDerivative(dgdx_sg_blocks[i],
854 DERIV_TRANS_MV_BY_ROW));
858 dgdx.isEmpty() ==
false,
860 "Error! Stokhos::SGModelEvaluator_Adaptive::evalModel: " <<
861 "Operator form of dg/dxdot is required!");
866 for (
int j=0;
j<num_p;
j++) {
867 if (!outArgs.supports(OUT_ARG_DgDp, i,
j).none()) {
868 Derivative dgdp = outArgs.get_DgDp(i,
j);
871 if (dgdp.getMultiVectorOrientation() == DERIV_MV_BY_COL)
874 sg_basis, overlapped_stoch_row_map,
875 me->get_g_map(ii), sg_g_map[i], sg_comm,
876 View, *(dgdp.getMultiVector())));
877 else if (dgdp.getMultiVectorOrientation() == DERIV_TRANS_MV_BY_ROW) {
882 sg_basis, overlapped_stoch_row_map,
883 me->get_p_map(
j), product_map, sg_comm,
884 View, *(dgdp.getMultiVector())));
886 me_outargs.set_DgDp_sg(ii,
j,
887 SGDerivative(dgdp_sg,
888 dgdp.getMultiVectorOrientation()));
892 "Error! Stokhos::SGModelEvaluator_Adaptive::evalModel " <<
893 "cannot handle operator form of dg/dp!");
900 me->evalModel(me_inargs, me_outargs);
912 adaptMngr->setupOperator(*W_sg,*Cijk,*W_sg_blocks);
918 for (
int i=0; i<sg_basis->size(); i++)
919 (*f_sg_blocks)[i].
Scale(sg_basis->norm_squared(i));
921 adaptMngr->copyToAdaptiveVector(*f_sg_blocks,*f_out);
925 for (
int i=0; i<num_p; i++) {
926 if (!outArgs.supports(OUT_ARG_DfDp, i).none()) {
927 Derivative dfdp = outArgs.get_DfDp(i);
928 SGDerivative dfdp_sg = me_outargs.get_DfDp_sg(i);
931 dfdp.getMultiVector()->Export(
932 *(dfdp_sg.getMultiVector()->getBlockMultiVector()),
933 *adapted_overlapped_f_exporter,
Insert);
943 *sg_x_init = x_sg_in;
956 *sg_p_init[i] = p_sg_in;
968 return sg_p_index_map;
974 return sg_g_index_map;
981 for (
int i=0; i<num_g; i++)
982 base_maps[i] = me->get_g_map(i);
989 return overlapped_stoch_row_map;
995 return adapted_overlapped_x_map;
1001 return adapted_overlapped_x_importer;
1011 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,
1026 sg_basis, overlapped_stoch_row_map, x_map,
1027 sg_overlapped_x_map, sg_comm));
1030 sg_basis, overlapped_stoch_row_map, x_map,
1031 sg_overlapped_x_map, sg_comm, CV, *v));
1042 sg_basis, stoch_row_map, x_map, sg_x_map, sg_comm,
1046 sg_basis, stoch_row_map, x_map, sg_x_map, sg_comm,
1060 sg_basis, overlapped_stoch_row_map, x_map,
1061 sg_overlapped_x_map, sg_comm, num_vecs));
1064 sg_basis, overlapped_stoch_row_map, x_map,
1065 sg_overlapped_x_map, sg_comm, CV, *v));
1075 sg_p_index_map.end(),
1078 "Error! Invalid p map index " << l);
1079 int ll = it - sg_p_index_map.
begin();
1082 sg_basis, overlapped_stoch_p_map, me->get_p_map(l),
1083 sg_p_map[ll], sg_comm));
1086 sg_basis, overlapped_stoch_p_map, me->get_p_map(l),
1087 sg_p_map[ll], sg_comm, CV, *v));
1098 sg_basis, stoch_row_map, f_map, sg_f_map, sg_comm));
1101 sg_basis, stoch_row_map, f_map, sg_f_map, sg_comm,
1113 sg_basis, overlapped_stoch_row_map, f_map,
1114 sg_overlapped_f_map, sg_comm));
1117 sg_basis, overlapped_stoch_row_map, f_map,
1118 sg_overlapped_f_map, sg_comm, CV, *v));
1131 sg_basis, stoch_row_map, f_map, sg_f_map, sg_comm,
1135 sg_basis, stoch_row_map, f_map, sg_f_map, sg_comm,
1149 sg_basis, overlapped_stoch_row_map, f_map,
1150 sg_overlapped_f_map, sg_comm, num_vecs));
1153 sg_basis, overlapped_stoch_row_map, f_map,
1154 sg_overlapped_f_map, sg_comm, CV, *v));
1164 sg_g_index_map.end(),
1167 "Error! Invalid g map index " << l);
1168 int ll = it - sg_g_index_map.
begin();
1171 sg_basis, overlapped_stoch_row_map,
1173 sg_g_map[ll], sg_comm));
1176 sg_basis, overlapped_stoch_row_map,
1178 sg_g_map[ll], sg_comm, CV, *v));
1189 sg_g_index_map.end(),
1192 "Error! Invalid g map index " << l);
1193 int ll = it - sg_g_index_map.
begin();
1196 sg_basis, overlapped_stoch_row_map,
1198 sg_g_map[ll], sg_comm, num_vecs));
1201 sg_basis, overlapped_stoch_row_map,
1203 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.