KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
List of all members
Kratos::DistributedCsrMatrix< TDataType, TIndexType > Class Template Referencefinal

This class implements "serial" CSR matrix, including capabilities for FEM assembly. More...

#include <distributed_csr_matrix.h>

Collaboration diagram for Kratos::DistributedCsrMatrix< TDataType, TIndexType >:

Public Member Functions

Life Cycle
 DistributedCsrMatrix ()
 
 DistributedCsrMatrix (const DataCommunicator &rComm)
 
 DistributedCsrMatrix (const DistributedSparseGraph< TIndexType > &rSparseGraph)
 
 DistributedCsrMatrix (const DistributedCsrMatrix &rOtherMatrix)
 
 DistributedCsrMatrix (DistributedCsrMatrix< TDataType, TIndexType > &&rOtherMatrix)
 
DistributedCsrMatrixoperator= (DistributedCsrMatrix &&rOtherMatrix)
 
 ~DistributedCsrMatrix ()
 Destructor. More...
 
DistributedCsrMatrixoperator= (DistributedCsrMatrix const &rOther)=delete
 Assignment operator. TODO: decide if we do want to allow it. More...
 
Operators
void Clear ()
 
const DistributedNumbering< TIndexType > & GetRowNumbering () const
 
const DistributedNumbering< TIndexType > & GetColNumbering () const
 
DistributedNumbering< TIndexType >::UniquePointer & pGetRowNumbering ()
 
DistributedNumbering< TIndexType >::UniquePointer & pGetColNumbering ()
 
DistributedVectorImporter< TDataType, TIndexType >::UniquePointer & pGetVectorImporter ()
 
void SetValue (const TDataType value)
 
TIndexType local_size1 () const
 
TIndexType size2 () const
 
TIndexType local_nnz () const
 
const DataCommunicatorGetComm () const
 
const DataCommunicatorpGetComm () const
 
CsrMatrix< TDataType, TIndexType >::UniquePointer & pGetDiagonalBlock ()
 
CsrMatrix< TDataType, TIndexType >::UniquePointer & pGetOffDiagonalBlock ()
 
CsrMatrix< TDataType, TIndexType > & GetDiagonalBlock ()
 
CsrMatrix< TDataType, TIndexType > & GetOffDiagonalBlock ()
 
const CsrMatrix< TDataType, TIndexType > & GetDiagonalBlock () const
 
const CsrMatrix< TDataType, TIndexType > & GetOffDiagonalBlock () const
 
const std::map< TIndexType, TIndexType > & GetOffDiagonalLocalIds () const
 
std::map< TIndexType, TIndexType > & GetOffDiagonalLocalIds ()
 
const DenseVector< TIndexType > & GetOffDiagonalGlobalIds () const
 
DenseVector< TIndexType > & GetOffDiagonalGlobalIds ()
 
TIndexType GetOffDiagonalBlockLocalId (TIndexType GlobalJ) const
 
TIndexType GetOffDiaGlobalId (TIndexType LocalJ) const
 
TDataType & GetLocalDataByGlobalId (TIndexType GlobalI, TIndexType GlobalJ)
 
TDataType & GetNonLocalCachedDataByGlobalId (TIndexType GlobalI, TIndexType GlobalJ)
 
DenseVector< TIndexType > GetDiagonalIndex2DataInGlobalNumbering () const
 
DenseVector< TIndexType > GetOffDiagonalIndex2DataInGlobalNumbering () const
 
void ApplyHomogeneousDirichlet (const DistributedSystemVector< TDataType, TIndexType > &rFreeDofsVector, const TDataType DiagonalValue, DistributedSystemVector< TDataType, TIndexType > &rRHS)
 
Operations
void SpMV (const DistributedSystemVector< TDataType, TIndexType > &x, DistributedSystemVector< TDataType, TIndexType > &y) const
 
void SpMV (const TDataType alpha, const DistributedSystemVector< TDataType, TIndexType > &x, const TDataType beta, DistributedSystemVector< TDataType, TIndexType > &y) const
 
DistributedVectorExporter< TIndexType > * TransposeSpMV (const DistributedSystemVector< TDataType, TIndexType > &x, DistributedSystemVector< TDataType, TIndexType > &y, DistributedVectorExporter< TIndexType > *pTransposeExporter=nullptr) const
 
