Skip to content
GitLab
Projects Groups Topics 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
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 98
    • Issues 98
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 89
    • Merge requests 89
  • 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
  • #964
Closed
Open
Issue created Nov 07, 2020 by Kilian Weishaupt@kweisMaintainer

[fluidmatrixinteraction] Temporary fluidmatrix law objects always get copied

When using

    template<class ElementSolution>
    auto fluidMatrixInteraction(const Element& element,
                                const SubControlVolume& scv,
                                const ElementSolution& elemSol) const
    {
        const auto params = ....; 
        return makeFluidMatrixInteraction(MyTemporaryPcSwCurve(params));
    }

the temporary object gets always copied in the PcKrSw constructor in fluidmatrixinteraction.hh

This also prevents using unique_ptrs in MyTemporaryPcSwCurve.

I suggest to change PcKrSw's ctor such that:


    template<class CtorType>
    PcKrSw(CtorType&& impl) : impl_(std::forward<CtorType>(impl))
    {
        static_assert(std::is_same_v<std::decay_t<T>, std::decay_t<CtorType>>);
    }

This means that CtorType (please feel free to suggest a better name) can be different from T.

Assignee
Assign to
Time tracking