Canoe
Comprehensive Atmosphere N' Ocean Engine
impl.cpp
Go to the documentation of this file.
1 // athena
2 #include <athena/athena.hpp>
3 #include <athena/hydro/hydro.hpp>
4 #include <athena/parameter_input.hpp>
5 
6 // canoe
7 #include <configure.hpp>
8 
9 // application
10 #include <application/application.hpp>
11 #include <application/exceptions.hpp>
12 
13 // harp
14 #include "harp/radiation.hpp"
15 #include "harp/radiation_band.hpp"
16 
17 // inversion
18 #include "inversion/inversion.hpp"
19 
20 // snap
25 
26 // microphysics
28 
29 // c3m
30 #include "c3m/chemistry.hpp"
31 
32 // tracer
33 #include "tracer/tracer.hpp"
34 
35 // n-body
36 #include "nbody/particles.hpp"
37 
38 // astro
40 
41 // canoe
42 #include "impl.hpp"
43 #include "index_map.hpp"
44 #include "virtual_groups.hpp"
45 
46 MeshBlock::Impl::Impl(MeshBlock *pmb, ParameterInput *pin) : pmy_block_(pmb) {
47  Application::Logger app("main");
48 
49  du.NewAthenaArray(NHYDRO, pmb->ncells3, pmb->ncells2, pmb->ncells1);
50 
51  // decomposition
52  pdec = std::make_shared<Decomposition>(pmb);
53 
54  // implicit methods
55  phevi = std::make_shared<ImplicitSolver>(pmb, pin);
56 
57  // microphysics
58  pmicro = std::make_shared<Microphysics>(pmb, pin);
59 
60  // radiation
61  prad = std::make_shared<Radiation>(pmb, pin);
62 
63  // chemistry
64  pchem = std::make_shared<Chemistry>(pmb, pin);
65 
66  // tracer
67  ptracer = std::make_shared<Tracer>(pmb, pin);
68 
69  // turbulence
70  pturb = TurbulenceFactory::Create(pmb, pin);
71 
72  // inversion queue
74 
75  // particle queue
77 
78  // scheduler
80 
81  // planet
82  planet = std::make_shared<CelestrialBody>(pin);
83 
84  // distance to parent star
85  stellar_distance_au_ = pin->GetOrAddReal("problem", "distance_au", 1.);
86  app->Log("Stellar distance = " + std::to_string(stellar_distance_au_) +
87  " au");
88 }
89 
91 
93  if (NCLOUD > 0) pmicro->u.InitWithShallowSlice(s, 4, 0, NCLOUD);
94 }
static AllInversions Create(MeshBlock *pmb, ParameterInput *pin)
Definition: inversion.cpp:124
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
Real stellar_distance_au_
Definition: impl.hpp:92
std::shared_ptr< Tracer > ptracer
Definition: impl.hpp:56
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::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
std::vector< std::shared_ptr< ParticleBase > > all_particles
Definition: impl.hpp:63
static AllParticles Create(MeshBlock *pmb, ParameterInput *pin)
Definition: particles.cpp:39
static SchedulerPtr Create(MeshBlock *pmb, ParameterInput *pin)
Definition: schedulers.cpp:54
static TurbulenceModelPtr Create(MeshBlock *pmb, ParameterInput *pin)