FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Global::Vector< LocalVector_, Mirror_ > Class Template Reference

Global vector wrapper class template. More...

#include <vector.hpp>

Public Types

template<typename LocalVector2_ , typename Mirror2_ = Mirror_>
using ContainerType = Vector< LocalVector2_, Mirror2_ >
 Our 'base' class type. More...
 
template<typename DataType2_ , typename IndexType2_ >
using ContainerTypeByMDI = Vector< typename LocalVector_::template ContainerType< DataType2_, IndexType2_ >, typename Mirror_::template MirrorType< DataType2_, IndexType2_ > >
 this typedef lets you create a vector container with new Datatype and Index types More...
 
typedef LocalVector_::DataType DataType
 
typedef Gate< LocalVector_, Mirror_ > GateType
 
typedef LocalVector_::IndexType IndexType
 
typedef LocalVector_ LocalVectorType
 

Public Member Functions

 Vector ()
 standard constructor More...
 
template<typename... Args_>
 Vector (const GateType *gate, Args_ &&... args)
 Forwarding constructor. More...
 
void axpy (const Vector &x, const DataType alpha=DataType(1))
 Performs an AXPY operation: this <- this + alpha*x. More...
 
void clear ()
 Clears the underlying vector. More...
 
void clone (const Vector &other, LAFEM::CloneMode mode=LAFEM::CloneMode::Weak)
 Creates this as a clone of another global vector. More...
 
Vector clone (LAFEM::CloneMode mode=LAFEM::CloneMode::Weak) const
 Creates and returns a clone of this global vector. More...
 
void component_invert (const Vector &x, const DataType alpha=DataType(1))
 Computes the component-wise inverse of a vector. More...
 
void component_product (const Vector &x, const Vector &y)
 Computes the component-wise product of two vector. More...
 
template<typename OtherGlobalVector_ >
void convert (const GateType *gate, const OtherGlobalVector_ &other)
 
void copy (const Vector &x)
 Copies the contents of another vector into this vector. More...
 
DataType dot (const Vector &x) const
 Computes the dot-product of this vector and another vector. More...
 
SynchScalarTicket< DataType > dot_async (const Vector &x) const
 Computes the dot-product of this vector and another vector. More...
 
void format (DataType alpha=DataType(0))
 Reset all elements of the container to a given value or zero if missing. More...
 
void format (Random &rng, DataType min, DataType max)
 Reset all elements of the container to random values. More...
 
void from_1_to_0 ()
 Converts a type-1 vector into a type-0 vector. More...
 
std::uint64_t get_checkpoint_size (LAFEM::SerialConfig &config)
 Calculate size. More...
 
const Dist::Commget_comm () const
 Returns a const pointer to the internal communicator of the gate of the vector. More...
 
const GateTypeget_gate () const
 Returns a const pointer to the internal gate of the vector. More...
 
LocalVector_ & local ()
 Returns a reference to the internal local LAFEM vector object. More...
 
const LocalVector_ & local () const
 Returns a const reference to the internal local LAFEM vector object. More...
 
DataType max_abs_element () const
 Retrieve the absolute maximum value of this vector. More...
 
SynchScalarTicket< DataType > max_abs_element_async () const
 Retrieve the absolute maximum value of this vector. More...
 
DataType max_element () const
 Retrieve the maximum value of this vector. More...
 
SynchScalarTicket< DataType > max_element_async () const
 Retrieve the maximum value of this vector. More...
 
DataType max_rel_diff (const Vector &x) const
 Retrieve the maximum relative difference of this vector and another one y.max_rel_diff(x) returns \( \max_{0\leq i < n}\frac{|x_i-y_i|}{\max{|x_i|+|y_i|, eps}} \). More...
 
SynchScalarTicket< DataType > max_rel_diff_async (const Vector &x) const
 Retrieve the maximum relative difference of this vector and another one y.max_rel_diff(x) returns \( \max_{0\leq i < n}\frac{|x_i-y_i|}{\max{|x_i|+|y_i|, eps}} \). More...
 
