Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yuhao Liu
ogs
Commits
4b4d4c32
Commit
4b4d4c32
authored
3 years ago
by
wenqing
Committed by
Dmitri Naumov
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Test/LIE] Removed the test for the functions, which are removed now.
parent
65062227
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tests/CMakeLists.txt
+0
-3
0 additions, 3 deletions
Tests/CMakeLists.txt
Tests/ProcessLib/LIE/TestLIE.cpp
+0
-164
0 additions, 164 deletions
Tests/ProcessLib/LIE/TestLIE.cpp
with
0 additions
and
167 deletions
Tests/CMakeLists.txt
+
0
−
3
View file @
4b4d4c32
...
...
@@ -46,9 +46,6 @@ if(OGS_BUILD_SWMM)
append_source_files
(
TEST_SOURCES FileIO_SWMM
)
endif
()
if
(
OGS_BUILD_PROCESS_LIE
)
append_source_files
(
TEST_SOURCES ProcessLib/LIE
)
endif
()
if
(
OGS_BUILD_PROCESS_RichardsMechanics
)
append_source_files
(
TEST_SOURCES ProcessLib/RichardsMechanics
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
Tests/ProcessLib/LIE/TestLIE.cpp
deleted
100644 → 0
+
0
−
164
View file @
65062227
/**
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include
<gtest/gtest.h>
#include
<Eigen/Eigen>
#include
<cmath>
#include
<memory>
#include
"MeshLib/Elements/Line.h"
#include
"MeshLib/Elements/Tri.h"
#include
"MeshLib/Mesh.h"
#include
"ProcessLib/LIE/Common/Utils.h"
namespace
{
std
::
unique_ptr
<
MeshLib
::
Mesh
>
createTriangle
(
std
::
array
<
std
::
array
<
double
,
3
>
,
3
>
const
&
points
)
{
auto
**
nodes
=
new
MeshLib
::
Node
*
[
3
];
for
(
std
::
size_t
i
=
0
;
i
<
points
.
size
();
++
i
)
{
nodes
[
i
]
=
new
MeshLib
::
Node
(
points
[
i
]);
}
MeshLib
::
Element
*
e
=
new
MeshLib
::
Tri
(
nodes
);
return
std
::
make_unique
<
MeshLib
::
Mesh
>
(
""
,
std
::
vector
<
MeshLib
::
Node
*>
{
nodes
[
0
],
nodes
[
1
],
nodes
[
2
]},
std
::
vector
<
MeshLib
::
Element
*>
{
e
});
}
std
::
unique_ptr
<
MeshLib
::
Mesh
>
createLine
(
std
::
array
<
std
::
array
<
double
,
3
>
,
2
>
const
&
points
)
{
auto
**
nodes
=
new
MeshLib
::
Node
*
[
2
];
for
(
std
::
size_t
i
=
0
;
i
<
points
.
size
();
++
i
)
{
nodes
[
i
]
=
new
MeshLib
::
Node
(
points
[
i
]);
}
MeshLib
::
Element
*
e
=
new
MeshLib
::
Line
(
nodes
);
return
std
::
make_unique
<
MeshLib
::
Mesh
>
(
""
,
std
::
vector
<
MeshLib
::
Node
*>
{
nodes
[
0
],
nodes
[
1
]},
std
::
vector
<
MeshLib
::
Element
*>
{
e
});
}
const
double
eps
=
std
::
numeric_limits
<
double
>::
epsilon
();
}
// namespace
TEST
(
LIE
,
rotationMatrixXYTriangle
)
{
auto
msh
=
createTriangle
(
{{{{
0.0
,
0.0
,
0.0
}},
{{
1.0
,
0.0
,
0.0
}},
{{
1.0
,
1.0
,
0.0
}}}});
auto
e
(
msh
->
getElement
(
0
));
Eigen
::
Vector3d
nv
;
ProcessLib
::
LIE
::
computeNormalVector
(
*
e
,
3
,
nv
);
ASSERT_EQ
(
0.
,
nv
[
0
]);
ASSERT_EQ
(
0.
,
nv
[
1
]);
ASSERT_EQ
(
-
1.
,
nv
[
2
]);
Eigen
::
MatrixXd
R
(
3
,
3
);
ProcessLib
::
LIE
::
computeRotationMatrix
(
*
e
,
nv
,
3
,
R
);
ASSERT_NEAR
(
-
1.
,
R
(
0
,
0
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
0
,
1
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
0
,
2
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
1
,
0
),
eps
);
ASSERT_NEAR
(
1.
,
R
(
1
,
1
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
1
,
2
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
2
,
0
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
2
,
1
),
eps
);
ASSERT_NEAR
(
-
1.
,
R
(
2
,
2
),
eps
);
}
TEST
(
LIE
,
rotationMatrixYZTriangle
)
{
auto
msh
=
createTriangle
(
{{{{
0.0
,
0.0
,
0.0
}},
{{
0.0
,
1.0
,
0.0
}},
{{
0.0
,
1.0
,
1.0
}}}});
auto
e
(
msh
->
getElement
(
0
));
Eigen
::
Vector3d
nv
;
ProcessLib
::
LIE
::
computeNormalVector
(
*
e
,
3
,
nv
);
ASSERT_EQ
(
-
1.
,
nv
[
0
]);
ASSERT_EQ
(
0.
,
nv
[
1
]);
ASSERT_EQ
(
0.
,
nv
[
2
]);
Eigen
::
MatrixXd
R
(
3
,
3
);
ProcessLib
::
LIE
::
computeRotationMatrix
(
*
e
,
nv
,
3
,
R
);
ASSERT_NEAR
(
0.
,
R
(
0
,
0
),
eps
);
ASSERT_NEAR
(
-
1.
,
R
(
0
,
1
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
0
,
2
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
1
,
0
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
1
,
1
),
eps
);
ASSERT_NEAR
(
1.
,
R
(
1
,
2
),
eps
);
ASSERT_NEAR
(
-
1.
,
R
(
2
,
0
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
2
,
1
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
2
,
2
),
eps
);
}
TEST
(
LIE
,
rotationMatrixX
)
{
auto
msh
=
createLine
({{{{
-
1.0
,
0.0
,
0.0
}},
{{
1.0
,
0.0
,
0.0
}}}});
auto
e
(
msh
->
getElement
(
0
));
Eigen
::
Vector3d
nv
;
ProcessLib
::
LIE
::
computeNormalVector
(
*
e
,
2
,
nv
);
ASSERT_EQ
(
0.
,
nv
[
0
]);
ASSERT_EQ
(
1.
,
nv
[
1
]);
ASSERT_EQ
(
0.
,
nv
[
2
]);
Eigen
::
MatrixXd
R
(
2
,
2
);
ProcessLib
::
LIE
::
computeRotationMatrix
(
*
e
,
nv
,
2
,
R
);
ASSERT_NEAR
(
1.
,
R
(
0
,
0
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
0
,
1
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
1
,
0
),
eps
);
ASSERT_NEAR
(
1.
,
R
(
1
,
1
),
eps
);
}
TEST
(
LIE
,
rotationMatrixY
)
{
auto
msh
=
createLine
({{{{
0.0
,
-
1.0
,
0.0
}},
{{
0.0
,
1.0
,
0.0
}}}});
auto
e
(
msh
->
getElement
(
0
));
Eigen
::
Vector3d
nv
;
ProcessLib
::
LIE
::
computeNormalVector
(
*
e
,
2
,
nv
);
ASSERT_EQ
(
-
1.
,
nv
[
0
]);
ASSERT_EQ
(
0.
,
nv
[
1
]);
ASSERT_EQ
(
0.
,
nv
[
2
]);
Eigen
::
MatrixXd
R
(
2
,
2
);
ProcessLib
::
LIE
::
computeRotationMatrix
(
*
e
,
nv
,
2
,
R
);
ASSERT_NEAR
(
0.
,
R
(
0
,
0
),
eps
);
ASSERT_NEAR
(
1.
,
R
(
0
,
1
),
eps
);
ASSERT_NEAR
(
-
1.
,
R
(
1
,
0
),
eps
);
ASSERT_NEAR
(
0.
,
R
(
1
,
1
),
eps
);
}
TEST
(
LIE
,
rotationMatrixXY
)
{
// 45degree inclined
auto
msh
=
createLine
(
{{{{
0.0
,
0.0
,
0.0
}},
{{
2.
/
std
::
sqrt
(
2
),
2.
/
std
::
sqrt
(
2
),
0.0
}}}});
auto
e
(
msh
->
getElement
(
0
));
Eigen
::
Vector3d
nv
;
ProcessLib
::
LIE
::
computeNormalVector
(
*
e
,
2
,
nv
);
ASSERT_NEAR
(
-
1.
/
std
::
sqrt
(
2
),
nv
[
0
],
eps
);
ASSERT_NEAR
(
1.
/
std
::
sqrt
(
2
),
nv
[
1
],
eps
);
ASSERT_EQ
(
0.
,
nv
[
2
]);
Eigen
::
MatrixXd
R
(
2
,
2
);
ProcessLib
::
LIE
::
computeRotationMatrix
(
*
e
,
nv
,
2
,
R
);
ASSERT_NEAR
(
1.
/
std
::
sqrt
(
2
),
R
(
0
,
0
),
eps
);
ASSERT_NEAR
(
1.
/
std
::
sqrt
(
2
),
R
(
0
,
1
),
eps
);
ASSERT_NEAR
(
-
1.
/
std
::
sqrt
(
2
),
R
(
1
,
0
),
eps
);
ASSERT_NEAR
(
1.
/
std
::
sqrt
(
2
),
R
(
1
,
1
),
eps
);
}
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