DFT-EFE
 
Loading...
Searching...
No Matches
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace > Class Template Reference

An class template to encapsulate a MultiVector. A MultiVector is a collection of \(N\) vectors belonging to the same finite-dimensional vector space, where usual notion of vector size denotes the dimension of the vector space. Note that this in the mathematical sense and not in the sense of an multi-dimensional array.The MultiVector is stored contiguously with the vector index being the fastest index, or in other words a matrix of size \(M \times N\) in row major format with \(M \) denoting the dimension of the vector space (size of individual vector). More...

#include <MultiVector.h>

Inheritance diagram for dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >:
Collaboration diagram for dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >:

Public Types

using Storage = dftefe::utils::MemoryStorage< ValueType, memorySpace >
 
using value_type = typename Storage::value_type
 
using pointer = typename Storage::pointer
 
using reference = typename Storage::reference
 
using const_reference = typename Storage::const_reference
 
using iterator = typename Storage::iterator
 
using const_iterator = typename Storage::const_iterator
 

Public Member Functions

 MultiVector ()=default
 Default Constructor. More...
 
 ~MultiVector ()=default
 Default Destructor. More...
 
 MultiVector (const size_type size, const size_type numVectors, std::shared_ptr< LinAlgOpContext< memorySpace > > linAlgOpContext, const ValueType initVal=utils::Types< ValueType >::zero)
 Constructor for serial MultiVector with vector size, number of vectors and initial value arguments. More...
 
 MultiVector (std::unique_ptr< typename MultiVector< ValueType, memorySpace >::Storage > storage, size_type numVectors, std::shared_ptr< LinAlgOpContext< memorySpace > > linAlgOpContext)
 Constructor for a \serial MultiVector with a predefined MultiVector::Storage (i.e., utils::MemoryStorage). This constructor transfers the ownership of the input Storage to the MultiVector. This is useful when one does not want to allocate new memory and instead use memory allocated in the MultiVector::Storage (i.e., utils::MemoryStorage). The locallyOwnedSize, ghostSize, etc., are automatically set using the size of the input Storage object. More...
 
 MultiVector (std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > > mpiPatternP2P, std::shared_ptr< LinAlgOpContext< memorySpace > > linAlgOpContext, const size_type numVectors, const ValueType initVal=utils::Types< ValueType >::zero)
 Constructor for a distributed MultiVector based on an input MPIPatternP2P. More...
 
 MultiVector (std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > > mpiPatternP2P, std::shared_ptr< LinAlgOpContext< memorySpace > > linAlgOpContext, const size_type numVectors, const ValueType min, const ValueType max)
 Constructor for a distributed random MultiVector based on an input MPIPatternP2P. More...
 
 MultiVector (std::unique_ptr< typename MultiVector< ValueType, memorySpace >::Storage > &storage, std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > > mpiPatternP2P, std::shared_ptr< LinAlgOpContext< memorySpace > > linAlgOpContext, const size_type numVectors)
 Constructor for a distributed MultiVector with a predefined MultiVector::Storage (i.e., utils::MemoryStorage) and MPIPatternP2P. This constructor transfers the ownership of the input Storage to the MultiVector. This is useful when one does not want to allocate new memory and instead use memory allocated in the input MultiVector::Storage (i.e., utils::MemoryStorage). More...
 
 MultiVector (const std::pair< global_size_type, global_size_type > locallyOwnedRange, const std::vector< global_size_type > &ghostIndices, const utils::mpi::MPIComm &mpiComm, std::shared_ptr< LinAlgOpContext< memorySpace > > linAlgOpContext, const size_type numVectors, ValueType initVal=utils::Types< ValueType >::zero)
 Constructor for a \distributed MultiVector based on locally owned and ghost indices. More...
 
 MultiVector (const std::pair< global_size_type, global_size_type > locallyOwnedRange, const utils::mpi::MPIComm &mpiComm, std::shared_ptr< LinAlgOpContext< memorySpace > > linAlgOpContext, const size_type numVectors, const ValueType initVal=utils::Types< ValueType >::zero)
 Constructor for a special case of distributed MultiVector where none none of the processors have any ghost indices. More...
 
 MultiVector (const global_size_type globalSize, const utils::mpi::MPIComm &mpiComm, std::shared_ptr< LinAlgOpContext< memorySpace > > linAlgOpContext, const size_type numVectors, const ValueType initVal=utils::Types< ValueType >::zero)
 Constructor for a distributed MultiVector based on total number of global indices. The resulting MultiVector will not contain any ghost indices on any of the processors. Internally, the vector is divided to ensure as much equitable distribution across all the processors much as possible. More...
 
 MultiVector (const MultiVector &u)
 Copy constructor. More...
 
 MultiVector (const MultiVector &u, const ValueType initVal=utils::Types< ValueType >::zero)
 Copy constructor with reinitialisation. More...
 
 MultiVector (MultiVector &&u) noexcept
 Move constructor. More...
 
