60 const SpatialParams& spatialParams,
61 const SolutionVector& x)
63 using MaterialLaw =
typename SpatialParams::MaterialLaw;
66 using Elem =
typename GridGeometry::GridView::template Codim<0>::Entity;
68 using Scv =
typename GridGeometry::SubControlVolume;
69 using ReturnType =
decltype(spatialParams.materialLawParams(Elem(), Scv(), ElemSol()));
70 static_assert(std::is_lvalue_reference<ReturnType>::value,
71 "In order to use the box-interface solver please provide access "
72 "to the material law parameters via returning (const) references");
76 DUNE_THROW(Dune::InvalidStateException,
"Determination of the interface material parameters with "
77 "this class only makes sense when using the box method!");
80 isOnMaterialInterface_.resize(gridGeometry.numDofs(),
false);
81 dofParams_.resize(gridGeometry.numDofs(),
nullptr);
82 for (
const auto& element : elements(gridGeometry.gridView()))
86 auto fvGeometry =
localView(gridGeometry);
87 fvGeometry.bind(element);
88 for (
const auto& scv : scvs(fvGeometry))
90 const auto& params = spatialParams.materialLawParams(element, scv, elemSol);
93 if (dofParams_[scv.dofIndex()] ==
nullptr)
94 dofParams_[scv.dofIndex()] = ¶ms;
97 else if (MaterialLaw::endPointPc( params ) < MaterialLaw::endPointPc( *(dofParams_[scv.dofIndex()]) ))
99 dofParams_[scv.dofIndex()] = ¶ms;
100 isOnMaterialInterface_[scv.dofIndex()] =
true;
104 else if ( !(params == *(dofParams_[scv.dofIndex()])) )
105 isOnMaterialInterface_[scv.dofIndex()] =
true;