42 #ifndef EPETRAEXT_BLOCKDIAGMATRIX_H 43 #define EPETRAEXT_BLOCKDIAGMATRIX_H 45 #include "Epetra_BLAS.h" 46 #include "Epetra_LAPACK.h" 47 #include "Epetra_DistObject.h" 48 #include "Epetra_BlockMap.h" 49 #include "Epetra_Map.h" 50 #include "Epetra_Operator.h" 51 #include "Teuchos_ParameterList.hpp" 92 double*
operator [] (
int index) {
return &Values_[DataMap_->FirstPointInElement(index)];}
97 const double*
operator [] (
int index)
const {
return &Values_[DataMap_->FirstPointInElement(index)];}
120 virtual const char *
Label()
const{
return "EpetraExt::BlockDiagMatrix";}
129 virtual const Epetra_Comm &
Comm()
const {
return Map().Comm();}
132 virtual const Epetra_Map &
OperatorDomainMap()
const {
return *
dynamic_cast<const Epetra_Map*
>(&Map());}
135 virtual const Epetra_Map &
OperatorRangeMap()
const {
return *
dynamic_cast<const Epetra_Map*
>(&Map());}
138 virtual const Epetra_BlockMap &
BlockMap()
const {
return Map();}
141 double*
Values()
const {
return(Values_);}
144 int BlockSize(
int LID)
const {
return Map().ElementSize(LID);}
147 int DataSize(
int LID)
const {
return DataMap_->ElementSize(LID);}
156 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 165 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES 171 int NumData()
const {
return DataMap_->NumMyPoints();}
177 virtual void Print(std::ostream & os)
const;
193 virtual int Apply(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const {
return -1;}
207 virtual int ApplyInverse(
const Epetra_MultiVector& X, Epetra_MultiVector& Y)
const;
216 virtual const Epetra_BlockMap &
DataMap()
const {
return *DataMap_;}
228 int CheckSizes(
const Epetra_SrcDistObject& Source);
230 int CopyAndPermute(
const Epetra_SrcDistObject& Source,
234 int * PermuteFromLIDs,
235 const Epetra_OffsetIndex * Indexor,
236 Epetra_CombineMode CombineMode = Zero);
239 int PackAndPrepare(
const Epetra_SrcDistObject& Source,
247 Epetra_Distributor& Distor);
250 int UnpackAndCombine(
const Epetra_SrcDistObject& Source,
256 Epetra_Distributor& Distor,
257 Epetra_CombineMode CombineMode,
258 const Epetra_OffsetIndex * Indexor);
260 Epetra_LAPACK LAPACK;
261 Teuchos::ParameterList List_;
270 Epetra_BlockMap* DataMap_;
int NumMyUnknowns() const
Returns the number of local unknowns.
int NumGlobalBlocks() const
Returns the number of global blocks.
int BlockSize(int LID) const
Returns the size of the given block.
int NumMyBlocks() const
Returns the number of local blocks.
virtual const char * Label() const
Returns a character std::string describing the operator.
virtual const Epetra_Comm & Comm() const
Returns a pointer to the Epetra_Comm communicator associated with this operator.
int NumGlobalUnknowns() const
Returns the number of global unknowns.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
virtual const Epetra_BlockMap & DataMap() const
Returns the Epetra_BlockMap object with the distribution of underlying values.
virtual bool HasNormInf() const
Returns true if the this object can provide an approximate Inf-norm, false otherwise.
EpetraExt_BlockDiagMatrix & operator=(const EpetraExt_BlockDiagMatrix &Source)
= Operator.
virtual const Epetra_Map & OperatorRangeMap() const
Returns the Epetra_Map object associated with the range of this operator.
virtual ~EpetraExt_BlockDiagMatrix()
Destructor.
double * operator[](int index)
Block access function.
bool ConstantBlockSize() const
Returns true if the element size is constant.
EpetraExt_BlockDiagMatrix: A class for storing distributed block matrices.
int DataSize(int LID) const
Returns the size of the data in the given block.
EpetraExt_BlockDiagMatrix(const Epetra_BlockMap &Map, bool zero_out=true)
Constructor - This map is the map of the vector this can be applied to.
long long NumGlobalUnknowns64() const
virtual int SetUseTranspose(bool)
SetUseTranspose - not implemented.
virtual int Compute()
Computes the inverse / factorization if such is set on the list.
virtual void Print(std::ostream &os) const
Print method.
virtual int SetParameters(Teuchos::ParameterList &List)
SetParameters.
virtual const Epetra_BlockMap & BlockMap() const
Returns the Epetra_BlockMap object associated with the range of this operator.
virtual const Epetra_Map & OperatorDomainMap() const
Returns the Epetra_Map object associated with the domain of this operator.
virtual double NormInf() const
NormInf - Not Implemented.
virtual int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_Operator applied to a Epetra_MultiVector X in Y.
double * Values() const
Returns a pointer to the array containing the blocks.
int NumData() const
Returns the size of the total Data block.
virtual int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector X in Y...
int GetApplyMode()
Gets apply mode info.
long long NumGlobalBlocks64() const
void PutScalar(double value)
PutScalar function.