MOAB: Mesh Oriented datABase
(version 5.5.0)
arc_intx_tests.cpp
Go to the documentation of this file.
1
/*
2
* arc_intx_tests.cpp
3
*/
4
#include <iostream>
5
#include <sstream>
6
#include <ctime>
7
#include <cstdlib>
8
#include <cstdio>
9
#include <cstring>
10
#include "
moab/Types.hpp
"
11
#include "
moab/IntxMesh/IntxUtils.hpp
"
12
13
#include "
TestUtil.hpp
"
14
15
using namespace
moab
;
16
void
test_great_arc_intx
()
17
{
18
double
A[3] = { 0., 0., 1. };
19
double
B[3] = { 1., 0., 0. };
20
double
C[3] = { 0., 0.6, 0.8 };
21
double
D[3] = { 0.6, -0.8, 0. };
22
23
double
E
[3];
24
double
R
= 1.0;
25
ErrorCode
rval =
moab::IntxUtils::intersect_great_circle_arcs
( A, B, C, D,
R
,
E
);
CHECK_ERR
( rval );
26
std::cout <<
"E: "
<<
E
[0] <<
" "
<<
E
[1] <<
" "
<<
E
[2] <<
"\n"
;
27
rval =
moab::IntxUtils::intersect_great_circle_arcs
( A, C, B, D,
R
,
E
);
28
CHECK
( rval == MB_FAILURE );
29
}
30
void
test_great_arc_clat_intx
()
31
{
32
double
d3 = 1 / sqrt( 3. );
33
double
A[3] = { 0., 0., 1. };
34
double
B[3] = { 1., 0., 0. };
35
double
C[3] = { d3, d3, d3 };
36
double
D[3] = { d3, -d3, d3 };
37
38
double
E
[9];
39
double
R
= 1.0;
40
int
np
= 0;
41
ErrorCode
rval =
moab::IntxUtils::intersect_great_circle_arc_with_clat_arc
( A, B, C, D,
R
,
E
,
np
);
CHECK_ERR
( rval );
42
std::cout <<
"E: "
<<
E
[0] <<
" "
<<
E
[1] <<
" "
<<
E
[2] <<
"\n"
;
43
double
F
[3] = { -d3, d3, d3 };
44
rval =
moab::IntxUtils::intersect_great_circle_arc_with_clat_arc
( A, B, C,
F
,
R
,
E
,
np
);
45
CHECK
( rval == MB_FAILURE );
46
}
47
int
main
()
48
{
49
int
failures = 0;
50
failures +=
RUN_TEST
(
test_great_arc_intx
);
51
failures +=
RUN_TEST
(
test_great_arc_clat_intx
);
52
return
failures;
53
}
test
arc_intx_tests.cpp
Generated on Wed Oct 4 2023 14:20:26 for MOAB: Mesh Oriented datABase by
1.9.1