43 #include "EpetraExt_BlockUtility.h"
65 coeff_map(coeff_map_),
66 product_comm(product_comm_),
67 product_map(Teuchos::
rcp(EpetraExt::BlockUtility::GenerateBlockMap(*coeff_map,*block_map, *product_comm))),
68 bv(Teuchos::
rcp(new EpetraExt::BlockMultiVector(*coeff_map, *product_map,
71 for (
int i=0; i<this->
size(); i++)
83 coeff_map(coeff_map_),
84 product_comm(product_comm_),
85 product_map(product_map_),
86 bv(Teuchos::
rcp(new EpetraExt::BlockMultiVector(*coeff_map, *product_map,
89 for (
int i=0; i<this->
size(); i++)
102 coeff_map(coeff_map_),
103 product_comm(product_comm_),
104 product_map(product_map_),
105 bv(Teuchos::
rcp(new EpetraExt::BlockMultiVector(CV, *coeff_map,
108 for (
int i=0; i<this->
size(); i++)
115 coeff_map(v.coeff_map),
116 product_comm(v.product_comm),
117 product_map(v.product_map),
139 if (this->size() > 0) {
141 bv->Update(1.0, v, 0.0);
143 EpetraExt::BlockMultiVector block_v(
View, *coeff_map, v);
144 for (
int i=0; i<this->size(); i++)
145 *(coeff_[i]) = *(block_v.GetBlock(i));
155 if (this->size() > 0) {
157 v.Update(1.0, *bv, 0.0);
159 EpetraExt::BlockMultiVector block_v(
View, *coeff_map, v);
160 for (
int i=0; i<this->size(); i++)
161 *(block_v.GetBlock(i)) = *(coeff_[i]);
170 if (this->size() > 0) {
172 bv->Update(1.0, v, 0.0);
174 EpetraExt::BlockMultiVector block_v(
View, *coeff_map, v);
175 for (
int i=0; i<this->size(); i++)
176 *(coeff_[i]) = *(block_v.GetBlock(i));
203 return bv->NumVectors();
204 else if (this->size() > 0 && this->coeff_[0] !=
Teuchos::null)
205 return this->coeff_[0]->NumVectors();
217 coeff_map = coeff_map_;
218 product_comm = product_comm_;
220 Teuchos::rcp(EpetraExt::BlockUtility::GenerateBlockMap(*coeff_map,
223 bv =
Teuchos::rcp(
new EpetraExt::BlockMultiVector(*coeff_map, *product_map,
225 for (
int i=0; i<this->size(); i++)
226 this->setCoeffPtr(i, bv->GetBlock(i));
238 coeff_map = coeff_map_;
239 product_comm = product_comm_;
240 product_map = product_map_;
241 bv =
Teuchos::rcp(
new EpetraExt::BlockMultiVector(*coeff_map, *product_map,
243 for (
int i=0; i<this->size(); i++)
244 this->setCoeffPtr(i, bv->GetBlock(i));
253 Teuchos::rcp(
new EpetraExt::BlockMultiVector(CV, *coeff_map, block_vector));
254 for (
int i=0; i<this->size(); i++)
255 this->setCoeffPtr(i, bv->GetBlock(i));
277 for (
int i=0; i<this->size(); i++)
278 this->setCoeffPtr(i, bv->GetBlock(i));
void setCoeffPtr(ordinal_type i, const Teuchos::RCP< Epetra_MultiVector > &c)
Set coefficient i to c.
Teuchos::RCP< const EpetraExt::MultiComm > product_comm
Product multi-level communicator.
int numVectors() const
Get number of vectors.
ProductContainer & operator=(const ProductContainer &)
Assignment.
void assignToBlockMultiVector(Epetra_MultiVector &v) const
Assignment.
Teuchos::RCP< EpetraExt::BlockMultiVector > bv
Block vector storing coefficients.
ProductEpetraMultiVector()
Default constructor.
ProductEpetraMultiVector & operator=(const ProductEpetraMultiVector &v)
Assignment.
Teuchos::RCP< const EpetraExt::MultiComm > productComm() const
Get product comm.
void reset(const Teuchos::RCP< const Epetra_BlockMap > &map)
Resize to new map map.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::RCP< const Epetra_BlockMap > coefficientMap() const
Get coefficient map.
void reset(const Teuchos::RCP< const Epetra_BlockMap > &block_map, const Teuchos::RCP< const Epetra_BlockMap > &coeff_map, const Teuchos::RCP< const EpetraExt::MultiComm > &product_comm, int num_vectors)
Reset to a new size.
A container class storing products of Epetra_MultiVector's.
Teuchos::RCP< EpetraExt::BlockMultiVector > getBlockMultiVector()
Get block vector.
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_BlockMap > productMap() const
Get product map.
Teuchos::RCP< const Epetra_BlockMap > coeff_map
Product map of block vector.
virtual ~ProductEpetraMultiVector()
Destructor.
void setBlockMultiVector(const Teuchos::RCP< EpetraExt::BlockMultiVector > &block_vec)
Set block vector.
void resetCoefficients(Epetra_DataAccess CV, const Epetra_MultiVector &block_vector)
Reset vector cofficients.
Teuchos::RCP< const Epetra_BlockMap > product_map
Product map of block vector.
void assignFromBlockMultiVector(const Epetra_MultiVector &v)
Assignment.
ordinal_type size() const
Return size.