chombo-discharge
CD_RtLayout.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2021 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_RtLayout_H
13 #define CD_RtLayout_H
14 
15 // Our includes
16 #include <CD_RtSolver.H>
17 #include <CD_NamespaceHeader.H>
18 
19 template <class T>
20 class RtIterator;
21 
25 template <class T>
26 class RtLayout
27 {
28 public:
33  RtLayout(const Vector<RefCountedPtr<RtSpecies>>& a_RtSpecies);
34 
38  virtual ~RtLayout();
39 
44  virtual RtIterator<T>
45  iterator();
46 
50  virtual const std::string
51  getRealm() const;
52 
57  virtual void
58  setRealm(const std::string a_realm);
59 
64  virtual void
65  addSolver(RefCountedPtr<T> a_solver);
66 
70  virtual void
71  parseOptions();
72 
76  virtual void
78 
82  virtual void
83  allocate();
84 
90  virtual void
91  preRegrid(const int a_base, const int a_oldFinestLevel);
92 
96  virtual void
97  deallocate();
98 
105  virtual void
106  regrid(const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel);
107 
111  virtual void
113 
118  virtual void
119  setAmr(const RefCountedPtr<AmrMesh>& a_amr);
120 
125  virtual void
126  setComputationalGeometry(const RefCountedPtr<ComputationalGeometry>& a_computationalGeometry);
127 
131  virtual void
132  sanityCheck();
133 
139  virtual void
140  setPhase(phase::which_phase a_phase = phase::gas);
141 
146  virtual void
147  setVerbosity(const int a_verbosity);
148 
156  virtual void
157  setTime(const int a_step, const Real a_time, const Real a_dt);
158 
163  virtual void
164  setSource(const EBAMRCellData& a_source);
165 
170  virtual void
171  setSource(const Real a_source);
172 
177  virtual void
178  setStationary(const bool a_stationary);
179 
183  virtual void
184  writePlotFile();
185 
190  virtual void
191  advance(const Real a_dt);
192 
197  virtual void
198  initialData();
199 
203  virtual bool
204  isStationary();
205 
209  virtual phase::which_phase
210  getPhase();
211 
215  virtual Vector<RefCountedPtr<T>>&
216  getSolvers();
217 
221  virtual Vector<RefCountedPtr<RtSpecies>>&
222  getSpecies();
223 
227  virtual Vector<EBAMRCellData*>
228  getSources();
229 
233  virtual Vector<EBAMRCellData*>
234  getPhis();
235 
236 protected:
240  std::string m_realm;
241 
245  phase::which_phase m_phase;
246 
250  Vector<RefCountedPtr<T>> m_solvers;
251 
255  Vector<RefCountedPtr<RtSpecies>> m_species;
256 
261 };
262 
268 template <class T, class S>
270 {
271 public:
275  RtFactory();
276 
280  ~RtFactory();
281 
286  RefCountedPtr<RtLayout<T>>
287  newLayout(const Vector<RefCountedPtr<RtSpecies>>& a_species) const;
288 };
289 
290 #include <CD_NamespaceFooter.H>
291 
292 #include <CD_RtLayoutImplem.H>
293 
294 #endif
Implementation of CD_RtLayout.H.
Abstract parent class for various radiative transfer solvers.
Factory class for RtLayout.
Definition: CD_RtLayout.H:270
~RtFactory()
Destructor (does nothing)
Definition: CD_RtLayoutImplem.H:452
RtFactory()
Constructor (does nothing)
Definition: CD_RtLayoutImplem.H:448
RefCountedPtr< RtLayout< T > > newLayout(const Vector< RefCountedPtr< RtSpecies >> &a_species) const
Get a new Layout. This will cast S to a specific class (T)
Definition: CD_RtLayoutImplem.H:457
Iterator class for RtLayout.
Definition: CD_RtIterator.H:24
Class for holding a set of RtSolvers. T must derive from RtSolver.
Definition: CD_RtLayout.H:27
Vector< RefCountedPtr< T > > m_solvers
Solvers.
Definition: CD_RtLayout.H:250
virtual void setVerbosity(const int a_verbosity)
Set verbosity.
Definition: CD_RtLayoutImplem.H:196
virtual void setComputationalGeometry(const RefCountedPtr< ComputationalGeometry > &a_computationalGeometry)
Set the computational geometry.
Definition: CD_RtLayoutImplem.H:164
int m_verbosity
Verbosity.
Definition: CD_RtLayout.H:260
virtual const std::string getRealm() const
Get realm where the solvers are allocated.
Definition: CD_RtLayoutImplem.H:49
virtual Vector< RefCountedPtr< T > > & getSolvers()
Get solvers.
Definition: CD_RtLayoutImplem.H:397
virtual void parseOptions()
Parse options.
Definition: CD_RtLayoutImplem.H:74
virtual void setStationary(const bool a_stationary)
Turn on/off stationary.
Definition: CD_RtLayoutImplem.H:303
virtual void sanityCheck()
Do a sanity check.
Definition: CD_RtLayoutImplem.H:213
virtual void setTime(const int a_step, const Real a_time, const Real a_dt)
Set time.
Definition: CD_RtLayoutImplem.H:228
Vector< RefCountedPtr< RtSpecies > > m_species
Species.
Definition: CD_RtLayout.H:255
virtual Vector< EBAMRCellData * > getSources()
Get all source terms.
Definition: CD_RtLayoutImplem.H:411
virtual void registerOperators()
Register operators.
Definition: CD_RtLayoutImplem.H:258
virtual void setSource(const EBAMRCellData &a_source)
Convenience function. Set source terms for all species. Mostly used for debugging.
Definition: CD_RtLayoutImplem.H:273
virtual bool isStationary()
Check if solvers are stationary.
Definition: CD_RtLayoutImplem.H:363
virtual Vector< EBAMRCellData * > getPhis()
Get all states.
Definition: CD_RtLayoutImplem.H:430
virtual void deallocate()
Deallocate internal storage for solvers.
Definition: CD_RtLayoutImplem.H:134
virtual void setAmr(const RefCountedPtr< AmrMesh > &a_amr)
Set amr.
Definition: CD_RtLayoutImplem.H:149
virtual void regrid(const int a_lmin, const int a_oldFinestLevel, const int a_newFinestLevel)
Regrid all solvers.
Definition: CD_RtLayoutImplem.H:243
virtual void addSolver(RefCountedPtr< T > a_solver)
Add a new solver to the solver layout.
Definition: CD_RtLayoutImplem.H:67
virtual void parseRuntimeOptions()
Parse runtime options.
Definition: CD_RtLayoutImplem.H:89
virtual Vector< RefCountedPtr< RtSpecies > > & getSpecies()
Get species.
Definition: CD_RtLayoutImplem.H:404
RtLayout(const Vector< RefCountedPtr< RtSpecies >> &a_RtSpecies)
Full constructor.
Definition: CD_RtLayoutImplem.H:24
virtual RtIterator< T > iterator()
Get iterator.
Definition: CD_RtLayoutImplem.H:42
virtual ~RtLayout()
Destructor (does nothing)
Definition: CD_RtLayoutImplem.H:35
phase::which_phase m_phase
Phase.
Definition: CD_RtLayout.H:245
std::string m_realm
Realm.
Definition: CD_RtLayout.H:240
virtual void setRealm(const std::string a_realm)
Set realm for solvers.
Definition: CD_RtLayoutImplem.H:56
virtual void writePlotFile()
Convenience function. All solvers write plot files.
Definition: CD_RtLayoutImplem.H:318
virtual void preRegrid(const int a_base, const int a_oldFinestLevel)
Pre regrid stuff.
Definition: CD_RtLayoutImplem.H:119
virtual void initialData()
Fill with initial data.
Definition: CD_RtLayoutImplem.H:348
virtual void advance(const Real a_dt)
Convenience function. Call advance method for each solver.
Definition: CD_RtLayoutImplem.H:333
virtual phase::which_phase getPhase()
Get phase.
Definition: CD_RtLayoutImplem.H:385
virtual void allocate()
Allocate internal storage for solvers.
Definition: CD_RtLayoutImplem.H:104
virtual void setPhase(phase::which_phase a_phase=phase::gas)
Set phase.
Definition: CD_RtLayoutImplem.H:179