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
0dd26cf1
Commit
0dd26cf1
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Prepare for Ruina nonlinearity; u/L -> uol
parent
b52ca9ed
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/compute_state.cc
+10
-8
10 additions, 8 deletions
src/compute_state.cc
src/compute_state.hh
+1
-1
1 addition, 1 deletion
src/compute_state.hh
src/one-body-sample.cc
+1
-1
1 addition, 1 deletion
src/one-body-sample.cc
with
12 additions
and
10 deletions
src/compute_state.cc
+
10
−
8
View file @
0dd26cf1
...
@@ -10,7 +10,8 @@
...
@@ -10,7 +10,8 @@
#include
"compute_state.hh"
#include
"compute_state.hh"
// The nonlinearity exp(-x)
// The nonlinearity exp(-x) [ Note: the Dieterich law has an additional linear
// term! ]
class
DecayingExponential
{
class
DecayingExponential
{
public:
public:
typedef
Dune
::
FieldVector
<
double
,
1
>
VectorType
;
typedef
Dune
::
FieldVector
<
double
,
1
>
VectorType
;
...
@@ -33,22 +34,23 @@ class DecayingExponential {
...
@@ -33,22 +34,23 @@ class DecayingExponential {
double
const
h
;
double
const
h
;
};
};
double
compute_
state_update_bisection
(
double
h
,
double
u
norm
,
double
L
,
double
state_update_
dieterich_
bisection
(
double
h
,
double
u
ol
,
double
old_state
)
{
double
old_state
)
{
DecayingExponential
::
VectorType
const
start
(
0
);
DecayingExponential
::
VectorType
const
start
(
0
);
DecayingExponential
::
VectorType
const
direction
(
1
);
DecayingExponential
::
VectorType
const
direction
(
1
);
DecayingExponential
const
phi
(
h
);
DecayingExponential
const
phi
(
h
);
MyDirectionalConvexFunction
<
DecayingExponential
>
const
J
(
MyDirectionalConvexFunction
<
DecayingExponential
>
const
J
(
1.0
,
old_state
-
unorm
/
L
,
phi
,
start
,
direction
);
1.0
,
old_state
-
uol
,
phi
,
start
,
direction
);
int
bisectionsteps
=
0
;
int
bisectionsteps
=
0
;
Bisection
const
bisection
(
0.0
,
1.0
,
1e-12
,
true
,
0
);
// TODO
Bisection
const
bisection
(
0.0
,
1.0
,
1e-12
,
true
,
0
);
// TODO
return
bisection
.
minimize
(
J
,
0.0
,
0.0
,
bisectionsteps
);
// TODO
return
bisection
.
minimize
(
J
,
0.0
,
0.0
,
bisectionsteps
);
// TODO
}
}
double
compute_
state_update
(
double
h
,
double
u
norm
,
double
L
,
double
state_update
_dieterich
(
double
h
,
double
u
ol
,
// unorm /
L
double
old_state
)
{
double
old_state
)
{
double
ret1
=
compute_
state_update_bisection
(
h
,
u
norm
,
L
,
old_state
);
double
const
ret1
=
state_update_
dieterich_
bisection
(
h
,
u
ol
,
old_state
);
assert
(
std
::
abs
(
ret1
-
old_state
+
u
norm
/
L
-
h
*
std
::
exp
(
-
ret1
))
<
1e-12
);
assert
(
std
::
abs
(
ret1
-
old_state
+
u
ol
-
h
*
std
::
exp
(
-
ret1
))
<
1e-12
);
return
ret1
;
return
ret1
;
}
}
This diff is collapsed.
Click to expand it.
src/compute_state.hh
+
1
−
1
View file @
0dd26cf1
#ifndef COMPUTE_STATE_HH
#ifndef COMPUTE_STATE_HH
#define COMPUTE_STATE_HH
#define COMPUTE_STATE_HH
double
compute_
state_update
(
double
h
,
double
u
norm
,
double
L
,
double
old_state
);
double
state_update
_dieterich
(
double
h
,
double
u
ol
,
double
old_state
);
#endif
#endif
This diff is collapsed.
Click to expand it.
src/one-body-sample.cc
+
1
−
1
View file @
0dd26cf1
...
@@ -277,7 +277,7 @@ int main(int argc, char *argv[]) {
...
@@ -277,7 +277,7 @@ int main(int argc, char *argv[]) {
// velocity
// velocity
// std::cout << std::log(L/unorm * h) << std::endl;
// std::cout << std::log(L/unorm * h) << std::endl;
(
*
s4_new
)[
i
]
=
compute_
state_update
(
h
,
unorm
,
L
,
s4_old
[
i
]);
(
*
s4_new
)[
i
]
=
state_update
_dieterich
(
h
,
unorm
/
L
,
s4_old
[
i
]);
}
}
}
}
if
(
parset
.
get
<
bool
>
(
"printProgress"
))
{
if
(
parset
.
get
<
bool
>
(
"printProgress"
))
{
...
...
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