| 568 | |
| 569 | template <class SCAL> |
| 570 | void S_GridFunction<SCAL> :: Load (istream & ist, int mdcomp) |
| 571 | { |
| 572 | static Timer t ("GridFunctionLoad"); RegionTimer r (t); |
| 573 | |
| 574 | if (mdcomp == -1) |
| 575 | { |
| 576 | for (int comp = 0; comp < GetMultiDim(); comp++) |
| 577 | Load (ist, comp); |
| 578 | return; |
| 579 | } |
| 580 | const auto& ma = fespace->GetMeshAccess(); |
| 581 | auto comm = ma->GetCommunicator(); |
| 582 | if (comm.Size() == 1) |
| 583 | { |
| 584 | const FESpace & fes = *GetFESpace(); |
| 585 | Array<DofId> dnums; |
| 586 | |
| 587 | // for (NODE_TYPE nt = NT_VERTEX; nt <= NT_CELL; nt++) |
| 588 | for (NODE_TYPE nt : { NT_VERTEX, NT_EDGE, NT_FACE, NT_CELL }) |
| 589 | { |
| 590 | int nnodes = ma->GetNNodes (nt); |
| 591 | |
| 592 | |
| 593 | Array<Vec<8, int> > nodekeys; |
| 594 | Array<int> pnums, compress; |
| 595 | for(int i = 0; i < nnodes; i++) |
| 596 | { |
| 597 | fes.GetDofNrs (NodeId(nt, i), dnums); |
| 598 | if (dnums.Size() == 0) continue; |
| 599 | |
| 600 | switch (nt) |
| 601 | { |
| 602 | case NT_VERTEX: pnums.SetSize(1); pnums[0] = i; break; |
| 603 | case NT_EDGE: pnums = ma->GetEdgePNums (i); break; |
| 604 | case NT_FACE: pnums = ma->GetFacePNums (i); break; |
| 605 | case NT_CELL: pnums = ma->GetElVertices (i); break; |
| 606 | default: |
| 607 | __assume(false); |
| 608 | } |
| 609 | Vec<8> key; |
| 610 | key = -1; |
| 611 | for (int j = 0; j < pnums.Size(); j++) |
| 612 | key[j] = pnums[j]; |
| 613 | nodekeys.Append (key); |
| 614 | compress.Append (i); |
| 615 | } |
| 616 | |
| 617 | nnodes = nodekeys.Size(); |
| 618 | |
| 619 | Array<int> index(nnodes); |
| 620 | for( int i = 0; i < index.Size(); i++) index[i] = i; |
| 621 | |
| 622 | QuickSortI (nodekeys, index, MyLess<8>); |
| 623 | |
| 624 | for( int i = 0; i < nnodes; i++) |
| 625 | { |
| 626 | fes.GetDofNrs (NodeId(nt, compress[index[i]]), dnums); |
| 627 | Vector<SCAL> elvec(dnums.Size()*fes.GetDimension()); |
nothing calls this directly
no test coverage detected