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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
podlesny
dune-tectonic
Commits
5f17c947
Commit
5f17c947
authored
Sep 17, 2012
by
Elias Pipping
Committed by
Elias Pipping
Sep 17, 2012
Browse files
Options
Downloads
Patches
Plain Diff
Clean up data writers; now enabled unconditionally
parent
831d3fb2
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/one-body-sample.cc
+25
-28
25 additions, 28 deletions
src/one-body-sample.cc
src/one-body-sample.parset
+0
-3
0 additions, 3 deletions
src/one-body-sample.parset
with
25 additions
and
31 deletions
src/one-body-sample.cc
+
25
−
28
View file @
5f17c947
...
...
@@ -266,7 +266,9 @@ int main(int argc, char *argv[]) {
mySolver
(
parset
.
sub
(
"solver.tnnmg"
),
refinements
,
solver_tolerance
,
*
grid
,
ignoreNodes
);
std
::
fstream
octave_writer
(
"data"
,
std
::
fstream
::
out
);
std
::
fstream
state_writer
(
"state"
,
std
::
fstream
::
out
);
std
::
fstream
displacement_writer
(
"displacement"
,
std
::
fstream
::
out
);
std
::
fstream
velocity_writer
(
"velocity"
,
std
::
fstream
::
out
);
std
::
fstream
coefficient_writer
(
"coefficient"
,
std
::
fstream
::
out
);
std
::
fstream
velocity_stepping_writer
(
"velocity_stepping"
,
std
::
fstream
::
out
);
...
...
@@ -280,10 +282,6 @@ int main(int argc, char *argv[]) {
auto
const
timesteps
=
parset
.
get
<
size_t
>
(
"timeSteps"
);
double
const
tau
=
1.0
/
timesteps
;
octave_writer
<<
"# name: A"
<<
std
::
endl
<<
"# type: matrix"
<<
std
::
endl
<<
"# rows: "
<<
timesteps
<<
std
::
endl
<<
"# columns: 3"
<<
std
::
endl
;
velocity_stepping_writer
<<
"# name: B"
<<
std
::
endl
<<
"# type: matrix"
<<
std
::
endl
<<
"# rows: "
<<
timesteps
<<
std
::
endl
<<
"# columns: 2"
<<
std
::
endl
;
...
...
@@ -405,16 +403,6 @@ int main(int argc, char *argv[]) {
if
(
parset
.
get
<
bool
>
(
"printProgress"
))
std
::
cerr
<<
std
::
endl
;
// Record the state, (scaled) displacement, and Neumann
// condition at a fixed node
if
(
parset
.
get
<
bool
>
(
"writeEvolution"
))
{
double
out
;
neumannFunction
.
evaluate
(
time
,
out
);
octave_writer
<<
alpha
[
first_frictional_node
][
0
]
<<
" "
<<
u
[
first_frictional_node
][
0
]
*
1e6
<<
" "
<<
out
<<
std
::
endl
;
}
// Comparison with the analytic solution of a velocity stepping test
// with the Ruina state evolution law.
// Jumps at 120 and 360 timesteps; v1 = .6 * v2;
...
...
@@ -440,24 +428,31 @@ int main(int argc, char *argv[]) {
}
velocity_stepping_writer
<<
euler
<<
" "
<<
direct
<<
std
::
endl
;
}
// Record the coefficient of friction at a fixed node
if
(
parset
.
get
<
bool
>
(
"printCoefficient"
))
{
double
const
V
=
ud
[
first_frictional_node
].
two_norm
();
double
const
state
=
alpha
[
first_frictional_node
];
coefficient_writer
<<
(
mu
+
a
*
std
::
log
(
V
*
eta
)
+
b
*
(
state
-
std
::
log
(
eta
*
L
)))
<<
std
::
endl
;
}
}
alpha_old
=
alpha
;
if
(
parset
.
get
<
bool
>
(
"printFrictionalVelocity"
))
{
{
// Write all kinds of data
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
if
(
frictionalNodes
[
i
][
0
])
state_writer
<<
alpha
[
i
][
0
]
<<
" "
;
state_writer
<<
std
::
endl
;
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
if
(
frictionalNodes
[
i
][
0
])
displacement_writer
<<
u
[
i
][
0
]
<<
" "
;
displacement_writer
<<
std
::
endl
;
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
if
(
frictionalNodes
[
i
][
0
])
velocity_writer
<<
ud
[
i
][
0
]
<<
" "
;
velocity_writer
<<
std
::
endl
;
for
(
size_t
i
=
0
;
i
<
frictionalNodes
.
size
();
++
i
)
if
(
frictionalNodes
[
i
][
0
])
std
::
cout
<<
ud
[
i
][
0
]
<<
" "
;
std
::
cout
<<
std
::
endl
;
coefficient_writer
<<
mu
+
a
*
std
::
log
(
ud
[
i
].
two_norm
()
*
eta
)
+
b
*
(
alpha
[
i
]
-
std
::
log
(
eta
*
L
))
<<
" "
;
coefficient_writer
<<
std
::
endl
;
}
// Compute von Mises stress and write everything to a file
...
...
@@ -478,7 +473,9 @@ int main(int argc, char *argv[]) {
std
::
cerr
<<
std
::
endl
<<
"Making "
<<
timesteps
<<
" time steps took "
<<
timer
.
elapsed
()
<<
"s"
<<
std
::
endl
;
octave_writer
.
close
();
state_writer
.
close
();
displacement_writer
.
close
();
velocity_writer
.
close
();
coefficient_writer
.
close
();
velocity_stepping_writer
.
close
();
...
...
This diff is collapsed.
Click to expand it.
src/one-body-sample.parset
+
0
−
3
View file @
5f17c947
...
...
@@ -2,11 +2,8 @@
timeSteps
=
1000
verbose
=
false
printCoefficient
=
false
printFrictionalVelocity
=
false
printProgress
=
false
writeEvolution
=
false
writeVTK
=
false
printVelocitySteppingComparison
=
false
...
...
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