Loading [MathJax]/extensions/tex2jax.js
Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/v0.3.0/v0.9.0/cpp
DOLFINx  0.3.0
DOLFINx C++ interface
All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Member Functions | List of all members
dolfinx::la::Vector< T, Allocator > Class Template Reference

Distributed vector. More...

#include <Vector.h>

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.
 
 ~Vector ()
 Destructor.
 
Vectoroperator= (const Vector &x)=delete
 
Vectoroperator= (Vector &&x)=default
 Move Assignment operator.
 
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...
 
void scatter_rev_end (common::IndexMap::Mode 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...
 
void scatter_rev (dolfinx::common::IndexMap::Mode 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...
 
norm (la::Norm type=la::Norm::l2) const
 Compute the norm of the vector. More...
 
double squared_norm () const
 Compute the squared L2 norm of vector. More...
 
std::shared_ptr< const common::IndexMapmap () const
 Get IndexMap.
 
constexpr int bs () const
 Get block size.
 
const std::vector< T, Allocator > & array () const
 Get local part of the vector (const version)
 
std::vector< T, Allocator > & mutable_array ()
 Get local part of the vector.
 

Detailed Description

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

Distributed vector.

Member Function Documentation

◆ norm()

template<typename T , class Allocator = std::allocator<T>>
T dolfinx::la::Vector< T, Allocator >::norm ( la::Norm  type = la::Norm::l2) const
inline

Compute the norm of the vector.

Note
Collective MPI operation
Parameters
typeNorm type (supported types are \(L^2\) and \(L^\infty\))

◆ scatter_fwd()

template<typename T , class Allocator = std::allocator<T>>
void dolfinx::la::Vector< T, Allocator >::scatter_fwd ( )
inline

Scatter local data to ghost positions on other ranks.

Note
Collective MPI operation

◆ scatter_fwd_begin()

template<typename T , class Allocator = std::allocator<T>>
void dolfinx::la::Vector< T, Allocator >::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 , class Allocator = std::allocator<T>>
void dolfinx::la::Vector< T, Allocator >::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 , class Allocator = std::allocator<T>>
void dolfinx::la::Vector< T, Allocator >::scatter_rev ( dolfinx::common::IndexMap::Mode  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 , class Allocator = std::allocator<T>>
void dolfinx::la::Vector< T, Allocator >::scatter_rev_begin ( )
inline

Start scatter of ghost data to owner.

Note
Collective MPI operation

◆ scatter_rev_end()

template<typename T , class Allocator = std::allocator<T>>
void dolfinx::la::Vector< T, Allocator >::scatter_rev_end ( common::IndexMap::Mode  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

◆ squared_norm()

template<typename T , class Allocator = std::allocator<T>>
double dolfinx::la::Vector< T, Allocator >::squared_norm ( ) const
inline

Compute the squared L2 norm of vector.

Note
Collective MPI operation

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