Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
dumux-repositories
dumux
Commits
a25e4e17
Commit
a25e4e17
authored
4 years ago
by
Samuel Scherrer
Committed by
Timo Koch
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[common] fix segment index issue in spline extrapolation
parent
6d430f90
No related branches found
No related tags found
1 merge request
!2235
[common] fix segment index issue in spline extrapolation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/common/splinecommon_.hh
+3
-3
3 additions, 3 deletions
dumux/common/splinecommon_.hh
with
3 additions
and
3 deletions
dumux/common/splinecommon_.hh
+
3
−
3
View file @
a25e4e17
...
...
@@ -145,12 +145,12 @@ public:
// handle extrapolation
if
(
extrapolate
)
{
if
(
x
<
xMin
())
{
Scalar
m
=
evalDerivative
(
xMin
(),
/*segmentIdx=*/
0
);
Scalar
m
=
evalDerivative
_
(
xMin
(),
/*segmentIdx=*/
0
);
Scalar
y0
=
y_
(
0
);
return
y0
+
m
*
(
x
-
xMin
());
}
else
if
(
x
>
xMax
())
{
Scalar
m
=
evalDerivative
(
xMax
(),
/*segmentIdx=*/
numSamples_
()
-
1
);
Scalar
m
=
evalDerivative
_
(
xMax
(),
/*segmentIdx=*/
numSamples_
()
-
2
);
Scalar
y0
=
y_
(
numSamples_
()
-
1
);
return
y0
+
m
*
(
x
-
xMax
());
}
...
...
@@ -179,7 +179,7 @@ public:
if
(
Dune
::
FloatCmp
::
le
(
x
,
xMin
()))
return
evalDerivative_
(
xMin
(),
0
);
else
if
(
Dune
::
FloatCmp
::
ge
(
x
,
xMax
()))
return
evalDerivative_
(
xMax
(),
numSamples_
()
-
1
);
return
evalDerivative_
(
xMax
(),
numSamples_
()
-
2
);
}
return
evalDerivative_
(
x
,
segmentIdx_
(
x
));
...
...
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