Peano
Loading...
Searching...
No Matches
MassAccumulator.h
Go to the documentation of this file.
1#pragma once
2
3
4#include <vector>
5
6#include "tarch/logging/Log.h"
8
9
10namespace applications {
11 namespace exahype2 {
12 namespace euler {
13 namespace sphericalaccretion {
14 class MassAccumulator;
15 } // namespace sphericalaccretion
16 } // namespace euler
17 } // namespace exahype2
18} // namespace applications
19
20
56private:
58
60
61 const double _shellWidth;
62 const double _threshold;
63
67 std::vector<double> _currentMass;
68
72 std::vector<double> _previousMassAccumulated;
73
75
80 int getBucket(double radius) const;
81
82public:
90 MassAccumulator(double shellWidth = 0.01, double threshold = 0.01);
91 void addMass(double mass, double radius);
92
100 double getMass_piecewiseConstantInterpolation(double radius) const;
101 double getMass_linearInterpolation(double radius) const;
102
142
155 double getMaxRelevantRadius() const;
156
163 double getTotalMass() const;
164};
int getBucket(double radius) const
Identifies the right bucket.
std::vector< double > _previousMassAccumulated
Holds accumulated mass per shell.
double getMaxRelevantRadius() const
Return the biggest radius which contributes towards mass.
void finishAccumulation()
Finalise data accumulation for next time step.
double getMass_piecewiseConstantInterpolation(double radius) const
If you try to read the mass for a distance where we had no accumulation yet, then this routine return...
double getTotalMass() const
This routine returns the total mass.
MassAccumulator(double shellWidth=0.01, double threshold=0.01)
Log Device.
Definition Log.h:517
Definition euler.py:1
This file is part of the ExaHyPE 2 project within Peano 4.
Definition __init__.py:1