Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_ProductEpetraMultiVectorOperator.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
12 #include "Epetra_LocalMap.h"
13 
17  bool is_multi_vec_transposed) :
18  ProductContainer<Epetra_Operator>(product_mv_->map()),
19  ProductEpetraOperator(product_mv_->map(),
20  product_mv_->productComm()),
21  product_mv(product_mv_)
22 {
23  // Create domain, range maps
24  Teuchos::RCP<const Epetra_Map> domain_map, range_map;
25  int nv = product_mv->numVectors();
26  const Epetra_Comm& coeff_comm = product_mv->productComm()->SubDomainComm();
28  Teuchos::rcp(new Epetra_LocalMap(nv, 0, coeff_comm));
29  if (is_multi_vec_transposed) {
30  domain_map =
31  Teuchos::rcp_dynamic_cast<const Epetra_Map>(product_mv->coefficientMap());
32  range_map = local_map;
33  }
34  else {
35  domain_map = local_map;
36  range_map =
37  Teuchos::rcp_dynamic_cast<const Epetra_Map>(product_mv->coefficientMap());
38  }
39  ProductEpetraOperator::setup(domain_map, range_map);
40 
41  // Set coefficients as operators
42  for (int i=0; i<this->size(); i++) {
45  product_mv->getCoeffPtr(i), is_multi_vec_transposed));
46  this->setCoeffPtr(i, op);
47  }
48 }
49 
55  product_mv(v.product_mv)
56 {
57 }
58 
61 
66  product_mv = v.product_mv;
67  return *this;
68 }
69 
73  return product_mv;
74 }
void setCoeffPtr(ordinal_type i, const Teuchos::RCP< Epetra_Operator > &c)
Set coefficient i to c.
ProductEpetraMultiVectorOperator(const Teuchos::RCP< ProductEpetraMultiVector > &product_mv, bool is_multi_vec_transposed)
Create ProductEpetraOperator out of ProductEpetraMultiVector.
A container class for products of Epetra_Vector&#39;s.
An adaptor that supplies the operator interface to a multi-vector.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
A container class for products of Epetra_Vector&#39;s.
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.
void setup(const Teuchos::RCP< const Epetra_Map > &domain_base_map, const Teuchos::RCP< const Epetra_Map > &range_base_map)
Second stage of setup.
Teuchos::RCP< ProductEpetraMultiVector > product_mv
The product multi-vector.
Teuchos::RCP< ProductEpetraMultiVector > productMultiVector() const
Get product multi vector.
ProductEpetraOperator & operator=(const ProductEpetraOperator &v)
Assignment.
ordinal_type size() const
Return size.
ProductEpetraMultiVectorOperator & operator=(const ProductEpetraMultiVectorOperator &v)
Assignment.