12#ifndef DUMUX_STAGGERED_ELEMENT_SOLUTION_HH
13#define DUMUX_STAGGERED_ELEMENT_SOLUTION_HH
16#include <dune/istl/bvector.hh>
28template<
class PrimaryVariables,
class CellCenterPrimaryVariables>
31 static_assert(int(PrimaryVariables::dimension) > int(CellCenterPrimaryVariables::dimension),
32 "PrimaryVariables' size must be greater than the one of CellCenterPrimaryVariables");
34 PrimaryVariables priVars(0.0);
35 constexpr auto offset = PrimaryVariables::dimension - CellCenterPrimaryVariables::dimension;
36 for (std::size_t i = 0; i < cellCenterPriVars.size(); ++i)
37 priVars[i + offset] = cellCenterPriVars[i];
41template<
class PrimaryVariables>
49template<
class FVElementGeometry,
class PrimaryVariables>
64template<
class PrimaryVariables,
class CellCenterPrimaryVariables>
StaggeredElementSolution< PrimaryVariables > makeElementSolutionFromCellCenterPrivars(const CellCenterPrimaryVariables &cellCenterPriVars)
Helper function to create an elementSolution from cell center primary variables.
Definition: staggered/elementsolution.hh:65
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethods::cctpfa||GridGeometry::discMethod==DiscretizationMethods::ccmpfa, CCElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for cell-centered schemes.
Definition: cellcentered/elementsolution.hh:101
PrimaryVariables makePriVarsFromCellCenterPriVars(const CellCenterPrimaryVariables &cellCenterPriVars)
Helper function to create a PrimaryVariables object from CellCenterPrimaryVariables.
Definition: staggered/elementsolution.hh:29
The available discretization methods in Dumux.
constexpr Staggered staggered
Definition: method.hh:149
Dune::BlockVector< PrimaryVariables > StaggeredElementSolution
Definition: staggered/elementsolution.hh:42