28#ifndef EWOMS_FV_BASE_DISCRETIZATION_FEMADAPT_HH
29#define EWOMS_FV_BASE_DISCRETIZATION_FEMADAPT_HH
31#include <dune/fem/function/blockvectorfunction.hh>
32#include <dune/fem/misc/capabilities.hh>
33#include <dune/fem/space/common/adaptationmanager.hh>
34#include <dune/fem/space/common/restrictprolongtuple.hh>
43template<
class TypeTag>
44class FvBaseDiscretizationFemAdapt;
48template<
class TypeTag>
49struct BaseDiscretizationType<TypeTag, TTag::FvBaseDiscretization>
52template<
class TypeTag>
53struct DiscreteFunction<TypeTag, TTag::FvBaseDiscretization>
57 using type = Dune::Fem::ISTLBlockVectorDiscreteFunction<DiscreteFunctionSpace, PrimaryVariables>;
68template <
class TypeTag>
81 using DiscreteFunction = Dune::Fem::ISTLBlockVectorDiscreteFunction<DiscreteFunctionSpace, PrimaryVariables>;
84 using ProblemRestrictProlongOperator =
typename Problem::RestrictProlongOperator;
87 using DiscreteFunctionRestrictProlong = Dune::Fem::RestrictProlongDefault<DiscreteFunction>;
89 = Dune::Fem::RestrictProlongTuple<DiscreteFunctionRestrictProlong, ProblemRestrictProlongOperator>;
92 using AdaptationManager = Dune::Fem::AdaptationManager<Grid, RestrictProlong>;
95 template<
class Serializer>
98 template<
class SolutionType>
99 static void serializeOp(Serializer&
serializer,
110 , space_(simulator.vanguard().
gridPart())
112 if (this->enableGridAdaptation_ && !Dune::Fem::Capabilities::isLocallyAdaptive<Grid>::v) {
113 throw std::invalid_argument(
"Grid adaptation enabled, but chosen Grid is not capable"
118 this->solution_[
timeIdx] = std::make_unique<DiscreteFunction>(
"solution", space_);
126 if (this->enableGridAdaptation_) {
128 if (this->simulator_.problem().markForGridAdaptation()) {
130 adaptationManager().adapt();
134 this->elementMapper_.update(this->gridView_);
135 this->vertexMapper_.update(this->gridView_);
147 this->simulator_.problem().gridChanged();
151 module->allocBuffers();
157 AdaptationManager& adaptationManager()
159 if (!adaptationManager_) {
163 std::make_unique<RestrictProlong>(DiscreteFunctionRestrictProlong(*(this->solution_[0])),
164 this->simulator_.problem().restrictProlongOperator());
166 std::make_unique<AdaptationManager>(this->simulator_.vanguard().grid(), *restrictProlong_);
168 return *adaptationManager_;
172 DiscreteFunctionSpace space_;
173 std::unique_ptr<RestrictProlong> restrictProlong_;
174 std::unique_ptr<AdaptationManager> adaptationManager_;
The base class for the finite volume discretization schemes.
Definition fvbasediscretizationfemadapt.hh:70
The base class for the finite volume discretization schemes.
Definition fvbasediscretization.hh:298
void finishInit()
Apply the initial conditions to the model.
Definition fvbasediscretization.hh:458
const SolutionVector & solution(unsigned timeIdx) const
Reference to the solution at a given history index as a block vector.
Definition fvbasediscretization.hh:1224
void resetLinearizer()
Resets the Jacobian matrix linearizer, so that the boundary types can be altered.
Definition fvbasediscretization.hh:1620
The base class for the finite volume discretization schemes.
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition propertysystem.hh:233
Definition fvbasediscretizationfemadapt.hh:97