problembase.h 3.44 KB
Newer Older
1
2
3
#ifndef PROBLEMBASE_H
#define PROBLEMBASE_H

4
#include "common/typedef.h"
5

steffen.schotthoefer's avatar
steffen.schotthoefer committed
6
7
8
9
10
// Forward Declaration
class Config;
class Physics;
class Mesh;

11
12
13
14
15
16
17
18
class ProblemBase
{

  protected:
    Config* _settings;
    Mesh* _mesh;
    Physics* _physics;

pia.stammer's avatar
pia.stammer committed
19
20
    std::vector<double> _density; /*! @brief: vector with patient densities */
    std::vector<double> _stoppingPower; /*! @brief: vector with stopping powers*/
21
22
23
24
25

    ProblemBase() = delete;

  public:
    /**
26
27
28
     * @brief GetScatteringXS gives back vector (each energy) of vectors (each grid cell)
     *        of scattering cross sections for materials defined by density and energies
     *        in vector energy
29
     * @param energy is the energy the cross section is queried for
30
     */
jannick.wolters's avatar
jannick.wolters committed
31
    virtual VectorVector GetScatteringXS( const Vector& energies ) = 0;
32
33

    /**
34
35
     * @brief GetTotalXS gives back vector of vectors of total cross sections for
     *        materials defined by density and energies in vector energy
36
     * @param energy is the energy the cross section is queried for
37
38
     * @param density is vector with patient densities (at different spatial cells)
     */
jannick.wolters's avatar
jannick.wolters committed
39
    virtual VectorVector GetTotalXS( const Vector& energies ) = 0;
pia.stammer's avatar
pia.stammer committed
40
    
41
42
43
44
45
46
47
48
49
50
51
52
    /**
     * @brief GetTotalXSE gives back vector of total cross sections for
     *        energies in vector energy
     * @param energy is the energy the cross section is queried for
     */
    virtual Vector GetTotalXSE( const Vector& energies ) { return Vector( 1 ); }

    /**
     * @brief GetScatteringXSE gives back vector (each energy) of scattering cross sections for energies
     *        in vector energy
     * @param energy is the energy the cross section is queried for
     */
Jonas Kusch's avatar
Jonas Kusch committed
53
54
    virtual std::vector<Matrix> GetScatteringXSE( const Vector& energies, const Matrix& angles ) {
        return std::vector<Matrix>( energies.size(), Matrix( angles.rows(), angles.columns() ) );
Jonas Kusch's avatar
Jonas Kusch committed
55
    }
56

Jonas Kusch's avatar
Jonas Kusch committed
57
58
59
60
61
62
63
    /**
     * @brief GetScatteringXSE gives back vector (each energy) of scattering cross sections for energies
     *        in vector energy
     * @param energy is the energy the cross section is queried for
     */
    virtual VectorVector GetScatteringXSE( const Vector& energies, const Vector& angles );

jannick.wolters's avatar
jannick.wolters committed
64
    /**
65
66
     * @brief GetExternalSource gives back vector of vectors of source terms for each
     *        energy, cell and angle
jannick.wolters's avatar
jannick.wolters committed
67
68
     * @param energies is vector with energies
     */
jannick.wolters's avatar
jannick.wolters committed
69
    virtual std::vector<VectorVector> GetExternalSource( const Vector& energies ) = 0;
jannick.wolters's avatar
jannick.wolters committed
70

71
    /**
72
73
     * @brief GetStoppingPower gives back vector of vectors of stopping powers for
     *        materials defined by density and energies in vector energy
74
75
     * @param energies is vector with energies
     */
76
    virtual Vector GetStoppingPower( const Vector& energies );
77

Jonas Kusch's avatar
Jonas Kusch committed
78
79
80
81
82
83
    /**
     * @brief GetDensity gives back vector of densities for every spatial cell
     * @param cellMidPoints is vector with cell mid points
     */
    virtual std::vector<double> GetDensity( const VectorVector& cellMidPoints );

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
    /**
     * @brief Setup the initial condition for the flux psi
     */
    virtual VectorVector SetupIC() = 0;

    /**
     * @brief Physics constructor
     * @param settings stores all needed user information
     */
    ProblemBase( Config* settings, Mesh* mesh );
    virtual ~ProblemBase();

    /**
     * @brief Create constructor
     * @param settings stores all needed information
     * @return pointer to Physics
     */
    static ProblemBase* Create( Config* settings, Mesh* mesh );
};

#endif