Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • dumux dumux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 88
    • Issues 88
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 82
    • Merge requests 82
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • dumux-repositories
  • dumuxdumux
  • Merge requests
  • !2692

Merged
Created Jun 28, 2021 by Timo Koch@timokOwner

Tabulated2DFunction::get(): out-of-bounds fix, also preferring interpolation to extrapolation

  • Overview 0
  • Commits 1
  • Changes 1

There are two issues. First, we have m * n points, so (m-1) * (n - 1) intervals. The existing iToX and jToY functions are written in accordance. However, xToI and jToY do not match. They assume that there are m*n intervals. That needs to be fixed.

The second issue is the following code in get():

        int i = max(0, min(m_, static_cast<int>(alpha)));
        int j = max(0, min(n_, static_cast<int>(beta)));

With x == xMax, alpha will be as big as (m_- 1) even after the proposed fix to xToI. But we need an interval number here, not a point number, and there is no (m_- 1)-th interval (not to mention _m-th). So we need to cut i at (m_ - 2). Similarly with j.

Without the fix, the assertions in getSamplePoint

        assert(0 <= i && i < m_);
        assert(0 <= j && j < n_);

rightfully fail when x is close to xMax or y is close to yMax.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: dpavlov/dumux-fix/tabulated2dfunction