criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
Loading...
Searching...
No Matches
Prob.H
Go to the documentation of this file.
1
15#ifndef _PROB_H_
16#define _PROB_H_
17
18#include <string>
19#include <vector>
20#include "../Core/CRPacket.H"
21#include "../Core/CRSource.H"
22#include "../Core/CRTree.H"
23#include "../Core/Geometry.H"
24#include "../Gas/Gas.H"
25#include "../Gas/UniformGas.H"
26#include "../IO/ParmParser.H"
27#include "../Propagation/Propagation.H"
28#include "../Propagation/PropPowerlaw.H"
29#include "../Utils/RngThread.H"
30#include "../Utils/Types.H"
31#include "../Utils/Vec3.H"
32
33namespace criptic {
34
45 class Prob {
46
47 public:
48
55 Prob(const ParmParser& pp_,
56 const Geometry& geom_,
57 RngThread& rng_) : pp(pp_), geom(geom_), rng(rng_)
58 { }
59
68 virtual gas::Gas *initGas() {
69 return new gas::UniformGas(pp);
70 }
71
82
92 virtual void initPackets(std::vector<RealVec>& x,
93 std::vector<CRPacket>& packets)
94 { }
95
105 virtual void initSources(std::vector<RealVec>& x,
106 std::vector<CRSource>& sources)
107 { }
108
117 virtual void userSetup()
118 { }
119
133 virtual void userWork(const Real t,
134 Real& dt,
135 gas::Gas& gasBG,
137 CRTree& tree)
138 { }
139
155 virtual void userRead(const std::string& filename,
156 const int step,
157 Real& t,
158 Real& dt,
159 CRTree& tree)
160 { }
161
176 virtual void userWrite(const int step,
177 const Real t,
178 const Real dt,
179 const int chkNum,
180 const std::string& baseChkName,
181 const CRTree& tree)
182 { }
183
197 virtual void userFinalize(const Real t,
198 gas::Gas& gasBG,
200 CRTree& tree)
201 { }
202
203 protected:
204
205 const ParmParser& pp;
207 const Geometry& geom;
208 const RngThread& rng;
210 };
211
226 const criptic::Geometry& geom,
227 criptic::RngThread& rng);
228}
229
230#endif
231// _PROB_H_
A class to manage CR packets and sources.
Definition CRTree.H:44
A class that describes the geometry of a calculation.
Definition Geometry.H:32
Class to parse the criptic input deck.
Definition ParmParser.H:37
A class to manage user-defined problem setup and work.
Definition Prob.H:45
virtual void userRead(const std::string &filename, const int step, Real &t, Real &dt, CRTree &tree)
Perform arbitrary user-defined input after reading checkpoint.
Definition Prob.H:155
const ParmParser & pp
Definition Prob.H:205
Prob(const ParmParser &pp_, const Geometry &geom_, RngThread &rng_)
Set up the problem class.
Definition Prob.H:55
virtual void initSources(std::vector< RealVec > &x, std::vector< CRSource > &sources)
Set initial CR source locations and properties.
Definition Prob.H:105
virtual void initPackets(std::vector< RealVec > &x, std::vector< CRPacket > &packets)
Set initial packet locations and properties.
Definition Prob.H:92
virtual propagation::Propagation * initProp()
Set up the CR propagation model.
Definition Prob.H:79
virtual void userFinalize(const Real t, gas::Gas &gasBG, propagation::Propagation &prop, CRTree &tree)
Perform arbitrary user-defined work at the end of a run.
Definition Prob.H:197
const Geometry & geom
Definition Prob.H:207
virtual void userWork(const Real t, Real &dt, gas::Gas &gasBG, propagation::Propagation &prop, CRTree &tree)
Perform arbitrary user-defined work every time step.
Definition Prob.H:133
const RngThread & rng
Definition Prob.H:208
virtual void userSetup()
Perform arbitrary user-defined work at startup.
Definition Prob.H:117
virtual gas::Gas * initGas()
Set properties of background gas.
Definition Prob.H:68
virtual void userWrite(const int step, const Real t, const Real dt, const int chkNum, const std::string &baseChkName, const CRTree &tree)
Perform arbitrary user-defined work after writing a checkpoint.
Definition Prob.H:176
Thread-safe random number generator.
Definition RngThread.H:39
Interface class to describe background gas.
Definition Gas.H:44
A class to describe a uniform background gas.
Definition UniformGas.H:26
A simple powerlaw CR propagation model.
Definition PropPowerlaw.H:46
Interface to describe the CR propagation model.
Definition Propagation.H:79
The primary namespace for criptic objects.
Definition AdvancePacket.H:25
Prob * initProb(const criptic::ParmParser &pp, const criptic::Geometry &geom, criptic::RngThread &rng)
Function to return the Prob object.
double Real
Definition Types.H:38