DistributedVectorExporter< TIndexType > * TransposeSpMV (TDataType alpha, const DistributedSystemVector< TDataType, TIndexType > &x, TDataType beta, DistributedSystemVector< TDataType, TIndexType > &y, DistributedVectorExporter< TIndexType > *pTransposeExporter=nullptr) const
 
TDataType NormFrobenius () const
 
void BeginAssemble ()
 
void FinalizeAssemble ()
 
template<class TMatrixType , class TIndexVectorType >
void Assemble (const TMatrixType &rMatrixInput, const TIndexVectorType &EquationId)
 
void AssembleEntry (const TDataType Value, const TIndexType GlobalI, const TIndexType GlobalJ)
 
template<class TMatrixType , class TIndexVectorType >
void Assemble (const TMatrixType &rMatrixInput, const TIndexVectorType &RowEquationId, const TIndexVectorType &ColEquationId)
 
MatrixMapType ToMap () const
 
CsrMatrix< TDataType, TIndexType >::Pointer ToSerialCSR (MpiIndexType target_rank=0) const
 
Input and output
std::string Info () const
 Turn back information as a string. More...
 
void PrintInfo (std::ostream &rOStream) const
 Print information about this object. More...
 
void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 

Protected Member Functions

Protected Operators
template<class TVectorType >
TIndexType BinarySearch (const TVectorType &arr, TIndexType l, TIndexType r, TIndexType x)
 
Protected Operations
void PrepareNonLocalCommunications (const DistributedSparseGraph< TIndexType > &rSparseGraph)
 

Type Definitions

typedef TIndexType IndexType
 
typedef int MpiIndexType
 
typedef CsrMatrix< TDataType, TIndexType > BlockMatrixType
 
typedef CsrMatrix< TDataType, TIndexType >::MatrixMapType MatrixMapType
 
 KRATOS_CLASS_POINTER_DEFINITION (DistributedCsrMatrix)
 Pointer definition of DistributedCsrMatrix. More...
 

Private Operators

class Serializer
 

Detailed Description

template<class TDataType = double, class TIndexType = std::size_t>
class Kratos::DistributedCsrMatrix< TDataType, TIndexType >

This class implements "serial" CSR matrix, including capabilities for FEM assembly.

Member Typedef Documentation

◆ BlockMatrixType

template<class TDataType = double, class TIndexType = std::size_t>
typedef CsrMatrix<TDataType,TIndexType> Kratos::DistributedCsrMatrix< TDataType, TIndexType >::BlockMatrixType

◆ IndexType

template<class TDataType = double, class TIndexType = std::size_t>
typedef TIndexType Kratos::DistributedCsrMatrix< TDataType, TIndexType >::IndexType

◆ MatrixMapType

template<class TDataType = double, class TIndexType = std::size_t>
typedef CsrMatrix<TDataType,TIndexType>::MatrixMapType Kratos::DistributedCsrMatrix< TDataType, TIndexType >::MatrixMapType

◆ MpiIndexType

template<class TDataType = double, class TIndexType = std::size_t>
typedef int Kratos::DistributedCsrMatrix< TDataType, TIndexType >::MpiIndexType

Constructor & Destructor Documentation

◆ DistributedCsrMatrix() [1/5]

template<class TDataType = double, class TIndexType = std::size_t>
Kratos::DistributedCsrMatrix< TDataType, TIndexType >::DistributedCsrMatrix ( )
inline

◆ DistributedCsrMatrix() [2/5]

template<class TDataType = double, class TIndexType = std::size_t>
Kratos::DistributedCsrMatrix< TDataType, TIndexType >::DistributedCsrMatrix ( const DataCommunicator rComm)
inline

◆ DistributedCsrMatrix() [3/5]

template<class TDataType = double, class TIndexType = std::size_t>
Kratos::DistributedCsrMatrix< TDataType, TIndexType >::DistributedCsrMatrix ( const DistributedSparseGraph< TIndexType > &  rSparseGraph)
inline

◆ DistributedCsrMatrix() [4/5]

