A class that stores the halo/haloed entries required when using a DoubleVectorWithHaloEntries. This is a separate class so thay many different Vectors can share the same object. The constructor requires the distribution of the DoubleVector (if you pass in a different distribution things will go badly wrong) and a vector that specifies which GLOBAL eqn numbers are required on each processor. More...
#include <double_vector_with_halo.h>
Public Member Functions | |
DoubleVectorHaloScheme (LinearAlgebraDistribution *const &dist_pt, const Vector< unsigned > &required_global_eqn) | |
Constructor that sets up the required information communicating between all processors. Requires two "all to all" communications. Arguments are the distribution of the DoubleVector and a Vector of global unknowns required on this processor. More... | |
unsigned | n_halo_values () const |
Return the number of halo values. More... | |
LinearAlgebraDistribution *& | distribution_pt () |
Return the pointer to the distirbution used to setup the halo information. More... | |
void | setup_halo_dofs (const std::map< unsigned, double * > &halo_data_pt, Vector< double * > &halo_dof_pt) |
Function that sets up a vector of pointers to halo data, index using the scheme in Local_index. More... | |
unsigned | local_index (const unsigned &global_eqn) |
Return the local index associated with the global equation. More... | |
Private Attributes | |
std::map< unsigned, unsigned > | Local_index |
Storage for the translation scheme from global unknown to local index in the additional storage vector. More... | |
Vector< unsigned > | Haloed_eqns |
The haloed entries that will be sent in a format compatible with MPI_Alltoallv i.e. (send_to_proc0,send_to_proc1 ... send_to_procn) More... | |
Vector< int > | Haloed_n |
Storage for the number of haloed entries to be sent to each processor. More... | |
Vector< int > | Haloed_displacement |
Storage for the offsets of the haloed entries for each processor in the packed Haloed_eqns array. More... | |
Vector< unsigned > | Halo_eqns |
Storage for all the entries that are to be received from other processors (received_from_proc0,received_from_proc1,...received_from_procn) More... | |
Vector< int > | Halo_n |
Storage for the number of entries to be received from each other processor. More... | |
Vector< int > | Halo_displacement |
Storage for the offsets of the processor data in the receive buffer. More... | |
LinearAlgebraDistribution * | Distribution_pt |
Store the distribution that was used to setup the halo scheme. More... | |
Friends | |
class | DoubleVectorWithHaloEntries |
The DoubleVectorWithHaloEntries should be able to access the private data. More... | |
A class that stores the halo/haloed entries required when using a DoubleVectorWithHaloEntries. This is a separate class so thay many different Vectors can share the same object. The constructor requires the distribution of the DoubleVector (if you pass in a different distribution things will go badly wrong) and a vector that specifies which GLOBAL eqn numbers are required on each processor.
Definition at line 51 of file double_vector_with_halo.h.
oomph::DoubleVectorHaloScheme::DoubleVectorHaloScheme | ( | LinearAlgebraDistribution *const & | dist_pt, |
const Vector< unsigned > & | required_global_eqn | ||
) |
Constructor that sets up the required information communicating between all processors. Requires two "all to all" communications. Arguments are the distribution of the DoubleVector and a Vector of global unknowns required on this processor.
Definition at line 36 of file double_vector_with_halo.cc.
References oomph::LinearAlgebraDistribution::communicator_pt(), oomph::LinearAlgebraDistribution::distributed(), oomph::LinearAlgebraDistribution::first_row(), Halo_displacement, Halo_eqns, Halo_n, Haloed_displacement, Haloed_eqns, Haloed_n, i, Local_index, and oomph::LinearAlgebraDistribution::rank_of_global_row().
|
inline |
Return the pointer to the distirbution used to setup the halo information.
Definition at line 106 of file double_vector_with_halo.h.
References Distribution_pt.
Referenced by oomph::Problem::global_dof_pt().
|
inline |
Return the local index associated with the global equation.
Definition at line 118 of file double_vector_with_halo.h.
References Local_index.
Referenced by oomph::Problem::global_dof_pt(), and oomph::DoubleVectorWithHaloEntries::global_value().
|
inline |
Return the number of halo values.
Definition at line 99 of file double_vector_with_halo.h.
References Local_index.
void oomph::DoubleVectorHaloScheme::setup_halo_dofs | ( | const std::map< unsigned, double * > & | halo_data_pt, |
Vector< double * > & | halo_dof_pt | ||
) |
Function that sets up a vector of pointers to halo data, index using the scheme in Local_index.
Function that sets up a vector of pointers to halo data, index using the scheme in Local_index. The first arguement is a map of pointers to all halo data index by the global equation number.
Definition at line 225 of file double_vector_with_halo.cc.
References Local_index.
Referenced by oomph::Problem::setup_dof_halo_scheme().
|
friend |
The DoubleVectorWithHaloEntries should be able to access the private data.
Definition at line 55 of file double_vector_with_halo.h.
|
private |
Store the distribution that was used to setup the halo scheme.
Definition at line 88 of file double_vector_with_halo.h.
Referenced by distribution_pt().
|
private |
Storage for the offsets of the processor data in the receive buffer.
Definition at line 84 of file double_vector_with_halo.h.
Referenced by DoubleVectorHaloScheme(), oomph::DoubleVectorWithHaloEntries::sum_all_halo_and_haloed_values(), and oomph::DoubleVectorWithHaloEntries::synchronise().
|
private |
Storage for all the entries that are to be received from other processors (received_from_proc0,received_from_proc1,...received_from_procn)
Definition at line 76 of file double_vector_with_halo.h.
Referenced by DoubleVectorHaloScheme(), oomph::DoubleVectorWithHaloEntries::sum_all_halo_and_haloed_values(), and oomph::DoubleVectorWithHaloEntries::synchronise().
|
private |
Storage for the number of entries to be received from each other processor.
Definition at line 80 of file double_vector_with_halo.h.
Referenced by DoubleVectorHaloScheme(), oomph::DoubleVectorWithHaloEntries::sum_all_halo_and_haloed_values(), and oomph::DoubleVectorWithHaloEntries::synchronise().
|
private |
Storage for the offsets of the haloed entries for each processor in the packed Haloed_eqns array.
Definition at line 71 of file double_vector_with_halo.h.
Referenced by DoubleVectorHaloScheme(), oomph::DoubleVectorWithHaloEntries::sum_all_halo_and_haloed_values(), and oomph::DoubleVectorWithHaloEntries::synchronise().
|
private |
The haloed entries that will be sent in a format compatible with MPI_Alltoallv i.e. (send_to_proc0,send_to_proc1 ... send_to_procn)
Definition at line 63 of file double_vector_with_halo.h.
Referenced by DoubleVectorHaloScheme(), oomph::DoubleVectorWithHaloEntries::sum_all_halo_and_haloed_values(), and oomph::DoubleVectorWithHaloEntries::synchronise().
|
private |
Storage for the number of haloed entries to be sent to each processor.
Definition at line 67 of file double_vector_with_halo.h.
Referenced by DoubleVectorHaloScheme(), oomph::DoubleVectorWithHaloEntries::sum_all_halo_and_haloed_values(), and oomph::DoubleVectorWithHaloEntries::synchronise().
|
private |
Storage for the translation scheme from global unknown to local index in the additional storage vector.
Definition at line 59 of file double_vector_with_halo.h.
Referenced by oomph::DoubleVectorWithHaloEntries::build_halo_scheme(), DoubleVectorHaloScheme(), local_index(), n_halo_values(), and setup_halo_dofs().