MultiVectoroperator= (const MultiVector &u)
 Copy assignment operator. More...
 
MultiVectoroperator= (MultiVector &&u)
 Move assignment operator. More...
 
iterator begin ()
 Return iterator pointing to the beginning of MultiVector data. More...
 
const_iterator begin () const
 Return iterator pointing to the beginning of MultiVector data. More...
 
iterator end ()
 Return iterator pointing to the end of MultiVector data. More...
 
const_iterator end () const
 Return iterator pointing to the end of MultiVector data. More...
 
ValueType * data ()
 Return the raw pointer to the MultiVector data. More...
 
const ValueType * data () const
 Return the constant raw pointer to the MultiVector data. More...
 
void setValue (const ValueType val)
 Set all entries of the MultiVector to a given value. More...
 
std::vector< double > l2Norms () const
 Returns \( l_2 \) norms of all the \(N\) vectors in the MultiVector. More...
 
std::vector< double > lInfNorms () const
 Returns \( l_{\inf} \) norms of all the \(N\) vectors in the MultiVector. More...
 
size_type getNumberComponents () const
 Returns the nunber of vectors in this multi-vector. More...
 
void updateGhostValues (const size_type communicationChannel=0)
 
void accumulateAddLocallyOwned (const size_type communicationChannel=0)
 
void updateGhostValuesBegin (const size_type communicationChannel=0)
 
void updateGhostValuesEnd ()
 
void accumulateAddLocallyOwnedBegin (const size_type communicationChannel=0)
 
void accumulateAddLocallyOwnedEnd ()
 
bool isCompatible (const MultiVector< ValueType, memorySpace > &rhs) const
 
std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > > getMPIPatternP2P () const
 
std::shared_ptr< LinAlgOpContext< memorySpace > > getLinAlgOpContext () const
 
global_size_type globalSize () const
 
size_type localSize () const
 
size_type locallyOwnedSize () const
 
size_type ghostSize () const
 
size_type numVectors () const
 

Protected Attributes

std::unique_ptr< Storaged_storage
 
std::shared_ptr< LinAlgOpContext< memorySpace > > d_linAlgOpContext
 
VectorAttributes d_vectorAttributes
 
size_type d_localSize
 
global_size_type d_globalSize
 
size_type d_locallyOwnedSize
 
size_type d_ghostSize
 
size_type d_numVectors
 
std::unique_ptr< utils::mpi::MPICommunicatorP2P< ValueType, memorySpace > > d_mpiCommunicatorP2P
 
std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > > d_mpiPatternP2P
 

Detailed Description

template<typename ValueType, dftefe::utils::MemorySpace memorySpace>
class dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >

An class template to encapsulate a MultiVector. A MultiVector is a collection of \(N\) vectors belonging to the same finite-dimensional vector space, where usual notion of vector size denotes the dimension of the vector space. Note that this in the mathematical sense and not in the sense of an multi-dimensional array.The MultiVector is stored contiguously with the vector index being the fastest index, or in other words a matrix of size \(M \times N\) in row major format with \(M \) denoting the dimension of the vector space (size of individual vector).

This class handles both serial and distributed MultiVector in a unfied way. There are different constructors provided for the serial and distributed case.

The serial MultiVector, as the name suggests, resides entirely in a processor.

The distributed MultiVector, on the other hand, is distributed across a set of processors. The storage of each of the \(N\) vectors in the distributed MultiVector in a processor follows along similar lines to a distributed Vector object and comprises of two parts:

  1. locally owned part: A part of the distribute MultiVector, defined through a contiguous range of indices \([a,b)\) ( \(a\) is included, but \(b\) is not), for which the current processor is the sole owner. The size of the locally owned part (i.e., \(b-a\)) is termed as locallyOwnedSize. Note that the range of indices that comprises the locally owned part (i.e., \([a,b)\)) is same for all the \(N\) vectors in the MultiVector
  2. ghost part: Part of the MultiVector, defined through a set of ghost indices, that are owned by other processors. The size of ghost indices for each vector is termed as ghostSize. Note that the set of indices that define the ghost indices are same for all the \(N\) vectors in the MultiVector