template<class TDataType = double, class TIndexType = std::size_t>
Kratos::DistributedCsrMatrix< TDataType, TIndexType >::DistributedCsrMatrix ( const DistributedCsrMatrix< TDataType, TIndexType > &  rOtherMatrix)
inlineexplicit

◆ DistributedCsrMatrix() [5/5]

template<class TDataType = double, class TIndexType = std::size_t>
Kratos::DistributedCsrMatrix< TDataType, TIndexType >::DistributedCsrMatrix ( DistributedCsrMatrix< TDataType, TIndexType > &&  rOtherMatrix)
inline

◆ ~DistributedCsrMatrix()

template<class TDataType = double, class TIndexType = std::size_t>
Kratos::DistributedCsrMatrix< TDataType, TIndexType >::~DistributedCsrMatrix ( )
inline

Destructor.

Member Function Documentation

◆ ApplyHomogeneousDirichlet()

template<class TDataType = double, class TIndexType = std::size_t>
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::ApplyHomogeneousDirichlet ( const DistributedSystemVector< TDataType, TIndexType > &  rFreeDofsVector,
const TDataType  DiagonalValue,
DistributedSystemVector< TDataType, TIndexType > &  rRHS 
)
inline

◆ Assemble() [1/2]

template<class TDataType = double, class TIndexType = std::size_t>
template<class TMatrixType , class TIndexVectorType >
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::Assemble ( const TMatrixType &  rMatrixInput,
const TIndexVectorType &  EquationId 
)
inline

◆ Assemble() [2/2]

template<class TDataType = double, class TIndexType = std::size_t>
template<class TMatrixType , class TIndexVectorType >
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::Assemble ( const TMatrixType &  rMatrixInput,
const TIndexVectorType &  RowEquationId,
const TIndexVectorType &  ColEquationId 
)
inline

◆ AssembleEntry()

template<class TDataType = double, class TIndexType = std::size_t>
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::AssembleEntry ( const TDataType  Value,
const TIndexType  GlobalI,
const TIndexType  GlobalJ 
)
inline

◆ BeginAssemble()

template<class TDataType = double, class TIndexType = std::size_t>
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::BeginAssemble ( )
inline

◆ BinarySearch()

template<class TDataType = double, class TIndexType = std::size_t>
template<class TVectorType >
TIndexType Kratos::DistributedCsrMatrix< TDataType, TIndexType >::BinarySearch ( const TVectorType &  arr,
TIndexType  l,
TIndexType  r,
TIndexType  x 
)
inlineprotected

◆ Clear()

template<class TDataType = double, class TIndexType = std::size_t>
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::Clear ( )
inline

◆ FinalizeAssemble()

template<class TDataType = double, class TIndexType = std::size_t>
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::FinalizeAssemble ( )
inline

◆ GetColNumbering()

template<class TDataType = double, class TIndexType = std::size_t>
const DistributedNumbering<TIndexType>& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetColNumbering ( ) const
inline

◆ GetComm()

template<class TDataType = double, class TIndexType = std::size_t>
const DataCommunicator& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetComm ( ) const
inline

◆ GetDiagonalBlock() [1/2]

template<class TDataType = double, class TIndexType = std::size_t>
CsrMatrix<TDataType,TIndexType>& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetDiagonalBlock ( )
inline

◆ GetDiagonalBlock() [2/2]

template<class TDataType = double, class TIndexType = std::size_t>
const CsrMatrix<TDataType,TIndexType>& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetDiagonalBlock ( ) const
inline

◆ GetDiagonalIndex2DataInGlobalNumbering()

template<class TDataType = double, class TIndexType = std::size_t>
DenseVector<TIndexType> Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetDiagonalIndex2DataInGlobalNumbering ( ) const
inline

◆ GetLocalDataByGlobalId()

template<class TDataType = double, class TIndexType = std::size_t>
TDataType& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetLocalDataByGlobalId ( TIndexType  GlobalI,
TIndexType  GlobalJ 
)
inline

◆ GetNonLocalCachedDataByGlobalId()

template<class TDataType = double, class TIndexType = std::size_t>
TDataType& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetNonLocalCachedDataByGlobalId ( TIndexType  GlobalI,
TIndexType  GlobalJ 
)
inline

◆ GetOffDiaGlobalId()

