Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • dumux dumux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 100
    • Issues 100
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 87
    • Merge requests 87
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • dumux-repositoriesdumux-repositories
  • dumuxdumux
  • Issues
  • #1159
Closed
Open
Issue created May 25, 2022 by Yue Wang@yueMaintainer

Wrong return type for function outsideScvfWithSameIntegrationPoint

The code here may return otherScvf as a reference of a local variable if caching is disabled.

   template<class FVElementGeometry, class SubControlVolumeFace>
    static const SubControlVolumeFace& outsideScvfWithSameIntegrationPoint(const FVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf)
    {
        const auto& lateralOrthogonalScvf = fvGeometry.lateralOrthogonalScvf(scvf);
        assert(!lateralOrthogonalScvf.boundary());

        const int offset = (dim == 2) ? 3 : 5;
        const auto otherLocalIdx = isOdd_(scvf.localIndex()) ? scvf.localIndex() - offset : scvf.localIndex() + offset;

        auto outsideFVGeometry = localView(fvGeometry.gridGeometry());
        const auto outsideElementIdx = fvGeometry.scv(lateralOrthogonalScvf.outsideScvIdx()).elementIndex();
        outsideFVGeometry.bindElement(fvGeometry.gridGeometry().element(outsideElementIdx));

        for (const auto& otherScvf : scvfs(outsideFVGeometry))
        {
            if (otherScvf.localIndex() == otherLocalIdx)
                return otherScvf;
        }

        DUNE_THROW(Dune::InvalidStateException, "No outside scvf found");
    }
Edited May 25, 2022 by Timo Koch
Assignee
Assign to
Time tracking