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

Method Update

comp/compressedfespace.cpp:20–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 }
19
20 void CompressedFESpace::Update()
21 {
22 // space->Update(); // removed as it may override changed doftypes
23 // we need it to update the space after refinement.
24 // space should set dofs only in first update on level
25
26 // for dirichlet_vertex/edge/face. should we get the freedofs from base space instead?
27 FESpace::Update();
28
29 const int ndofall = space->GetNDof();
30 all2comp.SetSize(ndofall);
31 comp2all.SetSize(ndofall);
32
33 if (active_dofs && active_dofs->Size() != ndofall)
34 throw Exception("active_dofs size doesn't match FESpace (anymore?).\n[active_dofs->Size() = "+to_string(active_dofs->Size())+", ndofall = "+to_string(ndofall)+"]");
35
36 int ndof = 0;
37 for (int i : Range(ndofall))
38 {
39 if ( ( active_dofs && (active_dofs->Test(i)))
40 || ( (!active_dofs) && ((space->GetDofCouplingType(i) & VISIBLE_DOF))))
41 {
42 comp2all[ndof] = i;
43 all2comp[i] = ndof++;
44 }
45 else
46 {
47 // all2comp[i] = -1;
48 if (space->GetDofCouplingType(i) == HIDDEN_DOF)
49 all2comp[i] = NO_DOF_NR_CONDENSE;
50 else
51 all2comp[i] = NO_DOF_NR;
52 }
53 }
54 comp2all.SetSize(ndof);
55
56 ctofdof.SetSize(ndof);
57 for (int i : Range(ndof))
58 ctofdof[i] = space->GetDofCouplingType(comp2all[i]);
59
60
61 (*testout) << "dof mapping of the wrapper space:" << endl;
62 for (int i : Range(ndof))
63 (*testout) << i << " -> " << comp2all[i] << endl;
64
65 SetNDof(ndof);
66 FESpace::FinalizeUpdate();
67 }
68
69 ProxyNode CompressedFESpace::MakeProxyFunction (bool testfunction,
70 const function<shared_ptr<ProxyFunction>(shared_ptr<ProxyFunction>)> & addblock) const

Callers

nothing calls this directly

Calls 6

UpdateFunction · 0.70
FinalizeUpdateFunction · 0.70
RangeFunction · 0.50
GetNDofMethod · 0.45
SetSizeMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected