DOpE
pdeprobleminterface.h
Go to the documentation of this file.
1 
24 #ifndef PDEPROBLEM_INTERFACE_H_
25 #define PDEPROBLEM_INTERFACE_H_
26 
27 #include "dopeexceptionhandler.h"
28 #include "outputhandler.h"
29 #include "controlvector.h"
30 #include "constraintvector.h"
32 #include "dwrdatacontainer.h"
33 
34 #include <assert.h>
35 
36 #include <deal.II/lac/vector.h>
37 
38 namespace DOpE
39 {
40  //Predeclaration necessary
41  template<typename VECTOR>
42  class DOpEOutputHandler;
43  template<typename VECTOR>
44  class DOpEExceptionHandler;
46 
52  template<typename PROBLEM, typename VECTOR, int dealdim>
54  {
55  public:
56  PDEProblemInterface(PROBLEM *OP, int base_priority = 0)
58  {
59  OP_ = OP;
60  base_priority_ = base_priority;
61  post_index_ = "_" + this->GetProblem()->GetName();
62  }
63  virtual
65  {
66  }
67 
68  /******************************************************/
69 
75  virtual void
77  {
78  this->GetProblem()->ReInit("reduced");
79  }
80 
81  /******************************************************/
82 
89  virtual void
91 
92  /******************************************************/
93 
98  void
99  SetProblemType(std::string type, unsigned int num = 0)
100  {
101  this->GetProblem()->SetType(type, num);
102  }
103 
108  template<class DWRC>
109  void
110  InitializeDWRC(DWRC& dwrc)
111  {
112  dwrc.Initialize(GetProblem()->GetSpaceTimeHandler(),
113  GetProblem()->GetStateNBlocks(),
114  GetProblem()->GetStateBlockComponent());
115  }
116 
117  protected:
122  virtual const std::map<std::string, unsigned int>&
124  {
125  return GetProblem()->GetFunctionalPosition();
126  }
127 
128  PROBLEM*
130  {
131  return OP_;
132  }
133  const PROBLEM*
134  GetProblem() const
135  {
136  return OP_;
137  }
138  std::string
140  {
141  return post_index_;
142  }
143  int
145  {
146  return base_priority_;
147  }
148  private:
149  PROBLEM* OP_;
150  int base_priority_;
151  std::string post_index_;
152  };
153 
154 }
155 #endif
PROBLEM * GetProblem()
Definition: pdeprobleminterface.h:129
std::string GetPostIndex()
Definition: pdeprobleminterface.h:139
PDEProblemInterface(PROBLEM *OP, int base_priority=0)
Definition: pdeprobleminterface.h:56
virtual void ReInit()
Definition: pdeprobleminterface.h:76
void InitializeDWRC(DWRC &dwrc)
Definition: pdeprobleminterface.h:110
void SetProblemType(std::string type, unsigned int num=0)
Definition: pdeprobleminterface.h:99
int GetBasePriority()
Definition: pdeprobleminterface.h:144
const PROBLEM * GetProblem() const
Definition: pdeprobleminterface.h:134
Definition: pdeprobleminterface.h:53
Definition: outputhandler.h:42
virtual void ComputeReducedFunctionals()=0
virtual ~PDEProblemInterface()
Definition: pdeprobleminterface.h:64
virtual const std::map< std::string, unsigned int > & GetFunctionalPosition() const
Definition: pdeprobleminterface.h:123