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
78d4007e
Commit
78d4007e
authored
14 years ago
by
Oliver Sander
Committed by
sander@FU-BERLIN.DE
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
implement an orthogonal basis of the tangent spaces for all dimensions (not just 2)
[[Imported from SVN: r6501]]
parent
63e29ab5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/gfe/unitvector.hh
+31
-5
31 additions, 5 deletions
dune/gfe/unitvector.hh
with
31 additions
and
5 deletions
dune/gfe/unitvector.hh
+
31
−
5
View file @
78d4007e
...
@@ -293,12 +293,38 @@ public:
...
@@ -293,12 +293,38 @@ public:
Dune
::
FieldMatrix
<
double
,
N
-
1
,
N
>
orthonormalFrame
()
const
{
Dune
::
FieldMatrix
<
double
,
N
-
1
,
N
>
orthonormalFrame
()
const
{
Dune
::
FieldMatrix
<
double
,
N
-
1
,
N
>
result
;
Dune
::
FieldMatrix
<
double
,
N
-
1
,
N
>
result
;
// Coordinates of the stereographic projection
Dune
::
FieldVector
<
double
,
N
-
1
>
X
;
if
(
N
==
2
)
{
if
(
data_
[
N
-
1
]
<=
0
)
{
result
[
0
][
0
]
=
-
data_
[
1
];
result
[
0
][
1
]
=
data_
[
0
];
// Stereographic projection from the north pole onto R^{N-1}
}
else
for
(
size_t
i
=
0
;
i
<
N
-
1
;
i
++
)
DUNE_THROW
(
Dune
::
NotImplemented
,
"orthonormalFrame for N!=2!"
);
X
[
i
]
=
data_
[
i
]
/
(
1
-
data_
[
N
-
1
]);
}
else
{
// Stereographic projection from the south pole onto R^{N-1}
for
(
size_t
i
=
0
;
i
<
N
-
1
;
i
++
)
X
[
i
]
=
data_
[
i
]
/
(
1
+
data_
[
N
-
1
]);
}
double
RSquared
=
X
.
two_norm2
();
for
(
size_t
i
=
0
;
i
<
N
-
1
;
i
++
)
for
(
size_t
j
=
0
;
j
<
N
-
1
;
j
++
)
// Note: the matrix is the transpose of the one in the paper
result
[
j
][
i
]
=
2
*
(
i
==
j
)
*
(
1
+
RSquared
)
-
4
*
X
[
i
]
*
X
[
j
];
for
(
size_t
j
=
0
;
j
<
N
-
1
;
j
++
)
result
[
j
][
N
-
1
]
=
4
*
X
[
j
];
// Upper hemisphere: adapt formulas so it is the stereographic projection from the south pole
if
(
data_
[
N
-
1
]
>
0
)
for
(
size_t
j
=
0
;
j
<
N
-
1
;
j
++
)
result
[
j
][
N
-
1
]
*=
-
1
;
return
result
;
return
result
;
}
}
...
...
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