DataType min_abs_element () const
 Retrieve the absolute minimum value of this vector. More...
 
SynchScalarTicket< DataType > min_abs_element_async () const
 Retrieve the absolute minimum value of this vector. More...
 
DataType min_element () const
 Retrieve the minimum value of this vector. More...
 
SynchScalarTicket< DataType > min_element_async () const
 Retrieve the minimum value of this vector. More...
 
DataType norm2 () const
 Computes the Euclid norm of this vector. More...
 
SynchScalarTicket< DataType > norm2_async () const
 Computes the Euclid norm of this vector. More...
 
DataType norm2sqr () const
 Computes the squared Euclid norm of this vector. More...
 
SynchScalarTicket< DataType > norm2sqr_async () const
 Computes the squared Euclid norm of this vector. More...
 
void restore_from_checkpoint_data (std::vector< char > &data)
 Extract object from checkpoint. More...
 
void scale (const Vector &x, const DataType alpha)
 Sets this to a scaled vector: this <- alpha*x. More...
 
std::uint64_t set_checkpoint_data (std::vector< char > &data, LAFEM::SerialConfig &config)
 
template<LAFEM::Perspective perspective_ = LAFEM::Perspective::pod>
Index size () const
 Returns the total number of entries in this distributed vector. More...
 
void sync_0 ()
 Performs a type-0 synchronization of the vector, i.e. sums up all local DOF contributions. More...
 
auto sync_0_async () -> decltype(_gate->sync_0_async(_vector))
 Performs a type-0 synchronization of the vector, i.e. sums up all local DOF contributions. More...
 
void sync_1 ()
 Performs a type-1 synchronization of the vector, i.e. averages all local DOF contributions. More...
 
auto sync_1_async () -> decltype(_gate->sync_1_async(_vector))
 Performs a type-1 synchronization of the vector, i.e. averages all local DOF contributions. More...
 

Protected Attributes

const GateType_gate
 a pointer to the gate responsible for synchronization More...
 
LocalVector_ _vector
 the internal local vector object More...
 

Detailed Description

template<typename LocalVector_, typename Mirror_>
class FEAT::Global::Vector< LocalVector_, Mirror_ >

Global vector wrapper class template.

This class implements a wrapper that contains a LAFEM vector as its core data object and provides the necessary synchronization functions required in an MPI-parallel simulation based on the overlapping domain decomposition approach. Effectively, this class only couples a local LAFEM vector with its corresponding Global::Gate, which actually performs all the dirty MPI work.

This wrapper class implements all the 'black-box' functionality of a LAFEM vector and includes the required synchronization for each operation. In the end, the only operations which require direct synchronization/communication are the dot-product and all types of norm functions. Most other functions (such as axpy, copy or scale) are parallel by nature and do not require any type of synchronization, however, they should still be called on all processes for the sake of consistency, unless a purely patch-local modification of the vector is desired, of course.

The class provides the two explicit synchronization functions sync_0() and synch_1(), which synchronize the vector data between nearest neighbors in the overlapping domain decomposition approach, thus ensuring that after all call to one of these functions, each DOF, which is shared by more than one process, has the same value on each if these processes, thus ensuring consistency of the DOF values across all processes. The difference between these two function is as follows: Each DOF, which is shared by more than one process, ...

  • sync_0: ... is replaced by the sum of all its contributions from each process that shares this DOF.
  • sync_1: ... is replaced by the average of all its contributions from each process that shares this DOF.

The 'sync_0' function is used after each assembly of a dual (right-hand-side or defect) vector to sum up all the linearform contributions for each DOF among all processes. This function is also used to synchronize a dual vector after a matrix-vector multiplication.