The global size of each vector in the distributed MultiVector (i.e., the number of unique indices across all the processors) is simply termed as size. Additionally, we define localSize = locallyOwnedSize + ghostSize.

We handle the serial MultiVector as a special case of the distributed MultiVector, wherein size = locallyOwnedSize and ghostSize = 0.

Note
While typically one would link to an MPI library while compiling this class, care is taken to seamlessly allow usage of this class even while not linking to an MPI library. To do so, we have our own MPI wrappers that redirect to the MPI library's function calls and definitions while linking to an MPI library. While not linking to an MPI library, the MPI wrappers provide equivalent functions and definitions that mimic the MPI functions and definitions, albeit for a single processor. This allows the user of this class to seamlessly switch between linking and de-linking to an MPI library without any change in the code and with the expected behavior.
Note that the case of not linking to an MPI library and the case of creating a serial mult-Vector are two independent things. One can still create a serial MultiVector while linking to an MPI library and running the code across multipe processors. That is, one can create a serial MultiVector in one or more than one of the set of processors used when running in parallel. Internally, we handle this by using MPI_COMM_SELF as our MPI_Comm for the serial MultiVector (i.e., the processor does self communication). However, while not linking to an MPI library (which by definition means running on a single processor), there is no notion of communication (neither with self nor with other processors). In such case, both serial and distributed mult-Vector mean the same thing and the MPI wrappers ensure the expected behavior (i.e., the behavior of a MultiVector while using just one processor)
Template Parameters
templateparameter ValueType defines underlying datatype being stored in the MultiVector (i.e., int, double, complex<double>, etc.)
templateparameter memorySpace defines the MemorySpace (i.e., HOST or DEVICE) in which the MultiVector must reside.
Note
Broadly, there are two ways of constructing a distributed MultiVector.
  1. [Prefered and efficient approach] The first approach takes a pointer to an MPIPatternP2P as an input argument (along with other arguments). The MPIPatternP2P, in turn, contains all the information regarding the locally owned and ghost part of the MultiVector as well as the interaction map between processors. This is the most efficient way of constructing a distributed MultiVector as it allows for reusing of an already constructed MPIPatternP2P.
  2. [ Expensive approach] The second approach takes in the locally owned, ghost indices or the total number of indices across all the processors and internally creates an MPIPatternP2P object. Given that the creation of an MPIPatternP2P is expensive, this route of constructing a distributed MultiVector should be avoided.

Member Typedef Documentation

◆ const_iterator

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
using dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::const_iterator = typename Storage::const_iterator

◆ const_reference

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
using dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::const_reference = typename Storage::const_reference

◆ iterator

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
using dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::iterator = typename Storage::iterator

◆ pointer

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
using dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::pointer = typename Storage::pointer

◆ reference

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
using dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::reference = typename Storage::reference

◆ Storage

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
using dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::Storage = dftefe::utils::MemoryStorage<ValueType, memorySpace>

◆ value_type

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
using dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::value_type = typename Storage::value_type

Constructor & Destructor Documentation

◆ MultiVector() [1/12]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::MultiVector ( )
default

Default Constructor.

◆ ~MultiVector()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::~MultiVector ( )
default

Default Destructor.

◆ MultiVector() [2/12]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::MultiVector ( const size_type  size,
const size_type  numVectors,
std::shared_ptr< LinAlgOpContext< memorySpace > >  linAlgOpContext,
const ValueType  initVal = utils::Types<ValueType>::zero 
)

Constructor for serial MultiVector with vector size, number of vectors and initial value arguments.

Constructor for a serial MultiVector using size, numVectors and init value.

Parameters
[in]sizesize of each vector in the MultiVector
[in]numVectorsnumber of vectors in the MultiVector
[in]initValinitial value of elements of the MultiVector
[in]linAlgOpContextshared pointer to LinAlgOpContext object

◆ MultiVector() [3/12]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::MultiVector ( std::unique_ptr< typename MultiVector< ValueType, memorySpace >::Storage storage,
size_type  numVectors,
std::shared_ptr< LinAlgOpContext< memorySpace > >  linAlgOpContext 
)

Constructor for a \serial MultiVector with a predefined MultiVector::Storage (i.e., utils::MemoryStorage). This constructor transfers the ownership of the input Storage to the MultiVector. This is useful when one does not want to allocate new memory and instead use memory allocated in the MultiVector::Storage (i.e., utils::MemoryStorage). The locallyOwnedSize, ghostSize, etc., are automatically set using the size of the input Storage object.

