12#ifndef DUMUX_SCVF_TO_SCV_BCTYPES_HH
13#define DUMUX_SCVF_TO_SCV_BCTYPES_HH
16#include <dune/common/exceptions.hh>
25template<
class BoundaryTypes,
class DiscretizationMethod>
31 template<
class Problem>
37 const auto& gridGeometry = problem.gridGeometry();
38 scvBoundaryTypes.resize(gridGeometry.vertexMapper().size());
40 for (std::size_t vIdx = 0; vIdx < scvBoundaryTypes.size(); vIdx++)
41 scvBoundaryTypes[vIdx].setAllNeumann();
43 auto fvGeometry =
localView(gridGeometry);
44 for (
const auto& element : elements(gridGeometry.gridView()))
47 fvGeometry.bindElement(element);
49 for (
const auto& scvf : scvfs(fvGeometry))
54 const auto bcTypes = problem.boundaryTypes(element, scvf);
55 if (!bcTypes.hasDirichlet())
59 const auto& scv = fvGeometry.scv(scvf.insideScvIdx());
60 for (
int pvIdx = 0; pvIdx < bcTypes.size(); ++pvIdx)
61 if (bcTypes.isDirichlet(pvIdx))
62 scvBoundaryTypes[scv.dofIndex()].setDirichlet(pvIdx);
69 template<
class SubControlVolume>
73 return scvBoundaryTypes[scv.dofIndex()];
75 DUNE_THROW(Dune::InvalidStateException,
"Only use this for the box discretization!");
79 std::vector<BoundaryTypes> scvBoundaryTypes;
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:26
Convert intersection boundary types to vertex boundary types.
Definition: scvftoscvboundarytypes.hh:27
ScvfToScvBoundaryTypes()=default
void computeBoundaryTypes(const Problem &problem)
Definition: scvftoscvboundarytypes.hh:32
const BoundaryTypes & boundaryTypes(const SubControlVolume &scv) const
get the boundary types of the scv
Definition: scvftoscvboundarytypes.hh:70
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:26
The available discretization methods in Dumux.
constexpr Box box
Definition: method.hh:147