Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
I
ITAPropagationModels
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Institute of Technical Acoustics (ITA)
ITAPropagationModels
Commits
8eb40b23
Commit
8eb40b23
authored
Dec 11, 2018
by
Dipl.-Ing. Jonas Stienen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Applying refactoring from Kirchhoff to Maekawa for benchmarks
parent
5665b91c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
17 deletions
+19
-17
benchmarks/DiffractionModelsBenchmark.cpp
benchmarks/DiffractionModelsBenchmark.cpp
+19
-17
No files found.
benchmarks/DiffractionModelsBenchmark.cpp
View file @
8eb40b23
...
...
@@ -21,7 +21,7 @@
#include <ITAPropagationModels/Base.h>
#include <ITAPropagationModels/
Kirchhoff
.h>
#include <ITAPropagationModels/
Maekawa
.h>
#include <ITAPropagationModels/UTD.h>
#include <ITAPropagationModels/Svensson.h>
...
...
@@ -82,33 +82,33 @@ void benchmark_single_wedge()
oReceiver
->
qOrient
=
VistaQuaternion
(
0
,
1
,
0
,
0
);
oReceiver
->
vPos
.
SetValues
(
-
.4
f
,
.6
f
,
.1
f
);
auto
o
Wedge
=
std
::
make_shared
<
ITAGeo
::
CITADiffractionWedgeAperture
>
();
o
Wedge
->
v3MainWedgeFaceNormal
=
VistaVector3D
(
1.0
f
,
1.0
f
,
.0
f
).
GetNormalized
();
o
Wedge
->
v3OppositeWedgeFaceNormal
=
VistaVector3D
(
-
1.0
f
,
1.0
f
,
.0
f
).
GetNormalized
();
o
Wedge
->
v3VertextStart
.
SetValues
(
.0
f
,
1.0
f
,
-
1.0
f
);
o
Wedge
->
v3VertextEnd
.
SetValues
(
.0
f
,
1.0
f
,
1.0
f
);
auto
p
Wedge
=
std
::
make_shared
<
ITAGeo
::
CITADiffractionWedgeAperture
>
();
p
Wedge
->
v3MainWedgeFaceNormal
=
VistaVector3D
(
1.0
f
,
1.0
f
,
.0
f
).
GetNormalized
();
p
Wedge
->
v3OppositeWedgeFaceNormal
=
VistaVector3D
(
-
1.0
f
,
1.0
f
,
.0
f
).
GetNormalized
();
p
Wedge
->
v3VertextStart
.
SetValues
(
.0
f
,
1.0
f
,
-
1.0
f
);
p
Wedge
->
v3VertextEnd
.
SetValues
(
.0
f
,
1.0
f
,
1.0
f
);
ITAGeoUtils
::
CalculateDiffractionAperturePoint
(
oWedge
->
GetEdgeRay
(),
oSource
->
v3InteractionPoint
,
oReceiver
->
v3InteractionPoint
,
o
Wedge
->
v3AperturePoint
);
ITAGeoUtils
::
CalculateDiffractionAperturePoint
(
pWedge
->
GetEdgeRay
(),
oSource
->
v3InteractionPoint
,
oReceiver
->
v3InteractionPoint
,
p
Wedge
->
v3AperturePoint
);
if
(
!
ITAGeoUtils
::
IsDiffractionAperturePointInRange
(
oWedge
->
v3VertextStart
,
oWedge
->
v3VertextEnd
,
o
Wedge
->
v3AperturePoint
)
)
if
(
!
ITAGeoUtils
::
IsDiffractionAperturePointInRange
(
pWedge
->
v3VertextStart
,
pWedge
->
v3VertextEnd
,
p
Wedge
->
v3AperturePoint
)
)
ITA_EXCEPT_INVALID_PARAMETER
(
"Aperture point over wedge is outside edge vertices"
);
if
(
!
o
Wedge
->
IsOutsideWedge
(
oSource
->
v3InteractionPoint
)
)
if
(
!
p
Wedge
->
IsOutsideWedge
(
oSource
->
v3InteractionPoint
)
)
ITA_EXCEPT_INVALID_PARAMETER
(
"Source point is inside wedge (solid part)"
);
if
(
!
o
Wedge
->
IsOutsideWedge
(
oReceiver
->
v3InteractionPoint
)
)
if
(
!
p
Wedge
->
IsOutsideWedge
(
oReceiver
->
v3InteractionPoint
)
)
ITA_EXCEPT_INVALID_PARAMETER
(
"Receiver point is inside wedge (solid part)"
);
ITAGeo
::
CPropagationPath
oPropPath
;
oPropPath
.
push_back
(
oSource
);
oPropPath
.
push_back
(
o
Wedge
);
oPropPath
.
push_back
(
p
Wedge
);
oPropPath
.
push_back
(
oReceiver
);
cout
<<
"Path: "
<<
oPropPath
<<
endl
;
// Kirchhoff
if
(
Kirchhoff
::
IsApplicable
(
oPropPath
)
)
if
(
Maekawa
::
IsApplicable
(
oSource
->
v3InteractionPoint
,
oReceiver
->
v3InteractionPoint
,
pWedge
)
)
ITA_EXCEPT_INVALID_PARAMETER
(
"Kirchhoff model can not be applied for this propagation path."
);
ITAStopWatch
sw
;
...
...
@@ -120,7 +120,9 @@ void benchmark_single_wedge()
for
(
int
i
=
0
;
i
<
1e8
;
i
++
)
{
sw
.
start
();
Kirchhoff
::
CalculateDiffractionFilter
(
oPropPath
,
oTF
,
g_fSpeedOfSound
);
double
dDir
,
dDet
;
Maekawa
::
GetDirectLengthAndDetourLength
(
oSource
->
v3InteractionPoint
,
oReceiver
->
v3InteractionPoint
,
pWedge
,
dDir
,
dDet
);
Maekawa
::
CalculateDiffractionFilter
(
dDir
,
dDet
,
oTF
,
g_fSpeedOfSound
);
sw
.
stop
();
}
double
dStopTime
=
ITAClock
::
getDefaultClock
()
->
getTime
();
...
...
@@ -137,7 +139,7 @@ void benchmark_single_wedge()
for
(
int
i
=
0
;
i
<
1e6
;
i
++
)
{
sw
.
start
();
UTD
::
CalculateDiffractionFilter
(
oSource
->
v3InteractionPoint
,
oReceiver
->
v3InteractionPoint
,
o
Wedge
,
oTF
,
iMethod
,
g_fSpeedOfSound
);
UTD
::
CalculateDiffractionFilter
(
oSource
->
v3InteractionPoint
,
oReceiver
->
v3InteractionPoint
,
p
Wedge
,
oTF
,
iMethod
,
g_fSpeedOfSound
);
sw
.
stop
();
}
dStopTime
=
ITAClock
::
getDefaultClock
()
->
getTime
();
...
...
@@ -150,14 +152,14 @@ void benchmark_single_wedge()
sw
.
reset
();
cout
<<
"Starting Biot-Tolstoy-Medwin-Svensson model benchmark:"
<<
endl
;
dStartTime
=
ITAClock
::
getDefaultClock
()
->
getTime
();
const
float
fMinDelay
=
o
Wedge
->
GetMinimumWavefrontDelayTime
(
oSource
->
v3InteractionPoint
,
oReceiver
->
v3InteractionPoint
,
g_fSpeedOfSound
);
const
float
fMaxDelay
=
o
Wedge
->
GetMaximumWavefrontDelayTime
(
oSource
->
v3InteractionPoint
,
oReceiver
->
v3InteractionPoint
,
g_fSpeedOfSound
);
const
float
fMinDelay
=
p
Wedge
->
GetMinimumWavefrontDelayTime
(
oSource
->
v3InteractionPoint
,
oReceiver
->
v3InteractionPoint
,
g_fSpeedOfSound
);
const
float
fMaxDelay
=
p
Wedge
->
GetMaximumWavefrontDelayTime
(
oSource
->
v3InteractionPoint
,
oReceiver
->
v3InteractionPoint
,
g_fSpeedOfSound
);
const
int
iIRLength
=
(
int
)
ceil
(
float
(
fMaxDelay
-
fMinDelay
)
*
g_fSampleRate
);
ITABase
::
CFiniteImpulseResponse
oIR
(
iIRLength
,
g_fSampleRate
,
true
);
for
(
int
i
=
0
;
i
<
1e4
;
i
++
)
{
sw
.
start
();
Svensson
::
CalculateDiffractionIR
(
oSource
->
v3InteractionPoint
,
oReceiver
->
v3InteractionPoint
,
o
Wedge
,
oIR
,
g_fSpeedOfSound
);
Svensson
::
CalculateDiffractionIR
(
oSource
->
v3InteractionPoint
,
oReceiver
->
v3InteractionPoint
,
p
Wedge
,
oIR
,
g_fSpeedOfSound
);
sw
.
stop
();
}
dStopTime
=
ITAClock
::
getDefaultClock
()
->
getTime
();
...
...
Write
Preview
Markdown
is supported
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