Commit a5349abc authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

Atmospheric Ray Tracing

- added first version of API for Simulation Engine
parent ce37fa28
/*
* ----------------------------------------------------------------
*
* ITA geometrical acoustics
* (c) Copyright Institute of Technical Acoustics (ITA)
* RWTH Aachen University, Germany, 2015-2019
*
* ----------------------------------------------------------------
* ____ __________ _______
* // / //__ ___/ // _ |
* // / // / // /_| |
* // / // / // ___ |
* //__/ //__/ //__/ |__|
*
* ----------------------------------------------------------------
*
*/
#ifndef IW_ITA_PROPAGATIONPATHSIM_ART_ENGINE
#define IW_ITA_PROPAGATIONPATHSIM_ART_ENGINE
#include <ITAPropagationPathSim/Definitions.h>
// Vista includes
#include <VistaBase/VistaVector3D.h>
// ITA includes
#include <ITAPropagationPathSim/AtmosphericRayTracing/ODESolver.h>
#include <ITAPropagationPathSim/AtmosphericRayTracing/Rays.h>
#include <ITAGeo/Atmosphere/StratifiedAtmosphere.h>
namespace ITAPropagationPathSim
{
namespace AtmosphericRayTracing
{
struct SimulationSettings {
ODESolver::SolverMethod solverMethod = ODESolver::EULER;
double dTMax = 30;
double dIntegrationTimeStep = 0.1;
IAbortCriterion* pAbortCriterion = nullptr; //!< Pointer to external abort criterion. If this is a NULL-pointer, it is ignored.
};
class ITA_PROPAGATION_PATH_SIM_API IAbortCriterion
{
virtual bool Abort(const CRay& ray) const = 0;
};
class ITA_PROPAGATION_PATH_SIM_API CSimulationEngine
{
private:
class CIntegrationStepAdaptor
{
public:
bool bActive = true; //!< If this is set to false, this class is bypassed and the integration step size is therefore not adapted
double dMaxError = 0.015;
double dUncriticalError = 0.005;
CIntegrationStepAdaptor() {}
//CIntegrationStepAdaptor(double maxError, double uncriticalError) : dMaxError(maxError), dUncriticalError(uncriticalError) {}
};
CIntegrationStepAdaptor integrationStepAdaptor;
class CWorker
{
private:
CRay& rRay;
const SimulationSettings& rSettings;
const CIntegrationStepAdaptor& rIntegrationStepAdaptor;
public:
CWorker(CRay& ray, const SimulationSettings& settings, const CIntegrationStepAdaptor& adaptor) : rRay(ray), rSettings(settings), rIntegrationStepAdaptor(adaptor){}
void TraceRay();
};
public:
SimulationSettings settings;
VistaVector3D v3SourcePosition;
std::vector<VistaVector3D> v3RayDirections;
private:
std::vector<CRay> rays;
public:
CSimulationEngine() {}
virtual ~CSimulationEngine() {}
public:
void Run();
private:
void InitRays();
CRay TraceRay(const VistaVector3D& v3Direction);
};
}
}
#endif //IW_ITA_PROPAGATIONPATHSIM_ART_ENGINE
\ No newline at end of file
......@@ -6,6 +6,8 @@ set( RelativeSourceGroup "Header Files\\ITAPropagationPathSim\\AtmosphericRayTra
set( DirFiles
ODESolver.h
SimulationEngine.h
Rays.h
)
set( DirFiles_SourceGroup "${RelativeSourceGroup}" )
......
#include <ITAPropagationPathSim/AtmosphericRayTracing/SimulationEngine.h>
// ITA includes
#include <ITAPropagationPathSim/AtmosphericRayTracing/ODESolver.h>
// STD
//#include <cmath>
using namespace ITAPropagationPathSim::AtmosphericRayTracing;
......@@ -6,6 +6,7 @@ set( RelativeSourceGroup "Source Files\\ITAPropagationPathSim\\AtmosphericRayTra
set( DirFiles
ODESolver.cpp
SimulationEngine.cpp
)
set( DirFiles_SourceGroup "${RelativeSourceGroup}" )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment