![]() |
|
#include <double_vector_with_halo.h>
Public Member Functions | |
DoubleVectorWithHaloEntries () | |
Constructor for an uninitialized DoubleVectorWithHaloEntries. More... | |
DoubleVectorWithHaloEntries (const LinearAlgebraDistribution *const &dist_pt, DoubleVectorHaloScheme *const &halo_scheme_pt=0, const double &v=0.0) | |
DoubleVectorWithHaloEntries (const LinearAlgebraDistribution &dist, DoubleVectorHaloScheme *const &halo_scheme_pt=0, const double &v=0.0) | |
~DoubleVectorWithHaloEntries () | |
Destructor. More... | |
DoubleVectorWithHaloEntries (const DoubleVectorWithHaloEntries &new_vector) | |
Copy constructor from any DoubleVector. More... | |
DoubleVectorWithHaloEntries (const DoubleVector &new_vector, DoubleVectorHaloScheme *const &halo_scheme_pt=0) | |
Copy constructor from any DoubleVector. More... | |
void | operator= (const DoubleVectorWithHaloEntries &old_vector) |
assignment operator More... | |
double & | global_value (const unsigned &i) |
Direct access to global entry. More... | |
const double & | global_value (const unsigned &i) const |
Direct access to the global entry (const version) More... | |
void | synchronise () |
Synchronise the halo data. More... | |
void | sum_all_halo_and_haloed_values () |
DoubleVectorHaloScheme *& | halo_scheme_pt () |
Access function for halo scheme. More... | |
DoubleVectorHaloScheme *const & | halo_scheme_pt () const |
Access function for halo scheme (const version) More... | |
void | build_halo_scheme (DoubleVectorHaloScheme *const &halo_scheme_pt) |
Construct the halo scheme and storage for the halo data. More... | |
![]() | |
DoubleVector () | |
Constructor for an uninitialized DoubleVector. More... | |
DoubleVector (const LinearAlgebraDistribution *const &dist_pt, const double &v=0.0) | |
DoubleVector (const LinearAlgebraDistribution &dist, const double &v=0.0) | |
~DoubleVector () | |
DoubleVector (const DoubleVector &new_vector) | |
Copy constructor. More... | |
void | operator= (const DoubleVector &old_vector) |
assignment operator More... | |
void | build (const DoubleVector &old_vector) |
Just copys the argument DoubleVector. More... | |
void | build (const LinearAlgebraDistribution &dist, const double &v) |
void | build (const LinearAlgebraDistribution *const &dist_pt, const double &v) |
void | build (const LinearAlgebraDistribution &dist, const Vector< double > &v) |
void | build (const LinearAlgebraDistribution *const &dist_pt, const Vector< double > &v) |
void | initialise (const double &v) |
initialise the whole vector with value v More... | |
void | initialise (const Vector< double > v) |
void | clear () |
wipes the DoubleVector More... | |
bool | built () const |
void | set_external_values (const LinearAlgebraDistribution *const &dist_pt, double *external_values, bool delete_external_values) |
void | set_external_values (double *external_values, bool delete_external_values) |
void | redistribute (const LinearAlgebraDistribution *const &dist_pt) |
double & | operator[] (int i) |
[] access function to the (local) values of this vector More... | |
bool | operator== (const DoubleVector &v) |
== operator More... | |
void | operator+= (const DoubleVector &v) |
+= operator with another vector More... | |
void | operator-= (const DoubleVector &v) |
-= operator with another vector More... | |
void | operator*= (const double &d) |
multiply by a double More... | |
void | operator/= (const double &d) |
divide by a double More... | |
const double & | operator[] (int i) const |
[] access function to the (local) values of this vector More... | |
double | max () const |
returns the maximum coefficient More... | |
double * | values_pt () |
access function to the underlying values More... | |
double * | values_pt () const |
access function to the underlying values (const version) More... | |
void | output (std::ostream &outfile, const int &output_precision=-1) const |
output the global contents of the vector More... | |
void | output (std::string filename, const int &output_precision=-1) const |
output the global contents of the vector More... | |
void | output_local_values (std::ostream &outfile, const int &output_precision=-1) const |
output the local contents of the vector More... | |
void | output_local_values (std::string filename, const int &output_precision=-1) const |
output the local contents of the vector More... | |
void | output_local_values_with_offset (std::ostream &outfile, const int &output_precision=-1) const |
output the local contents of the vector More... | |
void | output_local_values_with_offset (std::string filename, const int &output_precision=-1) const |
output the local contents of the vector More... | |
double | dot (const DoubleVector &vec) const |
compute the dot product of this vector with the vector vec. More... | |
double | norm () const |
compute the 2 norm of this vector More... | |
double | norm (const CRDoubleMatrix *matrix_pt) const |
compute the A-norm using the matrix at matrix_pt More... | |
![]() | |
DistributableLinearAlgebraObject () | |
Default constructor - create a distribution. More... | |
DistributableLinearAlgebraObject (const DistributableLinearAlgebraObject &matrix)=delete | |
Broken copy constructor. More... | |
void | operator= (const DistributableLinearAlgebraObject &)=delete |
Broken assignment operator. More... | |
virtual | ~DistributableLinearAlgebraObject () |
Destructor. More... | |
LinearAlgebraDistribution * | distribution_pt () const |
access to the LinearAlgebraDistribution More... | |
unsigned | nrow () const |
access function to the number of global rows. More... | |
unsigned | nrow_local () const |
access function for the num of local rows on this processor. More... | |
unsigned | nrow_local (const unsigned &p) const |
access function for the num of local rows on this processor. More... | |
unsigned | first_row () const |
access function for the first row on this processor More... | |
unsigned | first_row (const unsigned &p) const |
access function for the first row on this processor More... | |
bool | distributed () const |
distribution is serial or distributed More... | |
bool | distribution_built () const |
void | build_distribution (const LinearAlgebraDistribution *const dist_pt) |
void | build_distribution (const LinearAlgebraDistribution &dist) |
Private Attributes | |
DoubleVectorHaloScheme * | Halo_scheme_pt |
Vector< double > | Halo_value |
Vector of the halo values. More... | |
Additional Inherited Members | |
![]() | |
void | clear_distribution () |
===================================================================== An extension of DoubleVector that allows access to certain global entries that are not stored locally. Synchronisation of these values must be performed manually by calling the synchronise() function. Synchronisation can only be from the haloed to the halo, but the local halo entries can all be summed and stored in the
|
inline |
Constructor for an uninitialized DoubleVectorWithHaloEntries.
|
inline |
Constructor. Assembles a DoubleVectorWithHaloEntries with a prescribed distribution. Additionally every entry can be set (with argument v - defaults to 0).
References build_halo_scheme(), and halo_scheme_pt().
|
inline |
Constructor. Assembles a DoubleVectorWithHaloEntries with a prescribed distribution. Additionally every entry can be set (with argument v - defaults to 0).
References build_halo_scheme(), and halo_scheme_pt().
|
inline |
|
inline |
void oomph::DoubleVectorWithHaloEntries::build_halo_scheme | ( | DoubleVectorHaloScheme *const & | halo_scheme_pt | ) |
Construct the halo scheme and storage for the halo data.
Construct the halo scheme and storage for the halo data
References Halo_scheme_pt, halo_scheme_pt(), Halo_value, oomph::DoubleVectorHaloScheme::Local_index, and synchronise().
Referenced by DoubleVectorWithHaloEntries(), operator=(), oomph::PitchForkHandler::PitchForkHandler(), and oomph::Problem::setup_element_count_per_dof().
Direct access to global entry.
References oomph::DistributableLinearAlgebraObject::distributed(), oomph::DistributableLinearAlgebraObject::first_row(), Halo_scheme_pt, Halo_value, i, oomph::DoubleVectorHaloScheme::local_index(), oomph::DistributableLinearAlgebraObject::nrow_local(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.
Referenced by oomph::PitchForkHandler::get_dresiduals_dparameter(), oomph::PitchForkHandler::get_jacobian(), oomph::PitchForkHandler::get_residuals(), oomph::PitchForkHandler::PitchForkHandler(), and oomph::Problem::setup_element_count_per_dof().
Direct access to the global entry (const version)
References oomph::DistributableLinearAlgebraObject::distributed(), oomph::DistributableLinearAlgebraObject::first_row(), Halo_scheme_pt, Halo_value, i, oomph::DoubleVectorHaloScheme::local_index(), oomph::DistributableLinearAlgebraObject::nrow_local(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.
|
inline |
Access function for halo scheme.
References Halo_scheme_pt.
Referenced by build_halo_scheme(), DoubleVectorWithHaloEntries(), and operator=().
|
inline |
Access function for halo scheme (const version)
References Halo_scheme_pt.
|
inline |
assignment operator
References oomph::DoubleVector::build(), build_halo_scheme(), and halo_scheme_pt().
void oomph::DoubleVectorWithHaloEntries::sum_all_halo_and_haloed_values | ( | ) |
Sum all the data, store in the master (haloed) data and then synchronise
Gather all ther data from multiple processors and sum the result which will be stored in the master copy and then synchronised to all copies. This requires two "all to all" communications
References oomph::DistributableLinearAlgebraObject::distributed(), oomph::DoubleVectorHaloScheme::Halo_displacement, oomph::DoubleVectorHaloScheme::Halo_eqns, oomph::DoubleVectorHaloScheme::Halo_n, Halo_scheme_pt, Halo_value, oomph::DoubleVectorHaloScheme::Haloed_displacement, oomph::DoubleVectorHaloScheme::Haloed_eqns, oomph::DoubleVectorHaloScheme::Haloed_n, i, and synchronise().
Referenced by oomph::PitchForkHandler::PitchForkHandler(), and oomph::Problem::setup_element_count_per_dof().
void oomph::DoubleVectorWithHaloEntries::synchronise | ( | ) |
Synchronise the halo data.
Synchronise the halo data within the vector. This requires one "all to all" communnication.
References oomph::DistributableLinearAlgebraObject::distributed(), oomph::DoubleVectorHaloScheme::Halo_displacement, oomph::DoubleVectorHaloScheme::Halo_eqns, oomph::DoubleVectorHaloScheme::Halo_n, Halo_scheme_pt, Halo_value, oomph::DoubleVectorHaloScheme::Haloed_displacement, oomph::DoubleVectorHaloScheme::Haloed_eqns, oomph::DoubleVectorHaloScheme::Haloed_n, and i.
Referenced by build_halo_scheme(), and sum_all_halo_and_haloed_values().
|
private |
Pointer to the lookup scheme that stores information about on which processor the required information is haloed
Referenced by build_halo_scheme(), global_value(), halo_scheme_pt(), sum_all_halo_and_haloed_values(), and synchronise().
Vector of the halo values.
Referenced by build_halo_scheme(), global_value(), sum_all_halo_and_haloed_values(), and synchronise().