template<class TDataType = double, class TIndexType = std::size_t>
TIndexType Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetOffDiaGlobalId ( TIndexType  LocalJ) const
inline

◆ GetOffDiagonalBlock() [1/2]

template<class TDataType = double, class TIndexType = std::size_t>
CsrMatrix<TDataType,TIndexType>& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetOffDiagonalBlock ( )
inline

◆ GetOffDiagonalBlock() [2/2]

template<class TDataType = double, class TIndexType = std::size_t>
const CsrMatrix<TDataType,TIndexType>& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetOffDiagonalBlock ( ) const
inline

◆ GetOffDiagonalBlockLocalId()

template<class TDataType = double, class TIndexType = std::size_t>
TIndexType Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetOffDiagonalBlockLocalId ( TIndexType  GlobalJ) const
inline

◆ GetOffDiagonalGlobalIds() [1/2]

template<class TDataType = double, class TIndexType = std::size_t>
DenseVector<TIndexType>& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetOffDiagonalGlobalIds ( )
inline

◆ GetOffDiagonalGlobalIds() [2/2]

template<class TDataType = double, class TIndexType = std::size_t>
const DenseVector<TIndexType>& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetOffDiagonalGlobalIds ( ) const
inline

◆ GetOffDiagonalIndex2DataInGlobalNumbering()

template<class TDataType = double, class TIndexType = std::size_t>
DenseVector<TIndexType> Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetOffDiagonalIndex2DataInGlobalNumbering ( ) const
inline

◆ GetOffDiagonalLocalIds() [1/2]

template<class TDataType = double, class TIndexType = std::size_t>
std::map<TIndexType, TIndexType>& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetOffDiagonalLocalIds ( )
inline

◆ GetOffDiagonalLocalIds() [2/2]

template<class TDataType = double, class TIndexType = std::size_t>
const std::map<TIndexType, TIndexType>& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetOffDiagonalLocalIds ( ) const
inline

◆ GetRowNumbering()

template<class TDataType = double, class TIndexType = std::size_t>
const DistributedNumbering<TIndexType>& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::GetRowNumbering ( ) const
inline

◆ Info()

template<class TDataType = double, class TIndexType = std::size_t>
std::string Kratos::DistributedCsrMatrix< TDataType, TIndexType >::Info ( ) const
inline

Turn back information as a string.

◆ KRATOS_CLASS_POINTER_DEFINITION()

template<class TDataType = double, class TIndexType = std::size_t>
Kratos::DistributedCsrMatrix< TDataType, TIndexType >::KRATOS_CLASS_POINTER_DEFINITION ( DistributedCsrMatrix< TDataType, TIndexType >  )

Pointer definition of DistributedCsrMatrix.

◆ local_nnz()

template<class TDataType = double, class TIndexType = std::size_t>
TIndexType Kratos::DistributedCsrMatrix< TDataType, TIndexType >::local_nnz ( ) const
inline

◆ local_size1()

template<class TDataType = double, class TIndexType = std::size_t>
TIndexType Kratos::DistributedCsrMatrix< TDataType, TIndexType >::local_size1 ( ) const
inline

◆ NormFrobenius()

template<class TDataType = double, class TIndexType = std::size_t>
TDataType Kratos::DistributedCsrMatrix< TDataType, TIndexType >::NormFrobenius ( ) const
inline

◆ operator=() [1/2]

template<class TDataType = double, class TIndexType = std::size_t>
DistributedCsrMatrix& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::operator= ( DistributedCsrMatrix< TDataType, TIndexType > &&  rOtherMatrix)
inline

◆ operator=() [2/2]

template<class TDataType = double, class TIndexType = std::size_t>
DistributedCsrMatrix& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::operator= ( DistributedCsrMatrix< TDataType, TIndexType > const &  rOther)
delete

Assignment operator. TODO: decide if we do want to allow it.

◆ pGetColNumbering()

template<class TDataType = double, class TIndexType = std::size_t>
DistributedNumbering<TIndexType>::UniquePointer& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::pGetColNumbering ( )
inline

◆ pGetComm()

template<class TDataType = double, class TIndexType = std::size_t>
const DataCommunicator* Kratos::DistributedCsrMatrix< TDataType, TIndexType >::pGetComm ( ) const
inline

