43 #include "EpetraExt_BlockUtility.h"
44 #include "EpetraExt_BlockMultiVector.h"
53 domain_base_map(domain_base_map_),
54 range_base_map(range_base_map_),
55 product_range_map(Teuchos::
rcp(EpetraExt::BlockUtility::GenerateBlockMap(*range_base_map, *block_map, *product_comm_))),
56 product_comm(product_comm_),
69 domain_base_map(domain_base_map_),
70 range_base_map(range_base_map_),
71 product_range_map(product_range_map_),
72 product_comm(product_comm_),
80 domain_base_map(v.domain_base_map),
81 range_base_map(v.range_base_map),
82 product_range_map(v.product_range_map),
83 product_comm(v.product_comm),
84 useTranspose(v.useTranspose)
113 useTranspose = UseTheTranspose;
114 for (
int i=0; i<coeff_.size(); i++)
115 coeff_[i]->SetUseTranspose(useTranspose);
125 EpetraExt::BlockMultiVector sg_input(
View, *range_base_map, Input);
127 Result.PutScalar(0.0);
128 for (
int i=0; i<coeff_.size(); i++) {
129 coeff_[i]->Apply(*(sg_input.GetBlock(i)), tmp);
130 Result.Update(1.0, tmp, 1.0);
134 EpetraExt::BlockMultiVector sg_result(
View, *range_base_map, Result);
135 for (
int i=0; i<coeff_.size(); i++)
136 coeff_[i]->Apply(Input, *(sg_result.GetBlock(i)));
147 throw "ProductEpetraOperator::ApplyInverse not defined!";
163 return "Stokhos::ProductEpetraOperator";
184 return *product_comm;
191 return *product_range_map;
192 return *domain_base_map;
200 return *domain_base_map;
201 return *product_range_map;
209 product_comm(product_comm_),
219 domain_base_map = domain_base_map_;
220 range_base_map = range_base_map_;
222 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.