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