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

ART

- renaming of ray grid adaptation class
parent cac045d8
......@@ -5,22 +5,22 @@
using namespace ITAPropagationPathSim::AtmosphericRayTracing;
using namespace ITAPropagationPathSim::AtmosphericRayTracing::EigenraySearch;
void CRayGridAdaptation::Reset(const CRayGrid& rayGrid)
void CAdaptiveRayGrid::Reset(const CRayGrid& rayGrid)
{
*this = rayGrid;
vpNewRaysOfLastAdaptation.clear();
}
void CRayGridAdaptation::ZoomIntoRay(const std::shared_ptr<CRay>& pRay)
void CAdaptiveRayGrid::ZoomIntoRay(const std::shared_ptr<CRay>& pRay)
{
if(!Contains(pRay) /*|| NRays() <= 1*/)
ITA_EXCEPT_INVALID_PARAMETER("Given ray is not part of the adapted grid.");
ITA_EXCEPT_INVALID_PARAMETER("Given ray is not part of the adaptive ray grid.");
SetToSurroundingGrid(pRay);
DoubleRayResolution();
}
void CRayGridAdaptation::ZoomIntoRay(const std::shared_ptr<CRay>& pRay, const int idxMinDist, const VistaVector3D& receiverPosition, const double& threshold)
void CAdaptiveRayGrid::ZoomIntoRay(const std::shared_ptr<CRay>& pRay, const int idxMinDist, const VistaVector3D& receiverPosition, const double& threshold)
{
if (!Contains(pRay) /*|| NRays() <= 1*/)
ITA_EXCEPT_INVALID_PARAMETER("Given ray is not part of the adapted grid.");
......@@ -30,7 +30,7 @@ void CRayGridAdaptation::ZoomIntoRay(const std::shared_ptr<CRay>& pRay, const in
DoubleRayResolution();
}
void CRayGridAdaptation::SetAdvancedRayGridLimits(const std::shared_ptr<CRay>& pRay, const int idxMinDist, const VistaVector3D& receiverPosition, const double& threshold)
void CAdaptiveRayGrid::SetAdvancedRayGridLimits(const std::shared_ptr<CRay>& pRay, const int idxMinDist, const VistaVector3D& receiverPosition, const double& threshold)
{
if (NPhi() > 3) // There can be more than three rays if pRay is located at a pole
return;
......@@ -40,7 +40,7 @@ void CRayGridAdaptation::SetAdvancedRayGridLimits(const std::shared_ptr<CRay>& p
FilterDirections(thetaIdxVec, phiIdxVec);
}
std::vector<int> CRayGridAdaptation::FindAdvancedRayGridLimits1D(const std::vector<std::shared_ptr<CRay>>& rayVector, const int idxMinDist, const VistaVector3D& receiverPosition, const double& threshold) const
std::vector<int> CAdaptiveRayGrid::FindAdvancedRayGridLimits1D(const std::vector<std::shared_ptr<CRay>>& rayVector, const int idxMinDist, const VistaVector3D& receiverPosition, const double& threshold) const
{
if (rayVector.size() == 1)
return { 0 };
......@@ -67,7 +67,7 @@ std::vector<int> CRayGridAdaptation::FindAdvancedRayGridLimits1D(const std::vect
return {1, 2};
}
void CRayGridAdaptation::DoubleRayResolution()
void CAdaptiveRayGrid::DoubleRayResolution()
{
if (NRays() <= 1)
return;
......@@ -101,7 +101,7 @@ void CRayGridAdaptation::DoubleRayResolution()
InitRayVectorFromRayMatrix();
}
std::vector<double> CRayGridAdaptation::DoubleAngularResolution(const std::vector<double>& angleVector) const
std::vector<double> CAdaptiveRayGrid::DoubleAngularResolution(const std::vector<double>& angleVector) const
{
if (angleVector.size() < 2)
return angleVector;
......
......@@ -28,13 +28,13 @@ namespace ITAPropagationPathSim
{
namespace EigenraySearch
{
class CRayGridAdaptation : private CRayGrid
class CAdaptiveRayGrid : private CRayGrid
{
private:
std::vector< std::shared_ptr<CRay> > vpNewRaysOfLastAdaptation;
public:
CRayGridAdaptation() {}
CRayGridAdaptation(const CRayGrid& rayGrid) : CRayGrid(rayGrid) {}
CAdaptiveRayGrid() {}
CAdaptiveRayGrid(const CRayGrid& rayGrid) : CRayGrid(rayGrid) {}
public:
void Reset(const CRayGrid& rayGrid);
......
#include "Worker.h"
// ITA includes
//#include <ITAPropagationPathSim/AtmosphericRayTracing/Simulation/Engine.h>
//#include "RayResolutionAdapter.h"
//#include <ITAPropagationPathSim/AtmosphericRayTracing/RayGrid.h>
// Vista includes
//#include <VistaInterProcComm/Concurrency/VistaThread.h>
......@@ -113,7 +110,7 @@ bool EigenraySearch::CAdaptiveWorker::AbortRequested(const RayPtr& pRay) {
}
EigenraySearch::CAdaptiveWorker::CAdaptiveWorker(const CRayGrid& rayGrid, const VistaVector3D& receiverPosition, const Simulation::Settings& simSettings, const Settings& eigenraySettings, const int activeReflectionOrder)
: rayResolutionAdapter(rayGrid), v3ReceiverPosition(receiverPosition), iActiveReflexionOrder(activeReflectionOrder), rayAdaptationSettings(eigenraySettings.rayAdaptation), rayTracingAbortSettings(eigenraySettings.rayTracing)
: adaptiveRayGrid(rayGrid), v3ReceiverPosition(receiverPosition), iActiveReflexionOrder(activeReflectionOrder), rayAdaptationSettings(eigenraySettings.rayAdaptation), rayTracingAbortSettings(eigenraySettings.rayTracing)
{
simulationEngine.settings = simSettings;
......@@ -124,12 +121,12 @@ EigenraySearch::CAdaptiveWorker::CAdaptiveWorker(const CRayGrid& rayGrid, const
EigenraySearch::RayPtr EigenraySearch::CAdaptiveWorker::Run(const ITAGeo::CStratifiedAtmosphere& atmosphere)
{
simulationEngine.Run(atmosphere, rayResolutionAdapter.Rays());
simulationEngine.Run(atmosphere, adaptiveRayGrid.Rays());
while (!EigenrayAccuracyReached())
{
rayResolutionAdapter.ZoomIntoRay(pMinDistanceRay);
simulationEngine.Run(atmosphere, rayResolutionAdapter.NewRaysOfLastAdaptation());
adaptiveRayGrid.ZoomIntoRay(pMinDistanceRay);
simulationEngine.Run(atmosphere, adaptiveRayGrid.NewRaysOfLastAdaptation());
nAdaptations++;
}
......
......@@ -85,7 +85,7 @@ namespace ITAPropagationPathSim
Simulation::CEngine simulationEngine;
RayTracingAbortSettings rayTracingAbortSettings;
CRayGridAdaptation rayResolutionAdapter;
CAdaptiveRayGrid adaptiveRayGrid;
VistaVector3D v3ReceiverPosition;
unsigned int iActiveReflexionOrder;
RayAdaptationSettings rayAdaptationSettings;
......
Supports Markdown
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