]> https://gitweb.dealii.org/ - dealii.git/commitdiff
parpack. added reinit for block vectors 2617/head
authoralberto sartori <alberto.sartori86@gmail.com>
Tue, 10 May 2016 11:30:27 +0000 (13:30 +0200)
committeralberto sartori <alberto.sartori86@gmail.com>
Wed, 18 May 2016 22:08:59 +0000 (00:08 +0200)
doc/news/changes.h
include/deal.II/lac/parpack_solver.h

index 4f0c73dfbb53b2bfa6ac4bc4b637cc1ec1d07034..88ce9b37a2a32360f71b6d6ed56e22f4b0cd5dbb 100644 (file)
@@ -248,6 +248,11 @@ inconvenience this causes.
 <h3>Specific improvements</h3>
 
 <ol>
+ <li> New: Added PArpackSolver::reinit() when dealing with BlockVectors.
+ <br>
+ (Alberto Sartori, 2016/05/19)
+ </li>
+
  <li> Fixed: Corrected the sign of curl calculated in the functions:
  LocalIntegrators::curl_curl_matrix, LocalIntegrators::curl_matrix,
  LocalIntegrators::nitsche_curl_matrix and LocalIntegrators::ip_curl_matrix in
index 27c20d5dd9c8e7ebcb1d6eb8a0924a72ca101de2..8ce958c12c62540a0ab27623d59bb053fdc9fa39 100644 (file)
@@ -231,7 +231,16 @@ public:
   /**
    * Initialise internal variables.
    */
-  void reinit(const dealii::IndexSet &locally_owned_dofs );
+  void reinit(const IndexSet &locally_owned_dofs );
+
+  /**
+   * Initialize internal variables when working with BlockVectors.
+   * @p locally_owned_dofs is used to set the dimension of the problem,
+   * whereas @p partitioning is used for calling the reinit of the deal.II
+   * blockvectors used.
+   */
+  void reinit(const IndexSet &locally_owned_dofs,
+              const std::vector<IndexSet> &partitioning);
 
   /**
    * Set desired shift value.
@@ -369,6 +378,14 @@ protected:
 
 private:
 
+  /**
+   * Initialize internal variables which depend on
+   * @p locally_owned_dofs.
+   *
+   * This function is called inside the reinit() functions
+   */
+  void internal_reinit(const IndexSet &locally_owned_dofs);
+
   /**
    * PArpackExcInfoPdnaupds.
    */
@@ -469,7 +486,8 @@ void PArpackSolver<VectorType>::set_shift(const double s )
 }
 
 template <typename VectorType>
-void PArpackSolver<VectorType>::reinit(const dealii::IndexSet &locally_owned_dofs)
+void PArpackSolver<VectorType>::
+internal_reinit(const IndexSet &locally_owned_dofs)
 {
   // store local indices to write to vectors
   locally_owned_dofs.fill_index_vector(local_indices);
@@ -507,6 +525,12 @@ void PArpackSolver<VectorType>::reinit(const dealii::IndexSet &locally_owned_dof
   workev.resize (lworkev, 0.);
 
   select.resize (ncv, 0);
+}
+
+template <typename VectorType>
+void PArpackSolver<VectorType>::reinit(const IndexSet &locally_owned_dofs)
+{
+  internal_reinit(locally_owned_dofs);
 
   // deal.II vectors:
   src.reinit (locally_owned_dofs,mpi_communicator);
@@ -515,6 +539,19 @@ void PArpackSolver<VectorType>::reinit(const dealii::IndexSet &locally_owned_dof
 
 }
 
+template <typename VectorType>
+void PArpackSolver<VectorType>::reinit(const IndexSet &locally_owned_dofs,
+                                       const std::vector<IndexSet> &partitioning)
+{
+  internal_reinit(locally_owned_dofs);
+
+  // deal.II vectors:
+  src.reinit (partitioning,mpi_communicator);
+  dst.reinit (partitioning,mpi_communicator);
+  tmp.reinit (partitioning,mpi_communicator);
+
+}
+
 template <typename VectorType>
 template <typename MatrixType1,typename MatrixType2, typename INVERSE>
 void PArpackSolver<VectorType>::solve

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.