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
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
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
agnumpde
dune-tectonic
Commits
afef5460
Commit
afef5460
authored
12 years ago
by
Elias Pipping
Committed by
Elias Pipping
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Rename: u -> u_old; use solution instead of u everywhere
parent
038364b7
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
src/one-body-sample.cc
+13
-14
13 additions, 14 deletions
src/one-body-sample.cc
with
13 additions
and
14 deletions
src/one-body-sample.cc
+
13
−
14
View file @
afef5460
...
@@ -191,13 +191,12 @@ int main(int argc, char *argv[]) {
...
@@ -191,13 +191,12 @@ int main(int argc, char *argv[]) {
leafView
,
p1Basis
,
frictionalNodes
);
leafView
,
p1Basis
,
frictionalNodes
);
// {{{ Initialise vectors
// {{{ Initialise vectors
VectorType
u
(
finestSize
);
VectorType
u
_old
(
finestSize
);
u
=
0.0
;
// Has to be zero!
u
_old
=
0.0
;
// Has to be zero!
VectorType
u_
previous
;
VectorType
u_
old_old
;
VectorType
u_diff
(
finestSize
);
VectorType
u_diff
(
finestSize
);
u_diff
=
0.0
;
// Has to be zero!
u_diff
=
0.0
;
// Has to be zero!
// temporary storage for u
VectorType
solution
(
finestSize
);
VectorType
solution
(
finestSize
);
SingletonVectorType
alpha_old
(
finestSize
);
SingletonVectorType
alpha_old
(
finestSize
);
...
@@ -257,7 +256,7 @@ int main(int argc, char *argv[]) {
...
@@ -257,7 +256,7 @@ int main(int argc, char *argv[]) {
VectorType
problem_rhs
(
finestSize
);
VectorType
problem_rhs
(
finestSize
);
VectorType
problem_iterate
(
finestSize
);
VectorType
problem_iterate
(
finestSize
);
VectorType
*
u_old_old_ptr
=
(
run
==
1
)
?
nullptr
:
&
u_
previous
;
VectorType
*
u_old_old_ptr
=
(
run
==
1
)
?
nullptr
:
&
u_
old_old
;
typedef
TimeSteppingScheme
<
VectorType
,
MatrixType
,
typedef
TimeSteppingScheme
<
VectorType
,
MatrixType
,
decltype
(
dirichletFunction
),
dim
>
TS
;
decltype
(
dirichletFunction
),
dim
>
TS
;
...
@@ -269,16 +268,16 @@ int main(int argc, char *argv[]) {
...
@@ -269,16 +268,16 @@ int main(int argc, char *argv[]) {
Dune
::
shared_ptr
<
TS
>
timeSteppingScheme
;
Dune
::
shared_ptr
<
TS
>
timeSteppingScheme
;
if
(
run
==
1
||
!
parset
.
get
<
bool
>
(
"implicitTwoStep"
))
if
(
run
==
1
||
!
parset
.
get
<
bool
>
(
"implicitTwoStep"
))
timeSteppingScheme
=
timeSteppingScheme
=
Dune
::
make_shared
<
IE
>
(
ell
,
stiffnessMatrix
,
u
,
u_old_old_ptr
,
Dune
::
make_shared
<
IE
>
(
ell
,
stiffnessMatrix
,
u
_old
,
u_old_old_ptr
,
ignoreNodes
,
dirichletFunction
,
time
,
tau
);
ignoreNodes
,
dirichletFunction
,
time
,
tau
);
else
else
timeSteppingScheme
=
timeSteppingScheme
=
Dune
::
make_shared
<
ITS
>
(
ell
,
stiffnessMatrix
,
u
,
u_old_old_ptr
,
Dune
::
make_shared
<
ITS
>
(
ell
,
stiffnessMatrix
,
u
_old
,
u_old_old_ptr
,
ignoreNodes
,
dirichletFunction
,
time
,
tau
);
ignoreNodes
,
dirichletFunction
,
time
,
tau
);
timeSteppingScheme
->
setup
(
problem_rhs
,
problem_iterate
,
problem_A
);
timeSteppingScheme
->
setup
(
problem_rhs
,
problem_iterate
,
problem_A
);
VectorType
solution_saved
=
u
;
VectorType
solution_saved
=
u
_old
;
auto
const
state_fpi_max
=
auto
const
state_fpi_max
=
parset
.
get
<
size_t
>
(
"solver.tnnmg.fixed_point_iterations"
);
parset
.
get
<
size_t
>
(
"solver.tnnmg.fixed_point_iterations"
);
for
(
size_t
state_fpi
=
1
;
state_fpi
<=
state_fpi_max
;
++
state_fpi
)
{
for
(
size_t
state_fpi
=
1
;
state_fpi
<=
state_fpi_max
;
++
state_fpi
)
{
...
@@ -346,8 +345,8 @@ int main(int argc, char *argv[]) {
...
@@ -346,8 +345,8 @@ int main(int argc, char *argv[]) {
double
out
;
double
out
;
neumannFunction
.
evaluate
(
time
,
out
);
neumannFunction
.
evaluate
(
time
,
out
);
octave_writer
<<
alpha
[
first_frictional_node
][
0
]
<<
" "
octave_writer
<<
alpha
[
first_frictional_node
][
0
]
<<
" "
<<
u
[
first_frictional_node
][
0
]
*
1e6
<<
" "
<<
out
<<
solution
[
first_frictional_node
][
0
]
*
1e6
<<
" "
<<
std
::
endl
;
<<
out
<<
std
::
endl
;
}
}
// Comparison with the analytic solution of a velocity stepping test
// Comparison with the analytic solution of a velocity stepping test
...
@@ -392,8 +391,8 @@ int main(int argc, char *argv[]) {
...
@@ -392,8 +391,8 @@ int main(int argc, char *argv[]) {
std
::
cout
<<
u_diff
[
i
][
0
]
*
timesteps
<<
" "
;
std
::
cout
<<
u_diff
[
i
][
0
]
*
timesteps
<<
" "
;
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
}
}
u_
previous
=
u
;
u_
old_old
=
u_old
;
u
=
solution
;
u
_old
=
solution
;
alpha_old
=
alpha
;
alpha_old
=
alpha
;
// Compute von Mises stress and write everything to a file
// Compute von Mises stress and write everything to a file
...
@@ -401,12 +400,12 @@ int main(int argc, char *argv[]) {
...
@@ -401,12 +400,12 @@ int main(int argc, char *argv[]) {
VonMisesStressAssembler
<
GridType
>
localStressAssembler
(
VonMisesStressAssembler
<
GridType
>
localStressAssembler
(
E
,
nu
,
E
,
nu
,
Dune
::
make_shared
<
BasisGridFunction
<
P1Basis
,
VectorType
>
const
>
(
Dune
::
make_shared
<
BasisGridFunction
<
P1Basis
,
VectorType
>
const
>
(
p1Basis
,
u
));
p1Basis
,
solution
));
FunctionalAssembler
<
P0Basis
>
(
p0Basis
)
FunctionalAssembler
<
P0Basis
>
(
p0Basis
)
.
assemble
(
localStressAssembler
,
vonMisesStress
,
true
);
.
assemble
(
localStressAssembler
,
vonMisesStress
,
true
);
writeVtk
<
P1Basis
,
P0Basis
,
VectorType
,
SingletonVectorType
,
GridView
>
(
writeVtk
<
P1Basis
,
P0Basis
,
VectorType
,
SingletonVectorType
,
GridView
>
(
p1Basis
,
u
,
alpha
,
p0Basis
,
vonMisesStress
,
leafView
,
p1Basis
,
solution
,
alpha
,
p0Basis
,
vonMisesStress
,
leafView
,
(
boost
::
format
(
"obs%d"
)
%
run
).
str
());
(
boost
::
format
(
"obs%d"
)
%
run
).
str
());
}
}
}
}
...
...
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