Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ITAPropagationPathSim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institute of Technical Acoustics (ITA)
ITAPropagationPathSim
Commits
c843a0ca
Commit
c843a0ca
authored
1 year ago
by
Pascal Palenda
Browse files
Options
Downloads
Patches
Plain Diff
Feat: adapt diffraction check to test for ESEA
parent
cd1cb406
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!3
Add unit tests for the IEM
,
!2
Rework of the geometry loading and material system
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/UnitTest/test_definitions.h
+12
-9
12 additions, 9 deletions
tests/UnitTest/test_definitions.h
with
12 additions
and
9 deletions
tests/UnitTest/test_definitions.h
+
12
−
9
View file @
c843a0ca
...
...
@@ -123,18 +123,21 @@ inline void checkDiffraction( const ITAGeo::CPropagationPath diffracted_path, co
REQUIRE
(
diffracted_path
.
at
(
0
)
->
v3InteractionPoint
==
parameters
.
source_position
);
REQUIRE
(
diffracted_path
.
at
(
2
)
->
v3InteractionPoint
==
parameters
.
receiver_position
);
const
auto
sound_path_direction
=
parameters
.
receiver_position
-
parameters
.
source_position
;
const
float
t
=
-
parameters
.
source_position
[
2
]
/
sound_path_direction
[
2
];
// Check that the ESEA is fulfilled. Ref Tsingos 2001 "Modeling ..."
auto
source_2_interaction
=
parameters
.
source_position
-
diffracted_path
.
at
(
1
)
->
v3InteractionPoint
;
auto
receiver_2_interaction
=
parameters
.
receiver_position
-
diffracted_path
.
at
(
1
)
->
v3InteractionPoint
;
const
auto
intersection_xy_plane
=
parameters
.
source_position
+
t
*
sound_path_direction
;
source_2_interaction
.
Normalize
(
);
receiver_2_interaction
.
Normalize
(
);
const
auto
interaction_point
=
VistaVector3D
(
intersection_xy_plane
[
0
],
0.f
,
0.f
);
const
auto
esea_lhs
=
source_2_interaction
.
Dot
(
VistaVector3D
(
1
,
0
,
0
)
);
const
auto
esea_rhs
=
receiver_2_interaction
.
Dot
(
VistaVector3D
(
-
1
,
0
,
0
)
);
for
(
in
t
i
=
0
;
i
<
3
;
++
i
)
{
INFO
(
"
Current i: "
<<
i
);
REQUIRE_THAT
(
diffracted_path
.
at
(
1
)
->
v3InteractionPoint
[
i
],
Catch
::
Matchers
::
WithinAbs
(
interaction_point
[
i
],
1e-4
)
);
// 0.1mm accuracy
}
const
floa
t
p
i
=
3.14159265358979323846264338327950288419716939937510582097
;
INFO
(
"
Difference = "
<<
(
esea_lhs
-
esea_rhs
)
*
180
/
pi
<<
"deg"
);
REQUIRE_THAT
(
esea_lhs
,
Catch
::
Matchers
::
WithinAbs
(
esea_rhs
,
1
*
pi
/
180
)
);
// 1 deg accuracy
}
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment