Canoe
Comprehensive Atmosphere N' Ocean Engine
impl.hpp
Go to the documentation of this file.
1 #ifndef SRC_IMPL_HPP_
2 #define SRC_IMPL_HPP_
3 
4 // C/C++
5 #include <map>
6 #include <memory>
7 #include <string>
8 #include <vector>
9 
10 // athena
11 #include <athena/athena.hpp>
12 #include <athena/mesh/mesh.hpp>
13 
14 class ParameterInput;
15 
16 class Inversion;
17 class ParticleBase;
18 
19 class MeshOutputGroup;
20 class FITSOutputGroup;
21 
22 class Inversion;
23 class ParticleBase;
24 
25 class Decomposition;
26 class ImplicitSolver;
27 class Microphysics;
28 class Radiation;
29 class Chemistry;
30 class Tracer;
31 class TurbulenceModel;
32 
33 class Inversion;
34 class ParticleBase;
35 
36 class Scheduler;
37 class MeshOutputGroup;
38 class FITSOutputGroup;
39 
40 class CelestrialBody;
41 
42 class ExchangerBase;
43 
47  public:
49  AthenaArray<Real> du; // stores tendency
50 
51  std::shared_ptr<Decomposition> pdec;
52  std::shared_ptr<ImplicitSolver> phevi;
53  std::shared_ptr<Microphysics> pmicro;
54  std::shared_ptr<Radiation> prad;
55  std::shared_ptr<Chemistry> pchem;
56  std::shared_ptr<Tracer> ptracer;
57  std::shared_ptr<TurbulenceModel> pturb;
58  std::shared_ptr<CelestrialBody> planet;
59 
60  // StaticVariablePtr pstatic;
61 
62  std::vector<std::shared_ptr<Inversion>> all_fits;
63  std::vector<std::shared_ptr<ParticleBase>> all_particles;
64 
65  // scheduler
66  std::shared_ptr<Scheduler> scheduler;
67 
68  public: // constructor and destructor
69  Impl(MeshBlock *pmb, ParameterInput *pin);
70  ~Impl();
71 
72  public: // member functions
73  ExchangerBase *GetExchanger(char const *name) const {
74  return exchangers_.at(name);
75  }
76 
77  Real GetDistanceInAu() const { return stellar_distance_au_; }
78 
79  auto &GetMeshOutputGroups() const { return mesh_outputs_; }
80  auto &GetFITSOutputGroups() const { return fits_outputs_; }
81 
82  // TODO(cli) : more needs to be changed
83  // called in task_list/time_integration.cpp
85 
86  protected:
87  std::map<char const *, ExchangerBase *> exchangers_;
88 
89  std::vector<std::weak_ptr<MeshOutputGroup>> mesh_outputs_;
90  std::vector<std::weak_ptr<FITSOutputGroup>> fits_outputs_;
91 
93 
94  private:
95  MeshBlock const *pmy_block_;
96 };
97 
98 #endif // SRC_IMPL_HPP_
opaque pointer class implements all physics on a MeshBlock
Definition: impl.hpp:46
std::shared_ptr< TurbulenceModel > pturb
Definition: impl.hpp:57
std::shared_ptr< Radiation > prad
Definition: impl.hpp:54
std::shared_ptr< CelestrialBody > planet
Definition: impl.hpp:58
std::shared_ptr< ImplicitSolver > phevi
Definition: impl.hpp:52
std::shared_ptr< Scheduler > scheduler
Definition: impl.hpp:66
std::vector< std::weak_ptr< MeshOutputGroup > > mesh_outputs_
Definition: impl.hpp:89
Real stellar_distance_au_
Definition: impl.hpp:92
auto & GetFITSOutputGroups() const
Definition: impl.hpp:80
std::shared_ptr< Tracer > ptracer
Definition: impl.hpp:56
auto & GetMeshOutputGroups() const
Definition: impl.hpp:79
Real GetDistanceInAu() const
Definition: impl.hpp:77
std::vector< std::shared_ptr< Inversion > > all_fits
Definition: impl.hpp:62
void MapScalarsConserved(AthenaArray< Real > &s)
Definition: impl.cpp:92
std::shared_ptr< Decomposition > pdec
Definition: impl.hpp:51
Impl(MeshBlock *pmb, ParameterInput *pin)
Definition: impl.cpp:46
std::map< char const *, ExchangerBase * > exchangers_
Definition: impl.hpp:87
MeshBlock const * pmy_block_
Definition: impl.hpp:95
std::shared_ptr< Microphysics > pmicro
Definition: impl.hpp:53
AthenaArray< Real > du
public data
Definition: impl.hpp:49
std::shared_ptr< Chemistry > pchem
Definition: impl.hpp:55
ExchangerBase * GetExchanger(char const *name) const
Definition: impl.hpp:73
std::vector< std::shared_ptr< ParticleBase > > all_particles
Definition: impl.hpp:63
std::vector< std::weak_ptr< FITSOutputGroup > > fits_outputs_
Definition: impl.hpp:90
root-level management class for microphysics