]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Set rhs parameters during initialization
authorMarco Feder <marco.feder@sissa.it>
Tue, 27 May 2025 12:31:36 +0000 (14:31 +0200)
committerMarco Feder <marco.feder@sissa.it>
Thu, 5 Jun 2025 12:25:03 +0000 (14:25 +0200)
include/deal.II/lac/sparse_direct.h
source/lac/sparse_direct.cc

index 0946439c44c050cb7fb6400a4db91647b1a18283..6f0f46232ea04814bffef06ee23b5e3ab0370640 100644 (file)
@@ -647,7 +647,7 @@ private:
   /**
    * Local to global index mapping for the right-hand side vector.
    */
-  mutable std::vector<int> irhs_loc;
+  mutable std::vector<types::mumps_index> irhs_loc;
 
   /**
    * irn contains the row indices of the non-zero entries of the matrix.
index c77bd182d2205da14133fcfef56a8e0a400a8165..2d02cd554b5c52d4c7d33b69b05a4ec6cdf6652c 100644 (file)
@@ -1086,6 +1086,13 @@ SparseDirectMUMPS::initialize_matrix(const Matrix &matrix)
       id.jcn_loc  = jcn.get();
       id.a_loc    = a.get();
       id.irhs_loc = irhs_loc.data();
+
+      // rhs parameters
+      id.icntl[19] = 10; // distributed rhs
+      id.icntl[20] = 0;  // centralized solution, stored on rank 0 by MUMPS
+      id.nrhs      = 1;
+      id.lrhs_loc  = n;
+      id.nloc_rhs  = row_range.n_elements();
     }
   else
     {
@@ -1173,13 +1180,6 @@ SparseDirectMUMPS::vmult(VectorType &dst, const VectorType &src) const
                                     TrilinosWrappers::MPI::Vector> ||
                      std::is_same_v<VectorType, PETScWrappers::MPI::Vector>)
     {
-      id.icntl[19] = 10; // distributed rhs
-      id.icntl[20] = 0;  // centralized solution, stored on rank 0 by MUMPS
-      id.nrhs      = 1;
-      id.lrhs_loc  = n;
-      id.nloc_rhs  = row_range.n_elements();
-
-
       if constexpr (std::is_same_v<VectorType, TrilinosWrappers::MPI::Vector>)
         id.rhs_loc = const_cast<double *>(src.begin());
       else if constexpr (std::is_same_v<VectorType, PETScWrappers::MPI::Vector>)

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.