Constructor for a \serial MultiVector with a predefined MultiVector::Storage (i.e., utils::MemoryStorage). This constructor transfers the ownership of the input Storage to the MultiVector. This is useful when one does not want to allocate new memory and instead use memory allocated in the MultiVector::Storage (i.e., utils::MemoryStorage).

Parameters
[in]storageunique_ptr to MultiVector::Storage whose ownership is to be transfered to the MultiVector
[in]numVectorsnumber of vectors in the MultiVector
[in]linAlgOpContextshared pointer to LinAlgOpContext object
Note
This Constructor transfers the ownership from the input unique_ptr storage to the internal data member of the MultiVector. Thus, after the function call storage will point to NULL and any access through storage will lead to undefined behavior.

◆ MultiVector() [4/12]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::MultiVector ( std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > >  mpiPatternP2P,
std::shared_ptr< LinAlgOpContext< memorySpace > >  linAlgOpContext,
const size_type  numVectors,
const ValueType  initVal = utils::Types<ValueType>::zero 
)

Constructor for a distributed MultiVector based on an input MPIPatternP2P.

Parameters
[in]mpiPatternP2PA shared_ptr to const MPIPatternP2P based on which the distributed MultiVector will be created.
[in]linAlgOpContextshared pointer to LinAlgOpContext object
[in]numVectorsnumber of vectors in the MultiVector
[in]initValvalue with which the MultiVector shoud be initialized
Here is the call graph for this function:

◆ MultiVector() [5/12]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::MultiVector ( std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > >  mpiPatternP2P,
std::shared_ptr< LinAlgOpContext< memorySpace > >  linAlgOpContext,
const size_type  numVectors,
const ValueType  min,
const ValueType  max 
)

Constructor for a distributed random MultiVector based on an input MPIPatternP2P.

Parameters
[in]mpiPatternP2PA shared_ptr to const MPIPatternP2P based on which the distributed MultiVector will be created.
[in]linAlgOpContextshared pointer to LinAlgOpContext object
[in]numVectorsnumber of vectors in the MultiVector
[in]min,maxvalue between for the random numbers
Here is the call graph for this function:

◆ MultiVector() [6/12]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::MultiVector ( std::unique_ptr< typename MultiVector< ValueType, memorySpace >::Storage > &  storage,
std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > >  mpiPatternP2P,
std::shared_ptr< LinAlgOpContext< memorySpace > >  linAlgOpContext,
const size_type  numVectors 
)

Constructor for a distributed MultiVector with a predefined MultiVector::Storage (i.e., utils::MemoryStorage) and MPIPatternP2P. This constructor transfers the ownership of the input Storage to the MultiVector. This is useful when one does not want to allocate new memory and instead use memory allocated in the input MultiVector::Storage (i.e., utils::MemoryStorage).

Parameters
[in]storageunique_ptr to MultiVector::Storage whose ownership is to be transfered to the MultiVector
[in]mpiPatternP2PA shared_ptr to const MPIPatternP2P based on which the distributed MultiVector will be created.
[in]linAlgOpContextshared pointer to LinAlgOpContext object
[in]numVectorsnumber of vectors in the MultiVector
Note
This Constructor transfers the ownership from the input unique_ptr storage to the internal data member of the MultiVector. Thus, after the function call storage will point to NULL and any access through storage will lead to undefined behavior.
Here is the call graph for this function:

◆ MultiVector() [7/12]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::MultiVector ( const std::pair< global_size_type, global_size_type locallyOwnedRange,
const std::vector< global_size_type > &  ghostIndices,
const utils::mpi::MPIComm mpiComm,
std::shared_ptr< LinAlgOpContext< memorySpace > >  linAlgOpContext,
const size_type  numVectors,
ValueType  initVal = utils::Types<ValueType>::zero 
)

Constructor for a \distributed MultiVector based on locally owned and ghost indices.

Note
This way of construction is expensive. One should use the other constructor based on an input MPIPatternP2P as far as possible.
Parameters
[in]locallyOwnedRangea pair \((a,b)\) which defines a range of indices (continuous) that are owned by the current processor.
[in]ghostIndicesvector containing an ordered set of ghost indices (ordered in increasing order and non-repeating)
[in]mpiCommutils::mpi::MPIComm object associated with the group of processors across which the MultiVector is to be distributed
[in]linAlgOpContextshared pointer to LinAlgOpContext object
[in]numVectorsnumber of vectors in the MultiVector
[in]initValvalue with which the MultiVector shoud be initialized
Note
The locallyOwnedRange should be an open interval where the start index is included, but the end index is not included.
This way of construction is expensive. One should use the other constructor based on an input MPIPatternP2P as far as possible.

