14 #include "EpetraExt_BlockUtility.h"
28 epetraCijk(epetraCijk_),
29 Cijk(epetraCijk->getParallelCijk()),
33 only_use_linear(false),
34 determOffset_(EpetraExt::BlockUtility::CalculateOffset(determ_graph->RowMap()))
36 scale_op = params->
get(
"Scale Operator by Inverse Basis Norms",
true);
59 if (!include_mean && index(k_begin) == 0)
61 if (only_use_linear) {
62 int dim = sg_basis->dimension();
63 k_end = Cijk->find_k(dim+1);
74 j_it != Cijk->j_end(k_it); ++j_it) {
75 int j = epetraCijk->GCID(index(j_it));
77 i_it != Cijk->i_end(j_it); ++i_it) {
78 int i = epetraCijk->GRID(index(i_it));
79 double c = value(i_it);
82 this->SumIntoGlobalBlock_Deterministic(c, *block, i, j);
113 std::vector<int> Indices(MaxIndices);
114 std::vector<double> Values(MaxIndices);
119 determBlock.
ExtractMyRowCopy( i, MaxIndices, NumIndices, &Values[0], &Indices[0] );
122 for(
int l = 0; l < NumIndices; ++l ) {
123 Indices[l] = Col + COffset_*determColMap.
GID(Indices[l]);
127 int BaseRow = determMap.
GID(i);
128 ierr = this->SumIntoGlobalValues(ROffset_*BaseRow + Row, NumIndices, &Values[0], &Indices[0]);
129 if (ierr != 0) std::cout <<
"WARNING InterlacedOperator::SumIntoBlock_Deterministic SumIntoGlobalValues err = " << ierr <<
130 "\n\t Row " << ROffset_*BaseRow + Row <<
", Col start " << Indices[0] << std::endl;
bool only_use_linear
Flag indicating whether to only use linear terms.
InterlacedOperator(const Teuchos::RCP< const EpetraExt::MultiComm > &sg_comm, const Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > &sg_basis, const Teuchos::RCP< const Stokhos::EpetraSparse3Tensor > &epetraCijk, const Teuchos::RCP< const Epetra_CrsGraph > &base_graph, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Constructor.
virtual const Epetra_Map & RowMatrixRowMap() const =0
T & get(ParameterList &l, const std::string &name)
virtual Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getSGPolynomial()
Get SG polynomial.
virtual ~InterlacedOperator()
Destructor.
virtual void setupOperator(const Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > &poly)
Setup operator.
Bi-directional iterator for traversing a sparse array.
int NumMyElements() const
virtual int MaxNumEntries() const =0
bool scale_op
Flag indicating whether operator be scaled with <^2>
void SumIntoGlobalBlock_Deterministic(double alpha, const Epetra_RowMatrix &determBlock, int Row, int Col)
Sum into global matrix.
bool include_mean
Flag indicating whether to include mean term.
CRS matrix of dense blocks.
virtual int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const =0
virtual const Epetra_Map & RowMatrixColMap() const =0