From 15c81c5f7437fc0d4e5ea733a5bd95dbdede85aa Mon Sep 17 00:00:00 2001 From: Felix Schindler <felix@schindlerfamily.de> Date: Tue, 20 May 2014 11:57:37 +0200 Subject: [PATCH] [spaces] added fake communicators --- dune/gdt/playground/spaces/finitevolume/default.hh | 9 +++++++++ dune/gdt/playground/spaces/raviartthomas/pdelab.hh | 8 ++++++++ dune/gdt/spaces/continuouslagrange/fem-localfunctions.hh | 9 +++++++++ dune/gdt/spaces/continuouslagrange/fem.hh | 9 +++++++++ .../spaces/discontinuouslagrange/fem-localfunctions.hh | 9 +++++++++ 5 files changed, 44 insertions(+) diff --git a/dune/gdt/playground/spaces/finitevolume/default.hh b/dune/gdt/playground/spaces/finitevolume/default.hh index 0006e1b07..d645741cd 100644 --- a/dune/gdt/playground/spaces/finitevolume/default.hh +++ b/dune/gdt/playground/spaces/finitevolume/default.hh @@ -45,6 +45,7 @@ public: dimRangeCols> BaseFunctionSetType; static const Stuff::Grid::ChoosePartView part_view_type = Stuff::Grid::ChoosePartView::view; static const bool needs_grid_view = true; + typedef double CommunicatorType; }; // class DefaultTraits @@ -77,12 +78,14 @@ public: : grid_view_(gv) , mapper_(std::make_shared<MapperType>(*grid_view_)) , backend_(1) + , communicator_(0.0) { } Default(const ThisType& other) : grid_view_(other.grid_view_) , mapper_(other.mapper_) + , communicator_(0.0) { } @@ -127,10 +130,16 @@ public: return BaseType::compute_face_and_volume_pattern(local_grid_view, ansatz_space); } + double& communicator() const + { + return communicator_; + } + private: std::shared_ptr<const GridViewType> grid_view_; std::shared_ptr<const MapperType> mapper_; const BackendType backend_; + mutable double communicator_; }; // class Default< ..., 1, 1 > diff --git a/dune/gdt/playground/spaces/raviartthomas/pdelab.hh b/dune/gdt/playground/spaces/raviartthomas/pdelab.hh index a1290047c..b8f7dcc2b 100644 --- a/dune/gdt/playground/spaces/raviartthomas/pdelab.hh +++ b/dune/gdt/playground/spaces/raviartthomas/pdelab.hh @@ -138,6 +138,7 @@ public: , fe_map_(std::make_shared<FEMapType>(*(grid_view_))) , backend_(std::make_shared<BackendType>(const_cast<GridViewType&>(*grid_view_), *fe_map_)) , mapper_(std::make_shared<MapperType>(*backend_)) + , communicator_(0.0) { } @@ -146,6 +147,7 @@ public: , fe_map_(other.fe_map_) , backend_(other.backend_) , mapper_(other.mapper_) + , communicator_(0.0) { } @@ -288,11 +290,17 @@ public: return local_DoF_index_of_intersection; } // ... local_DoF_indices(...) + double& communicator() const + { + return communicator_; + } + private: std::shared_ptr<const GridViewType> grid_view_; std::shared_ptr<const FEMapType> fe_map_; std::shared_ptr<const BackendType> backend_; std::shared_ptr<const MapperType> mapper_; + mutable double communicator_; }; // class PdelabBased< ..., 0, ..., 1 > diff --git a/dune/gdt/spaces/continuouslagrange/fem-localfunctions.hh b/dune/gdt/spaces/continuouslagrange/fem-localfunctions.hh index b052bd47b..c9a1a59e8 100644 --- a/dune/gdt/spaces/continuouslagrange/fem-localfunctions.hh +++ b/dune/gdt/spaces/continuouslagrange/fem-localfunctions.hh @@ -94,6 +94,7 @@ public: typedef typename BaseFunctionSetType::EntityType EntityType; static const Stuff::Grid::ChoosePartView part_view_type = Stuff::Grid::ChoosePartView::part; static const bool needs_grid_view = false; + typedef double CommunicatorType; private: template <class G, int p, class R, int r, int rC> @@ -143,6 +144,7 @@ public: , backend_(new BackendType(const_cast<GridPartType&>(*gridPart_), *baseFunctionSetMap_)) , mapper_(new MapperType(backend_->mapper())) , tmp_global_indices_(mapper_->maxNumDofs()) + , communicator_(0.0) { } @@ -153,6 +155,7 @@ public: , backend_(other.backend_) , mapper_(other.mapper_) , tmp_global_indices_(mapper_->maxNumDofs()) + , communicator_(0.0) { } @@ -199,6 +202,11 @@ public: return BaseFunctionSetType(*baseFunctionSetMap_, entity); } + double& communicator() const + { + return communicator_; + } + private: std::shared_ptr<const GridPartType> gridPart_; std::shared_ptr<const GridViewType> gridView_; @@ -206,6 +214,7 @@ private: std::shared_ptr<const BackendType> backend_; std::shared_ptr<const MapperType> mapper_; mutable Dune::DynamicVector<size_t> tmp_global_indices_; + mutable double communicator_; }; // class FemLocalfunctionsBased< ..., 1, 1 > diff --git a/dune/gdt/spaces/continuouslagrange/fem.hh b/dune/gdt/spaces/continuouslagrange/fem.hh index 33b84b127..ef89a1906 100644 --- a/dune/gdt/spaces/continuouslagrange/fem.hh +++ b/dune/gdt/spaces/continuouslagrange/fem.hh @@ -68,6 +68,7 @@ public: dimDomain, RangeFieldType, dimRange, dimRangeCols> BaseFunctionSetType; static const Stuff::Grid::ChoosePartView part_view_type = Stuff::Grid::ChoosePartView::part; static const bool needs_grid_view = false; + typedef double CommunicatorType; }; // class SpaceWrappedFemContinuousLagrangeTraits @@ -107,6 +108,7 @@ public: , mapper_(std::make_shared<MapperType>(backend_->blockMapper())) , tmpMappedRows_(mapper_->maxNumDofs()) , tmpMappedCols_(mapper_->maxNumDofs()) + , communicator_(0.0) { } @@ -117,6 +119,7 @@ public: , mapper_(other.mapper_) , tmpMappedRows_(mapper_->maxNumDofs()) , tmpMappedCols_(mapper_->maxNumDofs()) + , communicator_(0.0) { } @@ -162,6 +165,11 @@ public: return BaseFunctionSetType(*backend_, entity); } + double& communicator() const + { + return communicator_; + } + private: std::shared_ptr<const GridPartType> gridPart_; std::shared_ptr<const GridViewType> gridView_; @@ -169,6 +177,7 @@ private: std::shared_ptr<const MapperType> mapper_; mutable Dune::DynamicVector<size_t> tmpMappedRows_; mutable Dune::DynamicVector<size_t> tmpMappedCols_; + mutable double communicator_; }; // class FemBased< ..., 1 > diff --git a/dune/gdt/spaces/discontinuouslagrange/fem-localfunctions.hh b/dune/gdt/spaces/discontinuouslagrange/fem-localfunctions.hh index 39040ec55..000650a76 100644 --- a/dune/gdt/spaces/discontinuouslagrange/fem-localfunctions.hh +++ b/dune/gdt/spaces/discontinuouslagrange/fem-localfunctions.hh @@ -91,6 +91,7 @@ public: typedef typename BaseFunctionSetType::EntityType EntityType; static const Stuff::Grid::ChoosePartView part_view_type = Stuff::Grid::ChoosePartView::part; static const bool needs_grid_view = false; + typedef double CommunicatorType; private: template <class G, int p, class R, int r, int rC> @@ -134,6 +135,7 @@ public: , baseFunctionSetMap_(new BaseFunctionSetMapType(*gridPart_)) , backend_(new BackendType(const_cast<GridPartType&>(*gridPart_), *baseFunctionSetMap_)) , mapper_(new MapperType(backend_->mapper())) + , communicator_(0.0) { } @@ -143,6 +145,7 @@ public: , baseFunctionSetMap_(other.baseFunctionSetMap_) , backend_(other.backend_) , mapper_(other.mapper_) + , communicator_(0.0) { } @@ -197,12 +200,18 @@ public: return BaseType::compute_face_and_volume_pattern(local_grid_view, ansatz_space); } + double& communicator() const + { + return communicator_; + } + private: std::shared_ptr<const GridPartType> gridPart_; std::shared_ptr<const GridViewType> gridView_; std::shared_ptr<BaseFunctionSetMapType> baseFunctionSetMap_; std::shared_ptr<const BackendType> backend_; std::shared_ptr<const MapperType> mapper_; + mutable double communicator_; }; // class FemLocalfunctionsBased< ..., 1, 1 > -- GitLab