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
ccaf7962
Commit
ccaf7962
authored
11 years ago
by
Elias Pipping
Committed by
Elias Pipping
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make as little virtual as possible
parent
7b1dfa20
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
dune/tectonic/frictionpotential.hh
+10
-10
10 additions, 10 deletions
dune/tectonic/frictionpotential.hh
with
10 additions
and
10 deletions
dune/tectonic/frictionpotential.hh
+
10
−
10
View file @
ccaf7962
...
@@ -48,7 +48,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
...
@@ -48,7 +48,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
// which would avoid the std::exp(std::log())
// which would avoid the std::exp(std::log())
{}
{}
double
virtual
evaluate
(
double
V
)
const
{
double
evaluate
(
double
V
)
const
{
assert
(
V
>=
0
);
assert
(
V
>=
0
);
if
(
V
<=
V_m
)
if
(
V
<=
V_m
)
return
0
;
return
0
;
...
@@ -59,7 +59,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
...
@@ -59,7 +59,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
// log(V/V_m) if V >= V_0
// log(V/V_m) if V >= V_0
// 0 otherwise
// 0 otherwise
double
virtual
differential
(
double
V
)
const
{
double
differential
(
double
V
)
const
{
assert
(
V
>=
0
);
assert
(
V
>=
0
);
if
(
V
<=
V_m
)
if
(
V
<=
V_m
)
return
0
;
return
0
;
...
@@ -70,7 +70,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
...
@@ -70,7 +70,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
// 1/V if V > V_0
// 1/V if V > V_0
// undefined if V == V_0
// undefined if V == V_0
// 0 if V < V_0
// 0 if V < V_0
double
virtual
second_deriv
(
double
V
)
const
{
double
second_deriv
(
double
V
)
const
{
assert
(
V
>=
0
);
assert
(
V
>=
0
);
if
(
V
<=
V_m
)
if
(
V
<=
V_m
)
return
0
;
return
0
;
...
@@ -78,7 +78,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
...
@@ -78,7 +78,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
return
coefficientProduct
/
V
;
return
coefficientProduct
/
V
;
}
}
double
virtual
regularity
(
double
V
)
const
{
double
regularity
(
double
V
)
const
{
assert
(
V
>=
0
);
assert
(
V
>=
0
);
// TODO: Make this controllable
// TODO: Make this controllable
if
(
std
::
abs
(
V
-
V_m
)
<
1e-14
)
if
(
std
::
abs
(
V
-
V_m
)
<
1e-14
)
...
@@ -87,7 +87,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
...
@@ -87,7 +87,7 @@ class FrictionPotential : public FrictionPotentialWrapper {
return
std
::
abs
(
second_deriv
(
V
));
return
std
::
abs
(
second_deriv
(
V
));
}
}
double
virtual
smallestPositivePoint
()
const
{
return
V_m
;
}
double
smallestPositivePoint
()
const
{
return
V_m
;
}
private
:
private
:
double
const
coefficientProduct
;
double
const
coefficientProduct
;
...
@@ -96,15 +96,15 @@ class FrictionPotential : public FrictionPotentialWrapper {
...
@@ -96,15 +96,15 @@ class FrictionPotential : public FrictionPotentialWrapper {
class
TrivialFunction
:
public
FrictionPotentialWrapper
{
class
TrivialFunction
:
public
FrictionPotentialWrapper
{
public:
public:
double
virtual
evaluate
(
double
)
const
{
return
0
;
}
double
evaluate
(
double
)
const
{
return
0
;
}
double
virtual
differential
(
double
)
const
{
return
0
;
}
double
differential
(
double
)
const
{
return
0
;
}
double
virtual
second_deriv
(
double
)
const
{
return
0
;
}
double
second_deriv
(
double
)
const
{
return
0
;
}
double
virtual
regularity
(
double
)
const
{
return
0
;
}
double
regularity
(
double
)
const
{
return
0
;
}
double
virtual
smallestPositivePoint
()
const
{
double
smallestPositivePoint
()
const
{
return
std
::
numeric_limits
<
double
>::
infinity
();
return
std
::
numeric_limits
<
double
>::
infinity
();
}
}
};
};
...
...
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