Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
podlesny
dune-tectonic
Commits
3b56cfc4
Commit
3b56cfc4
authored
11 years ago
by
Elias Pipping
Committed by
Elias Pipping
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[Algorit] FIX: Calculate the initial acceleration
parent
c6fb60c0
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
src/one-body-sample.cc
+26
-1
26 additions, 1 deletion
src/one-body-sample.cc
with
26 additions
and
1 deletion
src/one-body-sample.cc
+
26
−
1
View file @
3b56cfc4
...
...
@@ -59,6 +59,7 @@
#include
<dune/fufem/functionspacebases/p0basis.hh>
#include
<dune/fufem/functionspacebases/p1nodalbasis.hh>
#include
<dune/fufem/sharedpointermap.hh>
#include
<dune/solvers/iterationsteps/truncatedblockgsstep.hh>
#include
<dune/solvers/norms/energynorm.hh>
#include
<dune/solvers/norms/sumnorm.hh>
#include
<dune/solvers/solvers/loopsolver.hh>
...
...
@@ -342,9 +343,33 @@ int main(int argc, char *argv[]) {
u_initial
=
0.0
;
VectorType
v_initial
(
finestSize
);
v_initial
=
0.0
;
// FIXME: This only happens to be correct
// From here on: calculate the initial acceleration
VectorType
a_initial
(
finestSize
);
a_initial
=
0.0
;
{
// We solve Au + Ma + Psi(v) = ell, thus Ma = - (Au + Psi(v) - ell)
VectorType
problem_rhs_initial
(
finestSize
);
{
problem_rhs_initial
=
0.0
;
Arithmetic
::
addProduct
(
problem_rhs_initial
,
stiffnessMatrix
,
u_initial
);
myGlobalNonlinearity
->
updateState
(
alpha_initial
);
// NOTE: We assume differentiability of Psi at v0 here!
myGlobalNonlinearity
->
addGradient
(
v_initial
,
problem_rhs_initial
);
createRHS
(
0.0
,
ell
);
problem_rhs_initial
-=
ell
;
problem_rhs_initial
*=
-
1.0
;
}
TruncatedBlockGSStep
<
MatrixType
,
VectorType
>
accelerationSolverStep
(
massMatrix
,
a_initial
,
problem_rhs_initial
);
accelerationSolverStep
.
ignoreNodes_
=
&
ignoreNodes
;
LoopSolver
<
VectorType
>
accelerationSolver
(
&
accelerationSolverStep
,
100000
,
// FIXME
1e-12
,
// FIXME
&
massMatrixNorm
,
Solver
::
FULL
,
// FIXME
false
);
// absolute error
accelerationSolver
.
solve
();
}
// }}}
// Set up TNNMG solver
...
...
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