#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) | |
Constructor. Assembles a DoubleVectorWithHaloEntries with a prescribed distribution. Additionally every entry can be set (with argument v - defaults to 0). More... | |
DoubleVectorWithHaloEntries (const LinearAlgebraDistribution &dist, DoubleVectorHaloScheme *const &halo_scheme_pt=0, const double &v=0.0) | |
Constructor. Assembles a DoubleVectorWithHaloEntries with a prescribed distribution. Additionally every entry can be set (with argument v - defaults to 0). More... | |
~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) | |
Constructor. Assembles a DoubleVector with a prescribed distribution. Additionally every entry can be set (with argument v - defaults to 0). More... | |
DoubleVector (const LinearAlgebraDistribution &dist, const double &v=0.0) | |
Constructor. Assembles a DoubleVector with a prescribed distribution. Additionally every entry can be set (with argument v - defaults to 0). More... | |
~DoubleVector () | |
Destructor - just calls this->clear() to delete the distribution and data. More... | |
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) |
Assembles a DoubleVector with distribution dist, if v is specified each element is set to v, otherwise each element is set to 0.0. More... | |
void | build (const LinearAlgebraDistribution *const &dist_pt, const double &v) |
Assembles a DoubleVector with distribution dist, if v is specified each element is set to v, otherwise each element is set to 0.0. More... | |
void | build (const LinearAlgebraDistribution &dist, const Vector< double > &v) |
Assembles a DoubleVector with a distribution dist and coefficients taken from the vector v. Note. The vector v MUST be of length nrow() More... | |
void | build (const LinearAlgebraDistribution *const &dist_pt, const Vector< double > &v) |
Assembles a DoubleVector with a distribution dist and coefficients taken from the vector v. Note. The vector v MUST be of length nrow() More... | |
void | initialise (const double &v) |
initialise the whole vector with value v More... | |
void | initialise (const Vector< double > v) |
initialise the vector with coefficient from the vector v. Note: The vector v must be of length More... | |
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) |
Allows are external data to be used by this vector. WARNING: The size of the external data must correspond to the LinearAlgebraDistribution dist_pt argument. More... | |
void | set_external_values (double *external_values, bool delete_external_values) |
Allows are external data to be used by this vector. WARNING: The size of the external data must correspond to the distribution of this vector. More... | |
void | redistribute (const LinearAlgebraDistribution *const &dist_pt) |
The contents of the vector are redistributed to match the new distribution. In a non-MPI rebuild this method works, but does nothing. NOTE 1: The current distribution and the new distribution must have the same number of global rows. NOTE 2: The current distribution and the new distribution must have the same Communicator. More... | |
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) | |
Broken copy constructor. More... | |
void | operator= (const DistributableLinearAlgebraObject &) |
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) |
setup the distribution of this distributable linear algebra object More... | |
void | build_distribution (const LinearAlgebraDistribution &dist) |
setup the distribution of this distributable linear algebra object More... | |
Private Attributes | |
DoubleVectorHaloScheme * | Halo_scheme_pt |
Pointer to the lookup scheme that stores information about on which processor the required information is haloed. More... | |
Vector< double > | Halo_value |
Vector of the halo values. More... | |
Additional Inherited Members | |
![]() | |
void | clear_distribution () |
clear the distribution of this distributable linear algebra object More... | |
===================================================================== 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
Definition at line 147 of file double_vector_with_halo.h.
|
inline |
Constructor for an uninitialized DoubleVectorWithHaloEntries.
Definition at line 159 of file double_vector_with_halo.h.
|
inline |
Constructor. Assembles a DoubleVectorWithHaloEntries with a prescribed distribution. Additionally every entry can be set (with argument v - defaults to 0).
Definition at line 165 of file double_vector_with_halo.h.
|
inline |
Constructor. Assembles a DoubleVectorWithHaloEntries with a prescribed distribution. Additionally every entry can be set (with argument v - defaults to 0).
Definition at line 179 of file double_vector_with_halo.h.
|
inline |
Destructor.
Definition at line 190 of file double_vector_with_halo.h.
|
inline |
Copy constructor from any DoubleVector.
Definition at line 194 of file double_vector_with_halo.h.
References halo_scheme_pt().
|
inline |
Copy constructor from any DoubleVector.
Definition at line 202 of file double_vector_with_halo.h.
void oomph::DoubleVectorWithHaloEntries::build_halo_scheme | ( | DoubleVectorHaloScheme *const & | halo_scheme_pt | ) |
Construct the halo scheme and storage for the halo data.
Definition at line 343 of file double_vector_with_halo.cc.
References oomph::DoubleVectorHaloScheme::Local_index.
Referenced by oomph::PitchForkHandler::PitchForkHandler(), and oomph::Problem::setup_element_count_per_dof().
|
inline |
Direct access to global entry.
Definition at line 219 of file double_vector_with_halo.h.
References i, and oomph::DoubleVectorHaloScheme::local_index().
Referenced by oomph::PitchForkHandler::get_dresiduals_dparameter(), oomph::Problem::get_hessian_vector_products(), oomph::PitchForkHandler::get_jacobian(), oomph::PitchForkHandler::get_residuals(), oomph::PitchForkHandler::PitchForkHandler(), and oomph::Problem::setup_element_count_per_dof().
|
inline |
Direct access to the global entry (const version)
Definition at line 266 of file double_vector_with_halo.h.
References i, and oomph::DoubleVectorHaloScheme::local_index().
|
inline |
Access function for halo scheme.
Definition at line 321 of file double_vector_with_halo.h.
Referenced by DoubleVectorWithHaloEntries(), and operator=().
|
inline |
Access function for halo scheme (const version)
Definition at line 324 of file double_vector_with_halo.h.
|
inline |
assignment operator
Definition at line 211 of file double_vector_with_halo.h.
References 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
Definition at line 297 of file double_vector_with_halo.cc.
References i.
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.
Definition at line 253 of file double_vector_with_halo.cc.
References i.
Referenced by oomph::PitchForkHandler::synchronise().
|
private |
Pointer to the lookup scheme that stores information about on which processor the required information is haloed.
Definition at line 151 of file double_vector_with_halo.h.
|
private |
Vector of the halo values.
Definition at line 154 of file double_vector_with_halo.h.