|
| | Vector (std::shared_ptr< const common::IndexMap > map, int bs) |
| | Create a distributed vector.
|
| | Vector (std::shared_ptr< const common::IndexMap > map, int bs, std::shared_ptr< const common::Scatterer< ScatterContainer > > scatterer) |
| | Create a distributed vector using an existing scatterer.
|
|
| Vector (const Vector &x)=default |
| | Copy constructor.
|
|
| Vector (Vector &&x)=default |
| | Move constructor.
|
| template<typename T0, typename Container0, typename ScatterContainer0> |
| | Vector (const Vector< T0, Container0, ScatterContainer0 > &x) |
| | Create a vector by copying and converting another vector.
|
|
Vector & | operator= (const Vector &x)=delete |
|
Vector & | operator= (Vector &&x)=default |
| | Move assignment operator.
|
| void | set (value_type v) |
| | Set all entries (including ghosts).
|
template<typename U, typename GetPtr>
requires VectorPackKernel<U, container_type, ScatterContainer> and GetPtrConcept<GetPtr, Container, T> |
| void | scatter_fwd_begin (U pack, GetPtr get_ptr) |
| | Begin scatter (send) of local data that is ghosted on other processes.
|
| void | scatter_fwd_begin () |
| | Begin scatter (send) of local data that is ghosted on other processes (simplified CPU version).
|
template<typename U>
requires VectorPackKernel<U, container_type, ScatterContainer> |
| void | scatter_fwd_end (U unpack) |
| | End scatter (send) of local data values that are ghosted on other processes.
|
| void | scatter_fwd_end () |
| | End scatter (send) of local data values that are ghosted on other processes (simplified CPU version).
|
| void | scatter_fwd () |
| | Scatter (send) of local data values that are ghosted on other processes and update ghost entry values (simplified CPU version).
|
template<typename U, typename GetPtr>
requires VectorPackKernel<U, container_type, ScatterContainer> and GetPtrConcept<GetPtr, Container, T> |
| void | scatter_rev_begin (U pack, GetPtr get_ptr) |
| | Start scatter (send) of ghost entry data to the owning process of an index.
|
| void | scatter_rev_begin () |
| | Start scatter (send) of ghost entry data to the owning process of an index (simplified CPU version).
|
template<typename U>
requires VectorPackKernel<U, container_type, ScatterContainer> |
| void | scatter_rev_end (U unpack) |
| | End scatter of ghost data to owner and update owned entries.
|
template<class BinaryOperation>
requires requires(Container c) { { c.data() } -> std::same_as<T*>; } |
| void | scatter_rev (BinaryOperation op) |
| | Scatter (send) of ghost data values to the owning process and assign/accumulate into the owned data entries (simplified CPU version).
|
|
std::shared_ptr< const common::IndexMap > | index_map () const noexcept |
| | Get IndexMap.
|
| std::shared_ptr< const common::Scatterer< ScatterContainer > > | scatterer () const noexcept |
| | Get the scatterer used for halo communication.
|
|
constexpr int | bs () const noexcept |
| | Get block size.
|
| container_type & | array () noexcept |
| | Get the process-local part of the vector.
|
| const container_type & | array () const noexcept |
| | Get the process-local part of the vector (const version).
|
| container_type & | mutable_array () noexcept |
| | Get local part of the vector.
|
template<typename T, typename Container = std::vector<T>, typename ScatterContainer = std::vector<std::int32_t>>
class dolfinx::la::Vector< T, Container, ScatterContainer >
A vector that can be distributed across processes.
- Template Parameters
-
| T | Scalar type of the vector. |
| Container | Data container type. This is typically std::vector<T> on CPUs, and thrust::device_vector<T> on GPUs. |
| ScatterContainer | Storage container type for the scatterer indices. This is typically std::vector<std::int32_t> on CPUs, and thrust::device_vector<std::int32_t> on GPUs. |
template<typename T, typename Container = std::vector<T>, typename ScatterContainer = std::vector<std::int32_t>>
template<typename T0, typename Container0, typename ScatterContainer0>
| Vector |
( |
const Vector< T0, Container0, ScatterContainer0 > & | x | ) |
|
|
inlineexplicit |
Create a vector by copying and converting another vector.
The local vector data, including ghost values, is copied and converted to T and Container. The index map is shared with x. If the scatter container types are the same, the scatterer is also shared; otherwise, a converted copy of the scatterer is created.
This constructor can be used to convert the scalar type, e.g. from double to float, or to transfer a vector between CPU and GPU storage.
- Note
- Construction is collective when ScatterContainer and ScatterContainer0 differ because copying the scatterer duplicates its MPI neighbourhood communicators.
- Template Parameters
-
| T0 | Scalar type of the Vector being copied. |
| Container0 | Data container type of the Vector being copied. |
| ScatterContainer0 | Scatterer container type of the Vector being copied. |
- Parameters
-
| [in] | x | Vector to copy and convert. |
template<typename T, typename Container = std::vector<T>, typename ScatterContainer = std::vector<std::int32_t>>
template<class BinaryOperation>
requires requires(Container c) { { c.data() } -> std::same_as<T*>; }
| void scatter_rev |
( |
BinaryOperation | op | ) |
|
|
inline |
Scatter (send) of ghost data values to the owning process and assign/accumulate into the owned data entries (simplified CPU version).
For an owned entry, data from more than one process may be received. The received data can be summed or inserted into the owning entry. This is controlled by the op function.
- Note
- Collective MPI operation. Every rank in the communicator must call this function, including ranks without neighbours.
- Parameters
-
| op | IndexMap operation (add or insert). |