DOLFINx 0.9.0
DOLFINx C++ interface
Loading...
Searching...
No Matches
Vector< T, Container > Class Template Reference

#include <Vector.h>

Public Types

using value_type = T
 Scalar type.
 
using container_type = Container
 Container type.
 

Public Member Functions

 Vector (std::shared_ptr< const common::IndexMap > map, int bs)
 
 Vector (const Vector &x)
 Copy constructor.
 
 Vector (Vector &&x)
 Move constructor.
 
Vectoroperator= (const Vector &x)=delete
 
Vectoroperator= (Vector &&x)=default
 Move Assignment operator.
 
void set (value_type v)
 
void scatter_fwd_begin ()
 
void scatter_fwd_end ()
 
void scatter_fwd ()
 
void scatter_rev_begin ()
 
template<class BinaryOperation >
void scatter_rev_end (BinaryOperation op)
 
template<class BinaryOperation >
void scatter_rev (BinaryOperation op)
 
std::shared_ptr< const common::IndexMapindex_map () const
 Get IndexMap.
 
constexpr int bs () const
 Get block size.
 
std::span< const value_typearray () const
 Get local part of the vector (const version)
 
std::span< value_typemutable_array ()
 Get local part of the vector.
 

Detailed Description

template<typename T, typename Container = std::vector<T>>
class dolfinx::la::Vector< T, Container >

Distributed vector

Template Parameters
TScalar type
Containerdata container type

Constructor & Destructor Documentation

◆ Vector()

template<typename T , typename Container = std::vector<T>>
Vector ( std::shared_ptr< const common::IndexMap > map,
int bs )
inline

Create a distributed vector

Parameters
mapIndexMap for parallel distribution of the data
bsBlock size

Member Function Documentation

◆ scatter_fwd()

template<typename T , typename Container = std::vector<T>>
void scatter_fwd ( )
inline

Scatter local data to ghost positions on other ranks

Note
Collective MPI operation

◆ scatter_fwd_begin()

template<typename T , typename Container = std::vector<T>>
void scatter_fwd_begin ( )
inline

Begin scatter of local data from owner to ghosts on other ranks

Note
Collective MPI operation

◆ scatter_fwd_end()

template<typename T , typename Container = std::vector<T>>
void scatter_fwd_end ( )
inline

End scatter of local data from owner to ghosts on other ranks

Note
Collective MPI operation

◆ scatter_rev()

template<typename T , typename Container = std::vector<T>>
template<class BinaryOperation >
void scatter_rev ( BinaryOperation op)
inline

Scatter ghost data to owner. This process may receive data from more than one process, and the received data can be summed or inserted into the local portion of the vector.

Parameters
opIndexMap operation (add or insert)
Note
Collective MPI operation

◆ scatter_rev_begin()

template<typename T , typename Container = std::vector<T>>
void scatter_rev_begin ( )
inline

Start scatter of ghost data to owner

Note
Collective MPI operation

◆ scatter_rev_end()

template<typename T , typename Container = std::vector<T>>
template<class BinaryOperation >
void scatter_rev_end ( BinaryOperation op)
inline

End scatter of ghost data to owner. This process may receive data from more than one process, and the received data can be summed or inserted into the local portion of the vector.

Parameters
opThe operation to perform when adding/setting received values (add or insert)
Note
Collective MPI operation

◆ set()

template<typename T , typename Container = std::vector<T>>
void set ( value_type v)
inline

Set all entries (including ghosts)

Parameters
[in]vThe value to set all entries to (on calling rank)

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