The 'sync_1' function is used whenever the local vectors are inconsistent over the processes, e.g. after applying a patch-local preconditioner, by averaging each DOF over all processes that contribute to that DOF.

Finally, this class also offers a function named 'from_1_to_0', which effectively scales each DOF by 1/K, where K is the number of processes that share the corresponding DOF. With this function, a call to 'sync_1' is effectively equivalent to a call to 'from_1_to_0' followed by a call to 'sync_0'.

Template Parameters
LocalVector_The type of the local vector container; may be any valid combination of LAFEM (meta-)vector types
Mirror_The type of the vector mirror; must be compatible to the local vector type
Author
Peter Zajac

Definition at line 67 of file vector.hpp.

Member Typedef Documentation

◆ ContainerType

template<typename LocalVector_ , typename Mirror_ >
template<typename LocalVector2_ , typename Mirror2_ = Mirror_>
using FEAT::Global::Vector< LocalVector_, Mirror_ >::ContainerType = Vector<LocalVector2_, Mirror2_>

Our 'base' class type.

Definition at line 78 of file vector.hpp.

◆ ContainerTypeByMDI

template<typename LocalVector_ , typename Mirror_ >
template<typename DataType2_ , typename IndexType2_ >
using FEAT::Global::Vector< LocalVector_, Mirror_ >::ContainerTypeByMDI = Vector< typename LocalVector_::template ContainerType<DataType2_, IndexType2_>, typename Mirror_::template MirrorType<DataType2_, IndexType2_> >

this typedef lets you create a vector container with new Datatype and Index types

Definition at line 82 of file vector.hpp.

◆ DataType

template<typename LocalVector_ , typename Mirror_ >
typedef LocalVector_::DataType FEAT::Global::Vector< LocalVector_, Mirror_ >::DataType

Definition at line 72 of file vector.hpp.

◆ GateType

template<typename LocalVector_ , typename Mirror_ >
typedef Gate<LocalVector_, Mirror_> FEAT::Global::Vector< LocalVector_, Mirror_ >::GateType

Definition at line 70 of file vector.hpp.

◆ IndexType

template<typename LocalVector_ , typename Mirror_ >
typedef LocalVector_::IndexType FEAT::Global::Vector< LocalVector_, Mirror_ >::IndexType

Definition at line 73 of file vector.hpp.

◆ LocalVectorType

template<typename LocalVector_ , typename Mirror_ >
typedef LocalVector_ FEAT::Global::Vector< LocalVector_, Mirror_ >::LocalVectorType

Definition at line 74 of file vector.hpp.

Constructor & Destructor Documentation

◆ Vector() [1/2]

template<typename LocalVector_ , typename Mirror_ >
FEAT::Global::Vector< LocalVector_, Mirror_ >::Vector ( )
inline

standard constructor

Definition at line 94 of file vector.hpp.

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::clone().

◆ Vector() [2/2]

template<typename LocalVector_ , typename Mirror_ >
template<typename... Args_>
FEAT::Global::Vector< LocalVector_, Mirror_ >::Vector ( const GateType gate,
Args_ &&...  args 
)
inlineexplicit

Forwarding constructor.

Parameters
[in]gateA resident pointer to the gate to be used for synchronization
[in]argsThe arguments that are to be passed to the local vector object constructor

Definition at line 110 of file vector.hpp.

Member Function Documentation

◆ axpy()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::axpy ( const Vector< LocalVector_, Mirror_ > &  x,
const DataType  alpha = DataType(1) 
)
inline

Performs an AXPY operation: this <- this + alpha*x.

Parameters
[in]x,yThe transient references to the two input vectors
[in]alphaThe scaling factor for the input vector x

Definition at line 350 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, and FEAT::Global::Vector< LocalVector_, Mirror_ >::local().

◆ clear()

◆ clone() [1/2]

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::clone ( const Vector< LocalVector_, Mirror_ > &  other,
LAFEM::CloneMode  mode = LAFEM::CloneMode::Weak 
)
inline