◆ MultiVector() [8/12]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::MultiVector ( const std::pair< global_size_type, global_size_type locallyOwnedRange,
const utils::mpi::MPIComm mpiComm,
std::shared_ptr< LinAlgOpContext< memorySpace > >  linAlgOpContext,
const size_type  numVectors,
const ValueType  initVal = utils::Types<ValueType>::zero 
)

Constructor for a special case of distributed MultiVector where none none of the processors have any ghost indices.

Note
This way of construction is expensive. One should use the other constructor based on an input MPIPatternP2P as far as possible.
Parameters
[in]locallyOwnedRangea pair \((a,b)\) which defines a range of indices (continuous) that are owned by the current processor.
[in]mpiCommutils::mpi::MPIComm object associated with the group of processors across which the MultiVector is to be distributed
[in]linAlgOpContextshared pointer to LinAlgOpContext object
[in]numVectorsnumber of vectors in the MultiVector
[in]initValvalue with which the MultiVector shoud be initialized
Note
The locallyOwnedRange should be an open interval where the start index included, but the end index is not included.
This way of construction is expensive. One should use the other constructor based on an input MPIPatternP2P as far as possible.
Here is the call graph for this function:

◆ MultiVector() [9/12]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::MultiVector ( const global_size_type  globalSize,
const utils::mpi::MPIComm mpiComm,
std::shared_ptr< LinAlgOpContext< memorySpace > >  linAlgOpContext,
const size_type  numVectors,
const ValueType  initVal = utils::Types<ValueType>::zero 
)

Constructor for a distributed MultiVector based on total number of global indices. The resulting MultiVector will not contain any ghost indices on any of the processors. Internally, the vector is divided to ensure as much equitable distribution across all the processors much as possible.

Note
This way of construction is expensive. One should use the other constructor based on an input MPIPatternP2P as far as possible. Further, the decomposition is not compatible with other ways of distributed MultiVector construction.
Parameters
[in]globalSizeTotal number of global indices that is distributed over the processors.
[in]mpiCommutils::mpi::MPIComm object associated with the group of processors across which the MultiVector is to be distributed
[in]linAlgOpContextshared pointer to LinAlgOpContext object
[in]numVectorsnumber of vectors in the MultiVector
[in]initValvalue with which the MultiVector shoud be initialized
Note
This way of construction is expensive. One should use the other constructor based on an input MPIPatternP2P as far as possible. Further, the decomposition is not compatible with other ways of distributed MultiVector construction.

◆ MultiVector() [10/12]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::MultiVector ( const MultiVector< ValueType, memorySpace > &  u)

Copy constructor.

Parameters
[in]uMultiVector object to copy from

◆ MultiVector() [11/12]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::MultiVector ( const MultiVector< ValueType, memorySpace > &  u,
const ValueType  initVal = utils::Types<ValueType>::zero 
)

Copy constructor with reinitialisation.

Parameters
[in]uMultiVector object to copy from
[in]initValInitial value of the MultiVector

◆ MultiVector() [12/12]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::MultiVector ( MultiVector< ValueType, memorySpace > &&  u)
noexcept

Move constructor.

Parameters
[in]uMultiVector object to move from

Member Function Documentation

◆ accumulateAddLocallyOwned()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::accumulateAddLocallyOwned ( const size_type  communicationChannel = 0)
Here is the caller graph for this function:

◆ accumulateAddLocallyOwnedBegin()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::accumulateAddLocallyOwnedBegin ( const size_type  communicationChannel = 0)

◆ accumulateAddLocallyOwnedEnd()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::accumulateAddLocallyOwnedEnd

