11 #include "EpetraExt_BlockUtility.h"
12 #include "EpetraExt_BlockMultiVector.h"
21 domain_base_map(domain_base_map_),
22 range_base_map(range_base_map_),
23 product_range_map(Teuchos::
rcp(EpetraExt::BlockUtility::GenerateBlockMap(*range_base_map, *block_map, *product_comm_))),
24 product_comm(product_comm_),
37 domain_base_map(domain_base_map_),
38 range_base_map(range_base_map_),
39 product_range_map(product_range_map_),
40 product_comm(product_comm_),
48 domain_base_map(v.domain_base_map),
49 range_base_map(v.range_base_map),
50 product_range_map(v.product_range_map),
51 product_comm(v.product_comm),
52 useTranspose(v.useTranspose)
81 useTranspose = UseTheTranspose;
82 for (
int i=0; i<coeff_.size(); i++)
83 coeff_[i]->SetUseTranspose(useTranspose);
93 EpetraExt::BlockMultiVector sg_input(
View, *range_base_map, Input);
95 Result.PutScalar(0.0);
96 for (
int i=0; i<coeff_.size(); i++) {
97 coeff_[i]->Apply(*(sg_input.GetBlock(i)), tmp);
98 Result.Update(1.0, tmp, 1.0);
102 EpetraExt::BlockMultiVector sg_result(
View, *range_base_map, Result);
103 for (
int i=0; i<coeff_.size(); i++)
104 coeff_[i]->Apply(Input, *(sg_result.GetBlock(i)));
115 throw "ProductEpetraOperator::ApplyInverse not defined!";
131 return "Stokhos::ProductEpetraOperator";
152 return *product_comm;
159 return *product_range_map;
160 return *domain_base_map;
168 return *domain_base_map;
169 return *product_range_map;
177 product_comm(product_comm_),
187 domain_base_map = domain_base_map_;
188 range_base_map = range_base_map_;
190 Teuchos::rcp(EpetraExt::BlockUtility::GenerateBlockMap(*range_base_map,
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this matrix operator.
virtual const char * Label() const
Returns a character string describing the operator.
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of the inverse of the operator applied to a Epetra_MultiVector Input in Result as ...
ProductEpetraOperator(const Teuchos::RCP< const Epetra_BlockMap > &block_map, const Teuchos::RCP< const Epetra_Map > &domain_base_map, const Teuchos::RCP< const Epetra_Map > &range_base_map, const Teuchos::RCP< const EpetraExt::MultiComm > &product_comm)
Create a container with container map block_map where each coefficient is generated from the supplied...
Teuchos::RCP< const EpetraExt::MultiComm > product_comm
Product multi-level communicator.
A container class for products of Epetra_Vector's.
ProductContainer & operator=(const ProductContainer &)
Assignment.
Teuchos::RCP< const Epetra_Map > product_range_map
Product range map.
Teuchos::RCP< const EpetraExt::MultiComm > productComm() const
Get product comm.
virtual int Apply(const Epetra_MultiVector &Input, Epetra_MultiVector &Result) const
Returns the result of a Epetra_Operator applied to a Epetra_MultiVector Input in Result as described ...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
Teuchos::RCP< const Epetra_Map > range_base_map
Range map of each coefficient.
virtual const Epetra_BlockMap & Map() const =0
virtual int SetUseTranspose(bool UseTranspose)
Set to true if the transpose of the operator is requested.
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this matrix operator. ...
bool useTranspose
Whether to use transpose in Apply()
A product (in the mathematical sense) container class whose coefficients are vectors, operators, or in general any type that would have an expensive copy constructor.
Teuchos::RCP< const Epetra_Map > domain_base_map
Domain map of each coefficient.
void setup(const Teuchos::RCP< const Epetra_Map > &domain_base_map, const Teuchos::RCP< const Epetra_Map > &range_base_map)
Second stage of setup.
virtual double NormInf() const
Returns an approximate infinity norm of the operator matrix.
virtual ~ProductEpetraOperator()
Destructor.
ProductEpetraOperator & operator=(const ProductEpetraOperator &v)
Assignment.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
virtual const Epetra_Comm & Comm() const
Returns a reference to the Epetra_Comm communicator associated with this operator.