Settings.h 2.15 KB
Newer Older
Philipp Schäfer's avatar
Philipp Schäfer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* ----------------------------------------------------------------
*
*		ITA geometrical acoustics
*		(c) Copyright Institute of Technical Acoustics (ITA)
*		RWTH Aachen University, Germany, 2015-2019
*
* ----------------------------------------------------------------
* 				    ____  __________  _______
*				   //  / //__   ___/ //  _   |
*				  //  /    //  /    //  /_|  |
*				 //  /    //  /    //  ___   |
*				//__/    //__/    //__/   |__|
*
* ----------------------------------------------------------------
*
*/

#ifndef IW_ITA_PROPAGATIONPATHSIM_ART_SIMULATION_SETTINGS
#define IW_ITA_PROPAGATIONPATHSIM_ART_SIMULATION_SETTINGS

#include <ITAPropagationPathSim/Definitions.h>

// ITA includes
#include <ITAPropagationPathSim/AtmosphericRayTracing/Rays.h>

// STD
#include <memory>

namespace ITAPropagationPathSim
{
	namespace AtmosphericRayTracing
	{
		namespace Simulation {
			class ITA_PROPAGATION_PATH_SIM_API IAbortCriterion
			{
			public:
				//! Returns true if the abort criterion for tracing the given ray is reached
				virtual bool AbortRequested(const std::shared_ptr<CRay>& pRay) = 0;
			};
			class ITA_PROPAGATION_PATH_SIM_API CAbortAtMaxTime : public IAbortCriterion
			{
			private:
				double dTMax;
			public:
				CAbortAtMaxTime(double tMax = 30) : dTMax(tMax) {}
				bool AbortRequested(const std::shared_ptr<CRay>& pRay) { return pRay->LastTimeStamp() >= dTMax; }
			};

			enum ITA_PROPAGATION_PATH_SIM_API SolverMethod
			{
				EULER = 0,	//!< Euler method
				RUNGE_KUTTA	//!< Classical Runge_Kutta method (RK4)
			};


			struct ITA_PROPAGATION_PATH_SIM_API AdaptiveIntegrationSettings {
				bool bActive = true;	//!< If this is set to false, the adaptation is bypassed and the integration step size is therefore constant
				double dMaxError = 0.015;
				double dUncriticalError = 0.005;
				unsigned int iMaxAdaptationLevel = 32; //! Maximum times, the time step is halfed
			};

			struct ITA_PROPAGATION_PATH_SIM_API SimulationSettings {
				SolverMethod solverMethod = SolverMethod::EULER;
				double dIntegrationTimeStep = 0.1;
				AdaptiveIntegrationSettings adaptiveIntegration;
			};
		}
	}
}

#endif //IW_ITA_PROPAGATIONPATHSIM_ART_SIMULATION_SETTINGS