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
dc055465
Commit
dc055465
authored
7 years ago
by
Sander, Oliver
Browse files
Options
Downloads
Patches
Plain Diff
Add stubs to allow building projected FE with OrthogonalMatrix
parent
b3d37f45
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/orthogonalmatrix.hh
+109
-3
109 additions, 3 deletions
dune/gfe/orthogonalmatrix.hh
with
109 additions
and
3 deletions
dune/gfe/orthogonalmatrix.hh
+
109
−
3
View file @
dc055465
...
...
@@ -3,6 +3,8 @@
#include
<dune/common/fmatrix.hh>
#include
<dune/gfe/skewmatrix.hh>
/** \brief An orthogonal \f$ n \times n \f$ matrix
* \tparam T Type of the matrix entries
* \tparam N Space dimension
...
...
@@ -11,7 +13,24 @@ template <class T, int N>
class
OrthogonalMatrix
{
public:
/** \brief The type used for coordinates */
typedef
T
ctype
;
/** \brief Dimension of the manifold formed by the orthogonal matrices */
static
const
int
dim
=
N
*
(
N
-
1
)
/
2
;
/** \brief Coordinates are embedded into a Euclidean space of N x N - matrices */
static
const
int
embeddedDim
=
N
*
N
;
/** \brief The type used for global coordinates */
typedef
Dune
::
FieldVector
<
T
,
embeddedDim
>
CoordinateType
;
/** \brief Member of the corresponding Lie algebra. This really is a skew-symmetric matrix */
typedef
Dune
::
FieldVector
<
T
,
dim
>
TangentVector
;
/** \brief A tangent vector as a vector in the surrounding coordinate space */
typedef
Dune
::
FieldVector
<
T
,
embeddedDim
>
EmbeddedTangentVector
;
/** \brief Default constructor -- leaves the matrix uninitialized */
OrthogonalMatrix
()
{}
...
...
@@ -24,6 +43,15 @@ public:
:
data_
(
matrix
)
{}
/** \brief Copy constructor
*
* It is not checked whether the matrix is really orthogonal
*/
explicit
OrthogonalMatrix
(
const
CoordinateType
&
other
)
{
DUNE_THROW
(
Dune
::
NotImplemented
,
"constructor"
);
}
/** \brief Const access to the matrix entries */
const
Dune
::
FieldMatrix
<
T
,
N
,
N
>&
data
()
const
{
...
...
@@ -63,7 +91,85 @@ public:
return
result
;
}
/** \brief Rebind the OrthogonalMatrix to another coordinate type */
template
<
class
U
>
struct
rebind
{
typedef
OrthogonalMatrix
<
U
,
N
>
other
;
};
OrthogonalMatrix
&
operator
=
(
const
CoordinateType
&
other
)
{
std
::
size_t
idx
=
0
;
for
(
int
i
=
0
;
i
<
N
;
i
++
)
for
(
int
j
=
0
;
j
<
N
;
j
++
)
data_
[
i
][
j
]
=
other
[
idx
++
];
return
*
this
;
}
/** \brief The exponential map from a given point $p \in SO(n)$.
\param v A tangent vector.
*/
static
OrthogonalMatrix
<
T
,
3
>
exp
(
const
OrthogonalMatrix
<
T
,
N
>&
p
,
const
TangentVector
&
v
)
{
DUNE_THROW
(
Dune
::
NotImplemented
,
"exp"
);
}
/** \brief Return the actual matrix */
void
matrix
(
Dune
::
FieldMatrix
<
T
,
N
,
N
>&
m
)
const
{
m
=
data_
;
}
/** \brief Project tangent vector of R^n onto the normal space space */
EmbeddedTangentVector
projectOntoNormalSpace
(
const
EmbeddedTangentVector
&
v
)
const
{
DUNE_THROW
(
Dune
::
NotImplemented
,
"projectOntoNormalSpace"
);
}
/** \brief The Weingarten map */
EmbeddedTangentVector
weingarten
(
const
EmbeddedTangentVector
&
z
,
const
EmbeddedTangentVector
&
v
)
const
{
EmbeddedTangentVector
result
;
DUNE_THROW
(
Dune
::
NotImplemented
,
"weingarten"
);
return
result
;
}
static
OrthogonalMatrix
<
T
,
N
>
projectOnto
(
const
CoordinateType
&
p
)
{
DUNE_THROW
(
Dune
::
NotImplemented
,
"projectOnto"
);
}
// TODO return type is wrong
static
Dune
::
FieldMatrix
<
T
,
1
,
1
>
derivativeOfProjection
(
const
CoordinateType
&
p
)
{
Dune
::
FieldMatrix
<
T
,
1
,
1
>
result
;
return
result
;
}
/** \brief The global coordinates, if you really want them */
CoordinateType
globalCoordinates
()
const
{
CoordinateType
result
;
std
::
size_t
idx
=
0
;
for
(
int
i
=
0
;
i
<
N
;
i
++
)
for
(
int
j
=
0
;
j
<
N
;
j
++
)
result
[
idx
++
]
=
data_
[
i
][
j
];
return
result
;
}
/** \brief Compute an orthonormal basis of the tangent space of SO(n). */
Dune
::
FieldMatrix
<
T
,
dim
,
embeddedDim
>
orthonormalFrame
()
const
{
Dune
::
FieldMatrix
<
T
,
dim
,
embeddedDim
>
result
;
DUNE_THROW
(
Dune
::
NotImplemented
,
"orthonormalFrame"
);
return
result
;
}
private
:
/** \brief The actual data */
...
...
@@ -71,4 +177,4 @@ private:
};
#endif // ORTHOGONAL_MATRIX_HH
\ No newline at end of file
#endif // ORTHOGONAL_MATRIX_HH
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