◆ begin() [1/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
MultiVector< ValueType, memorySpace >::iterator dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::begin

Return iterator pointing to the beginning of MultiVector data.

Returns
Iterator pointing to the beginning of MultiVector.
Here is the caller graph for this function:

◆ begin() [2/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
MultiVector< ValueType, memorySpace >::const_iterator dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::begin

Return iterator pointing to the beginning of MultiVector data.

Returns
Constant iterator pointing to the beginning of MultiVector.

◆ data() [1/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
ValueType * dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::data

Return the raw pointer to the MultiVector data.

Returns
pointer to data
Here is the caller graph for this function:

◆ data() [2/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
const ValueType * dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::data

Return the constant raw pointer to the MultiVector data.

Returns
pointer to const data

◆ end() [1/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
MultiVector< ValueType, memorySpace >::iterator dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::end

Return iterator pointing to the end of MultiVector data.

Returns
Iterator pointing to the end of MultiVector.

◆ end() [2/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
MultiVector< ValueType, memorySpace >::const_iterator dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::end

Return iterator pointing to the end of MultiVector data.

Returns
Constant iterator pointing to the end of MultiVector.

◆ getLinAlgOpContext()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
std::shared_ptr< LinAlgOpContext< memorySpace > > dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::getLinAlgOpContext
Here is the caller graph for this function:

◆ getMPIPatternP2P()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
std::shared_ptr< const utils::mpi::MPIPatternP2P< memorySpace > > dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::getMPIPatternP2P
Here is the caller graph for this function:

◆ getNumberComponents()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
size_type dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::getNumberComponents

Returns the nunber of vectors in this multi-vector.

Returns
d_numVectors
Here is the caller graph for this function:

◆ ghostSize()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
size_type dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::ghostSize

◆ globalSize()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
global_size_type dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::globalSize
Here is the caller graph for this function:

◆ isCompatible()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
bool dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::isCompatible ( const MultiVector< ValueType, memorySpace > &  rhs) const
Here is the caller graph for this function:

◆ l2Norms()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
std::vector< double > dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::l2Norms

Returns \( l_2 \) norms of all the \(N\) vectors in the MultiVector.

Returns
\( l_2 \) norms of the various vectors as std::vector<double> type
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lInfNorms()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
std::vector< double > dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::lInfNorms

Returns \( l_{\inf} \) norms of all the \(N\) vectors in the MultiVector.

Returns
\( l_{\inf} \) norms of the various vectors as std::vector<double> type
Here is the caller graph for this function:

◆ locallyOwnedSize()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
size_type dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::locallyOwnedSize
Here is the caller graph for this function:

◆ localSize()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
size_type dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::localSize
Here is the caller graph for this function:

◆ numVectors()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
size_type dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::numVectors
Here is the caller graph for this function:

◆ operator=() [1/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
MultiVector< ValueType, memorySpace > & dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::operator= ( const MultiVector< ValueType, memorySpace > &  u)

Copy assignment operator.

Parameters
[in]uconst reference to MultiVector object to copy from
Returns
reference to this object after copying data from u

◆ operator=() [2/2]

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
MultiVector< ValueType, memorySpace > & dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::operator= ( MultiVector< ValueType, memorySpace > &&  u)

Move assignment operator.

Parameters
[in]uconst reference to MultiVector object to move from
Returns
reference to this object after moving data from u

◆ setValue()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::setValue ( const ValueType  val)

Set all entries of the MultiVector to a given value.

Parameters
[in]valThe value to which the entries are to be set
Here is the caller graph for this function:

◆ updateGhostValues()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::updateGhostValues ( const size_type  communicationChannel = 0)
Here is the caller graph for this function:

◆ updateGhostValuesBegin()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::updateGhostValuesBegin ( const size_type  communicationChannel = 0)

◆ updateGhostValuesEnd()

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
void dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::updateGhostValuesEnd

Member Data Documentation

◆ d_ghostSize

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
size_type dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::d_ghostSize
protected

◆ d_globalSize

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
global_size_type dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::d_globalSize
protected

◆ d_linAlgOpContext

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
std::shared_ptr<LinAlgOpContext<memorySpace> > dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::d_linAlgOpContext
protected

◆ d_locallyOwnedSize

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
size_type dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::d_locallyOwnedSize
protected

◆ d_localSize

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
size_type dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::d_localSize
protected

◆ d_mpiCommunicatorP2P

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
std::unique_ptr<utils::mpi::MPICommunicatorP2P<ValueType, memorySpace> > dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::d_mpiCommunicatorP2P
protected

◆ d_mpiPatternP2P

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
std::shared_ptr<const utils::mpi::MPIPatternP2P<memorySpace> > dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::d_mpiPatternP2P
protected

◆ d_numVectors

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
size_type dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::d_numVectors
protected

◆ d_storage

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
std::unique_ptr<Storage> dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::d_storage
protected

◆ d_vectorAttributes

template<typename ValueType , dftefe::utils::MemorySpace memorySpace>
VectorAttributes dftefe::linearAlgebra::MultiVector< ValueType, memorySpace >::d_vectorAttributes
protected

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