24#ifndef DUMUX_CC_ELEMENT_SOLUTION_HH
25#define DUMUX_CC_ELEMENT_SOLUTION_HH
38template<
class FVElementGeometry,
class PV>
41 using GridGeometry =
typename FVElementGeometry::GridGeometry;
42 using GridView =
typename GridGeometry::GridView;
43 using Element =
typename GridView::template Codim<0>::Entity;
53 template<
class SolutionVector>
55 const GridGeometry& gridGeometry)
60 template<
class ElementVolumeVariables>
62 const FVElementGeometry& fvGeometry)
64 for (
const auto& scv : scvs(fvGeometry))
65 priVars_ = elemVolVars[scv].priVars();
70 : priVars_(std::move(priVars)) {}
74 : priVars_(priVars) {}
77 template<
class SolutionVector>
78 void update(
const Element& element,
const SolutionVector& sol,
79 const GridGeometry& gridGeometry)
81 priVars_ = sol[gridGeometry.elementMapper().index(element)];
85 constexpr std::size_t
size()
const
89 template<
typename IndexType>
92 assert(i == 0 &&
"Index exceeds valid range!");
97 template<
typename IndexType>
100 assert(i == 0 &&
"Index exceeds valid range!");
112template<
class Element,
class SolutionVector,
class Gr
idGeometry>
113auto elementSolution(
const Element& element,
const SolutionVector& sol,
const GridGeometry& gg)
116 CCElementSolution<
typename GridGeometry::LocalView,
117 std::decay_t<decltype(std::declval<SolutionVector>()[0])>>
120 using PrimaryVariables = std::decay_t<decltype(std::declval<SolutionVector>()[0])>;
121 return CCElementSolution<typename GridGeometry::LocalView, PrimaryVariables>(element, sol, gg);
128template<
class Element,
class ElementVolumeVariables,
class FVElementGeometry>
129auto elementSolution(
const Element& element,
const ElementVolumeVariables& elemVolVars,
const FVElementGeometry& gg)
132 CCElementSolution<FVElementGeometry, typename ElementVolumeVariables::VolumeVariables::PrimaryVariables>>
134 using PrimaryVariables =
typename ElementVolumeVariables::VolumeVariables::PrimaryVariables;
135 return CCElementSolution<FVElementGeometry, PrimaryVariables>(element, elemVolVars, gg);
143template<
class FVElementGeometry,
class PrimaryVariables>
157template<
class FVElementGeometry,
class PrimaryVariables>
The available discretization methods in Dumux.
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethods::box, BoxElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for box schemes.
Definition: box/elementsolution.hh:118
constexpr CCMpfa ccmpfa
Definition: method.hh:138
constexpr CCTpfa cctpfa
Definition: method.hh:137
The element solution vector.
Definition: cellcentered/elementsolution.hh:40
CCElementSolution(PrimaryVariables &&priVars)
Constructor with a primary variable object.
Definition: cellcentered/elementsolution.hh:69
const PrimaryVariables & operator[](IndexType i) const
bracket operator const access
Definition: cellcentered/elementsolution.hh:90
CCElementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gridGeometry)
Constructor with element, solution vector and grid geometry.
Definition: cellcentered/elementsolution.hh:54
constexpr std::size_t size() const
return the size of the element solution
Definition: cellcentered/elementsolution.hh:85
void update(const Element &element, const SolutionVector &sol, const GridGeometry &gridGeometry)
extract the element solution from the solution vector using a mapper
Definition: cellcentered/elementsolution.hh:78
CCElementSolution(const Element &element, const ElementVolumeVariables &elemVolVars, const FVElementGeometry &fvGeometry)
Constructor with element, element volume variables and fv element geometry.
Definition: cellcentered/elementsolution.hh:61
PV PrimaryVariables
export the primary variables type
Definition: cellcentered/elementsolution.hh:47
CCElementSolution(const PrimaryVariables &priVars)
Constructor with a primary variable object.
Definition: cellcentered/elementsolution.hh:73
CCElementSolution()=default
default constructor