Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-elasticity
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Nebel, Lisa Julia
dune-elasticity
Commits
950f4a03
Commit
950f4a03
authored
2 years ago
by
Jaap, Patrick
Browse files
Options
Downloads
Patches
Plain Diff
whitespace cleanup
parent
e5407289
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/elasticity/assemblers/localhyperdualstiffness.hh
+15
-15
15 additions, 15 deletions
dune/elasticity/assemblers/localhyperdualstiffness.hh
with
15 additions
and
15 deletions
dune/elasticity/assemblers/localhyperdualstiffness.hh
+
15
−
15
View file @
950f4a03
...
...
@@ -8,7 +8,7 @@
namespace
Dune
::
Elasticity
{
/** \brief Assembles energy gradient and Hessian using Hyperdual Numbers
/** \brief Assembles energy gradient and Hessian using Hyperdual Numbers
*/
template
<
class
LocalView
>
class
LocalHyperDualStiffness
...
...
@@ -36,7 +36,7 @@ public:
std
::
vector
<
double
>&
localGradient
,
Dune
::
Matrix
<
double
>&
localHessian
);
std
::
shared_ptr
<
Dune
::
Elasticity
::
LocalEnergy
<
LocalView
,
hyperdual
>>
localEnergy_
;
std
::
shared_ptr
<
Dune
::
Elasticity
::
LocalEnergy
<
LocalView
,
hyperdual
>>
localEnergy_
;
};
...
...
@@ -50,10 +50,10 @@ energy(const LocalView& localView,
std
::
vector
<
hyperdual
>
localHyperDualConfiguration
(
localConfiguration
.
size
());
hyperdual
energy
;
for
(
size_t
i
=
0
;
i
<
localConfiguration
.
size
();
i
++
)
localHyperDualConfiguration
[
i
]
=
hyperdual
(
localConfiguration
[
i
]);
localHyperDualConfiguration
[
i
]
=
hyperdual
(
localConfiguration
[
i
]);
energy
=
localEnergy_
->
energy
(
localView
,
localHyperDualConfiguration
);
pureEnergy
=
energy
.
real
();
...
...
@@ -70,7 +70,7 @@ assembleGradientAndHessian(const LocalView& localView,
Dune
::
Matrix
<
double
>&
localHessian
)
{
size_t
nDoubles
=
localConfiguration
.
size
();
size_t
nDoubles
=
localConfiguration
.
size
();
localGradient
.
resize
(
nDoubles
);
...
...
@@ -79,28 +79,28 @@ assembleGradientAndHessian(const LocalView& localView,
std
::
vector
<
hyperdual
>
localHyperDualConfiguration
(
nDoubles
);
for
(
size_t
i
=
0
;
i
<
nDoubles
;
i
++
)
localHyperDualConfiguration
[
i
]
=
hyperdual
(
localConfiguration
[
i
]);
// Compute gradient and hessian (symmetry is used) using hyperdual function evaluation
// localHyperDualConfiguration puts Ones in the eps1 and eps2 component to evaluate the different partial derivatives
for
(
size_t
i
=
0
;
i
<
nDoubles
;
i
++
)
for
(
size_t
i
=
0
;
i
<
nDoubles
;
i
++
)
{
localHyperDualConfiguration
[
i
].
seteps1
(
1.0
);
localHyperDualConfiguration
[
i
].
seteps2
(
1.0
);
hyperdual
temp
=
localEnergy_
->
energy
(
localView
,
localHyperDualConfiguration
);
localGradient
[
i
]
=
temp
.
eps1
();
localGradient
[
i
]
=
temp
.
eps1
();
localHessian
[
i
][
i
]
=
temp
.
eps1eps2
();
localHyperDualConfiguration
[
i
].
seteps2
(
0.0
);
for
(
size_t
j
=
i
+
1
;
j
<
nDoubles
;
j
++
)
{
for
(
size_t
j
=
i
+
1
;
j
<
nDoubles
;
j
++
)
{
localHyperDualConfiguration
[
j
].
seteps2
(
1.0
);
localHessian
[
i
][
j
]
=
localEnergy_
->
energy
(
localView
,
localHyperDualConfiguration
).
eps1eps2
();
localHessian
[
j
][
i
]
=
localHessian
[
i
][
j
];
// Use symmetry of hessian
localHessian
[
j
][
i
]
=
localHessian
[
i
][
j
];
// Use symmetry of hessian
localHyperDualConfiguration
[
j
].
seteps2
(
0.0
);
}
localHyperDualConfiguration
[
i
].
seteps1
(
0.0
);
}
...
...
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