43#include "EpetraExt_BlockMultiVector.h"
48 const Teuchos::RCP<const EpetraExt::MultiComm>& mp_comm_,
50 const Teuchos::RCP<const Epetra_Map>& domain_base_map_,
51 const Teuchos::RCP<const Epetra_Map>& range_base_map_,
52 const Teuchos::RCP<const Epetra_Map>& domain_mp_map_,
53 const Teuchos::RCP<const Epetra_Map>& range_mp_map_) :
54 label(
"Stokhos Block Diagonal Operator"),
74 const Teuchos::RCP<Stokhos::ProductEpetraOperator >& ops)
79Teuchos::RCP< Stokhos::ProductEpetraOperator >
86Teuchos::RCP<const Stokhos::ProductEpetraOperator >
108 Teuchos::RCP<const Epetra_BlockMap> input_base_map, result_base_map;
117 EpetraExt::BlockMultiVector mp_input(
View, *input_base_map, Input);
118 EpetraExt::BlockMultiVector mp_result(
View, *result_base_map, Result);
120 (*block_ops)[i].Apply(*(mp_input.GetBlock(i)), *(mp_result.GetBlock(i)));
130 Teuchos::RCP<const Epetra_BlockMap> input_base_map, result_base_map;
139 EpetraExt::BlockMultiVector mp_input(
View, *input_base_map, Input);
142 (*block_ops)[i].ApplyInverse(*(mp_input.GetBlock(i)),
143 *(mp_result.GetBlock(i)));
152 double product_nrm = 0.0;
154 double nrm = (*block_ops)[i].NormInf();
155 if (nrm > product_nrm)
166 return const_cast<char*
>(
label.c_str());
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
Teuchos::RCP< const EpetraExt::MultiComm > mp_comm
Stores MP parallel communicator.
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this matrix operator.
BlockDiagonalOperator(const Teuchos::RCP< const EpetraExt::MultiComm > &mp_comm, int num_mp_blocks, const Teuchos::RCP< const Epetra_Map > &domain_base_map, const Teuchos::RCP< const Epetra_Map > &range_base_map, const Teuchos::RCP< const Epetra_Map > &domain_mp_map, const Teuchos::RCP< const Epetra_Map > &range_mp_map)
Constructor.
bool useTranspose
Whether to use transpose.
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 ...
Teuchos::RCP< const Epetra_Map > range_base_map
Stores range base map.
virtual Teuchos::RCP< Stokhos::ProductEpetraOperator > getMPOps()
Get multi-point ops.
std::string label
Label for operator.
virtual double NormInf() const
Returns an approximate infinity norm of the operator matrix.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
Teuchos::RCP< const Epetra_Map > domain_mp_map
Stores domain MP map.
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this matrix operator.
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::RCP< Stokhos::ProductEpetraOperator > block_ops
Stores operators.
int num_mp_blocks
Stores number of blocks.
virtual void setupOperator(const Teuchos::RCP< Stokhos::ProductEpetraOperator > &ops)
Setup operator.
Teuchos::RCP< const Epetra_Map > range_mp_map
Stores range MP map.
virtual const char * Label() const
Returns a character string describing the operator.
virtual int SetUseTranspose(bool UseTranspose)
Set to true if the transpose of the operator is requested.
virtual const Epetra_Comm & Comm() const
Returns a reference to the Epetra_Comm communicator associated with this operator.
Teuchos::RCP< const Epetra_Map > domain_base_map
Stores domain base map.
virtual ~BlockDiagonalOperator()
Destructor.