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
58ef9bfc
Commit
58ef9bfc
authored
12 years ago
by
Elias Pipping
Committed by
Elias Pipping
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Move coefficient logic to a function
parent
1a5d975c
No related branches found
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
+10
-3
10 additions, 3 deletions
src/one-body-sample.cc
src/one-body-sample.parset
+1
-1
1 addition, 1 deletion
src/one-body-sample.parset
with
11 additions
and
4 deletions
src/one-body-sample.cc
+
10
−
3
View file @
58ef9bfc
...
@@ -139,6 +139,13 @@ template <class FunctionMap> void initPython(FunctionMap &functions) {
...
@@ -139,6 +139,13 @@ template <class FunctionMap> void initPython(FunctionMap &functions) {
.
toC
<
typename
FunctionMap
::
Base
>
(
functions
);
.
toC
<
typename
FunctionMap
::
Base
>
(
functions
);
}
}
double
computeCOF
(
double
mu0
,
double
a
,
double
b
,
double
V0
,
double
L
,
double
V
,
double
log_state
)
{
double
const
mu
=
mu0
+
a
*
std
::
log
(
V
/
V0
)
+
b
*
(
log_state
+
std
::
log
(
V0
/
L
));
return
(
mu
>
0
)
?
mu
:
0
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
try
{
Dune
::
Timer
timer
;
Dune
::
Timer
timer
;
...
@@ -158,7 +165,7 @@ int main(int argc, char *argv[]) {
...
@@ -158,7 +165,7 @@ int main(int argc, char *argv[]) {
auto
const
E
=
parset
.
get
<
double
>
(
"body.E"
);
auto
const
E
=
parset
.
get
<
double
>
(
"body.E"
);
auto
const
nu
=
parset
.
get
<
double
>
(
"body.nu"
);
auto
const
nu
=
parset
.
get
<
double
>
(
"body.nu"
);
auto
const
mu
=
parset
.
get
<
double
>
(
"boundary.friction.mu"
);
auto
const
mu
0
=
parset
.
get
<
double
>
(
"boundary.friction.mu
0
"
);
auto
const
a
=
parset
.
get
<
double
>
(
"boundary.friction.a"
);
auto
const
a
=
parset
.
get
<
double
>
(
"boundary.friction.a"
);
auto
const
b
=
parset
.
get
<
double
>
(
"boundary.friction.b"
);
auto
const
b
=
parset
.
get
<
double
>
(
"boundary.friction.b"
);
auto
const
V0
=
parset
.
get
<
double
>
(
"boundary.friction.V0"
);
auto
const
V0
=
parset
.
get
<
double
>
(
"boundary.friction.V0"
);
...
@@ -480,8 +487,8 @@ int main(int argc, char *argv[]) {
...
@@ -480,8 +487,8 @@ int main(int argc, char *argv[]) {
state_writer
<<
alpha
[
i
][
0
]
<<
" "
;
state_writer
<<
alpha
[
i
][
0
]
<<
" "
;
displacement_writer
<<
u
[
i
][
0
]
<<
" "
;
displacement_writer
<<
u
[
i
][
0
]
<<
" "
;
velocity_writer
<<
ud
[
i
][
0
]
<<
" "
;
velocity_writer
<<
ud
[
i
][
0
]
<<
" "
;
coefficient_writer
<<
mu
+
a
*
std
::
log
(
ud
[
i
].
two_norm
()
/
V0
)
+
coefficient_writer
<<
computeCOF
(
mu0
,
a
,
b
,
V0
,
L
,
ud
[
i
].
two_norm
()
,
b
*
(
alpha
[
i
]
+
std
::
log
(
V0
/
L
)
)
<<
" "
;
alpha
[
i
])
<<
" "
;
}
}
state_writer
<<
std
::
endl
;
state_writer
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
src/one-body-sample.parset
+
1
−
1
View file @
58ef9bfc
...
@@ -50,7 +50,7 @@ acceptFactor = 1.0
...
@@ -50,7 +50,7 @@ acceptFactor = 1.0
requiredResidual
=
1
e
-
12
requiredResidual
=
1
e
-
12
[
boundary
.
friction
]
[
boundary
.
friction
]
mu
=
0
.
6
mu
0
=
0
.
6
a
=
0
.
010
a
=
0
.
010
b
=
0
.
015
b
=
0
.
015
V0
=
1
V0
=
1
...
...
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