Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/d2/d0b/classdolfinx_1_1la_1_1Vector.html
DOLFINx  0.5.1
DOLFINx C++ interface
Public Types | Public Member Functions | List of all members
Vector< T, Allocator > Class Template Reference

Distributed vector. More...

#include <Vector.h>

Public Types

using value_type = T
 The value type.
 
using allocator_type = Allocator
 The allocator type.
 

Public Member Functions

 Vector (const std::shared_ptr< const common::IndexMap > &map, int bs, const Allocator &alloc=Allocator())
 Create a distributed vector.
 
 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 (T v)
 Set all entries (including ghosts) More...
 
void scatter_fwd_begin ()
 Begin scatter of local data from owner to ghosts on other ranks. More...
 
void scatter_fwd_end ()
 End scatter of local data from owner to ghosts on other ranks. More...
 
void scatter_fwd ()
 Scatter local data to ghost positions on other ranks. More...
 
void scatter_rev_begin ()
 Start scatter of ghost data to owner. More...
 
template<class BinaryOperation >
void scatter_rev_end (BinaryOperation op)
 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. More...
 
template<class BinaryOperation >
void scatter_rev (BinaryOperation op)
 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. More...
 
std::shared_ptr< const common::IndexMapmap () const
 Get IndexMap.
 
constexpr int bs () const
 Get block size.
 
std::span< const T > array () const
 Get local part of the vector (const version)
 
std::span< T > mutable_array ()
 Get local part of the vector.
 
constexpr allocator_type allocator () const
 Get the allocator associated with the container.
 

Detailed Description

template<typename T, class Allocator = std::allocator<T>>
class dolfinx::la::Vector< T, Allocator >

Distributed vector.

Member Function Documentation

◆ scatter_fwd()

void scatter_fwd ( )
inline

Scatter local data to ghost positions on other ranks.

Note
Collective MPI operation

◆ scatter_fwd_begin()

void scatter_fwd_begin ( )
inline

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

Note
Collective MPI operation

◆ scatter_fwd_end()

void scatter_fwd_end ( )
inline

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

Note
Collective MPI operation

◆ scatter_rev()

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()

void scatter_rev_begin ( )
inline

Start scatter of ghost data to owner.

Note
Collective MPI operation

◆ scatter_rev_end()

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()

void set ( 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: