MFEM  v4.2.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
ortho_solver.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2020, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-806117.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability visit https://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 #ifndef MFEM_NAVIER_ORTHO_SOLVER_HPP
13 #define MFEM_NAVIER_ORTHO_SOLVER_HPP
14 
15 #include "mfem.hpp"
16 
17 namespace mfem
18 {
19 namespace navier
20 {
21 /// Solver wrapper which orthogonalizes the input and output vector
22 /**
23  * OrthoSolver wraps an existing Operator and orthogonalizes the input vector
24  * before passing it to the Mult method of the Operator. This is a convenience
25  * implementation to handle e.g. a Poisson problem with pure Neumann boundary
26  * conditions, where this procedure removes the Nullspace.
27  */
28 class OrthoSolver : public Solver
29 {
30 public:
31  OrthoSolver();
32 
33  virtual void SetOperator(const Operator &op);
34 
35  void Mult(const Vector &b, Vector &x) const;
36 
37 private:
38  const Operator *oper = nullptr;
39 
40  mutable Vector b_ortho;
41 
42  void Orthogonalize(const Vector &v, Vector &v_ortho) const;
43 };
44 
45 } // namespace navier
46 
47 } // namespace mfem
48 
49 #endif
virtual void SetOperator(const Operator &op)
Set/update the solver for the given operator.
double b
Definition: lissajous.cpp:42
void Mult(const Vector &b, Vector &x) const
Operator application: y=A(x).
Vector data type.
Definition: vector.hpp:51
Base class for solvers.
Definition: operator.hpp:634
Abstract operator.
Definition: operator.hpp:24
Solver wrapper which orthogonalizes the input and output vector.