55 void update(
const GridGeometry& gridGeometry,
56 const SpatialParams& spatialParams,
57 const SolutionVector& x)
61 DUNE_THROW(Dune::InvalidStateException,
"Determination of the interface material parameters with "
62 "this class only makes sense when using the box method!");
64 isOnMaterialInterface_.resize(gridGeometry.numDofs(),
false);
65 pcSwAtDof_.resize(gridGeometry.numDofs(),
nullptr);
66 auto fvGeometry =
localView(gridGeometry);
67 for (
const auto& element : elements(gridGeometry.gridView()))
70 fvGeometry.bind(element);
72 for (
const auto& scv : scvs(fvGeometry))
74 const auto fluidMatrixInteraction = spatialParams.fluidMatrixInteraction(element, scv, elemSol);
75 const auto& pcKrSw = fluidMatrixInteraction.pcSwCurve();
78 static_assert(std::is_lvalue_reference<
typename std::decay_t<
decltype(fluidMatrixInteraction)>::PcKrSwType>::value,
79 "In order to use the box-interface solver please provide access "
80 "to the material law parameters via returning (const) references");
83 if (!pcSwAtDof_[scv.dofIndex()])
84 pcSwAtDof_[scv.dofIndex()] = &pcKrSw;
87 else if (pcKrSw.endPointPc() < pcSwAtDof_[scv.dofIndex()]->endPointPc())
89 pcSwAtDof_[scv.dofIndex()] = &pcKrSw;
90 isOnMaterialInterface_[scv.dofIndex()] =
true;
94 else if ( !(pcKrSw == *(pcSwAtDof_[scv.dofIndex()])) )
95 isOnMaterialInterface_[scv.dofIndex()] =
true;