Skip to content
Snippets Groups Projects
Commit 81d456d7 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[...block] updated grid layer usage

parent 2d591434
No related branches found
No related tags found
No related merge requests found
......@@ -105,7 +105,7 @@ private:
private:
static size_t find_block_of_(const MsGridType& ms_grid, const Comdim0EntityType& entity)
{
const auto global_entity_index = ms_grid.globalGridView()->indexSet().index(entity);
const auto global_entity_index = ms_grid.globalGridView().indexSet().index(entity);
const auto result = ms_grid.entityToSubdomainMap()->find(global_entity_index);
#ifndef NDEBUG
if (result == ms_grid.entityToSubdomainMap()->end())
......
......@@ -58,6 +58,10 @@ public:
} // namespace internal
/**
* \todo This can be implemented easier by now. Since all local spaces hold a copy of their local grid view it should
* be enough to hold a copy of the global grid view in this space (if the ms_grid is not needed elsewhere)
*/
template <class LocalSpaceImp>
class Block : public SpaceInterface<internal::BlockTraits<LocalSpaceImp>>
{
......@@ -81,6 +85,7 @@ public:
Block(const std::shared_ptr<const MsGridType>& ms_grid,
const std::vector<std::shared_ptr<const LocalSpaceType>>& local_spaces)
: ms_grid_(ms_grid)
, grid_view_(ms_grid_->globalGridView())
, local_spaces_(local_spaces)
, mapper_(std::make_shared<MapperType>(ms_grid_, local_spaces_))
{
......@@ -114,7 +119,7 @@ public:
const GridViewType& grid_view() const
{
return ms_grid_->globalGridView();
return grid_view_;
}
const BackendType& backend() const
......@@ -156,7 +161,7 @@ private:
template <class EntityType>
size_t find_block_of_(const EntityType& entity) const
{
const auto global_entity_index = ms_grid_->globalGridView()->indexSet().index(entity);
const auto global_entity_index = ms_grid_->globalGridView().indexSet().index(entity);
const auto result = ms_grid_->entityToSubdomainMap()->find(global_entity_index);
#ifndef NDEBUG
if (result == ms_grid_->entityToSubdomainMap()->end())
......@@ -179,6 +184,7 @@ private:
} // ... find_block_of_(...)
const std::shared_ptr<const MsGridType> ms_grid_;
const GridViewType grid_view_;
const std::vector<std::shared_ptr<const LocalSpaceType>> local_spaces_;
const std::shared_ptr<const MapperType> mapper_;
}; // class Block
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment