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
2a336f94
Commit
2a336f94
authored
12 years ago
by
Elias Pipping
Committed by
Elias Pipping
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Work with velocities rather than differences
parent
19e86cbd
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/one-body-sample.cc
+7
-7
7 additions, 7 deletions
src/one-body-sample.cc
src/timestepping.cc
+8
-10
8 additions, 10 deletions
src/timestepping.cc
with
15 additions
and
17 deletions
src/one-body-sample.cc
+
7
−
7
View file @
2a336f94
...
@@ -194,10 +194,10 @@ int main(int argc, char *argv[]) {
...
@@ -194,10 +194,10 @@ int main(int argc, char *argv[]) {
VectorType
u_old
(
finestSize
);
VectorType
u_old
(
finestSize
);
u_old
=
0.0
;
// Has to be zero!
u_old
=
0.0
;
// Has to be zero!
VectorType
u_old_old
;
VectorType
u_old_old
;
VectorType
u_diff
(
finestSize
);
u_diff
=
0.0
;
// Has to be zero!
VectorType
u
(
finestSize
);
VectorType
u
(
finestSize
);
VectorType
ud
(
finestSize
);
ud
=
0.0
;
SingletonVectorType
alpha_old
(
finestSize
);
SingletonVectorType
alpha_old
(
finestSize
);
alpha_old
=
parset
.
get
<
double
>
(
"boundary.friction.state.initial"
);
alpha_old
=
parset
.
get
<
double
>
(
"boundary.friction.state.initial"
);
...
@@ -298,12 +298,12 @@ int main(int argc, char *argv[]) {
...
@@ -298,12 +298,12 @@ int main(int argc, char *argv[]) {
overallSolver
.
solve
();
overallSolver
.
solve
();
timeSteppingScheme
->
extractSolution
(
problem_iterate
,
u
);
timeSteppingScheme
->
extractSolution
(
problem_iterate
,
u
);
timeSteppingScheme
->
extract
Difference
(
problem_iterate
,
u
_diff
);
timeSteppingScheme
->
extract
Velocity
(
problem_iterate
,
u
d
);
// Update the state
// Update the state
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
{
if
(
frictionalNodes
[
i
][
0
])
{
if
(
frictionalNodes
[
i
][
0
])
{
double
const
unorm
=
u
_diff
[
i
].
two_norm
();
double
const
unorm
=
u
d
[
i
].
two_norm
()
*
tau
;
// // the (logarithmic) steady state corresponding to the
// // the (logarithmic) steady state corresponding to the
// // current velocity
// // current velocity
...
@@ -353,7 +353,7 @@ int main(int argc, char *argv[]) {
...
@@ -353,7 +353,7 @@ int main(int argc, char *argv[]) {
// with the Ruina state evolution law.
// with the Ruina state evolution law.
// Jumps at 120 and 360 timesteps; v1 = .6 * v2;
// Jumps at 120 and 360 timesteps; v1 = .6 * v2;
if
(
parset
.
get
<
bool
>
(
"printVelocitySteppingComparison"
))
{
if
(
parset
.
get
<
bool
>
(
"printVelocitySteppingComparison"
))
{
double
const
v
=
u
_diff
[
first_frictional_node
].
two_norm
()
/
tau
/
L
;
double
const
v
=
u
d
[
first_frictional_node
].
two_norm
()
/
L
;
double
const
euler
=
alpha
[
first_frictional_node
];
double
const
euler
=
alpha
[
first_frictional_node
];
double
direct
;
double
direct
;
...
@@ -377,7 +377,7 @@ int main(int argc, char *argv[]) {
...
@@ -377,7 +377,7 @@ int main(int argc, char *argv[]) {
// Record the coefficient of friction at a fixed node
// Record the coefficient of friction at a fixed node
if
(
parset
.
get
<
bool
>
(
"printCoefficient"
))
{
if
(
parset
.
get
<
bool
>
(
"printCoefficient"
))
{
double
const
V
=
u
_diff
[
first_frictional_node
].
two_norm
();
double
const
V
=
u
d
[
first_frictional_node
].
two_norm
();
double
const
state
=
alpha
[
first_frictional_node
];
double
const
state
=
alpha
[
first_frictional_node
];
coefficient_writer
<<
(
mu
+
a
*
std
::
log
(
V
*
eta
)
+
coefficient_writer
<<
(
mu
+
a
*
std
::
log
(
V
*
eta
)
+
...
@@ -388,7 +388,7 @@ int main(int argc, char *argv[]) {
...
@@ -388,7 +388,7 @@ int main(int argc, char *argv[]) {
if
(
parset
.
get
<
bool
>
(
"printFrictionalVelocity"
))
{
if
(
parset
.
get
<
bool
>
(
"printFrictionalVelocity"
))
{
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
if
(
frictionalNodes
[
i
][
0
])
if
(
frictionalNodes
[
i
][
0
])
std
::
cout
<<
u
_diff
[
i
][
0
]
*
timesteps
<<
" "
;
std
::
cout
<<
u
d
[
i
][
0
]
<<
" "
;
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
}
}
u_old_old
=
u_old
;
u_old_old
=
u_old
;
...
...
This diff is collapsed.
Click to expand it.
src/timestepping.cc
+
8
−
10
View file @
2a336f94
...
@@ -23,8 +23,8 @@ class TimeSteppingScheme {
...
@@ -23,8 +23,8 @@ class TimeSteppingScheme {
void
virtual
extractSolution
(
VectorType
const
&
problem_iterate
,
void
virtual
extractSolution
(
VectorType
const
&
problem_iterate
,
VectorType
&
solution
)
const
=
0
;
VectorType
&
solution
)
const
=
0
;
void
virtual
extract
Difference
(
VectorType
const
&
problem_iterate
,
void
virtual
extract
Velocity
(
VectorType
const
&
problem_iterate
,
VectorType
&
difference
)
const
=
0
;
VectorType
&
velocity
)
const
=
0
;
protected
:
protected
:
VectorType
const
&
ell
;
VectorType
const
&
ell
;
...
@@ -84,10 +84,9 @@ class ImplicitEuler
...
@@ -84,10 +84,9 @@ class ImplicitEuler
solution
.
axpy
(
this
->
tau
,
problem_iterate
);
solution
.
axpy
(
this
->
tau
,
problem_iterate
);
}
}
void
virtual
extractDifference
(
VectorType
const
&
problem_iterate
,
void
virtual
extractVelocity
(
VectorType
const
&
problem_iterate
,
VectorType
&
difference
)
const
{
VectorType
&
velocity
)
const
{
difference
=
problem_iterate
;
velocity
=
problem_iterate
;
difference
*=
this
->
tau
;
}
}
};
};
...
@@ -151,9 +150,8 @@ class ImplicitTwoStep
...
@@ -151,9 +150,8 @@ class ImplicitTwoStep
}
}
}
}
void
virtual
extractDifference
(
VectorType
const
&
problem_iterate
,
void
virtual
extractVelocity
(
VectorType
const
&
problem_iterate
,
VectorType
&
difference
)
const
{
VectorType
&
velocity
)
const
{
difference
=
problem_iterate
;
velocity
=
problem_iterate
;
difference
*=
this
->
tau
;
}
}
};
};
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