diff --git a/dune/gdt/local/assembler/operator-applicators.hh b/dune/gdt/local/assembler/operator-applicators.hh index 27ec1c89f7271511d5240e77f6268d3d73b2a61f..e81291b30520595a244f60e0c01b45884aaf00b6 100644 --- a/dune/gdt/local/assembler/operator-applicators.hh +++ b/dune/gdt/local/assembler/operator-applicators.hh @@ -82,6 +82,7 @@ public: void apply_local(const ElementType& element) override final { local_range_->bind(element); + local_operator_->bind(element); local_operator_->apply(*local_range_, param_); } diff --git a/dune/gdt/local/assembler/operator-fd-jacobian-assemblers.hh b/dune/gdt/local/assembler/operator-fd-jacobian-assemblers.hh index 3c5714b4ddfd65b802c76347f4ee460c1df46ff5..28105d773f7accf40dfe4fbedaf566826af06737 100644 --- a/dune/gdt/local/assembler/operator-fd-jacobian-assemblers.hh +++ b/dune/gdt/local/assembler/operator-fd-jacobian-assemblers.hh @@ -122,6 +122,7 @@ public: void apply_local(const ElementType& element) override final { // some preparations + local_op_->bind(element); local_source_->bind(element); local_range_->bind(element); source_space_->mapper().global_indices(element, global_source_indices_); diff --git a/dune/gdt/local/operators/advection-fv.hh b/dune/gdt/local/operators/advection-fv.hh index a94cbcfe75909ed3814d6bde460c44b57da99b87..5f92fcce7674bccfec99973e3b684f23f944c696 100644 --- a/dune/gdt/local/operators/advection-fv.hh +++ b/dune/gdt/local/operators/advection-fv.hh @@ -381,7 +381,7 @@ public: if (numerical_flux_->x_dependent()) x_in_intersection_coords_ = intersection().geometry().local(intersection().geometry().center()); u_ = local_sources_[0]->evaluate(source_is_elementwise_constant_ ? CouplingOperatorType::static_x - : intersection.geometryInInside().center()); + : intersection().geometryInInside().center()); v_ = extrapolate_(intersection(), ReferenceElements<D, d - 1>::general(intersection().type()).position(0, 0), numerical_flux_->flux(), diff --git a/dune/gdt/local/operators/interfaces.hh b/dune/gdt/local/operators/interfaces.hh index 408005b0247e1c74a0dc9b74b164de595837189f..d295aa945af0b464e64edbf523109411d8e558ca 100644 --- a/dune/gdt/local/operators/interfaces.hh +++ b/dune/gdt/local/operators/interfaces.hh @@ -109,7 +109,7 @@ public: LocalElementOperatorInterface(const ThisType& other) : XT::Common::ParametricInterface(other) - , XT::Grid::ElementBoundObject<E>() + , XT::Grid::ElementBoundObject<E>(other) , source_(other.source_) , local_sources_(0) { diff --git a/dune/gdt/operators/reconstruction/linear_kinetic.hh b/dune/gdt/operators/reconstruction/linear_kinetic.hh index 863065af003aa8b78105b5309fbb00484c358676..9caec6708fadec82ca4bea652f361cc126cb5ae8 100644 --- a/dune/gdt/operators/reconstruction/linear_kinetic.hh +++ b/dune/gdt/operators/reconstruction/linear_kinetic.hh @@ -28,20 +28,18 @@ namespace Dune { namespace GDT { -template <class GV, class AnalyticalFluxType, class BoundaryValueType, class LocalVectorType> +template <class GV, class AnalyticalFluxType, class LocalVectorType> class LocalPointwiseLinearKineticReconstructionOperator : public XT::Grid::ElementFunctor<GV> { using ThisType = LocalPointwiseLinearKineticReconstructionOperator; using BaseType = XT::Grid::ElementFunctor<GV>; - static constexpr size_t dimDomain = BoundaryValueType::d; - static constexpr size_t dimRange = BoundaryValueType::r; + static constexpr size_t dimDomain = GV::dimension; + static constexpr size_t dimRange = AnalyticalFluxType::state_dim; using EntityType = typename GV::template Codim<0>::Entity; - using RangeFieldType = typename BoundaryValueType::RangeFieldType; static constexpr size_t stencil_size = 3; using StencilType = XT::Common::FieldVector<size_t, stencil_size>; using StencilsType = FieldVector<StencilType, dimDomain>; - using DomainType = typename BoundaryValueType::DomainType; - using RangeType = typename BoundaryValueType::RangeReturnType; + using RangeFieldType = typename AnalyticalFluxType::RangeFieldType; using ReconstructedFunctionType = DiscreteValuedGridFunction<GV, dimRange, 1, RangeFieldType>; public: @@ -114,25 +112,21 @@ private: // Does not reconstruct a full first-order DG function, but only stores the reconstructed values at the intersection // centers. This avoids the interpolation in this operator and the evaluation of the reconstructed function in the // finite volume operator which are both quite expensive for large dimRange. -template <class GV, class BoundaryValueImp, class AnalyticalFluxType, class VectorType, class LocalVectorType> +template <class GV, class AnalyticalFluxType, class VectorType, class LocalVectorType> class PointwiseLinearKineticReconstructionOperator { public: - using BoundaryValueType = BoundaryValueImp; using E = XT::Grid::extract_entity_t<GV>; using EigenVectorWrapperType = internal::DummyEigenVectorWrapper<AnalyticalFluxType, LocalVectorType>; - using R = typename BoundaryValueType::R; - static constexpr size_t dimDomain = BoundaryValueType::d; - static constexpr size_t dimRange = BoundaryValueType::r; + using R = typename AnalyticalFluxType::R; + static constexpr size_t dimDomain = GV::dimension; + static constexpr size_t dimRange = AnalyticalFluxType::state_dim; using SpaceType = SpaceInterface<GV, dimRange, 1, R>; using ReconstructedFunctionType = DiscreteValuedGridFunction<GV, dimRange, 1, R>; using ReconstructedValuesType = std::vector<typename ReconstructedFunctionType::LocalFunctionValuesType>; - PointwiseLinearKineticReconstructionOperator(const BoundaryValueType& boundary_values, - const SpaceType& space, - const AnalyticalFluxType& analytical_flux) - : boundary_values_(boundary_values) - , space_(space) + PointwiseLinearKineticReconstructionOperator(const SpaceType& space, const AnalyticalFluxType& analytical_flux) + : space_(space) , analytical_flux_(analytical_flux) {} @@ -146,23 +140,12 @@ public: return space_; } - void apply(const VectorType& source, ReconstructedFunctionType& range, const XT::Common::Parameter& param) const + void apply(const VectorType& /*source*/, ReconstructedFunctionType& range, const XT::Common::Parameter& param) const { - // evaluate cell averages - const auto& grid_view = space_.grid_view(); - const auto& index_set = grid_view.indexSet(); - std::vector<LocalVectorType> source_values(index_set.size(0)); - auto source_func = make_discrete_function(space_, source); - const auto local_source = source_func.local_function(); - for (const auto& entity : Dune::elements(grid_view)) { - local_source->bind(entity); - const auto entity_index = index_set.index(entity); - source_values[entity_index] = local_source->evaluate(entity.geometry().local(entity.geometry().center())); - } - // do reconstruction + const auto& grid_view = space_.grid_view(); auto local_reconstruction_operator = - LocalPointwiseLinearKineticReconstructionOperator<GV, AnalyticalFluxType, BoundaryValueType, LocalVectorType>( + LocalPointwiseLinearKineticReconstructionOperator<GV, AnalyticalFluxType, LocalVectorType>( range, grid_view, analytical_flux_, param); auto walker = XT::Grid::Walker<GV>(grid_view); walker.append(local_reconstruction_operator); @@ -170,7 +153,6 @@ public: } // void apply(...) private: - const BoundaryValueType& boundary_values_; const SpaceType& space_; const AnalyticalFluxType& analytical_flux_; }; // class PointwiseLinearKineticReconstructionOperator<...> diff --git a/dune/gdt/test/momentmodels/entropic-coords-mn-discretization.hh b/dune/gdt/test/momentmodels/entropic-coords-mn-discretization.hh index 9ea77ad2e2ac1c2baab6f9aca873b94b71c9d671..81678e1f31e3635fe760d702d7b0e2be044313d9 100644 --- a/dune/gdt/test/momentmodels/entropic-coords-mn-discretization.hh +++ b/dune/gdt/test/momentmodels/entropic-coords-mn-discretization.hh @@ -70,7 +70,6 @@ struct HyperbolicEntropicCoordsMnDiscretization using I = XT::Grid::extract_intersection_t<GV>; using ProblemType = typename TestCaseType::ProblemType; using RangeFieldType = typename MomentBasis::RangeFieldType; - using BoundaryValueType = typename ProblemType::BoundaryValueType; static constexpr size_t dimDomain = MomentBasis::dimDomain; static constexpr size_t dimRange = MomentBasis::dimRange; using MatrixType = typename XT::LA::Container<RangeFieldType>::MatrixType; @@ -160,7 +159,7 @@ struct HyperbolicEntropicCoordsMnDiscretization RangeType>; #else using ReconstructionOperatorType = - PointwiseLinearKineticReconstructionOperator<GV, BoundaryValueType, EntropyFluxType, VectorType, RangeType>; + PointwiseLinearKineticReconstructionOperator<GV, EntropyFluxType, VectorType, RangeType>; #endif using ReconstructionAdvectionOperatorType = AdvectionWithPointwiseReconstructionOperator<AdvectionOperatorType, ReconstructionOperatorType>; @@ -248,7 +247,7 @@ struct HyperbolicEntropicCoordsMnDiscretization XT::Grid::ApplyOn::NonPeriodicBoundaryIntersections<GV> filter; advection_operator.append(boundary_lambda, {}, filter); - ReconstructionOperatorType reconstruction_operator(boundary_values_alpha, fv_space, *analytical_flux); + ReconstructionOperatorType reconstruction_operator(fv_space, *analytical_flux); ReconstructionAdvectionOperatorType reconstruction_advection_operator(advection_operator, reconstruction_operator); if (XT::Common::is_zero(t_end))