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
f19735ba
Commit
f19735ba
authored
6 years ago
by
Sander, Oliver
Browse files
Options
Downloads
Patches
Plain Diff
Make construction of initial values more stable for SO(3)
parent
027ddd10
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
dune/gfe/localquickanddirtyfefunction.hh
+47
-4
47 additions, 4 deletions
dune/gfe/localquickanddirtyfefunction.hh
with
47 additions
and
4 deletions
dune/gfe/localquickanddirtyfefunction.hh
+
47
−
4
View file @
f19735ba
...
...
@@ -100,11 +100,54 @@ namespace Dune {
std
::
vector
<
Dune
::
FieldVector
<
ctype
,
1
>
>
w
;
localFiniteElement_
.
localBasis
().
evaluateFunction
(
local
,
w
);
typename
TargetSpace
::
CoordinateType
c
(
0
);
for
(
size_t
i
=
0
;
i
<
coefficients_
.
size
();
i
++
)
c
.
axpy
(
w
[
i
][
0
],
coefficients_
[
i
].
globalCoordinates
());
// Special-casing for the Rotations. This is quite a challenge:
//
// Projection-based interpolation in the
// unit quaternions is not a good idea, here, because you may end up on the
// wrong sheet of the covering of SO(3) by the unit quaternions. The minimization
// solver for the weighted distance functional may then actually converge
// to the wrong local minimizer -- the interpolating functions wraps "the wrong way"
// around SO(3).
//
// Projection-based interpolation in SO(3) is not a good idea, because it is about as
// expensive as the geodesic interpolation itself. That's not good if all we want
// is an initial iterate.
//
// Averaging in R^{3x3} followed by QR decomposition is not a good idea either:
// The averaging can give you singular matrices quite quickly (try two matrices that
// differ by a rotation of pi/2). Then, the QR factorization of the identity may
// not be the identity (but differ in sign)! I tried that with the implementation
// from Numerical recipies.
//
// What do we do instead? We start from the coefficient that produces the lowest
// value of the objective functional.
if
constexpr
(
std
::
is_same
<
TargetSpace
,
Rotation
<
double
,
3
>
>::
value
)
{
AverageDistanceAssembler
averageDistance
(
coefficients_
,
w
);
auto
minDistance
=
averageDistance
.
value
(
coefficients_
[
0
]);
std
::
size_t
minCoefficient
=
0
;
for
(
std
::
size_t
i
=
1
;
i
<
coefficients_
.
size
();
i
++
)
{
auto
distance
=
averageDistance
.
value
(
coefficients_
[
i
]);
if
(
distance
<
minDistance
)
{
minDistance
=
distance
;
minCoefficient
=
i
;
}
}
return
coefficients_
[
minCoefficient
];
}
else
{
typename
TargetSpace
::
CoordinateType
c
(
0
);
for
(
size_t
i
=
0
;
i
<
coefficients_
.
size
();
i
++
)
c
.
axpy
(
w
[
i
][
0
],
coefficients_
[
i
].
globalCoordinates
());
return
TargetSpace
(
c
);
return
TargetSpace
(
c
);
}
}
}
// namespace GFE
...
...
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