Creates this as a clone of another global vector.

Parameters
[in]vectorA transient reference to the vector that is to be cloned
[in]modeSpecifies the clone mode for the internal vector object.

Definition at line 283 of file vector.hpp.

References XASSERTM.

◆ clone() [2/2]

template<typename LocalVector_ , typename Mirror_ >
Vector FEAT::Global::Vector< LocalVector_, Mirror_ >::clone ( LAFEM::CloneMode  mode = LAFEM::CloneMode::Weak) const
inline

◆ component_invert()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::component_invert ( const Vector< LocalVector_, Mirror_ > &  x,
const DataType  alpha = DataType(1) 
)
inline

Computes the component-wise inverse of a vector.

This function performs \( this_i \leftarrow \alpha / x_i \)

Parameters
[in]xA transient reference to the vector whose components are to be inverted
[in]alphaThe scaling factor for the component inversion

Definition at line 467 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, and FEAT::Global::Vector< LocalVector_, Mirror_ >::local().

◆ component_product()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::component_product ( const Vector< LocalVector_, Mirror_ > &  x,
const Vector< LocalVector_, Mirror_ > &  y 
)
inline

Computes the component-wise product of two vector.

This function performs \( this_i \leftarrow x_i \cdot y_i \)

Parameters
[in]x,yThe transient references to the two vectors whose components are to be multiplied

Definition at line 480 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, and FEAT::Global::Vector< LocalVector_, Mirror_ >::local().

◆ convert()

template<typename LocalVector_ , typename Mirror_ >
template<typename OtherGlobalVector_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::convert ( const GateType gate,
const OtherGlobalVector_ &  other 
)
inline

Definition at line 137 of file vector.hpp.

◆ copy()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::copy ( const Vector< LocalVector_, Mirror_ > &  x)
inline

◆ dot()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Vector< LocalVector_, Mirror_ >::dot ( const Vector< LocalVector_, Mirror_ > &  x) const
inline

Computes the dot-product of this vector and another vector.

Parameters
[in]xA transient reference to the other vector for the dot-product
Returns
The dot-product of this and x
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 380 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, FEAT::Global::Gate< LocalVector_, Mirror_ >::dot(), and FEAT::Global::Vector< LocalVector_, Mirror_ >::local().

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::norm2sqr().

◆ dot_async()

template<typename LocalVector_ , typename Mirror_ >
SynchScalarTicket< DataType > FEAT::Global::Vector< LocalVector_, Mirror_ >::dot_async ( const Vector< LocalVector_, Mirror_ > &  x) const
inline

Computes the dot-product of this vector and another vector.

Parameters
[in]xA transient reference to the other vector for the dot-product
Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 397 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, FEAT::Global::Gate< LocalVector_, Mirror_ >::dot_async(), and FEAT::Global::Vector< LocalVector_, Mirror_ >::local().

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::norm2sqr_async().

◆ format() [1/2]

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::format ( DataType  alpha = DataType(0))
inline

Reset all elements of the container to a given value or zero if missing.

Parameters
[in]alphaThe value to be set (defaults to 0)

Definition at line 302 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector.

Referenced by FEAT::Control::Meshopt::MeshoptSystemLevel< DT_, IT_, Functional_ >::assemble_rhs_vector().

◆ format() [2/2]

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::format ( Random rng,
DataType  min,
DataType  max 
)
inline

Reset all elements of the container to random values.

Parameters
[in]rngThe random number generator.
[in]minLower rng bound.
[in]maxUpper rng bound.
Note
This function automatically synchronizes the resulting vector to ensure that the shared DOFs are consistent over all processes.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 320 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, and FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_1().

◆ from_1_to_0()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::from_1_to_0 ( )
inline

Converts a type-1 vector into a type-0 vector.

This function scales each DOF (local vector value) x_i by 1/P_i, where P_i is the number of processes that share the DOF x_i.

