Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Sander, Oliver
dune-gfe
Commits
a6573bcf
Commit
a6573bcf
authored
13 years ago
by
Oliver Sander
Committed by
sander@FU-BERLIN.DE
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
implement unit test for SO(3)
[[Imported from SVN: r7302]]
parent
a776f1dd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/localgeodesicfefunctiontest.cc
+35
-15
35 additions, 15 deletions
test/localgeodesicfefunctiontest.cc
with
35 additions
and
15 deletions
test/localgeodesicfefunctiontest.cc
+
35
−
15
View file @
a6573bcf
...
...
@@ -44,6 +44,13 @@ void testDerivativeTangentiality(const UnitVector<vectorDim>& x,
}
// the columns of the derivative must be tangential to the manifold
template
<
int
domainDim
,
int
vectorDim
>
void
testDerivativeTangentiality
(
const
Rotation
<
vectorDim
-
1
,
double
>&
x
,
const
FieldMatrix
<
double
,
vectorDim
,
domainDim
>&
derivative
)
{
}
/** \brief Test whether interpolation is invariant under permutation of the simplex vertices
*/
template
<
int
domainDim
,
class
TargetSpace
>
...
...
@@ -313,33 +320,44 @@ void testUnitVector3d()
testDerivative
<
domainDim
>
(
corners
);
testDerivativeOfValueWRTCoefficients
<
domainDim
>
(
corners
);
testDerivativeOfGradientWRTCoefficients
<
domainDim
>
(
corners
);
}
}
template
<
int
domainDim
>
void
testRotation
s
()
void
testRotation
()
{
std
::
cout
<<
" --- Testing Rotation<3>, domain dimension: "
<<
domainDim
<<
" ---"
<<
std
::
endl
;
typedef
Rotation
<
3
,
double
>
TargetSpace
;
FieldVector
<
double
,
3
>
xAxis
(
0
);
xAxis
[
0
]
=
1
;
FieldVector
<
double
,
3
>
yAxis
(
0
);
yAxis
[
1
]
=
1
;
FieldVector
<
double
,
3
>
zAxis
(
0
);
zAxis
[
2
]
=
1
;
int
nTestPoints
=
10
;
double
testPoints
[
10
][
4
]
=
{{
1
,
0
,
0
,
0
},
{
0
,
1
,
0
,
0
},
{
-
0.838114
,
0.356751
,
-
0.412667
,
0.5
},
{
-
0.490946
,
-
0.306456
,
0.81551
,
0.23
},{
-
0.944506
,
0.123687
,
-
0.304319
,
-
0.7
},
{
-
0.6
,
0.1
,
-
0.2
,
0.8
},{
0.45
,
0.12
,
0.517
,
0
},
{
-
0.1
,
0.3
,
-
0.1
,
0.73
},{
-
0.444506
,
0.123687
,
0.104319
,
-
0.23
},{
-
0.7
,
-
0.123687
,
-
0.304319
,
0.72
}};
// Set up elements of SO(3)
std
::
vector
<
TargetSpace
>
corners
(
domainDim
+
1
);
corners
[
0
]
=
Rotation
<
3
,
double
>
(
xAxis
,
0.1
);
corners
[
1
]
=
Rotation
<
3
,
double
>
(
yAxis
,
0.1
);
corners
[
2
]
=
Rotation
<
3
,
double
>
(
zAxis
,
0.1
);
testPermutationInvariance
<
domainDim
>
(
corners
);
//testDerivative(corners);
MultiIndex
<
domainDim
+
1
>
index
(
nTestPoints
);
int
numIndices
=
index
.
cycle
();
for
(
int
i
=
0
;
i
<
numIndices
;
i
++
,
++
index
)
{
for
(
int
j
=
0
;
j
<
domainDim
+
1
;
j
++
)
{
Dune
::
array
<
double
,
4
>
w
=
{{
testPoints
[
index
[
j
]][
0
],
testPoints
[
index
[
j
]][
1
],
testPoints
[
index
[
j
]][
2
],
testPoints
[
index
[
j
]][
3
]}};
corners
[
j
]
=
Rotation
<
3
,
double
>
(
w
);
}
//testPermutationInvariance(corners);
testDerivative
<
domainDim
>
(
corners
);
testDerivativeOfValueWRTCoefficients
<
domainDim
>
(
corners
);
testDerivativeOfGradientWRTCoefficients
<
domainDim
>
(
corners
);
}
}
...
...
@@ -355,5 +373,7 @@ int main()
testUnitVector3d
<
1
>
();
testUnitVector2d
<
2
>
();
testUnitVector3d
<
2
>
();
//testRotations();
testRotation
<
1
>
();
testRotation
<
2
>
();
}
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