67 void update(
const GridGeometry& gridGeometry,
68 const SpatialParams& spatialParams,
69 const SolutionVector& x)
73 DUNE_THROW(Dune::InvalidStateException,
"Determination of the interface material parameters with "
74 "this class only makes sense when using the box method!");
76 isOnMaterialInterface_.resize(gridGeometry.numDofs(),
false);
77 pcSwAtDof_.resize(gridGeometry.numDofs(),
nullptr);
78 for (
const auto& element : elements(gridGeometry.gridView()))
82 auto fvGeometry =
localView(gridGeometry);
83 fvGeometry.bind(element);
84 for (
const auto& scv : scvs(fvGeometry))
86 const auto fluidMatrixInteraction = spatialParams.fluidMatrixInteraction(element, scv, elemSol);
87 const auto& pcKrSw = fluidMatrixInteraction.pcSwCurve();
90 static_assert(std::is_lvalue_reference<
typename std::decay_t<
decltype(fluidMatrixInteraction)>::PcKrSwType>::value,
91 "In order to use the box-interface solver please provide access "
92 "to the material law parameters via returning (const) references");
95 if (!pcSwAtDof_[scv.dofIndex()])
96 pcSwAtDof_[scv.dofIndex()] = &pcKrSw;
99 else if (pcKrSw.endPointPc() < pcSwAtDof_[scv.dofIndex()]->endPointPc())
101 pcSwAtDof_[scv.dofIndex()] = &pcKrSw;
102 isOnMaterialInterface_[scv.dofIndex()] =
true;
106 else if ( !(pcKrSw == *(pcSwAtDof_[scv.dofIndex()])) )
107 isOnMaterialInterface_[scv.dofIndex()] =
true;