43 #include "EpetraExt_BlockMultiVector.h"
54 label(
"Stokhos Block Diagonal Operator"),
56 num_mp_blocks(num_mp_blocks_),
57 domain_base_map(domain_base_map_),
58 range_base_map(range_base_map_),
59 domain_mp_map(domain_mp_map_),
60 range_mp_map(range_mp_map_),
97 useTranspose = UseTheTranspose;
98 for (
int i=0; i<num_mp_blocks; i++)
99 (*block_ops)[i].SetUseTranspose(useTranspose);
110 input_base_map = range_base_map;
111 result_base_map = domain_base_map;
114 input_base_map = domain_base_map;
115 result_base_map = range_base_map;
117 EpetraExt::BlockMultiVector mp_input(
View, *input_base_map, Input);
118 EpetraExt::BlockMultiVector mp_result(
View, *result_base_map, Result);
119 for (
int i=0; i<num_mp_blocks; i++) {
120 (*block_ops)[i].Apply(*(mp_input.GetBlock(i)), *(mp_result.GetBlock(i)));
132 input_base_map = domain_base_map;
133 result_base_map = range_base_map;
136 input_base_map = range_base_map;
137 result_base_map = domain_base_map;
139 EpetraExt::BlockMultiVector mp_input(
View, *input_base_map, Input);
140 EpetraExt::BlockMultiVector mp_result(
View, *range_base_map, Result);
141 for (
int i=0; i<num_mp_blocks; i++) {
142 (*block_ops)[i].ApplyInverse(*(mp_input.GetBlock(i)),
143 *(mp_result.GetBlock(i)));
152 double product_nrm = 0.0;
153 for (
int i=0; i<num_mp_blocks; i++) {
154 double nrm = (*block_ops)[i].NormInf();
155 if (nrm > product_nrm)
166 return const_cast<char*
>(label.c_str());
178 if (num_mp_blocks == 0)
180 return (*block_ops)[0].HasNormInf();
192 return *range_mp_map;
193 return *domain_mp_map;
200 return *domain_mp_map;
201 return *range_mp_map;
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this matrix 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 ...
virtual int SetUseTranspose(bool UseTranspose)
Set to true if the transpose of the operator is requested.
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.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
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 ...
virtual double NormInf() const
Returns an approximate infinity norm of the operator matrix.
virtual void setupOperator(const Teuchos::RCP< Stokhos::ProductEpetraOperator > &ops)
Setup operator.
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
virtual Teuchos::RCP< Stokhos::ProductEpetraOperator > getMPOps()
Get multi-point ops.
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this matrix operator. ...
virtual const char * Label() const
Returns a character string describing the operator.
virtual ~BlockDiagonalOperator()
Destructor.
virtual const Epetra_Comm & Comm() const
Returns a reference to the Epetra_Comm communicator associated with this operator.