24#ifndef DUMUX_SCVF_TO_SCV_BCTYPES_HH
25#define DUMUX_SCVF_TO_SCV_BCTYPES_HH
28#include <dune/common/exceptions.hh>
37template<
class BoundaryTypes, DiscretizationMethod discMethod>
43 template<
class Problem>
49 const auto& gridGeometry = problem.gridGeometry();
50 scvBoundaryTypes.resize(gridGeometry.vertexMapper().size());
52 for (std::size_t vIdx = 0; vIdx < scvBoundaryTypes.size(); vIdx++)
53 scvBoundaryTypes[vIdx].setAllNeumann();
55 for (
const auto& element : elements(gridGeometry.gridView()))
58 auto fvGeometry =
localView(gridGeometry);
59 fvGeometry.bindElement(element);
61 for (
const auto& scvf : scvfs(fvGeometry))
66 const auto bcTypes = problem.boundaryTypes(element, scvf);
67 if (!bcTypes.hasDirichlet())
71 const auto& scv = fvGeometry.scv(scvf.insideScvIdx());
72 for (
int pvIdx = 0; pvIdx < bcTypes.size(); ++pvIdx)
73 if (bcTypes.isDirichlet(pvIdx))
74 scvBoundaryTypes[scv.dofIndex()].setDirichlet(pvIdx);
81 template<
class SubControlVolume>
85 return scvBoundaryTypes[scv.dofIndex()];
87 DUNE_THROW(Dune::InvalidStateException,
"Only use this for the box discretization!");
91 std::vector<BoundaryTypes> scvBoundaryTypes;
The available discretization methods in Dumux.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:38
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:38
Convert intersection boundary types to vertex boundary types.
Definition: scvftoscvboundarytypes.hh:39
ScvfToScvBoundaryTypes()=default
void computeBoundaryTypes(const Problem &problem)
Definition: scvftoscvboundarytypes.hh:44
const BoundaryTypes & boundaryTypes(const SubControlVolume &scv) const
get the boundary types of the scv
Definition: scvftoscvboundarytypes.hh:82