◆ pGetDiagonalBlock()

template<class TDataType = double, class TIndexType = std::size_t>
CsrMatrix<TDataType,TIndexType>::UniquePointer& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::pGetDiagonalBlock ( )
inline

◆ pGetOffDiagonalBlock()

template<class TDataType = double, class TIndexType = std::size_t>
CsrMatrix<TDataType,TIndexType>::UniquePointer& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::pGetOffDiagonalBlock ( )
inline

◆ pGetRowNumbering()

template<class TDataType = double, class TIndexType = std::size_t>
DistributedNumbering<TIndexType>::UniquePointer& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::pGetRowNumbering ( )
inline

◆ pGetVectorImporter()

template<class TDataType = double, class TIndexType = std::size_t>
DistributedVectorImporter<TDataType,TIndexType>::UniquePointer& Kratos::DistributedCsrMatrix< TDataType, TIndexType >::pGetVectorImporter ( )
inline

◆ PrepareNonLocalCommunications()

template<class TDataType = double, class TIndexType = std::size_t>
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::PrepareNonLocalCommunications ( const DistributedSparseGraph< TIndexType > &  rSparseGraph)
inlineprotected

◆ PrintData()

template<class TDataType = double, class TIndexType = std::size_t>
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::PrintData ( std::ostream &  rOStream) const
inline

Print object's data.

◆ PrintInfo()

template<class TDataType = double, class TIndexType = std::size_t>
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::PrintInfo ( std::ostream &  rOStream) const
inline

Print information about this object.

◆ SetValue()

template<class TDataType = double, class TIndexType = std::size_t>
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::SetValue ( const TDataType  value)
inline

◆ size2()

template<class TDataType = double, class TIndexType = std::size_t>
TIndexType Kratos::DistributedCsrMatrix< TDataType, TIndexType >::size2 ( ) const
inline

◆ SpMV() [1/2]

template<class TDataType = double, class TIndexType = std::size_t>
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::SpMV ( const DistributedSystemVector< TDataType, TIndexType > &  x,
DistributedSystemVector< TDataType, TIndexType > &  y 
) const
inline

◆ SpMV() [2/2]

template<class TDataType = double, class TIndexType = std::size_t>
void Kratos::DistributedCsrMatrix< TDataType, TIndexType >::SpMV ( const TDataType  alpha,
const DistributedSystemVector< TDataType, TIndexType > &  x,
const TDataType  beta,
DistributedSystemVector< TDataType, TIndexType > &  y 
) const
inline

◆ ToMap()

template<class TDataType = double, class TIndexType = std::size_t>
MatrixMapType Kratos::DistributedCsrMatrix< TDataType, TIndexType >::ToMap ( ) const
inline

◆ ToSerialCSR()

template<class TDataType = double, class TIndexType = std::size_t>
CsrMatrix<TDataType,TIndexType>::Pointer Kratos::DistributedCsrMatrix< TDataType, TIndexType >::ToSerialCSR ( MpiIndexType  target_rank = 0) const
inline

◆ TransposeSpMV() [1/2]

template<class TDataType = double, class TIndexType = std::size_t>
DistributedVectorExporter<TIndexType>* Kratos::DistributedCsrMatrix< TDataType, TIndexType >::TransposeSpMV ( const DistributedSystemVector< TDataType, TIndexType > &  x,
DistributedSystemVector< TDataType, TIndexType > &  y,
DistributedVectorExporter< TIndexType > *  pTransposeExporter = nullptr 
) const
inline

◆ TransposeSpMV() [2/2]

template<class TDataType = double, class TIndexType = std::size_t>
DistributedVectorExporter<TIndexType>* Kratos::DistributedCsrMatrix< TDataType, TIndexType >::TransposeSpMV ( TDataType  alpha,
const DistributedSystemVector< TDataType, TIndexType > &  x,
TDataType  beta,
DistributedSystemVector< TDataType, TIndexType > &  y,
DistributedVectorExporter< TIndexType > *  pTransposeExporter = nullptr 
) const
inline

Friends And Related Function Documentation

◆ Serializer

template<class TDataType = double, class TIndexType = std::size_t>
friend class Serializer
friend

The documentation for this class was generated from the following file: