Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
ITAPropagationPathSim
Commits
6c2c5a27
Commit
6c2c5a27
authored
May 04, 2020
by
Philipp Schäfer
Browse files
ART - AdaptiveRayGrid
- bugfix
parent
ce99275c
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/ITAPropagationPathSim/AtmosphericRayTracing/EigenraySearch/AdaptiveRayGrid.h
View file @
6c2c5a27
...
...
@@ -16,8 +16,8 @@
*
*/
#ifndef IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_
RAYRESOLUTIONADAPTER
#define IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_
RAYRESOLUTIONADAPTER
#ifndef IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_
ADAPTIVERAYGRID
#define IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_
ADAPTIVERAYGRID
#include <ITAPropagationPathSim/AtmosphericRayTracing/RayGrid.h>
...
...
@@ -32,7 +32,7 @@ namespace ITAPropagationPathSim
{
namespace
EigenraySearch
{
class
CAdaptiveRayGrid
:
private
CRayGrid
class
ITA_PROPAGATION_PATH_SIM_API
CAdaptiveRayGrid
:
private
CRayGrid
{
private:
std
::
set
<
std
::
shared_ptr
<
CRay
>
>
vpNewRaysOfLastAdaptation
;
...
...
@@ -70,10 +70,10 @@ namespace ITAPropagationPathSim
//! By comparing the vector from three rays to the receiver, this decides between which two rays the eigenray is located and returns their indices
std
::
vector
<
int
>
FindAdvancedRayGridLimits1D
(
const
std
::
vector
<
std
::
shared_ptr
<
CRay
>
>&
pRays
,
const
int
idxMinDist
,
const
VistaVector3D
&
receiverPosition
,
const
double
&
threshold
)
const
;
void
DoubleRayResolution
();
std
::
vector
<
double
>
DoubleAngularResolution
(
const
std
::
vector
<
double
>&
angleVector
)
const
;
void
DoubleAngularResolution
(
std
::
vector
<
double
>&
angleVector
)
const
;
};
}
}
}
#endif //IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_RAYRESOLUTIONADAPTER
\ No newline at end of file
#endif //IW_ITA_PROPAGATIONPATHSIM_ART_EIGENRAYSEARCH_ADAPTIVERAYGRID
\ No newline at end of file
src/ITAPropagationPathSim/AtmosphericRayTracing/EigenraySearch/AdaptiveRayGrid.cpp
View file @
6c2c5a27
...
...
@@ -72,8 +72,8 @@ void CAdaptiveRayGrid::DoubleRayResolution()
if
(
NRays
()
<=
1
)
return
;
vdThetaDeg
=
DoubleAngularResolution
(
vdThetaDeg
);
vdPhiDeg
=
DoubleAngularResolution
(
vdPhiDeg
);
DoubleAngularResolution
(
vdThetaDeg
);
DoubleAngularResolution
(
vdPhiDeg
);
RayMatrix
newRayMatrix
(
NTheta
(),
RayVector
(
NPhi
()
)
);
vpNewRaysOfLastAdaptation
.
clear
();
...
...
@@ -101,18 +101,20 @@ void CAdaptiveRayGrid::DoubleRayResolution()
SetRayMatrix
(
newRayMatrix
);
}
std
::
vector
<
double
>
CAdaptiveRayGrid
::
DoubleAngularResolution
(
const
std
::
vector
<
double
>&
angleVector
)
const
void
CAdaptiveRayGrid
::
DoubleAngularResolution
(
std
::
vector
<
double
>&
angleVector
)
const
{
if
(
angleVector
.
size
()
<
2
)
return
angleVector
;
return
;
std
::
vector
<
double
>
returnVector
;
returnVector
.
push_back
(
angleVector
.
front
()
);
std
::
vector
<
double
>
newAngleVector
;
newAngleVector
.
reserve
(
2
*
angleVector
.
size
()
-
1
);
newAngleVector
.
push_back
(
angleVector
.
front
()
);
for
(
int
idxAngle
=
1
;
idxAngle
<
angleVector
.
size
();
idxAngle
++
)
{
const
double
angle1
=
angleVector
[
idxAngle
-
1
];
const
double
angle2
=
angleVector
[
idxAngle
];
return
Vector
.
push_back
(
(
angle1
+
angle2
)
/
2
);
return
Vector
.
push_back
(
angle2
);
const
double
&
angle1
=
angleVector
[
idxAngle
-
1
];
const
double
&
angle2
=
angleVector
[
idxAngle
];
newAngle
Vector
.
push_back
(
(
angle1
+
angle2
)
/
2
);
newAngle
Vector
.
push_back
(
angle2
);
}
angleVector
=
newAngleVector
;
}
tests/AtmosphericRayTracing/AdaptiveRayGridTest.cpp
View file @
6c2c5a27
...
...
@@ -73,6 +73,24 @@ void Test()
idx
++
;
}
//TODO: Create one test for each situation:
/*
2D-Grid:
- Ray in the middle
- Ray on the left/right phi-"border" of circular grid
- Ray on the theta/phi border of non-circular grid
- Ray at south / north pole
1D-Grid - Theta:
- Ray in the middle
- Ray at border of grid
- Ray at south / north pole
1D-Grid - Phi:
- Ray in the middle
- Ray at border of grid
*/
cout
<<
endl
<<
ray
->
InitialDirection
()
<<
endl
;
adaptiveRayGrid
.
ZoomIntoRay
(
ray
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment