78 using DiscreteFunction = Dune::Fem::ISTLBlockVectorDiscreteFunction<DiscreteFunctionSpace, PrimaryVariables>;
81 using ProblemRestrictProlongOperator =
typename Problem::RestrictProlongOperator;
84 using DiscreteFunctionRestrictProlong = Dune::Fem::RestrictProlongDefault<DiscreteFunction>;
86 = Dune::Fem::RestrictProlongTuple<DiscreteFunctionRestrictProlong, ProblemRestrictProlongOperator>;
89 using AdaptationManager = Dune::Fem::AdaptationManager<Grid, RestrictProlong>;
92 template<
class Serializer>
94 template<
class SolutionType>
95 static void serializeOp(Serializer&
serializer,
106 , space_(simulator.vanguard().
gridPart())
108 if (this->enableGridAdaptation_ && !Dune::Fem::Capabilities::isLocallyAdaptive<Grid>::v) {
109 throw std::invalid_argument(
"Grid adaptation enabled, but chosen Grid is not capable"
114 this->solution_[
timeIdx] = std::make_unique<DiscreteFunction>(
"solution", space_);
122 if (this->enableGridAdaptation_) {
124 if (this->simulator_.problem().markForGridAdaptation()) {
126 adaptationManager().adapt();
130 this->elementMapper_.update(this->gridView_);
131 this->vertexMapper_.update(this->gridView_);
143 this->simulator_.problem().gridChanged();
146 auto outIt = this->outputModules_.begin();
147 auto outEndIt = this->outputModules_.end();
149 (*outIt)->allocBuffers();
154 AdaptationManager& adaptationManager()
156 if (!adaptationManager_) {
159 restrictProlong_ = std::make_unique<RestrictProlong>(DiscreteFunctionRestrictProlong(*(this->solution_[0])),
160 this->simulator_.problem().restrictProlongOperator());
161 adaptationManager_ = std::make_unique<AdaptationManager>(this->simulator_.vanguard().grid(), *restrictProlong_);
163 return *adaptationManager_;
167 DiscreteFunctionSpace space_;
168 std::unique_ptr<RestrictProlong> restrictProlong_;
169 std::unique_ptr<AdaptationManager> adaptationManager_;
const SolutionVector & solution(unsigned timeIdx) const
Reference to the solution at a given history index as a block vector.
Definition fvbasediscretization.hh:1136
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
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:235