63 #include "EpetraExt_BlockUtility.h"
64 #include "EpetraExt_RowMatrixOut.h"
79 bool full_expansion =
false;
87 Cijk = basis->computeTripleProductTensor();
89 Cijk = basis->computeLinearTripleProductTensor();
92 parallelParams.
set(
"Number of Spatial Processors", numProc);
105 int gid = determRowMap->
GID(row);
109 int gid = determRowMap->
GID(row);
110 int indices[2] = {gid-1,gid+1};
116 params->
set(
"Scale Operator by Inverse Basis Norms",
false);
117 params->
set(
"Include Mean",
true);
118 params->
set(
"Only Use Linear Terms",
false);
124 for(
int i=0; i<W_sg_blocks->
size(); i++) {
141 op.setupOperator(W_sg_blocks);
144 full_op.PutScalar(0.0);
150 for(
int i=0;i<100;i++) {
158 x_vec_blocked->Random();
159 f_vec_blocked->PutScalar(0.0);
166 f_vec_inter->PutScalar(0.0);
168 full_op.
Apply(*x_vec_blocked,*f_vec_blocked);
169 op.Apply(*x_vec_inter,*f_vec_inter);
176 double true_norm = 0.0;
177 f_vec_blk_inter->NormInf(&true_norm);
178 f_vec_blk_inter->Update(-1.0,*f_vec_inter,1.0);
179 f_vec_blk_inter->NormInf(&error);
181 out <<
"rel error = " << error/true_norm <<
" ( " << true_norm <<
" ), ";
182 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.
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Teuchos::RCP< EpetraExt::BlockVector > getBlockVector()
Get block vector.
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)