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
ec888c76
Commit
ec888c76
authored
5 years ago
by
Sander, Oliver
Browse files
Options
Downloads
Patches
Plain Diff
LocalGeodesicFEStiffness is an abstract base class now
parent
ab19f673
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/localgeodesicfestiffness.hh
+3
-36
3 additions, 36 deletions
dune/gfe/localgeodesicfestiffness.hh
with
3 additions
and
36 deletions
dune/gfe/localgeodesicfestiffness.hh
+
3
−
36
View file @
ec888c76
...
@@ -27,22 +27,12 @@ public:
...
@@ -27,22 +27,12 @@ public:
//! Dimension of the embedding space
//! Dimension of the embedding space
enum
{
embeddedBlocksize
=
TargetSpace
::
EmbeddedTangentVector
::
dimension
};
enum
{
embeddedBlocksize
=
TargetSpace
::
EmbeddedTangentVector
::
dimension
};
/** \brief Assemble the local stiffness matrix at the current position
/** \brief Assemble the local gradient and stiffness matrix at the current position
This default implementation used finite-difference approximations to compute the second derivatives
The formula for the Riemannian Hessian has been taken from Absil, Mahony, Sepulchre:
'Optimization algorithms on matrix manifolds', page 107. There it says that
\f[
\langle Hess f(x)[\xi], \eta \rangle
= \frac 12 \frac{d^2}{dt^2} \Big(f(\exp_x(t(\xi + \eta))) - f(\exp_x(t\xi)) - f(\exp_x(t\eta))\Big)\Big|_{t=0}.
\f]
We compute that using a finite difference approximation.
*/
*/
virtual
void
assembleGradientAndHessian
(
const
typename
Basis
::
LocalView
&
localView
,
virtual
void
assembleGradientAndHessian
(
const
typename
Basis
::
LocalView
&
localView
,
const
std
::
vector
<
TargetSpace
>&
localSolution
,
const
std
::
vector
<
TargetSpace
>&
localSolution
,
std
::
vector
<
typename
TargetSpace
::
TangentVector
>&
localGradient
);
std
::
vector
<
typename
TargetSpace
::
TangentVector
>&
localGradient
)
=
0
;
/** \brief Compute the energy at the current configuration */
/** \brief Compute the energy at the current configuration */
virtual
RT
energy
(
const
typename
Basis
::
LocalView
&
localView
,
virtual
RT
energy
(
const
typename
Basis
::
LocalView
&
localView
,
...
@@ -53,35 +43,12 @@ public:
...
@@ -53,35 +43,12 @@ public:
The default implementation in this class uses a finite difference approximation */
The default implementation in this class uses a finite difference approximation */
virtual
void
assembleGradient
(
const
typename
Basis
::
LocalView
&
localView
,
virtual
void
assembleGradient
(
const
typename
Basis
::
LocalView
&
localView
,
const
std
::
vector
<
TargetSpace
>&
solution
,
const
std
::
vector
<
TargetSpace
>&
solution
,
std
::
vector
<
typename
TargetSpace
::
TangentVector
>&
gradient
)
const
;
std
::
vector
<
typename
TargetSpace
::
TangentVector
>&
gradient
)
const
=
0
;
// assembled data
// assembled data
Dune
::
Matrix
<
Dune
::
FieldMatrix
<
RT
,
blocksize
,
blocksize
>
>
A_
;
Dune
::
Matrix
<
Dune
::
FieldMatrix
<
RT
,
blocksize
,
blocksize
>
>
A_
;
};
};
template
<
class
Basis
,
class
TargetSpace
>
void
LocalGeodesicFEStiffness
<
Basis
,
TargetSpace
>::
assembleGradient
(
const
typename
Basis
::
LocalView
&
localView
,
const
std
::
vector
<
TargetSpace
>&
localSolution
,
std
::
vector
<
typename
TargetSpace
::
TangentVector
>&
localGradient
)
const
{
DUNE_THROW
(
Dune
::
NotImplemented
,
"!"
);
}
// ///////////////////////////////////////////////////////////
// Compute gradient by finite-difference approximation
// ///////////////////////////////////////////////////////////
template
<
class
Basis
,
class
TargetSpace
>
void
LocalGeodesicFEStiffness
<
Basis
,
TargetSpace
>::
assembleGradientAndHessian
(
const
typename
Basis
::
LocalView
&
localView
,
const
std
::
vector
<
TargetSpace
>&
localSolution
,
std
::
vector
<
typename
TargetSpace
::
TangentVector
>&
localGradient
)
{
DUNE_THROW
(
Dune
::
NotImplemented
,
"!"
);
}
#endif
#endif
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