Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
fa441e6b
Commit
fa441e6b
authored
May 10, 2021
by
Dmitry Pavlov
Committed by
Timo Koch
Jun 28, 2021
Browse files
Tabulated2DFunction::get(): out-of-bounds fix, also preferring interpolation to extrapolation
parent
cd899248
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/common/tabulated2dfunction.hh
View file @
fa441e6b
...
...
@@ -113,7 +113,7 @@ public:
*/
Scalar
xToI
(
Scalar
x
)
const
{
return
(
x
-
xMin_
)
/
(
xMax_
-
xMin_
)
*
m_
;
return
(
x
-
xMin_
)
/
(
xMax_
-
xMin_
)
*
(
m_
-
1
)
;
}
...
...
@@ -127,7 +127,7 @@ public:
*/
Scalar
yToJ
(
Scalar
y
)
const
{
return
(
y
-
yMin_
)
/
(
yMax_
-
yMin_
)
*
n_
;
return
(
y
-
yMin_
)
/
(
yMax_
-
yMin_
)
*
(
n_
-
1
)
;
}
...
...
@@ -165,10 +165,9 @@ public:
Scalar
alpha
=
xToI
(
x
);
Scalar
beta
=
yToJ
(
y
);
using
std
::
max
;
using
std
::
min
;
int
i
=
max
(
0
,
min
(
m_
,
static_cast
<
int
>
(
alpha
)));
int
j
=
max
(
0
,
min
(
n_
,
static_cast
<
int
>
(
beta
)));
using
std
::
clamp
;
int
i
=
clamp
(
static_cast
<
int
>
(
alpha
),
0
,
m_
-
2
);
int
j
=
clamp
(
static_cast
<
int
>
(
beta
),
0
,
n_
-
2
);
alpha
-=
i
;
beta
-=
j
;
...
...
Timo Koch
@timok
mentioned in commit
d5c72a9c
·
Jun 28, 2021
mentioned in commit
d5c72a9c
mentioned in commit d5c72a9cc035477f189728e814a83f77c88f6d25
Toggle commit list
Timo Koch
@timok
mentioned in merge request
!2693 (merged)
·
Jun 28, 2021
mentioned in merge request
!2693 (merged)
mentioned in merge request !2693
Toggle commit list
Timo Koch
@timok
mentioned in commit
c67e7e18
·
Jun 29, 2021
mentioned in commit
c67e7e18
mentioned in commit c67e7e1837066b5f63cf47cbd13efc003a17dd47
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment