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

Method CreateMatrixFMM

bem/ngbem.cpp:106–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105 template <typename KERNEL>
106 shared_ptr<BaseMatrix> GenericIntegralOperator<KERNEL> ::
107 CreateMatrixFMM(LocalHeap & lh) const
108 {
109 static Timer tall("ngbem fmm setup"); RegionTimer r(tall);
110 Array<Vec<3>> xpts, ypts, xnv, ynv;
111 // IntegrationRule ir(ET_TRIG, intorder);
112 IntegrationRule ir_trig(ET_TRIG, intorder);
113 IntegrationRule ir_quad(ET_QUAD, intorder);
114 auto trial_mesh = trial_space->GetMeshAccess();
115 auto test_mesh = test_space->GetMeshAccess();
116
117 Array<int> compress_trial_els(trial_mesh->GetNE(BND));
118 Array<int> compress_test_els(test_mesh->GetNE(BND));
119 compress_trial_els = -1;
120 compress_test_els = -1;
121
122 int cnt = 0;
123 for (auto el : trial_mesh->Elements(BND))
124 if (trial_space->DefinedOn(el))
125 if (!trial_definedon || (*trial_definedon).Mask().Test(trial_mesh->GetElIndex(el)))
126 {
127 HeapReset hr(lh);
128 auto & trafo = trial_mesh->GetTrafo(el, lh);
129 // auto & mir = static_cast<MappedIntegrationRule<2,3>&>(trafo(ir, lh));
130 auto & ir = (trafo.GetElementType() == ET_QUAD) ? ir_quad : ir_trig;
131 auto & mir = static_cast<MappedIntegrationRule<2,3>&>(trafo(ir, lh));
132 for (auto & mip : mir)
133 {
134 xpts.Append(mip.GetPoint());
135 xnv.Append(mip.GetNV());
136 }
137 compress_trial_els[el.Nr()] = cnt++;
138 }
139
140 cnt = 0;
141 for (auto el : test_mesh->Elements(BND))
142 if (test_space->DefinedOn(el))
143 if (!test_definedon || (*test_definedon).Mask().Test(test_mesh->GetElIndex(el)))
144 {
145 HeapReset hr(lh);
146 auto & trafo = test_mesh->GetTrafo(el, lh);
147 // auto & mir = static_cast<MappedIntegrationRule<2,3>&>(trafo(ir, lh));
148 auto & ir = (trafo.GetElementType() == ET_QUAD) ? ir_quad : ir_trig;
149 auto & mir = static_cast<MappedIntegrationRule<2,3>&>(trafo(ir, lh));
150 for (auto & mip : mir)
151 {
152 ypts.Append(mip.GetPoint());
153 ynv.Append(mip.GetNV());
154 }
155 compress_test_els[el.Nr()] = cnt++;
156 }
157
158 auto create_eval = [&](const FESpace & fes,
159 const Array<int> & compress_els,
160 const DifferentialOperator & evaluator)
161 {
162 auto mesh = fes.GetMeshAccess();
163 Array<short> classnr(mesh->GetNE(BND));

Callers

nothing calls this directly

Calls 15

TransposeOperatorFunction · 0.85
ElementIdClass · 0.85
CalcElementMatrixFunction · 0.85
GetMeshAccessMethod · 0.80
ElementsMethod · 0.80
VerticesMethod · 0.80
AddMethod · 0.80
ContainsMethod · 0.80
UseFMMMethod · 0.80
StopMethod · 0.80
RangeFunction · 0.50
TransFunction · 0.50

Tested by

no test coverage detected