41 template <
class Space,
class Range>
44 using std::begin;
using std::end;
45 std::vector<size_t> dofs;
48 for (
auto const& cell: cells)
50 auto const& range = space.mapper().globalIndices(cell);
51 dofs.insert(end(dofs),begin(range),end(range));
53 assert(dofs.size()>0);
56 std::sort(begin(dofs),end(dofs));
57 dofs.erase(std::unique(begin(dofs),end(dofs)),end(dofs));
64 auto const& gridview = space.gridView();
65 for (
auto const& cell: cells)
66 for (
auto fi=gridview.ibegin(cell); fi!=gridview.iend(cell); ++fi)
69 auto neighbor = fi->outside();
70 if (std::find(begin(cells),end(cells),neighbor)==end(cells))
71 for (
size_t i: space.mapper().globalIndices(neighbor))
73 auto j = std::lower_bound(begin(dofs),end(dofs),i);
74 if (j!=end(dofs) && *j==i)
77 assert(dofs.size()>0);
104 template <
class Space,
class Range>
107 std::vector<std::vector<size_t>>
const& indicesOnFacets)
109 using std::begin;
using std::end;
110 std::vector<size_t> dofs;
111 int const dim = Space::Grid::dimension;
114 for (
auto const& cell: cells)
116 auto const& range = space.mapper().globalIndices(cell);
117 dofs.insert(end(dofs),begin(range),end(range));
119 assert(dofs.size()>0);
122 std::sort(begin(dofs),end(dofs));
123 dofs.erase(std::unique(begin(dofs),end(dofs)),end(dofs));
128 for (
auto const& cell: cells)
130 int localVertexIndex = 0;
131 for (
int ci=0; ci<dim+1; ++ci)
132 if(space.indexSet().subIndex(cell,ci,dim) == vertexIdx)
133 localVertexIndex = ci;
135 for (
auto const& intersection : intersections(space.gridView(), cell))
137 int indexInInside = intersection.indexInInside();
140 for (
size_t i: indicesOnFacets[space.indexSet().subIndex(cell,indexInInside,1)])
142 auto j = std::lower_bound(begin(dofs),end(dofs),i);
143 if (j!=end(dofs) && *j==i)
146 assert(dofs.size()>0);
164 template <
class Gr
idView>
167 int const dim = GridView::dimension;
168 std::vector<std::vector<Cell<GridView>>> patches(gridview.size(dim));
170 for (
auto const& cell: elements(gridview))
171 for (
int i=0; i<cell.subEntities(dim); ++i)
172 patches[gridview.indexSet().subIndex(cell,i,dim)].push_back(cell);
std::vector< size_t > algebraicPatch(Space const &space, Range const &cells)
Computes the global indices of all ansatz functions whose support is a subset of the union of given c...
auto computePatches(GridView const &gridview)
Computes the patches around vertices of the grid view.
bool onSimplexFace(int dim, int codim, int id, int localFaceId)
check if a given subentity E is part of a certain simplex face F