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

Method Finalize

comp/bddc.cpp:374–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372
373
374 void Finalize()
375 {
376 static Timer timer ("BDDC Finalize");
377 RegionTimer reg(timer);
378
379 // auto fes = bfa->GetFESpace();
380 int ndof = fes->GetNDof();
381
382 if (!local)
383 if (auto pd = fes->GetParallelDofs(); pd)
384 pd -> AllReduceDofData (weight, NG_MPI_SUM);
385
386 ParallelFor (weight.Size(),
387 [&] (size_t i)
388 {
389 if (weight[i]) weight[i] = 1.0/weight[i];
390 });
391
392 ParallelFor (sparse_innersolve->Height(),
393 [&] (size_t i)
394 {
395 FlatArray cols = sparse_innersolve -> GetRowIndices(i);
396 FlatVector<SCAL> values = sparse_innersolve->GetRowValues(i);
397 double wi = weight[i];
398 for (int j = 0; j < cols.Size(); j++)
399 values(j) *= wi * weight[cols[j]];
400 }, TasksPerThread(5));
401
402 ParallelFor (sparse_harmonicext->Height(),
403 [&] (size_t i)
404 {
405 sparse_harmonicext->GetRowValues(i) *= weight[i];
406 }, TasksPerThread(5));
407
408 if (!bfa->SymmetricStorage())
409 {
410 ParallelFor (// sparse_harmonicexttrans->Height(),
411 sparse_harmonicexttrans->GetBalancing(),
412 [&] (size_t i)
413 {
414 FlatArray rowind = sparse_harmonicexttrans->GetRowIndices(i);
415 FlatVector<SCAL> values = sparse_harmonicexttrans->GetRowValues(i);
416 for (int j = 0; j < rowind.Size(); j++)
417 values[j] *= weight[rowind[j]];
418 }, TasksPerThread(5));
419 }
420
421 // now generate wire-basked solver
422
423 if (block)
424 {
425 if (coarse)
426 throw Exception("combination of coarse and block not implemented! ");
427
428 //Smoothing Blocks
429 Flags flags;
430 flags.SetFlag("eliminate_internal");
431 flags.SetFlag("subassembled");

Callers 1

FinalizeLevelMethod · 0.80

Calls 15

IMClass · 0.85
ComposeOperatorsFunction · 0.85
GetParallelDofsMethod · 0.80
AllReduceDofDataMethod · 0.80
GetFESpaceMethod · 0.80
CreateSmoothingBlocksMethod · 0.80
SetInverseTypeMethod · 0.80
FinalizeLevelMethod · 0.80
GetNDofMethod · 0.45
SizeMethod · 0.45
HeightMethod · 0.45
SetFlagMethod · 0.45

Tested by

no test coverage detected