hypre_solver.h
Go to the documentation of this file.
1 // LIC// ====================================================================
2 // LIC// This file forms part of oomph-lib, the object-oriented,
3 // LIC// multi-physics finite-element library, available
4 // LIC// at http://www.oomph-lib.org.
5 // LIC//
6 // LIC// Copyright (C) 2006-2022 Matthias Heil and Andrew Hazel
7 // LIC//
8 // LIC// This library is free software; you can redistribute it and/or
9 // LIC// modify it under the terms of the GNU Lesser General Public
10 // LIC// License as published by the Free Software Foundation; either
11 // LIC// version 2.1 of the License, or (at your option) any later version.
12 // LIC//
13 // LIC// This library is distributed in the hope that it will be useful,
14 // LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // LIC// Lesser General Public License for more details.
17 // LIC//
18 // LIC// You should have received a copy of the GNU Lesser General Public
19 // LIC// License along with this library; if not, write to the Free Software
20 // LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 // LIC// 02110-1301 USA.
22 // LIC//
23 // LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24 // LIC//
25 // LIC//====================================================================
26 #ifndef OOMPH_HYPRE_SOLVER_HEADER
27 #define OOMPH_HYPRE_SOLVER_HEADER
28 
29 // Headers required for hypre
30 #include "_hypre_utilities.h"
31 #include "HYPRE.h"
32 #include "HYPRE_parcsr_ls.h"
33 #include "HYPRE_krylov.h"
34 #include "HYPRE_IJ_mv.h"
35 #include "HYPRE_parcsr_mv.h"
36 
37 // OOMPH-LIB includes
39 #include "linear_solver.h"
40 #include "preconditioner.h"
41 
42 // hypre's global error flag
43 extern int hypre__global_error;
44 
45 
46 namespace oomph
47 {
48  //==================================================================
50  //==================================================================
51  namespace HypreHelpers
52  {
55  extern double AMG_strength;
56 
69  extern unsigned AMG_coarsening;
70 
72  extern double AMG_truncation; // 0.0;
73 
76  int check_HYPRE_error_flag(std::ostringstream& message);
77 
84  extern void create_HYPRE_Vector(const DoubleVector& oomph_vec,
85  const LinearAlgebraDistribution* dist_pt,
86  HYPRE_IJVector& hypre_ij_vector,
87  HYPRE_ParVector& hypre_par_vector);
88 
96  void create_HYPRE_Vector(const LinearAlgebraDistribution* oomph_vec,
97  HYPRE_IJVector& hypre_ij_vector,
98  HYPRE_ParVector& hypre_par_vector);
99 
102  void create_HYPRE_Matrix(CRDoubleMatrix* oomph_matrix,
103  HYPRE_IJMatrix& hypre_ij_matrix,
104  HYPRE_ParCSRMatrix& hypre_par_matrix,
105  LinearAlgebraDistribution* dist_pt);
106 
109  void euclid_settings_helper(const bool& use_block_jacobi,
110  const bool& use_row_scaling,
111  const bool& use_ilut,
112  const int& level,
113  const double& drop_tol,
114  const int& print_level,
115  HYPRE_Solver& euclid_object);
116 
117  } // namespace HypreHelpers
118 
119 
120  //=====================================================================
132  //====================================================================
134  {
135  public:
138  {
139 #ifdef PARANOID
140 #ifndef HYPRE_SEQUENTIAL
141  // For the MPI version of Hypre, check MPI_Helpers::setup has been called
143  {
144  std::ostringstream error_message;
145  error_message << "When using the MPI version of Hypre please first\n"
146  << "call function MPI_Helpers::setup()\n";
147  throw OomphLibError(error_message.str(),
150  }
151 #endif
152 #endif
153 
154  // setup the distribution
156 
157  // These keep track of which solver and preconditioner
158  // (if any) currently exist
161 
162  // Do we want to output info and results of timings?
163  Output_info = true;
164 
165  // General control paramaters
166  Tolerance = 1e-10;
167  Max_iter = 100;
170 
171  // Default AMG control parameters -- these seem OK;
172  // see hypre documenation for details.
174  if (MPI_Helpers::communicator_pt()->nproc() > 1)
175  {
176  // Jacobi in parallel
178  }
179  else
180  {
181  // Gauss Seidel in serial
183  }
186  AMG_damping = 1.0;
190  AMG_max_levels = 100;
191  AMG_max_row_sum = 1.0;
192  AMG_print_level = 0;
193 
194  // Parameters for using Euclicd as an AMG smoother (defaults copied
195  // from the normal defaults listed in the manual).
200  AMGEuclidSmoother_drop_tol = 0; // No dropping
202 
203  // Print level for CG, GMRES and BiCGStab
204  Krylov_print_level = 0;
205 
206  // Set ParaSails default values
207  ParaSails_symmetry = 2;
208  ParaSails_nlevel = 1;
209  ParaSails_thresh = 0.1;
210  ParaSails_filter = 0.1;
211 
212  // Set Euclid default values
213  Euclid_droptol = 0.0;
214  Euclid_rowScale = false;
215  Euclid_using_ILUT = false;
216  Euclid_using_BJ = false;
217  Euclid_level = 1;
218  Euclid_print_level = 0;
219 
220  // Set to true to periodically check the hypre error flag
221  // and output any messages
222  Hypre_error_messages = false;
223  }
224 
227  {
228  // call function to delete solver data
230 
231  // delete teh oomph-lib distribution
232  delete Hypre_distribution_pt;
233  }
234 
236  HypreInterface(const HypreInterface&) = delete;
237 
239  void operator=(const HypreInterface&) = delete;
240 
243  {
244  Hypre_error_messages = true;
245  }
246 
249  {
250  Hypre_error_messages = false;
251  }
252 
256  {
257  CG,
263  None
264  };
265 
267  unsigned existing_solver()
268  {
269  return Existing_solver;
270  }
271 
274  {
276  }
277 
278  //??ds comment, write access functions and move to protected?
285 
286  protected:
288  void hypre_clean_up_memory();
289 
293  void hypre_matrix_setup(CRDoubleMatrix* matrix_pt);
294 
298  void hypre_solver_setup();
299 
302  void hypre_solve(const DoubleVector& rhs, DoubleVector& solution);
303 
306 
308  unsigned Max_iter;
309 
311  double Tolerance;
312 
314  unsigned Hypre_method;
315 
321 
327  unsigned AMG_print_level;
328 
330  unsigned AMG_max_levels;
331 
334 
339 
352 
361 
364 
366  double AMG_damping;
367 
369  double AMG_strength;
370 
373 
386  unsigned AMG_coarsening;
387 
395 
398 
401 
404 
407 
410 
413 
416 
419 
426 
430 
442 
446 
447 #ifdef OOMPH_HAS_MPI
450  bool Using_distributed_rhs;
451 
454  bool Returning_distributed_solution;
455 #endif
456 
457  private:
466 
469  HYPRE_IJMatrix Matrix_ij;
470 
473  HYPRE_ParCSRMatrix Matrix_par;
474 
477  HYPRE_Solver Solver;
478 
481  HYPRE_Solver Preconditioner;
482 
484  unsigned Existing_solver;
485 
488 
491  };
492 
493 
497 
498  //=====================================================================
512  //====================================================================
513  class HypreSolver : public LinearSolver, public HypreInterface
514  {
515  public:
518  {
519  // Hypre copies matrix data from oomph-lib's CRDoubleMatrix
520  // and Distributed CRDoubleMatrix into its own data structures,
521  // doubling the memory requirements for the matrix.
522  // As far as the Hypre solvers are concerned the oomph-lib matrix
523  // is no longer required and could be deleted to save memory.
524  // However, this will not be the expected behaviour and therefore
525  // needs to be requested explicitly by the user by changing this
526  // flag from false (its default) to true.
527  Delete_matrix = false;
528 
529  // Do we want to output results of timings?
530  Doc_time = true;
531  }
532 
535 
537  HypreSolver(const HypreSolver&) = delete;
538 
540  void operator=(const HypreSolver&) = delete;
541 
545  {
546  Enable_resolve = false;
547  clean_up_memory();
548  }
549 
551  unsigned& max_iter()
552  {
553  return Max_iter;
554  }
555 
557  double& tolerance()
558  {
559  return Tolerance;
560  }
561 
563  unsigned& hypre_method()
564  {
565  return Hypre_method;
566  }
567 
571  {
573  }
574 
578  {
580  }
581 
584  {
585  return AMG_simple_smoother;
586  }
587 
591  {
593  }
594 
597  {
598  return AMG_complex_smoother;
599  }
600 
602  unsigned& amg_print_level()
603  {
604  return AMG_print_level;
605  }
606 
609  {
611  }
612 
614  unsigned& amg_coarsening()
615  {
616  return AMG_coarsening;
617  }
618 
620  unsigned& amg_max_levels()
621  {
622  return AMG_max_levels;
623  }
624 
626  double& amg_damping()
627  {
628  return AMG_damping;
629  }
630 
632  double& amg_strength()
633  {
634  return AMG_strength;
635  }
636 
638  double& amg_max_row_sum()
639  {
640  return AMG_max_row_sum;
641  }
642 
644  double& amg_truncation()
645  {
646  return AMG_truncation;
647  }
648 
651  {
652  return ParaSails_symmetry;
653  }
654 
657  {
658  return ParaSails_nlevel;
659  }
660 
663  {
664  return ParaSails_thresh;
665  }
666 
669  {
670  return ParaSails_filter;
671  }
672 
674  double& euclid_droptol()
675  {
676  return Euclid_droptol;
677  }
678 
682  {
683  return Euclid_level;
684  }
685 
688  {
689  Euclid_rowScale = true;
690  }
691 
694  {
695  Euclid_rowScale = false;
696  }
697 
701  {
702  Euclid_using_BJ = true;
703  }
704 
708  {
709  Euclid_using_BJ = false;
710  }
711 
715  {
716  Euclid_using_ILUT = false;
717  }
718 
722  {
723  Euclid_using_ILUT = true;
724  }
725 
731  unsigned& euclid_print_level()
732  {
733  return Euclid_print_level;
734  }
735 
737  unsigned& krylov_print_level()
738  {
739  return Krylov_print_level;
740  }
741 
752  {
753  Delete_matrix = true;
754  }
755 
761  {
762  Delete_matrix = false;
763  }
764 
765 
769  void solve(Problem* const& problem_pt, DoubleVector& solution);
770 
784  void solve(DoubleMatrixBase* const& matrix_pt,
785  const DoubleVector& rhs,
787 
792  void resolve(const DoubleVector& rhs, DoubleVector& solution);
793 
795  void clean_up_memory();
796 
797  private:
807  };
808 
809 
813 
814  //=====================================================================
824  //====================================================================
826  {
827  public:
830  HyprePreconditioner(const std::string& context_string = "")
831  {
832  Context_string = context_string;
833 
834  // Hypre copies matrix data from oomph-lib's CRDoubleMatrix
835  // or DistributedCRDoubleMatrix into its own data structures,
836  // doubling the memory requirements for the matrix.
837  // As far as the Hypre solvers are concerned the oomph-lib matrix
838  // is no longer required and could be deleted to save memory.
839  // However, this will not be the expected behaviour and therefore
840  // needs to be requested explicitly by the user by changing this
841  // flag from false (its default) to true.
842  Delete_matrix = false;
843 
844  // Do we want to output results of timings?
845  Doc_time = true;
846 
847  // General control paramaters for using HYPRE as preconditioner
848  Tolerance = 0.0;
849  Max_iter = 1;
852 
853  // Initialise private double that accumulates the preconditioner
854  // solve time of thi instantiation of this class. Is reported
855  // in destructor if Report_my_cumulative_preconditioner_solve_time
856  // is set to true
859  }
860 
863  {
865  {
866  oomph_info << "~HyprePreconditioner() in context \" " << Context_string
867  << "\": My_cumulative_preconditioner_solve_time = "
869  }
870  }
871 
874 
876  void operator=(const HyprePreconditioner&) = delete;
877 
883 
889  static std::map<std::string, double> Context_based_cumulative_solve_time;
890 
891 
897 
903  static std::map<std::string, unsigned>
905 
911  static std::map<std::string, unsigned> Context_based_nrow;
912 
915  static void report_cumulative_solve_times();
916 
918  static void reset_cumulative_solve_times();
919 
922  {
924  }
925 
928  {
930  }
931 
934  {
935  Doc_time = true;
936  }
937 
940  {
941  Doc_time = false;
942  }
943 
945  unsigned& hypre_method()
946  {
947  return Hypre_method;
948  }
949 
953  {
955  }
956 
959  {
961  }
962 
964  void set_amg_iterations(const unsigned& amg_iterations)
965  {
967  }
968 
970  unsigned& amg_iterations()
971  {
972  return Max_iter;
973  }
974 
978  {
980  }
981 
984  {
985  return AMG_simple_smoother;
986  }
987 
991  {
993  }
994 
997  {
998  return AMG_complex_smoother;
999  }
1000 
1003  {
1005  }
1006 
1008  unsigned& amg_print_level()
1009  {
1010  return AMG_print_level;
1011  }
1012 
1015  {
1016  return AMG_smoother_iterations;
1017  }
1018 
1020  unsigned& amg_coarsening()
1021  {
1022  return AMG_coarsening;
1023  }
1024 
1026  unsigned& amg_max_levels()
1027  {
1028  return AMG_max_levels;
1029  }
1030 
1032  double& amg_damping()
1033  {
1034  return AMG_damping;
1035  }
1036 
1038  double& amg_strength()
1039  {
1040  return AMG_strength;
1041  }
1042 
1045  {
1046  return AMG_max_row_sum;
1047  }
1048 
1050  double& amg_truncation()
1051  {
1052  return AMG_truncation;
1053  }
1054 
1057  {
1059  }
1060 
1063  {
1064  return ParaSails_symmetry;
1065  }
1066 
1069  {
1070  return ParaSails_nlevel;
1071  }
1072 
1075  {
1076  return ParaSails_thresh;
1077  }
1078 
1081  {
1082  return ParaSails_filter;
1083  }
1084 
1086  void use_Euclid()
1087  {
1088  Hypre_method = Euclid;
1089  }
1090 
1092  double& euclid_droptol()
1093  {
1094  return Euclid_droptol;
1095  }
1096 
1099  {
1100  return Euclid_level;
1101  }
1102 
1105  {
1106  Euclid_rowScale = true;
1107  }
1108 
1111  {
1112  Euclid_rowScale = false;
1113  }
1114 
1118  {
1119  Euclid_using_BJ = true;
1120  }
1121 
1125  {
1126  Euclid_using_BJ = false;
1127  }
1128 
1132  {
1133  Euclid_using_ILUT = false;
1134  }
1135 
1139  {
1140  Euclid_using_ILUT = true;
1141  }
1142 
1149  {
1150  return Euclid_print_level;
1151  }
1152 
1163  {
1164  Delete_matrix = true;
1165  }
1166 
1172  {
1173  Delete_matrix = false;
1174  }
1175 
1192  void setup();
1193 
1205 
1207  void clean_up_memory();
1208 
1209  private:
1219 
1220  // Flag is true to output results of timings
1221  bool Doc_time;
1222 
1228 
1232 
1235  };
1236 
1237 
1241 
1242  //==================================================================
1244  //==================================================================
1245  namespace Hypre_default_settings
1246  {
1250  HyprePreconditioner* hypre_preconditioner_pt);
1251 
1255  HyprePreconditioner* hypre_preconditioner_pt);
1256 
1260  HyprePreconditioner* hypre_preconditioner_pt);
1261 
1262  } // namespace Hypre_default_settings
1263 } // namespace oomph
1264 
1265 #endif
std::vector< double > DoubleVector
loads clump configuration
Definition: ClumpInput.h:26
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Definition: matrices.h:888
Definition: matrices.h:261
Definition: double_vector.h:58
Definition: hypre_solver.h:134
bool Output_info
Flag is true to output info and results of timings.
Definition: hypre_solver.h:305
bool Delete_input_data
Definition: hypre_solver.h:445
unsigned AMG_coarsening
Definition: hypre_solver.h:386
int Euclid_level
Euclid level parameter for ILU(k) factorization.
Definition: hypre_solver.h:418
double AMGEuclidSmoother_drop_tol
Definition: hypre_solver.h:283
bool Euclid_using_BJ
Flag to determine if Block Jacobi is used instead of PILU.
Definition: hypre_solver.h:415
bool Euclid_rowScale
Flag to switch on Euclid row scaling.
Definition: hypre_solver.h:409
double AMG_strength
Connection strength threshold parameter for BoomerAMG.
Definition: hypre_solver.h:369
HypreInterface(const HypreInterface &)=delete
Broken copy constructor.
void enable_hypre_error_messages()
Turn on the hypre error messages.
Definition: hypre_solver.h:242
LinearAlgebraDistribution * Hypre_distribution_pt
the distribution for this helpers-
Definition: hypre_solver.h:490
int ParaSails_nlevel
ParaSails nlevel parameter.
Definition: hypre_solver.h:397
double ParaSails_filter
ParaSails filter parameter.
Definition: hypre_solver.h:403
bool AMGEuclidSmoother_use_row_scaling
Definition: hypre_solver.h:280
unsigned AMGEuclidSmoother_level
Definition: hypre_solver.h:282
HYPRE_Solver Solver
Definition: hypre_solver.h:477
int ParaSails_symmetry
Definition: hypre_solver.h:394
HypreInterface()
Constructor.
Definition: hypre_solver.h:137
unsigned existing_preconditioner()
Function return value of which preconditioner (if any) is stored.
Definition: hypre_solver.h:273
HYPRE_ParCSRMatrix Matrix_par
Definition: hypre_solver.h:473
bool AMGEuclidSmoother_use_ilut
Definition: hypre_solver.h:281
void operator=(const HypreInterface &)=delete
Broken assignment operator.
void disable_hypre_error_messages()
Turn off hypre error messages.
Definition: hypre_solver.h:248
unsigned Internal_preconditioner
Definition: hypre_solver.h:320
void hypre_solve(const DoubleVector &rhs, DoubleVector &solution)
Definition: hypre_solver.cc:1086
Hypre_method_types
Definition: hypre_solver.h:256
@ BiCGStab
Definition: hypre_solver.h:259
@ ParaSails
Definition: hypre_solver.h:262
@ GMRES
Definition: hypre_solver.h:258
@ CG
Definition: hypre_solver.h:257
@ None
Definition: hypre_solver.h:263
@ BoomerAMG
Definition: hypre_solver.h:260
@ Euclid
Definition: hypre_solver.h:261
~HypreInterface()
Destructor.
Definition: hypre_solver.h:226
HYPRE_Solver Preconditioner
Definition: hypre_solver.h:481
unsigned AMGEuclidSmoother_print_level
Definition: hypre_solver.h:284
bool AMGEuclidSmoother_use_block_jacobi
Definition: hypre_solver.h:279
unsigned AMG_complex_smoother
Definition: hypre_solver.h:360
bool Delete_matrix
Definition: hypre_solver.h:465
double ParaSails_thresh
ParaSails thresh parameter.
Definition: hypre_solver.h:400
double AMG_truncation
Interpolation truncation factor for BoomerAMG.
Definition: hypre_solver.h:372
unsigned Krylov_print_level
Definition: hypre_solver.h:429
unsigned AMG_smoother_iterations
The number of smoother iterations to apply.
Definition: hypre_solver.h:363
unsigned existing_solver()
Function to return value of which solver (if any) is currently stored.
Definition: hypre_solver.h:267
void hypre_clean_up_memory()
Function deletes all solver data.
Definition: hypre_solver.cc:1301
bool Hypre_error_messages
Definition: hypre_solver.h:441
double Tolerance
Tolerance used to terminate solver.
Definition: hypre_solver.h:311
bool AMG_using_simple_smoothing
Definition: hypre_solver.h:338
unsigned Existing_solver
Used to keep track of which solver (if any) is currently stored.
Definition: hypre_solver.h:484
unsigned Max_iter
Maximum number of iterations used in solver.
Definition: hypre_solver.h:308
double AMG_damping
Damping factor for BoomerAMG smoothed Jacobi or hybrid SOR.
Definition: hypre_solver.h:366
unsigned AMG_simple_smoother
Definition: hypre_solver.h:351
unsigned AMG_print_level
Definition: hypre_solver.h:327
HYPRE_IJMatrix Matrix_ij
Definition: hypre_solver.h:469
unsigned Euclid_print_level
Definition: hypre_solver.h:425
unsigned AMG_max_levels
Maximum number of levels used in AMG.
Definition: hypre_solver.h:330
unsigned Hypre_method
Hypre method flag. Valid values are specified in enumeration.
Definition: hypre_solver.h:314
void hypre_matrix_setup(CRDoubleMatrix *matrix_pt)
Definition: hypre_solver.cc:513
double AMG_max_row_sum
Parameter to identify diagonally dominant parts of the matrix in AMG.
Definition: hypre_solver.h:333
double Euclid_droptol
Euclid drop tolerance for ILU(k) and ILUT factorization.
Definition: hypre_solver.h:406
unsigned Existing_preconditioner
Used to keep track of which preconditioner (if any) is currently stored.
Definition: hypre_solver.h:487
bool Euclid_using_ILUT
Flag to determine if ILUT (if true) or ILU(k) is used in Euclid.
Definition: hypre_solver.h:412
void hypre_solver_setup()
Definition: hypre_solver.cc:558
Definition: hypre_solver.h:826
~HyprePreconditioner()
Destructor.
Definition: hypre_solver.h:862
unsigned & amg_smoother_iterations()
Access function to AMG_smoother_iterations.
Definition: hypre_solver.h:1014
unsigned & amg_simple_smoother()
Access function to AMG_simple_smoother flag.
Definition: hypre_solver.h:983
double & amg_max_row_sum()
Access function to AMG_max_row_sum.
Definition: hypre_solver.h:1044
static void reset_cumulative_solve_times()
Reset cumulative solve times.
Definition: hypre_solver.cc:1699
double & amg_strength()
Access function to AMG_strength.
Definition: hypre_solver.h:1038
static std::map< std::string, unsigned > Context_based_cumulative_npreconditioner_solve
Definition: hypre_solver.h:904
unsigned & amg_iterations()
Return function for Max_iter.
Definition: hypre_solver.h:970
void disable_euclid_using_BJ()
Definition: hypre_solver.h:1124
std::string Context_string
String can be used to provide context for annotation.
Definition: hypre_solver.h:1234
double & parasails_thresh()
Access function to ParaSails thresh parameter.
Definition: hypre_solver.h:1074
int & parasails_nlevel()
Access function to ParaSails nlevel parameter.
Definition: hypre_solver.h:1068
void enable_delete_matrix()
Definition: hypre_solver.h:1162
void disable_report_my_cumulative_preconditioner_solve_time()
Disable reporting of cumulative solve time in destructor.
Definition: hypre_solver.h:927
double & amg_damping()
Access function to AMG_damping parameter.
Definition: hypre_solver.h:1032
unsigned & amg_print_level()
Access function to AMG_print_level.
Definition: hypre_solver.h:1008
void set_amg_iterations(const unsigned &amg_iterations)
Function to set the number of times to apply BoomerAMG.
Definition: hypre_solver.h:964
void clean_up_memory()
Function deletes all solver data.
Definition: hypre_solver.cc:1842
void disable_delete_matrix()
Definition: hypre_solver.h:1171
static double Cumulative_preconditioner_solve_time
Definition: hypre_solver.h:882
void euclid_using_ILUT()
Definition: hypre_solver.h:1138
void setup()
Definition: hypre_solver.cc:1714
void enable_euclid_rowScale()
Enable euclid rowScaling.
Definition: hypre_solver.h:1104
unsigned & hypre_method()
Access function to Hypre_method flag – specified via enumeration.
Definition: hypre_solver.h:945
void euclid_using_ILUK()
Definition: hypre_solver.h:1131
int & euclid_level()
Access function to Euclid level parameter for ILU(k) factorization.
Definition: hypre_solver.h:1098
bool Report_my_cumulative_preconditioner_solve_time
Definition: hypre_solver.h:1231
void amg_using_complex_smoothing()
Definition: hypre_solver.h:990
static std::map< std::string, double > Context_based_cumulative_solve_time
Definition: hypre_solver.h:889
unsigned & amg_max_levels()
Access function to AMG_max_levels.
Definition: hypre_solver.h:1026
void enable_euclid_using_BJ()
Definition: hypre_solver.h:1117
double & amg_truncation()
Access function to AMG_truncation.
Definition: hypre_solver.h:1050
bool Delete_matrix
Definition: hypre_solver.h:1218
void enable_doc_time()
Enable documentation of preconditioner timings.
Definition: hypre_solver.h:933
void disable_doc_time()
Disable documentation of preconditioner timings.
Definition: hypre_solver.h:939
static std::map< std::string, unsigned > Context_based_nrow
Definition: hypre_solver.h:911
void amg_using_simple_smoothing()
Definition: hypre_solver.h:977
bool & amg_using_simple_smoothing_flag()
Return function for the AMG_using_simple_smoothing_flag.
Definition: hypre_solver.h:1002
double My_cumulative_preconditioner_solve_time
Definition: hypre_solver.h:1227
void use_Euclid()
Function to select use Euclid as the preconditioner.
Definition: hypre_solver.h:1086
double & euclid_droptol()
Access function to Euclid drop tolerance parameter.
Definition: hypre_solver.h:1092
unsigned & euclid_print_level()
Definition: hypre_solver.h:1148
void disable_euclid_rowScale()
Disable euclid row scaling.
Definition: hypre_solver.h:1110
void operator=(const HyprePreconditioner &)=delete
Broken assignment operator.
void use_BoomerAMG()
Function to select BoomerAMG as the preconditioner.
Definition: hypre_solver.h:958
unsigned & internal_preconditioner()
Definition: hypre_solver.h:952
static void report_cumulative_solve_times()
Definition: hypre_solver.cc:1648
void use_ParaSails()
Function to select ParaSails as the preconditioner.
Definition: hypre_solver.h:1056
int & parasails_symmetry()
Access function to ParaSails symmetry flag.
Definition: hypre_solver.h:1062
unsigned & amg_complex_smoother()
Access function to AMG_complex_smoother flag.
Definition: hypre_solver.h:996
unsigned & amg_coarsening()
Access function to AMG_coarsening flag.
Definition: hypre_solver.h:1020
bool Doc_time
Definition: hypre_solver.h:1221
static unsigned Cumulative_npreconditioner_solve
Definition: hypre_solver.h:896
void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Preconditioner_solve uses a hypre solver to precondition vector r.
Definition: hypre_solver.cc:1775
HyprePreconditioner(const HyprePreconditioner &)=delete
Broken copy constructor.
HyprePreconditioner(const std::string &context_string="")
Definition: hypre_solver.h:830
double & parasails_filter()
Access function to ParaSails filter parameter.
Definition: hypre_solver.h:1080
void enable_report_my_cumulative_preconditioner_solve_time()
Enable reporting of cumulative solve time in destructor.
Definition: hypre_solver.h:921
Definition: hypre_solver.h:514
unsigned & amg_simple_smoother()
Access function to AMG_simple_smoother flag.
Definition: hypre_solver.h:583
void disable_euclid_using_BJ()
Definition: hypre_solver.h:707
int & euclid_level()
Definition: hypre_solver.h:681
void disable_euclid_rowScale()
Disable euclid row scaling.
Definition: hypre_solver.h:693
double & amg_damping()
Access function to AMG_damping parameter.
Definition: hypre_solver.h:626
unsigned & max_iter()
Access function to Max_iter.
Definition: hypre_solver.h:551
void enable_euclid_using_BJ()
Definition: hypre_solver.h:700
double & euclid_droptol()
Access function to Euclid drop tolerance parameter.
Definition: hypre_solver.h:674
unsigned & hypre_method()
Access function to Hypre_method flag – specified via enumeration.
Definition: hypre_solver.h:563
unsigned & euclid_print_level()
Definition: hypre_solver.h:731
void solve(Problem *const &problem_pt, DoubleVector &solution)
Definition: hypre_solver.cc:1383
double & amg_max_row_sum()
Access function to AMG_max_row_sum.
Definition: hypre_solver.h:638
unsigned & amg_print_level()
Access function to AMG_print_level.
Definition: hypre_solver.h:602
HypreSolver(const HypreSolver &)=delete
Broken copy constructor.
~HypreSolver()
Empty destructor.
Definition: hypre_solver.h:534
unsigned & krylov_print_level()
Access function to Krylov_print_level.
Definition: hypre_solver.h:737
double & tolerance()
Access function to Tolerance.
Definition: hypre_solver.h:557
void clean_up_memory()
Function deletes all solver data.
Definition: hypre_solver.cc:1586
unsigned & amg_coarsening()
Access function to AMG_coarsening flag.
Definition: hypre_solver.h:614
double & parasails_thresh()
Access function to ParaSails thresh parameter.
Definition: hypre_solver.h:662
HypreSolver()
Constructor.
Definition: hypre_solver.h:517
double & parasails_filter()
Access function to ParaSails filter parameter.
Definition: hypre_solver.h:668
unsigned & amg_complex_smoother()
Access function to AMG_complex_smoother flag.
Definition: hypre_solver.h:596
bool Delete_matrix
Definition: hypre_solver.h:806
void amg_using_complex_smoothing()
Definition: hypre_solver.h:590
void euclid_using_ILUT()
Definition: hypre_solver.h:721
void amg_using_simple_smoothing()
Definition: hypre_solver.h:577
void resolve(const DoubleVector &rhs, DoubleVector &solution)
Definition: hypre_solver.cc:1532
void enable_euclid_rowScale()
Enable euclid rowScaling.
Definition: hypre_solver.h:687
unsigned & amg_max_levels()
Access function to AMG_max_levels.
Definition: hypre_solver.h:620
int & parasails_symmetry()
Access function to ParaSails symmetry flag.
Definition: hypre_solver.h:650
unsigned & amg_smoother_iterations()
Access function to AMG_smoother_iterations.
Definition: hypre_solver.h:608
unsigned & internal_preconditioner()
Definition: hypre_solver.h:570
void euclid_using_ILUK()
Definition: hypre_solver.h:714
void operator=(const HypreSolver &)=delete
Broken assignment operator.
double & amg_truncation()
Access function to AMG_truncation.
Definition: hypre_solver.h:644
int & parasails_nlevel()
Access function to ParaSails nlevel parameter.
Definition: hypre_solver.h:656
void disable_resolve()
Definition: hypre_solver.h:544
void enable_delete_matrix()
Definition: hypre_solver.h:751
void disable_delete_matrix()
Definition: hypre_solver.h:760
double & amg_strength()
Access function to AMG_strength.
Definition: hypre_solver.h:632
Definition: linear_algebra_distribution.h:64
Definition: linear_solver.h:68
bool Doc_time
Boolean flag that indicates whether the time taken.
Definition: linear_solver.h:77
bool Enable_resolve
Definition: linear_solver.h:73
static bool mpi_has_been_initialised()
return true if MPI has been initialised
Definition: oomph_utilities.h:851
static OomphCommunicator * communicator_pt()
access to the global oomph-lib communicator
Definition: oomph_utilities.cc:1046
Definition: oomph_definitions.h:222
Definition: preconditioner.h:54
Definition: problem.h:151
int hypre__global_error
void solution(const Vector< double > &x, Vector< double > &u)
Definition: two_d_biharmonic.cc:113
r
Definition: UniformPSDSelfTest.py:20
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
void create_HYPRE_Matrix(CRDoubleMatrix *oomph_matrix, HYPRE_IJMatrix &hypre_ij_matrix, HYPRE_ParCSRMatrix &hypre_par_matrix, LinearAlgebraDistribution *dist_pt)
Definition: hypre_solver.cc:270
void create_HYPRE_Vector(const DoubleVector &oomph_vec, const LinearAlgebraDistribution *dist_pt, HYPRE_IJVector &hypre_ij_vector, HYPRE_ParVector &hypre_par_vector)
Definition: hypre_solver.cc:178
int check_HYPRE_error_flag(std::ostringstream &message)
Definition: hypre_solver.cc:147
unsigned AMG_coarsening
Definition: hypre_solver.cc:134
double AMG_truncation
AMG interpolation truncation factor.
Definition: hypre_solver.cc:140
double AMG_strength
Definition: hypre_solver.cc:118
void euclid_settings_helper(const bool &use_block_jacobi, const bool &use_row_scaling, const bool &use_ilut, const int &level, const double &drop_tol, const int &print_level, HYPRE_Solver &euclid_object)
Definition: hypre_solver.cc:409
void set_defaults_for_navier_stokes_momentum_block(HyprePreconditioner *hypre_preconditioner_pt)
Definition: hypre_solver.cc:85
void set_defaults_for_3D_poisson_problem(HyprePreconditioner *hypre_preconditioner_pt)
Definition: hypre_solver.cc:72
void set_defaults_for_2D_poisson_problem(HyprePreconditioner *hypre_preconditioner_pt)
Definition: hypre_solver.cc:45
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86