29 #include "EpetraExt_BlockUtility.h"
30 #include "EpetraExt_RowMatrixOut.h"
45 bool full_expansion =
false;
53 Cijk = basis->computeTripleProductTensor();
55 Cijk = basis->computeLinearTripleProductTensor();
58 parallelParams.
set(
"Number of Spatial Processors", numProc);
71 int gid = determRowMap->
GID(row);
75 int gid = determRowMap->
GID(row);
76 int indices[2] = {gid-1,gid+1};
82 params->
set(
"Scale Operator by Inverse Basis Norms",
false);
83 params->
set(
"Include Mean",
true);
84 params->
set(
"Only Use Linear Terms",
false);
90 for(
int i=0; i<W_sg_blocks->
size(); i++) {
107 op.setupOperator(W_sg_blocks);
110 full_op.PutScalar(0.0);
116 for(
int i=0;i<100;i++) {
124 x_vec_blocked->Random();
125 f_vec_blocked->PutScalar(0.0);
132 f_vec_inter->PutScalar(0.0);
134 full_op.
Apply(*x_vec_blocked,*f_vec_blocked);
135 op.Apply(*x_vec_inter,*f_vec_inter);
142 double true_norm = 0.0;
143 f_vec_blk_inter->NormInf(&true_norm);
144 f_vec_blk_inter->Update(-1.0,*f_vec_inter,1.0);
145 f_vec_blk_inter->NormInf(&error);
147 out <<
"rel error = " << error/true_norm <<
" ( " << true_norm <<
" ), ";
148 result &= (error/true_norm < 1e-14);
void setCoeffPtr(ordinal_type i, const Teuchos::RCP< coeff_type > &c)
Set coefficient i to c.
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< const EpetraExt::MultiComm > getMultiComm() const
Get global comm.
virtual void setupOperator(const Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > &poly)
Setup operator.
Teuchos::RCP< EpetraExt::BlockVector > getBlockVector()
Get block vector.
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
int InsertGlobalIndices(int_type GlobalRow, int NumIndices, int_type *Indices)
int PutScalar(double ScalarConstant)
int NumMyElements() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< const Epetra_BlockMap > getStochasticRowMap() const
Get stochastic row 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.
virtual int Apply(const Epetra_MultiVector &Input, Epetra_MultiVector &Result) const
Wrap Apply() to add a timer.
Teuchos::RCP< const EpetraExt::MultiComm > getMultiComm() const
Get global comm.
An Epetra operator representing the block stochastic Galerkin operator generated by fully assembling ...
Teuchos::RCP< const Stokhos::CompletePolynomialBasis< int, double > > buildBasis(int num_KL, int porder)
virtual int NumProc() const =0
An Epetra operator representing the block stochastic Galerkin operator generated by fully assembling ...
ordinal_type size() const
Return size.
static void copyToInterlacedVector(const Stokhos::EpetraVectorOrthogPoly &x_sg, Epetra_Vector &x)