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

Function IterateElementsTP

comp/tpfes.cpp:361–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359 }
360
361 void IterateElementsTP (const FESpace & fes, VorB vb, LocalHeap & clh,
362 const function<void(ElementId,ElementId,LocalHeap&)> & func)
363 {
364 // static mutex copyex_mutex;
365 const TPHighOrderFESpace & festp = dynamic_cast<const TPHighOrderFESpace &>(fes);
366 shared_ptr<FESpace> space_x = festp.Space(-1);
367 shared_ptr<FESpace> space_y = festp.Space(0);
368 auto & nels = festp.GetNels();
369 const Table<int> & element_coloring0 = space_x->ElementColoring(vb);
370 if (GetTaskManager())
371 {
372 for (FlatArray<int> els_of_col : element_coloring0)
373 {
374 SharedLoop2 sl(els_of_col.Range());
375 TaskManager :: CreateJob
376 ( [&] (const TaskInfo & ti)
377 {
378 LocalHeap lh = clh.Split(ti.thread_nr, ti.nthreads);
379 for (int mynr : sl)
380 {
381 for(int j=0;j<nels[1];j++)
382 {
383 HeapReset hr(lh);
384 func (ElementId(vb,els_of_col[mynr]),ElementId(vb,j), lh);
385 }
386 }
387 }
388 );
389 }
390 return;
391 }
392 if(vb == VOL)
393 for (int i = 0; i< nels[0];i++)
394 {
395 for(int j=0;j<nels[1];j++)
396 {
397 HeapReset hr(clh);
398 func (ElementId (vb, i),ElementId (vb, j), clh);
399 }
400 }
401 }
402
403 void TPHighOrderFESpace::SolveM (CoefficientFunction * rho, BaseVector & vec, Region * def,
404 LocalHeap & clh) const

Callers 2

Transfer2StdMeshFunction · 0.85
Transfer2TPMeshFunction · 0.85

Calls 3

ElementIdClass · 0.85
RangeMethod · 0.45
SplitMethod · 0.45

Tested by

no test coverage detected