13#ifndef DUMUX_EXPERIMENTAL_MULTISTAGE_FV_LOCAL_OPERATOR_HH
14#define DUMUX_EXPERIMENTAL_MULTISTAGE_FV_LOCAL_OPERATOR_HH
21template<
class LocalOperator>
24 using ElementOperatorResultVector =
typename LocalOperator::ElementResidualVector;
32 , temporalWeight_(1.0)
36 template<
class FVGeometry,
class ElemVolVars>
38 const FVGeometry& fvGeometry,
39 const ElemVolVars& elemVolVars
41 ElementOperatorResultVector result(fvGeometry.numScv());
43 if (std::abs(temporalWeight_) > 1e-6)
45 for (
const auto& scv : scvs(fvGeometry))
46 result[scv.localDofIndex()] +=
47 op_.computeStorage(op_.problem(), scv, elemVolVars[scv])
48 * elemVolVars[scv].extrusionFactor()
57 template<
class FVGeometry,
class ElemVolVars,
class ElemFluxVars,
class ElemBCTypes>
59 const typename FVGeometry::Element&,
60 const FVGeometry& fvGeometry,
61 const ElemVolVars& elemVolVars,
62 const ElemFluxVars& elemFluxVarsCache,
63 const ElemBCTypes& bcTypes
65 ElementOperatorResultVector result(fvGeometry.numScv());
66 if (std::abs(spatialWeight_) > 1e-6)
68 result = op_.evalFluxAndSource(fvGeometry.element(), fvGeometry, elemVolVars, elemFluxVarsCache, bcTypes);
69 for (
auto& r : result)
77 template<
class Problem,
class FVGeometry,
class ElemVolVars,
class ElemFluxVars>
80 const typename FVGeometry::Element& element,
81 const FVGeometry& fvGeometry,
82 const ElemVolVars& elemVolVars,
83 const ElemFluxVars& elemFluxVarsCache,
84 const typename FVGeometry::SubControlVolumeFace& scvf
86 using NumEqVector = std::decay_t<
decltype(op_.evalFlux(op_.problem(), element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf))>;
88 if (std::abs(spatialWeight_) > 1e-6)
90 result = op_.evalFlux(op_.problem(), element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf);
91 result *= spatialWeight_;
103 {
return op_.problem(); }
114 double spatialWeight_, temporalWeight_;
Definition: multistagefvlocaloperator.hh:23
void temporalWeight(double w)
Definition: multistagefvlocaloperator.hh:99
ElementOperatorResultVector evalFluxAndSource(const typename FVGeometry::Element &, const FVGeometry &fvGeometry, const ElemVolVars &elemVolVars, const ElemFluxVars &elemFluxVarsCache, const ElemBCTypes &bcTypes) const
Definition: multistagefvlocaloperator.hh:58
bool isStationary() const
Definition: multistagefvlocaloperator.hh:109
ElementOperatorResultVector ElementResidualVector
Definition: multistagefvlocaloperator.hh:27
void spatialWeight(double w)
Definition: multistagefvlocaloperator.hh:96
double temporalWeight() const
Definition: multistagefvlocaloperator.hh:100
ElementOperatorResultVector evalStorage(const FVGeometry &fvGeometry, const ElemVolVars &elemVolVars) const
Definition: multistagefvlocaloperator.hh:37
const auto & problem() const
Definition: multistagefvlocaloperator.hh:102
auto evalFlux(const Problem &, const typename FVGeometry::Element &element, const FVGeometry &fvGeometry, const ElemVolVars &elemVolVars, const ElemFluxVars &elemFluxVarsCache, const typename FVGeometry::SubControlVolumeFace &scvf) const
Definition: multistagefvlocaloperator.hh:78
double spatialWeight() const
Definition: multistagefvlocaloperator.hh:97
MultiStageFVLocalOperator(const LocalOperator &op)
Definition: multistagefvlocaloperator.hh:29
Helper classes to compute the integration elements.
typename NumEqVectorTraits< PrimaryVariables >::type NumEqVector
A vector with the same size as numbers of equations This is the default implementation and has to be ...
Definition: numeqvector.hh:34
auto volume(const Geometry &geo, unsigned int integrationOrder=4)
The volume of a given geometry.
Definition: volume.hh:159
Definition: experimental/assembly/cclocalassembler.hh:36