Note
This function is process-local and does not perform any communication, but it should be not be called by individual processes only anyways.

Definition at line 172 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::from_1_to_0().

Referenced by FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::apply(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::apply_async(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::apply_transposed(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::apply_transposed_async(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::join().

◆ get_checkpoint_size()

template<typename LocalVector_ , typename Mirror_ >
std::uint64_t FEAT::Global::Vector< LocalVector_, Mirror_ >::get_checkpoint_size ( LAFEM::SerialConfig config)
inline

Calculate size.

Calculate size of complete object as it is stored in the checkpoint

Returns
size of object

Definition at line 629 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector.

◆ get_comm()

template<typename LocalVector_ , typename Mirror_ >
const Dist::Comm * FEAT::Global::Vector< LocalVector_, Mirror_ >::get_comm ( ) const
inline

◆ get_gate()

◆ local() [1/2]

template<typename LocalVector_ , typename Mirror_ >
LocalVector_ & FEAT::Global::Vector< LocalVector_, Mirror_ >::local ( )
inline

Returns a reference to the internal local LAFEM vector object.

Returns
A reference to the internal local LAFEM vector object.

Definition at line 121 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector.

Referenced by FEAT::Control::Meshopt::DuDvFunctionalControl< DT_, IT_, DomainControl_ >::DuDvFunctionalControl(), FEAT::Solver::SchwarzPrecond< Global::Vector< LocalVector_, Mirror_ >, Global::Filter< LocalFilter_, Mirror_ > >::apply(), FEAT::Solver::DirectStokesSolver< Global::Matrix< LocalMatrix_, Mirror_, Mirror_ >, Global::Filter< LocalFilter_, Mirror_ > >::apply(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::apply(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::apply(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::apply_async(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::apply_transposed(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::apply_transposed_async(), FEAT::Control::Meshopt::MeshoptSystemLevel< DT_, IT_, Functional_ >::assemble_sol_vector(), FEAT::Control::Meshopt::MeshoptSystemLevel< DT_, IT_, Functional_ >::assemble_system_transfer(), FEAT::Global::Vector< LocalVector_, Mirror_ >::axpy(), FEAT::Assembly::BurgersAssemblyJobBase< DataType_, Space_, ConvVector_ >::calc_sd_v_norm(), FEAT::Assembly::BurgersCarreauAssemblyJobBase< DataType_, Space_, ConvVector_ >::calc_sd_v_norm(), FEAT::Global::Vector< LocalVector_, Mirror_ >::component_invert(), FEAT::Global::Vector< LocalVector_, Mirror_ >::component_product(), FEAT::Global::Vector< LocalVector_, Mirror_ >::copy(), FEAT::Global::Vector< LocalVector_, Mirror_ >::dot(), FEAT::Global::Vector< LocalVector_, Mirror_ >::dot_async(), FEAT::Global::AlgDofPartiVector< LocalVector_, Mirror_ >::download(), FEAT::Global::PMDCDSCMatrix< Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, dim_, 1 >, MirrorV_, MirrorP_ >, Global::Matrix< LAFEM::SparseMatrixBCSR< DT_, IT_, 1, dim_ >, MirrorP_, MirrorV_ > >::extract_diag(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::extract_diag(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::join(), FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::lump_rows(), FEAT::Control::Meshopt::DuDvFunctionalControl< DT_, IT_, DomainControl_ >::optimize(), FEAT::Control::Meshopt::HyperelasticityFunctionalControl< DT_, IT_, DomainControl_, Hyperelasticity_ >::optimize(), FEAT::Control::Meshopt::DuDvFunctionalControl< DT_, IT_, DomainControl_ >::prepare(), FEAT::Control::Meshopt::HyperelasticityFunctionalControl< DT_, IT_, DomainControl_, Hyperelasticity_ >::prepare(), FEAT::Global::NonlinearFunctional< LocalNonlinearFunctional_, RowMirrorType_, ColMirrorType_ >::prepare(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::prol(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::prol_recv(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::rest(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::rest_send(), FEAT::Global::Vector< LocalVector_, Mirror_ >::scale(), FEAT::Assembly::BurgersAssembler< DataType_, IndexType_, dim_ >::set_sd_v_norm(), FEAT::Assembly::BurgersAssemblerCarreau< DataType_, IndexType_, dim_ >::set_sd_v_norm(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::split(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::split_read_from(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::trunc(), FEAT::Global::Transfer< LocalTransfer_, Mirror_ >::trunc_send(), and FEAT::Global::AlgDofPartiVector< LocalVector_, Mirror_ >::upload().

◆ local() [2/2]

template<typename LocalVector_ , typename Mirror_ >
const LocalVector_ & FEAT::Global::Vector< LocalVector_, Mirror_ >::local ( ) const
inline

Returns a const reference to the internal local LAFEM vector object.

Returns
A const reference to the internal local LAFEM vector object.

Definition at line 131 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector.

◆ max_abs_element()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Vector< LocalVector_, Mirror_ >::max_abs_element ( ) const
inline

Retrieve the absolute maximum value of this vector.

Returns
The largest absolute value of this vector.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 493 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::max().

◆ max_abs_element_async()

template<typename LocalVector_ , typename Mirror_ >
SynchScalarTicket< DataType > FEAT::Global::Vector< LocalVector_, Mirror_ >::max_abs_element_async ( ) const
inline

Retrieve the absolute maximum value of this vector.

Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 507 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::max_async().

◆ max_element()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Vector< LocalVector_, Mirror_ >::max_element ( ) const
inline

Retrieve the maximum value of this vector.

Returns
The largest value of this vector.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 549 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::max_async().

◆ max_element_async()

template<typename LocalVector_ , typename Mirror_ >
SynchScalarTicket< DataType > FEAT::Global::Vector< LocalVector_, Mirror_ >::max_element_async ( ) const
inline

Retrieve the maximum value of this vector.

Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 563 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::max_async().

◆ max_rel_diff()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Vector< LocalVector_, Mirror_ >::max_rel_diff ( const Vector< LocalVector_, Mirror_ > &  x) const
inline

Retrieve the maximum relative difference of this vector and another one y.max_rel_diff(x) returns \( \max_{0\leq i < n}\frac{|x_i-y_i|}{\max{|x_i|+|y_i|, eps}} \).

Returns
The largest relative difference.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 606 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::max().

◆ max_rel_diff_async()

template<typename LocalVector_ , typename Mirror_ >
SynchScalarTicket< DataType > FEAT::Global::Vector< LocalVector_, Mirror_ >::max_rel_diff_async ( const Vector< LocalVector_, Mirror_ > &  x) const
inline

Retrieve the maximum relative difference of this vector and another one y.max_rel_diff(x) returns \( \max_{0\leq i < n}\frac{|x_i-y_i|}{\max{|x_i|+|y_i|, eps}} \).

Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 621 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::max_async().

◆ min_abs_element()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Vector< LocalVector_, Mirror_ >::min_abs_element ( ) const
inline

Retrieve the absolute minimum value of this vector.

Returns
The smallest absolute value of this vector.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 521 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::min().

◆ min_abs_element_async()

template<typename LocalVector_ , typename Mirror_ >
SynchScalarTicket< DataType > FEAT::Global::Vector< LocalVector_, Mirror_ >::min_abs_element_async ( ) const
inline

Retrieve the absolute minimum value of this vector.

Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 535 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::min_async().

◆ min_element()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Vector< LocalVector_, Mirror_ >::min_element ( ) const
inline

Retrieve the minimum value of this vector.

Returns
The smallest value of this vector.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 577 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::min().

◆ min_element_async()

template<typename LocalVector_ , typename Mirror_ >
SynchScalarTicket< DataType > FEAT::Global::Vector< LocalVector_, Mirror_ >::min_element_async ( ) const
inline

Retrieve the minimum value of this vector.

Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 591 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::min_async().

◆ norm2()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Vector< LocalVector_, Mirror_ >::norm2 ( ) const
inline

Computes the Euclid norm of this vector.

Returns
The Euclid norm of this vector
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 437 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::norm2sqr(), and FEAT::Math::sqrt().

◆ norm2_async()

template<typename LocalVector_ , typename Mirror_ >
SynchScalarTicket< DataType > FEAT::Global::Vector< LocalVector_, Mirror_ >::norm2_async ( ) const
inline

Computes the Euclid norm of this vector.

Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 450 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::dot_async().

◆ norm2sqr()

template<typename LocalVector_ , typename Mirror_ >
DataType FEAT::Global::Vector< LocalVector_, Mirror_ >::norm2sqr ( ) const
inline

Computes the squared Euclid norm of this vector.

Returns
The squared Euclid norm of this vector
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 411 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::dot().

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::norm2().

◆ norm2sqr_async()

template<typename LocalVector_ , typename Mirror_ >
SynchScalarTicket< DataType > FEAT::Global::Vector< LocalVector_, Mirror_ >::norm2sqr_async ( ) const
inline

Computes the squared Euclid norm of this vector.

Returns
A scalar ticket that has to be waited upon to complete the operation.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 424 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::dot_async().

◆ restore_from_checkpoint_data()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::restore_from_checkpoint_data ( std::vector< char > &  data)
inline

Extract object from checkpoint.

Restores complete object with all its contents from checkpoint data

Parameters
[out]dataobject as bytestrem

Definition at line 635 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector.

◆ scale()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::scale ( const Vector< LocalVector_, Mirror_ > &  x,
const DataType  alpha 
)
inline

Sets this to a scaled vector: this <- alpha*x.

Parameters
[in]xA transient reference to the input vector that is to be scaled
[in]alphaThe scaling factor for the input vector x

Definition at line 364 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, and FEAT::Global::Vector< LocalVector_, Mirror_ >::local().

◆ set_checkpoint_data()

template<typename LocalVector_ , typename Mirror_ >
std::uint64_t FEAT::Global::Vector< LocalVector_, Mirror_ >::set_checkpoint_data ( std::vector< char > &  data,
LAFEM::SerialConfig config 
)
inline

◆ size()

template<typename LocalVector_ , typename Mirror_ >
template<LAFEM::Perspective perspective_ = LAFEM::Perspective::pod>
Index FEAT::Global::Vector< LocalVector_, Mirror_ >::size ( ) const
inline

Returns the total number of entries in this distributed vector.

Warning
In parallel, this requires communication and is very expensive, so use sparingly!
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.
Returns
The number of entries

Definition at line 255 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, and ASSERTM.

◆ sync_0()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_0 ( )
inline

◆ sync_0_async()

template<typename LocalVector_ , typename Mirror_ >
auto FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_0_async ( ) -> decltype(_gate->sync_0_async(_vector))
inline

Performs a type-0 synchronization of the vector, i.e. sums up all local DOF contributions.

This function performs a type-0 synchronization, i.e. sums up all local DOF contributions for each DOF, by exchanging the DOF values of each shared DOF among all nearest neighbors.

Returns
A SynchVectorTicket object that waits for the operation to complete.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 204 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::sync_0_async().

Referenced by FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::apply_async(), and FEAT::Global::Matrix< LocalMatrix_, RowMirror_, ColMirror_ >::apply_transposed_async().

◆ sync_1()

template<typename LocalVector_ , typename Mirror_ >
void FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_1 ( )
inline

Performs a type-1 synchronization of the vector, i.e. averages all local DOF contributions.

This function performs a type-1 synchronization, i.e. averages all local DOF contributions for each DOF, by exchanging the DOF values of each shared DOF among all nearest neighbors.

Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 220 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::sync_1().

Referenced by FEAT::Solver::SchwarzPrecond< Global::Vector< LocalVector_, Mirror_ >, Global::Filter< LocalFilter_, Mirror_ > >::apply(), and FEAT::Global::Vector< LocalVector_, Mirror_ >::format().

◆ sync_1_async()

template<typename LocalVector_ , typename Mirror_ >
auto FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_1_async ( ) -> decltype(_gate->sync_1_async(_vector))
inline

Performs a type-1 synchronization of the vector, i.e. averages all local DOF contributions.

This function performs a type-1 synchronization, i.e. averages all local DOF contributions for each DOF, by exchanging the DOF values of each shared DOF among all nearest neighbors.

Returns
A SynchVectorTicket object that waits for the operation to complete.
Attention
This function is collective, i.e. it must be called by all processes participating in the gate's communicator, otherwise the application will deadlock.

Definition at line 237 of file vector.hpp.

References FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate, FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector, ASSERTM, and FEAT::Global::Gate< LocalVector_, Mirror_ >::sync_1_async().

Member Data Documentation

◆ _gate

template<typename LocalVector_ , typename Mirror_ >
const GateType* FEAT::Global::Vector< LocalVector_, Mirror_ >::_gate
protected

◆ _vector

template<typename LocalVector_ , typename Mirror_ >
LocalVector_ FEAT::Global::Vector< LocalVector_, Mirror_ >::_vector
protected

the internal local vector object

Definition at line 90 of file vector.hpp.

Referenced by FEAT::Global::Vector< LocalVector_, Mirror_ >::axpy(), FEAT::Global::Vector< LocalVector_, Mirror_ >::clear(), FEAT::Global::Vector< LocalVector_, Mirror_ >::clone(), FEAT::Global::Vector< LocalVector_, Mirror_ >::component_invert(), FEAT::Global::Vector< LocalVector_, Mirror_ >::component_product(), FEAT::Global::Vector< LocalVector_, Mirror_ >::copy(), FEAT::Global::Vector< LocalVector_, Mirror_ >::dot(), FEAT::Global::Vector< LocalVector_, Mirror_ >::dot_async(), FEAT::Global::Vector< LocalVector_, Mirror_ >::format(), FEAT::Global::Vector< LocalVector_, Mirror_ >::get_checkpoint_size(), FEAT::Global::Vector< LocalVector_, Mirror_ >::local(), FEAT::Global::Vector< LocalVector_, Mirror_ >::max_abs_element(), FEAT::Global::Vector< LocalVector_, Mirror_ >::max_abs_element_async(), FEAT::Global::Vector< LocalVector_, Mirror_ >::max_element(), FEAT::Global::Vector< LocalVector_, Mirror_ >::max_element_async(), FEAT::Global::Vector< LocalVector_, Mirror_ >::max_rel_diff(), FEAT::Global::Vector< LocalVector_, Mirror_ >::max_rel_diff_async(), FEAT::Global::Vector< LocalVector_, Mirror_ >::min_abs_element(), FEAT::Global::Vector< LocalVector_, Mirror_ >::min_abs_element_async(), FEAT::Global::Vector< LocalVector_, Mirror_ >::min_element(), FEAT::Global::Vector< LocalVector_, Mirror_ >::min_element_async(), FEAT::Global::Vector< LocalVector_, Mirror_ >::norm2_async(), FEAT::Global::Vector< LocalVector_, Mirror_ >::restore_from_checkpoint_data(), FEAT::Global::Vector< LocalVector_, Mirror_ >::scale(), FEAT::Global::Vector< LocalVector_, Mirror_ >::set_checkpoint_data(), FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_0(), FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_0_async(), FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_1(), and FEAT::Global::Vector< LocalVector_, Mirror_ >::sync_1_async().


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