https://mooseframework.inl.gov
MFEMHyprePatch.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 // To be removed as soon as we have a fix upstream in either hypre or mfem
11 
12 #ifdef MOOSE_MFEM_ENABLED
13 
14 namespace mfem
15 {
16 namespace patched
17 {
21 class HypreGMRES : public mfem::HypreGMRES
22 {
23 public:
24  using mfem::HypreGMRES::HypreGMRES;
25  void SetOperator(const mfem::Operator & op)
26  {
27  mfem::HypreGMRES::SetOperator(op);
28  HYPRE_GMRESSetPrecondMatrix(HYPRE_Solver(*this), nullptr);
29  }
30 };
31 
35 class HyprePCG : public mfem::HyprePCG
36 {
37 public:
38  using mfem::HyprePCG::HyprePCG;
39  void SetOperator(const mfem::Operator & op)
40  {
41  mfem::HyprePCG::SetOperator(op);
42  HYPRE_PCGSetPrecondMatrix(HYPRE_Solver(*this), nullptr);
43  }
44 };
45 }
46 }
47 
48 #endif
Patch for mfem::HypreGMRES to reset preconditioning matrix at every nonlinear/time iteration...
void SetOperator(const mfem::Operator &op)
void SetOperator(const mfem::Operator &op)
Patch for mfem::HyprePCG to reset preconditioning matrix at every nonlinear/time iteration.