Proto  3.2
Proto_LevelSolver.H
Go to the documentation of this file.
1 #pragma once
2 #ifndef _PROTO_LEVEL_SOLVER_
3 #define _PROTO_LEVEL_SOLVER_
4 
5 #include "Proto_LevelOp.H"
6 
7 namespace Proto {
8 
9 /// Level Solver
10 /**
11  Level Solver is an interface for building a solver to invert a LevelOp.
12  In particular, we would like to solve the equation L(phi) = G where L is defined by a
13  LevelOp, G is an external forcing defined on a level, and phi is the solution, also on a level.
14 
15  TODO: specifically, this is an interface for *iterative* solvers.
16 */
17 
18 template <template<typename, MemType> class OpType, typename T, MemType MEM = MEMTYPE_DEFAULT>
20 {
21  public:
22  typedef OpType<T, MEM> BOP;
23  //Note: BC is a placeholder and isn't fully implemented
27  static constexpr unsigned int numState() { return BOP::numState(); }
28  static constexpr unsigned int numAux() { return BOP::numAux(); }
29 
30  inline virtual double
31  solve(
32  LevelStateData& a_state,
33  LevelStateData& a_forcing,
34  LevelAuxData& a_aux,
35  int a_maxIter,
36  double a_tolerance) = 0;
37 
38  inline virtual double
39  solve(
40  LevelStateData& a_state,
41  LevelStateData& a_forcing,
42  int a_maxIter,
43  double a_tolerance) = 0;
44 
45 };
46 } // end namespace Proto
47 
48 #endif // end include guard
LevelBoxData< T, BOP::numState(), MEM, PR_CELL > LevelStateData
Definition: Proto_LevelSolver.H:25
MemType
Definition: Proto_MemType.H:7
Level Box Data.
Definition: Proto_HDF5.H:17
LevelBoxData< T, BOP::numAux(), MEM, PR_CELL > LevelAuxData
Definition: Proto_LevelSolver.H:26
Level-Scope Operator.
Definition: Proto_LevelOp.H:25
static constexpr unsigned int numState()
Definition: Proto_LevelSolver.H:27
Definition: Proto_Array.H:17
static constexpr unsigned int numAux()
Definition: Proto_LevelSolver.H:28
LevelOp< OpType, T, PeriodicBC, MEM > LOP
Definition: Proto_LevelSolver.H:24
OpType< T, MEM > BOP
Definition: Proto_LevelSolver.H:22
virtual double solve(LevelStateData &a_state, LevelStateData &a_forcing, LevelAuxData &a_aux, int a_maxIter, double a_tolerance)=0
#define MEMTYPE_DEFAULT
Definition: Proto_MemType.H:24
Level Solver.
Definition: Proto_LevelSolver.H:19