![]() |
|
#include "generic.h"Functions | |
| template<typename myType > | |
| void | construct_vector (myType given_array[], unsigned given_arraysize, Vector< myType > &result_vector) |
| template<typename myType > | |
| void | output_vector (Vector< myType > &given_vector) |
| void | create_vector_ascend_row (unsigned const nrow, const OomphCommunicator *const comm_pt, bool const distributed, DoubleVector &my_vec) |
| void | fill_in_sub_vectors (const OomphCommunicator *const comm_pt, const bool distributed, Vector< unsigned > &dimvector, Vector< DoubleVector > &my_vecs) |
| void | create_vectors_to_cat (const unsigned nvectors, unsigned dimarray[], const OomphCommunicator *const comm_pt, Vector< DoubleVector > &my_vecs) |
| int | main (int argc, char *argv[]) |
| void construct_vector | ( | myType | given_array[], |
| unsigned | given_arraysize, | ||
| Vector< myType > & | result_vector | ||
| ) |
| void create_vector_ascend_row | ( | unsigned const | nrow, |
| const OomphCommunicator *const | comm_pt, | ||
| bool const | distributed, | ||
| DoubleVector & | my_vec | ||
| ) |
References oomph::DoubleVector::build(), oomph::DoubleVector::clear(), oomph::LinearAlgebraDistribution::first_row(), and oomph::LinearAlgebraDistribution::nrow_local().
Referenced by fill_in_sub_vectors().
| void create_vectors_to_cat | ( | const unsigned | nvectors, |
| unsigned | dimarray[], | ||
| const OomphCommunicator *const | comm_pt, | ||
| Vector< DoubleVector > & | my_vecs | ||
| ) |
References construct_vector(), and fill_in_sub_vectors().
Referenced by main().
| void fill_in_sub_vectors | ( | const OomphCommunicator *const | comm_pt, |
| const bool | distributed, | ||
| Vector< unsigned > & | dimvector, | ||
| Vector< DoubleVector > & | my_vecs | ||
| ) |
References create_vector_ascend_row().
Referenced by create_vectors_to_cat().
Driver code: Testing DoubleVectorHelpers::concatenate(...)
We concatenate uniformly distributed DoubleVectors. The vectors v1, v2, and v3 have increasing entries with lengths 7, 5 and 3 as depicted below:
v1 v2 v3 [1 [1 [1 2 2 2 3 3 3] 4 4 5 5] 6 7]
The script validate.sh should run this driver on 1, 2, 3 and 4 cores.
Communication is required and the order of the entries is preserved. We demonstrate this on two cores, p0 and p1: v1 p0 p1 [1 [4 2 5 3] 6 7]
v2 p0 p1 [1 [3 2] 4 5]
v3 p0 p1 [1] [2 3]
Result vector: p0 p1 [1 [1 2 2 3 3 4 4 5 5 6 1 7] 2 3]
References oomph::MPI_Helpers::communicator_pt(), oomph::DoubleVectorHelpers::concatenate(), create_vectors_to_cat(), oomph::DistributableLinearAlgebraObject::distributed(), oomph::MPI_Helpers::finalize(), oomph::DistributableLinearAlgebraObject::first_row(), oomph::MPI_Helpers::init(), oomph::OomphCommunicator::my_rank(), oomph::OomphCommunicator::nproc(), oomph::DistributableLinearAlgebraObject::nrow(), oomph::DistributableLinearAlgebraObject::nrow_local(), and oomph::DoubleVector::values_pt().
| void output_vector | ( | Vector< myType > & | given_vector | ) |
References oomph::oomph_info.