Commit be667c2b authored by Philipp Schäfer's avatar Philipp Schäfer

ART - EigenraySearch

- added setting to (de)activate advanced
- Engine now actually uses advanced ray zooming
- spreading loss is now calculated for sound pressure and not intensity
parent 3a55471d
......@@ -29,23 +29,24 @@ namespace ITAPropagationPathSim
namespace EigenraySearch {
struct ITA_PROPAGATION_PATH_SIM_API RayAdaptationSettings {
struct {
int maxNAdaptations = 15; //< Abort after X adaptations of the ray resolution
double minAngleResolutionDeg = 0.001; //< []
int maxNAdaptations = 15; //< Abort after N adaptations of the ray resolution
double minAngleResolutionDeg = 0.001; //< Abort if angle between neighboring rays is below this value []
} abort;
struct {
double maxReceiverRadius = 1; //< [m]
double maxSourceReceiverAngle = 1; //< []
double maxAngleForGeomSpreading = 0.01; //< []
double maxReceiverRadius = 1; //< Maximum radius of receiver sphere [m]
double maxSourceReceiverAngle = 1; //< Maximum angle between vectors from source to receiver point and receiver sphere []
double maxAngleForGeomSpreading = 0.01; //< Angular resolution of rays which is required to calculate spreading loss []
} accuracy;
struct {
double threshold = 0.1; //< [0 1]
bool bActive = true; //< Switch to enable/disable advanced ray zooming
double threshold = 0.1; //< Threshold between 0 and 2 above which advanced ray zooming is performed (0 = always, 2 = never)
} advancedRayZooming;
};
struct ITA_PROPAGATION_PATH_SIM_API RayTracingAbortSettings {
int maxReflectionOrder = 3; //< Maximum considered order of reflections
double maxTime = 30; //< [s]
int maxReflectionOrder = 1; //< Maximum considered order of reflections
double maxTime = 30; //< Maximum propagation time of rays [s]
};
struct ITA_PROPAGATION_PATH_SIM_API Settings {
RayTracingAbortSettings rayTracing;
......
......@@ -2,6 +2,7 @@
// STD
#include <algorithm>
#include <cmath>
using namespace ITAPropagationPathSim::AtmosphericRayTracing;
......@@ -154,7 +155,11 @@ EigenraySearch::RayPtr EigenraySearch::CAdaptiveWorker::Run(const ITAGeo::CStrat
m_pMinDistanceRay = FindMinimumDistanceRay(m_adaptiveRayGrid.UniqueRays(), m_iActiveReflexionOrder);
while (!EigenrayAccuracyReached())
{
m_adaptiveRayGrid.ZoomIntoRay(m_pMinDistanceRay);
if (m_rayAdaptationSettings.advancedRayZooming.bActive)
m_adaptiveRayGrid.ZoomIntoRay(m_pMinDistanceRay, VirtualReceiverPosition(), m_rayAdaptationSettings.advancedRayZooming.threshold);
else
m_adaptiveRayGrid.ZoomIntoRay(m_pMinDistanceRay);
m_simulationEngine.Run(atmosphere, m_adaptiveRayGrid.NewRaysOfLastAdaptation());
m_pMinDistanceRay = FindMinimumDistanceRay(m_adaptiveRayGrid.UniqueRays(), m_iActiveReflexionOrder);
m_nAdaptations++;
......@@ -220,6 +225,6 @@ void EigenraySearch::CAdaptiveWorker::CalculateEigenraySpreadingLoss(const ITAGe
const double cReceiver = atmosphere.SpeedOfSound(zReceiver);
const double cRef = atmosphere.SpeedOfSound(zRef);
m_pMinDistanceRay->SetSpreadingLoss( surfaceRef/surfaceReceiver * cReceiver/cRef );
m_pMinDistanceRay->SetSpreadingLoss( std::sqrt(surfaceRef/surfaceReceiver * cReceiver/cRef) );
}
#pragma endregion
\ No newline at end of file
......@@ -137,16 +137,16 @@ void TestSourceReceiverAzimuthAbove324Deg()
int main(int iNumInArgs, char* pcInArgs[])
{
//Disable multi-threading for debugging purposes
omp_set_num_threads(1);
//Disable multi-threading for debugging purposes
omp_set_num_threads(1);
TestSourceReceiverAzimuthAbove324Deg();
const CStratifiedAtmosphere homAtmosphere = GetHomogeneousAtmosphere();
const CStratifiedAtmosphere inhomAtmosphere = GetInhomogeneousAtmosphere();
const CStratifiedAtmosphere homAtmosphere = GetHomogeneousAtmosphere();
const CStratifiedAtmosphere inhomAtmosphere = GetInhomogeneousAtmosphere();
TestReceiverNearGroundSourceElevation(homAtmosphere, "Homogeneous");
TestReceiverNearGroundSourceElevation(inhomAtmosphere, "Inhomogeneous");
TestReceiverNearGroundSourceElevation(homAtmosphere, "Homogeneous");
TestReceiverNearGroundSourceElevation(inhomAtmosphere, "Inhomogeneous");
TestReceiverNearGroundSourceAzimuth(inhomAtmosphere, "Inhomogeneous");
TestSourceReceiverAzimuthAbove324Deg();
}
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