[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
.