Public Member Functions | Private Attributes | Friends | List of all members
oomph::DoubleVectorHaloScheme Class Reference

#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...
 
LinearAlgebraDistributionDistribution_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...
 

Detailed Description

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 55 of file double_vector_with_halo.h.

Constructor & Destructor Documentation

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

Member Function Documentation

LinearAlgebraDistribution* & oomph::DoubleVectorHaloScheme::distribution_pt ( )
inline

Return the pointer to the distirbution used to setup the halo information.

Definition at line 108 of file double_vector_with_halo.h.

References Distribution_pt.

Referenced by oomph::Problem::global_dof_pt().

unsigned oomph::DoubleVectorHaloScheme::local_index ( const unsigned &  global_eqn)
inline

Return the local index associated with the global equation.

Definition at line 117 of file double_vector_with_halo.h.

References Local_index.

Referenced by oomph::Problem::global_dof_pt(), and oomph::DoubleVectorWithHaloEntries::global_value().

unsigned oomph::DoubleVectorHaloScheme::n_halo_values ( ) const
inline

Return the number of halo values.

Definition at line 104 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 210 of file double_vector_with_halo.cc.

References Local_index.

Referenced by oomph::Problem::setup_dof_halo_scheme().

Friends And Related Function Documentation

friend class DoubleVectorWithHaloEntries
friend

The DoubleVectorWithHaloEntries should be able to access the private data.

Definition at line 59 of file double_vector_with_halo.h.

Member Data Documentation

LinearAlgebraDistribution* oomph::DoubleVectorHaloScheme::Distribution_pt
private

Store the distribution that was used to setup the halo scheme.

Definition at line 92 of file double_vector_with_halo.h.

Referenced by distribution_pt().

Vector<int> oomph::DoubleVectorHaloScheme::Halo_displacement
private

Storage for the offsets of the processor data in the receive buffer.

Definition at line 88 of file double_vector_with_halo.h.

Referenced by DoubleVectorHaloScheme(), oomph::DoubleVectorWithHaloEntries::sum_all_halo_and_haloed_values(), and oomph::DoubleVectorWithHaloEntries::synchronise().

Vector<unsigned> oomph::DoubleVectorHaloScheme::Halo_eqns
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 80 of file double_vector_with_halo.h.

Referenced by DoubleVectorHaloScheme(), oomph::DoubleVectorWithHaloEntries::sum_all_halo_and_haloed_values(), and oomph::DoubleVectorWithHaloEntries::synchronise().

Vector<int> oomph::DoubleVectorHaloScheme::Halo_n
private

Storage for the number of entries to be received from each other processor.

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

Vector<int> oomph::DoubleVectorHaloScheme::Haloed_displacement
private

Storage for the offsets of the haloed entries for each processor in the packed Haloed_eqns array.

Definition at line 75 of file double_vector_with_halo.h.

Referenced by DoubleVectorHaloScheme(), oomph::DoubleVectorWithHaloEntries::sum_all_halo_and_haloed_values(), and oomph::DoubleVectorWithHaloEntries::synchronise().

Vector<unsigned> oomph::DoubleVectorHaloScheme::Haloed_eqns
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 67 of file double_vector_with_halo.h.

Referenced by DoubleVectorHaloScheme(), oomph::DoubleVectorWithHaloEntries::sum_all_halo_and_haloed_values(), and oomph::DoubleVectorWithHaloEntries::synchronise().

Vector<int> oomph::DoubleVectorHaloScheme::Haloed_n
private

Storage for the number of haloed entries to be sent to each processor.

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

std::map<unsigned,unsigned> oomph::DoubleVectorHaloScheme::Local_index
private

Storage for the translation scheme from global unknown to local index in the additional storage vector.

Definition at line 63 of file double_vector_with_halo.h.

Referenced by oomph::DoubleVectorWithHaloEntries::build_halo_scheme(), DoubleVectorHaloScheme(), local_index(), n_halo_values(), and setup_halo_dofs().


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