modified:   src/generic/preconditioner.h

Put the Setup_time back in, I required it in my code.

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@669 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.h
Fixed a lot of comments.

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@670 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.cc
modified:   src/generic/block_preconditioner.h

Moved the contents of get_coarsened_block(...) into get_block(...).

Deleted the get_coarsened_block function.

Fixed a lot of comments.

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@671 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.h

Added more comments, even included ASCII art-like depiction of what I'm
doing in get_block(...).

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@672 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified: src/generic/block_preconditioner.h and .cc

Changed get_block(...)'s argument so that ignore_replacement_block is
passed by const reference, not by value (also changed the .cc file to
reflect this change).

Renamed set_master_preconditioner_matrix(...) to
set_master_matrix_pt(...).

Added comments to the functions following functions:
get_block(...),
set_master_matrix_pt(...),
get_dof_level_block(...),
get_concatenated_block(...).

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@673 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.cc
modified:   src/generic/block_preconditioner.h

src/generic/block_preconditioner.cc

Fixed comment in internal_get_block_ordered_preconditioner_vector(...)
Put in paranoia test in get_dof_level_block(...)

src/generic/block_preconditioner.h
Fixed comments in get/return block vector(s) functions

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@674 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/double_vector.cc and .h

Wrote wrappers around the following functions:
DoubleVectorHelpers::split(...)
DoubleVectorHelpers::split_without_communication(...)
DoubleVectorHelpers::concatenate(...)
DoubleVectorHelpers::concatenate_without_communication(...)

These wrappers take a Vector of DoubleVectors, (as opposed to a Vector of
pointers to DoubleVectors), created a tmp Vector of pointers to
DoubleVector and passes it to the functions above.

This is done to hide ugly code, namely creating the Vector of pointers
to DoubleVector objects by either invoking new and delete, or creating
Vector<DoubleVector> foo then creating Vector<*DoubleVector> bar and performing
the following loop:

for...
  foo[i] = &bar[i];
end

The following self tests are modified to take advantage of this new
interface:

modified:   self_test/mpi/vector_concatenation/vector_concatenation.cc
modified:   self_test/mpi/vector_concatenation_without_communication/vector_concatenation_without_communication.cc
modified:   self_test/mpi/vector_split/vector_split.cc
modified:   self_test/mpi/vector_split_without_communication/vector_split_without_communication.cc

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@675 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.h and .cc

src/generic/block_preconditioner.h

Added two new functions:

void get_block_vectors_with_original_matrix_ordering(...)

void return_block_vectors_with_original_matrix_ordering(...)

These take a Vector of unsigned to indicate which block vector is
required and extract all indicated block vectors at the same time.
This functionality never existed, previously, if we want block
vectors 1 and 3, we would have to extract them one at a time.
Each extraction requires communication, this is done per Newton step
and could be very costly!

src/generic/block_preconditioner.cc

Implementation of
"void get_block_vectors_with_original_matrix_ordering(...)" and
"void return_block_vectors_with_original_matrix_ordering(...)".

In the function get_block_vector_with_precomputed_block_ordering(...)
we use the Block_to_dof_map_fine variable instead of re-constructing the
most fine grain block to dof mapping.

Everywhere:
There now exists a new interface for splitting and concatenation which
takes Vectors of DoubleVectors of the form Vector<DoubleVector> instead
of Vector<*DoubleVector>, so all the code to convert Vector<DoubleVector>
to Vector<DoubleVector> is removed.

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@676 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.h and .cc

Re-wrote the get_block_vectors(...) and return_block_vectors(...)
functions to make use of the new functions
get_block_vectors_with_original_matrix_ordering(...) and
return_block_vectors_with_original_matrix_ordering(...).

Advantages: Communication is done once for all the dof-level block
vectors we need.

Disadvanges: None.

This has massively reduced communication.

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@677 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified: src/generic/block_preconditioner.cc

1) The function
get_block_vectors_with_original_matrix_ordering(
   const DoubleVector& v, Vector<DoubleVector >& s) const

is now a wrapper around

get_block_vectors_with_original_matrix_ordering(
   const Vector<unsigned>& required_vector, const DoubleVector& v,
   Vector<DoubleVector >& s) const

with the identity required_block vector.

2) The function
return_block_vectors_with_original_matrix_ordering(
     const Vector<DoubleVector >& s, DoubleVector& v) const

is now a wrapper around

return_block_vectors_with_original_matrix_ordering(
 const Vector<unsigned>& required_vector,
 const Vector<DoubleVector >& s, DoubleVector& v) const

with the identity required_vector vector.

3) The function
get_block_vector(const unsigned& b, const DoubleVector& v,
                 DoubleVector& w) const

has been re-written to make use of the function

get_block_vectors_with_original_matrix_ordering(...)

to reduce communication. It no longer calls the function

get_block_vector_with_precomputed_block_ordering(b,v,w);

4) The function
return_block_vector(const unsigned& b, const DoubleVector& w,
                    DoubleVector& v) const

is re-written to make use of the function

return_block_vectors_with_original_matrix_ordering(...)

to reduce communication. It no longer calls the function

return_block_vector_with_precomputed_block_ordering(b,w,v);

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@678 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.h and .cc

1) Added two new functions:

void get_concatenated_block_vector(
  const Vector<unsigned>& required_vector,
  const DoubleVector& v,
  DoubleVector& b);

void return_concatenated_block_vector(
  const Vector<unsigned>& required_vector,
  const DoubleVector& b,
  DoubleVector& v) const;

For get_concatenated_block_vector(...): given a Vector of
unsigns describing which block vectors we want to get,
this function will extract the relevant DoubleVectors all in one
go and concatenate them for the user.

For return_concatenated_block_vector(...): given a Vector
of unsigns describing the block positions the concatenated
vector should be returned to, this function splits the
DoubleVector into the relevant sub-vectors and returns,
all at once, for the user.

The get_concatenated_block_vector function is not const
because if the concatenated distribution is not used before
i.e. not stored in Auxiliary_distribution_pt, it is created
then stored for future use.

-------------------------------------------------------------------------------

2) The functions:
void get_block_ordered_preconditioner_vector(const DoubleVector& v,
                                             DoubleVector& w);
and

void return_block_ordered_preconditioner_vector(const DoubleVector& w,
                                                DoubleVector& v) const;

are re-implemented in terms of the function
get_concatenated_block_vector(...) and
return_concatenated_block_vector(...) respectively, calling them with
the identity mapping.

-------------------------------------------------------------------------------

3) The function

void get_block_ordered_preconditioner_vector(
  const DoubleVector& v,
  DoubleVector& w) const;

is made non-const since it invokes get_concatenated_block_vector(...)
which is not const since it may create distributions and store
them for future use.

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@679 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/navier_stokes/lagrange_enforced_flow_preconditioner.h

Included temporary de-bugging tools for testing the new get/return
vector functions in the BlockPreconditioner base class.

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@680 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/navier_stokes/lagrange_enforced_flow_preconditioner.h
Removed the get/return block vector debugging, now using the new
functions, everything is shiny and great.

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@681 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.h and .cc

1) New function:
  void setup_matrix_vector_product(MatrixVectorProduct* matvec_prod_pt,
                                   CRDoubleMatrix* block_pt,
                                   const Vector<unsigned>& block_col_indices)

Caters for concatenated block distributions, making use of the distributions
in Auxiliary_distribution_pt.

-------------------------------------------------------------------------------

2) The function
  void setup_matrix_vector_product(MatrixVectorProduct* matvec_prod_pt,
                                   CRDoubleMatrix* block_pt,
                                   const unsigned& block_col_index)

has been modified to be a wrapper around the new function above.

-------------------------------------------------------------------------------

3) Commented out all functions with names containing the word
"precomputed", everything still works!

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@682 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.h and .cc

Removed functions with names containing the word "precomputed".

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@683 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.h and .cc

1) Everywhere: Rename required_vector to block_vec_number

2) Added lots of comments to the function
get_concatenated_block_vector(...).

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@684 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.h and .cc

1) Everywhere: renamed Auxiliary_distribution_pt to
Auxiliary_block_distribution_pt

2) Move Auxiliary_block_distribution_pt to private.

3) Private function "insert_auxiliary_block_distribution(...)"
to store a Vector<unsigned>/LinearAlgebraDistribution* pair.
This performs paranoia checks.

4) Finished commenting the function
return_concatenated_block_vector(...)

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@685 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.h and .cc

Finished commenting the following functions:

  void get_block_vectors(const Vector<unsigned> & block_vec_number,
                         const DoubleVector& v,
                         Vector<DoubleVector >& s) const;

  void get_block_vectors(const DoubleVector& v,
                         Vector<DoubleVector >& s) const;

  void return_block_vectors(const Vector<unsigned>& block_vec_number,
                            const Vector<DoubleVector >& s,
                            DoubleVector& v) const;

  void return_block_vectors(const Vector<DoubleVector >& s,
                            DoubleVector& v) const;

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@686 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.h and .cc

Finshed commenting the functions

  void get_block_vector(const unsigned& n, const DoubleVector& v,
                        DoubleVector& b) const;

  void return_block_vector(const unsigned& n, const DoubleVector& b,
                           DoubleVector& v) const;

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@687 595e1d82-adf1-4282-bac7-b6073fa2ca8e
modified:   src/generic/block_preconditioner.h and .cc

Getting rid of all references to "precomputed" and "original" to
distinguish between Richard's old code and my new code.

Functions with names containing the word "precomputed" has already been
deleted in a previous commit. The functions which uses them have been
re-written (again, in a previous commit) to work more efficiently.

Now we re-name a lot of function names:

get_block_vectors_with_original_matrix_ordering to
internal_get_block_vectors

return_block_vectors_with_original_matrix_ordering to
internal_return_block_vectors

get_block_from_original_matrix to
internal_get_block

return_block_vector_with_original_matrix_ordering to
internal_return_block_vector

get_block_vector_with_original_matrix_ordering to
internal_get_block_vector

git-svn-id: svn+ssh://vummath.ma.man.ac.uk/home/svn-oomphlib/public/trunk@688 595e1d82-adf1-4282-bac7-b6073fa2ca8e