| 39 | } |
| 40 | |
| 41 | void DiscontinuousFESpace :: Update() |
| 42 | { |
| 43 | space->Update(); |
| 44 | FESpace::Update(); |
| 45 | |
| 46 | first_element_dof.SetSize(ma->GetNE(vb)+1); |
| 47 | LocalHeap lh(10000, "discontinuous lh"); |
| 48 | // fes->Elements only iterates over definedon elements, here we need all! |
| 49 | for (auto i : Range(ma->GetNE(vb))) { |
| 50 | HeapReset hr(lh); |
| 51 | first_element_dof[i] = space->GetFE(ElementId(vb, i), lh).GetNDof(); |
| 52 | } |
| 53 | |
| 54 | size_t ndof = 0; |
| 55 | for (size_t i : Range(ma->GetNE(vb))) |
| 56 | { |
| 57 | size_t nd = first_element_dof[i]; |
| 58 | first_element_dof[i] = ndof; |
| 59 | ndof += nd; |
| 60 | } |
| 61 | first_element_dof[ma->GetNE(vb)] = ndof; |
| 62 | SetNDof(ndof); |
| 63 | |
| 64 | ctofdof.SetSize(ndof); |
| 65 | ctofdof = LOCAL_DOF; |
| 66 | |
| 67 | Array<int> dnums(0,lh); |
| 68 | Array<COUPLING_TYPE> cts(0,lh); |
| 69 | ndof = 0; |
| 70 | for (auto i : Range(ma->GetNE(vb))) { |
| 71 | HeapReset hr(lh); |
| 72 | size_t nd = space->GetFE(ElementId(vb, i), lh).GetNDof(); |
| 73 | space->GetDofNrs(ElementId(vb, i), dnums); |
| 74 | for (int i = 0; i < dnums.Size(); i++) |
| 75 | { |
| 76 | COUPLING_TYPE ct = space->GetDofCouplingType(dnums[i]); |
| 77 | ctofdof[ndof+i] = ct >= LOCAL_DOF ? LOCAL_DOF : ct; |
| 78 | } |
| 79 | ndof += nd; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | FiniteElement& DiscontinuousFESpace :: GetFE (ElementId ei, Allocator & alloc) const |
| 84 | { |