MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / Update

Method Update

comp/discontinuous.cpp:41–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 8

ElementIdClass · 0.85
UpdateFunction · 0.70
RangeFunction · 0.50
UpdateMethod · 0.45
SetSizeMethod · 0.45
GetNDofMethod · 0.45
GetDofNrsMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected