Debian Codegraph @

packages/trilinoscouplings/examples/scaling/TrilinosCouplings_EpetraIntrepidPoissonExample_SolveWithAztecOO.hpp

raw
1 // @HEADER
2 // *****************************************************************************
3 // Trilinos: An Object-Oriented Solver Framework
4 //
5 // Copyright 2001-2024 NTESS and the Trilinos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 #ifndef __TrilinosCouplings_IntrepidPoissonExample_SolveWithAztecOO_hpp
11 #define __TrilinosCouplings_IntrepidPoissonExample_SolveWithAztecOO_hpp
12
13 /// \file TrilinosCouplings_IntrepidPoissonExample_SolveWithAztecOO.hpp
14 /// \brief AztecOO solver for the Intrepid Poisson test problem example.
15
16 #include "Teuchos_RCP.hpp"
17 #include "Epetra_Vector.h"
18 #include "Epetra_Operator.h"
19
20 namespace TrilinosCouplings {
21 namespace EpetraIntrepidPoissonExample {
22
23 /// \brief Solve the linear system(s) AX=B with AztecOO.
24 ///
25 /// This interface will change in the future to accept the name of the
26 /// Aztec solver to use. For now, the solver is hard-coded to
27 /// CG.
28 ///
29 /// \param converged [out] Whether Aztec reported that the iterative
30 /// method converged (solved the linear system to the desired
31 /// tolerance).
32 ///
33 /// \param numItersPerformed [out] Number of iterations that the Aztec
34 /// solver performed.
35 ///
36 /// \param tol [in] Convergence tolerance for the iterative method.
37 /// The meaning of this depends on the particular iterative method.
38 ///
39 /// \param maxNumIters [in] Maximum number of iterations that the
40 /// iterative method should perform, regardless of whether it
41 /// converged.
42 ///
43 /// \param num_steps [in] Number of "time steps", i.e., the number of
44 // times the solver is called in a fake time-step loop.
45 ///
46 /// \param X [in/out] On input: the initial guess(es) for the iterative
47 /// method. On output: the computed approximate solution.
48 ///
49 /// \param A [in] The matrix in the linear system(s) AX=B to solve.
50 ///
51 /// \param B [in] The right-hand side in the linear system AX=B to solve.
52 ///
53 /// \param M_right [in] If nonnull, a right preconditioner that the
54 /// iterative method may use. If null, the iterative method will
55 /// not use a right preconditioner.
56 void
57 solveWithAztecOO (bool& converged,
58 int& numItersPerformed,
59 const double tol,
60 const int maxNumIters,
61 const int num_steps,
62 const Teuchos::RCP<Epetra_Vector>& X,
63 const Teuchos::RCP<Epetra_Operator>& A,
64 const Teuchos::RCP<Epetra_Vector>& B,
65 const Teuchos::RCP<Epetra_Operator>& M_right);
66
67 } // namespace EpetraIntrepidPoissonExample
68 } // namespace TrilinosCouplings
69
70 #endif // __TrilinosCouplings_IntrepidPoissonExample_SolveWithAztecOO_hpp