11 #include "EpetraExt_BlockUtility.h"
33 coeff_map(coeff_map_),
34 product_comm(product_comm_),
35 product_map(Teuchos::
rcp(EpetraExt::BlockUtility::GenerateBlockMap(*coeff_map,*block_map, *product_comm))),
36 bv(Teuchos::
rcp(new EpetraExt::BlockMultiVector(*coeff_map, *product_map,
39 for (
int i=0; i<this->
size(); i++)
51 coeff_map(coeff_map_),
52 product_comm(product_comm_),
53 product_map(product_map_),
54 bv(Teuchos::
rcp(new EpetraExt::BlockMultiVector(*coeff_map, *product_map,
57 for (
int i=0; i<this->
size(); i++)
70 coeff_map(coeff_map_),
71 product_comm(product_comm_),
72 product_map(product_map_),
73 bv(Teuchos::
rcp(new EpetraExt::BlockMultiVector(CV, *coeff_map,
76 for (
int i=0; i<this->
size(); i++)
83 coeff_map(v.coeff_map),
84 product_comm(v.product_comm),
85 product_map(v.product_map),
107 if (this->size() > 0) {
109 bv->Update(1.0, v, 0.0);
111 EpetraExt::BlockMultiVector block_v(
View, *coeff_map, v);
112 for (
int i=0; i<this->size(); i++)
113 *(coeff_[i]) = *(block_v.GetBlock(i));
123 if (this->size() > 0) {
125 v.Update(1.0, *bv, 0.0);
127 EpetraExt::BlockMultiVector block_v(
View, *coeff_map, v);
128 for (
int i=0; i<this->size(); i++)
129 *(block_v.GetBlock(i)) = *(coeff_[i]);
138 if (this->size() > 0) {
140 bv->Update(1.0, v, 0.0);
142 EpetraExt::BlockMultiVector block_v(
View, *coeff_map, v);
143 for (
int i=0; i<this->size(); i++)
144 *(coeff_[i]) = *(block_v.GetBlock(i));
171 return bv->NumVectors();
172 else if (this->size() > 0 && this->coeff_[0] !=
Teuchos::null)
173 return this->coeff_[0]->NumVectors();
185 coeff_map = coeff_map_;
186 product_comm = product_comm_;
188 Teuchos::rcp(EpetraExt::BlockUtility::GenerateBlockMap(*coeff_map,
191 bv =
Teuchos::rcp(
new EpetraExt::BlockMultiVector(*coeff_map, *product_map,
193 for (
int i=0; i<this->size(); i++)
194 this->setCoeffPtr(i, bv->GetBlock(i));
206 coeff_map = coeff_map_;
207 product_comm = product_comm_;
208 product_map = product_map_;
209 bv =
Teuchos::rcp(
new EpetraExt::BlockMultiVector(*coeff_map, *product_map,
211 for (
int i=0; i<this->size(); i++)
212 this->setCoeffPtr(i, bv->GetBlock(i));
221 Teuchos::rcp(
new EpetraExt::BlockMultiVector(CV, *coeff_map, block_vector));
222 for (
int i=0; i<this->size(); i++)
223 this->setCoeffPtr(i, bv->GetBlock(i));
245 for (
int i=0; i<this->size(); i++)
246 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.