29 const bool & e_has_hangingnodes,
const bool & f_has_hangingnodes,
30 const LFS & lfs_e,
const LFS & lfs_f,
31 T& trafo_e, T& trafo_f,
34 typedef IG Intersection;
35 typedef typename Intersection::Entity Cell;
36 typedef typename LFS::Traits::SizeType SizeType;
38 typedef typename LFS::Traits::GridFunctionSpace::Traits::GridView::IndexSet IndexSet;
40 auto f = !
ig.boundary() ?
ig.outside() :
ig.inside();
42 const std::size_t dimension = Intersection::mydimension;
44 auto refelement_e = referenceElement(e.geometry());
45 auto refelement_f = referenceElement(f.geometry());
49 if(e_has_hangingnodes && f_has_hangingnodes)
53 const LFS & lfs = e_has_hangingnodes ? lfs_e : lfs_f;
54 const IndexSet& indexSet = lfs.gridFunctionSpace().gridView().indexSet();
56 const Cell& cell = e_has_hangingnodes ? e : f;
57 const int faceindex = e_has_hangingnodes ?
ig.indexInInside() :
ig.indexInOutside();
58 auto refelement = e_has_hangingnodes ? refelement_e : refelement_f;
59 const FlagVector & nodeState = e_has_hangingnodes ? nodeState_e : nodeState_f;
60 T & trafo = e_has_hangingnodes ? trafo_e : trafo_f;
64 std::vector<int> m(refelement.size(faceindex,1,dimension));
65 for (
int j=0; j<refelement.size(faceindex,1,dimension); j++)
66 m[j] = refelement.subEntity(faceindex,1,j,dimension);
69 std::vector<std::size_t> global_vertex_idx(refelement.size(faceindex,1,dimension));
70 for (
int j=0; j<refelement.size(faceindex,1,dimension); ++j)
71 global_vertex_idx[j] = indexSet.subIndex(cell,refelement.subEntity(faceindex,1,j,dimension),dimension);
76 typename LFS::Traits::DOFIndex dof_index(lfs.dofIndex(0));
78 typedef typename LFS::Traits::GridFunctionSpace::Ordering::Traits::DOFIndexAccessor::GeometryIndex GeometryIndexAccessor;
81 for (
int j=0; j<refelement.size(faceindex,1,dimension); j++){
84 typename T::RowType contribution;
88 assert(nodeState.size() == 8);
90 const SizeType i = 4*j;
94 const unsigned int fi[16] = {0,1,2,3, 1,0,3,2, 2,0,3,1, 3,1,2,0};
97 if(nodeState[m[j]].isHanging()){
101 if(nodeState[m[fi[i+1]]].isHanging() && nodeState[m[fi[i+2]]].isHanging())
103 GeometryIndexAccessor::store(dof_index.entityIndex(),
104 GeometryTypes::vertex,
105 global_vertex_idx[fi[i+3]]);
107 contribution[dof_index] = 0.25;
109 GeometryIndexAccessor::store(dof_index.entityIndex(),
110 GeometryTypes::vertex,
111 global_vertex_idx[j]);
113 trafo[dof_index] = contribution;
116 else if(!nodeState[m[fi[i+1]]].isHanging())
118 GeometryIndexAccessor::store(dof_index.entityIndex(),
119 GeometryTypes::vertex,
120 global_vertex_idx[fi[i+1]]);
122 contribution[dof_index] = 0.5;
124 GeometryIndexAccessor::store(dof_index.entityIndex(),
125 GeometryTypes::vertex,
126 global_vertex_idx[j]);
128 trafo[dof_index] = contribution;
131 else if(!nodeState[m[fi[i+2]]].isHanging())
133 GeometryIndexAccessor::store(dof_index.entityIndex(),
134 GeometryTypes::vertex,
135 global_vertex_idx[fi[i+2]]);
137 contribution[dof_index] = 0.5;
139 GeometryIndexAccessor::store(dof_index.entityIndex(),
140 GeometryTypes::vertex,
141 global_vertex_idx[j]);
143 trafo[dof_index] = contribution;
147 }
else if(dimension == 2){
149 assert(nodeState.size() == 4);
153 if(nodeState[m[j]].isHanging()){
155 const SizeType n_j = 1-j;
157 assert( !nodeState[m[n_j]].isHanging() );
159 GeometryIndexAccessor::store(dof_index.entityIndex(),
160 GeometryTypes::vertex,
161 global_vertex_idx[n_j]);
163 contribution[dof_index] = 0.5;
165 GeometryIndexAccessor::store(dof_index.entityIndex(),
166 GeometryTypes::vertex,
167 global_vertex_idx[j]);
169 trafo[dof_index] = contribution;