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
3793cea1
Commit
3793cea1
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Do not use bisection for the Ruina update
parent
6b6407e2
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/compute_state_ruina.cc
+5
-52
5 additions, 52 deletions
src/compute_state_ruina.cc
with
5 additions
and
52 deletions
src/compute_state_ruina.cc
+
5
−
52
View file @
3793cea1
#include
<cassert>
#include
<dune/common/fvector.hh>
#include
<dune/common/fmatrix.hh>
#include
<dune/fufem/interval.hh>
#include
<dune/tnnmg/problem-classes/bisection.hh>
#include
<dune/tectonic/mydirectionalconvexfunction.hh>
#include
<cmath>
#include
"compute_state_ruina.hh"
// Ruina's nonlinearity
class
Ruina
{
public:
typedef
Dune
::
FieldVector
<
double
,
1
>
VectorType
;
typedef
Dune
::
FieldMatrix
<
double
,
1
,
1
>
MatrixType
;
Ruina
(
double
h
,
double
uol
)
:
h
(
h
),
uol
(
uol
)
{}
void
directionalSubDiff
(
VectorType
const
&
u
,
VectorType
const
&
v
,
Interval
<
double
>
&
D
)
const
{
if
(
uol
==
0
)
D
[
0
]
=
D
[
1
]
=
v
[
0
]
*
uol
*
(
u
[
0
]);
else
D
[
0
]
=
D
[
1
]
=
v
[
0
]
*
uol
*
(
u
[
0
]
+
std
::
log
(
uol
/
h
));
}
void
directionalDomain
(
VectorType
const
&
,
VectorType
const
&
,
Interval
<
double
>
&
dom
)
const
{
dom
[
0
]
=
-
std
::
numeric_limits
<
double
>::
max
();
dom
[
1
]
=
std
::
numeric_limits
<
double
>::
max
();
}
private
:
double
const
h
;
double
const
uol
;
};
double
state_update_ruina_bisection
(
double
h
,
double
uol
,
double
old_state
)
{
Ruina
::
VectorType
const
start
(
0
);
Ruina
::
VectorType
const
direction
(
1
);
Ruina
const
phi
(
h
,
uol
);
MyDirectionalConvexFunction
<
Ruina
>
const
J
(
1.0
,
old_state
,
phi
,
start
,
direction
);
int
bisectionsteps
=
0
;
Bisection
const
bisection
(
0.0
,
1.0
,
1e-12
,
true
,
0
);
// TODO
return
bisection
.
minimize
(
J
,
0.0
,
0.0
,
bisectionsteps
);
// TODO
}
double
state_update_ruina
(
double
h
,
double
uol
,
// unorm/L
double
old_state
)
{
double
const
uol_log_uol
=
(
uol
==
0
)
?
0.0
:
uol
*
std
::
log
(
uol
);
double
ret1
=
state_update_ruina_bisection
(
h
,
uol
,
old_state
);
assert
(
std
::
abs
(
ret1
+
uol
*
ret1
-
old_state
+
uol_log_uol
-
uol
*
std
::
log
(
h
))
<
1e-14
);
if
(
uol
==
0
)
return
old_state
;
return
ret1
;
double
const
ret
=
old_state
-
uol
*
std
::
log
(
uol
/
h
);
return
ret
/
(
1
+
uol
);
}
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