| 651 | |
| 652 | template <class SCAL> template <int N, NODE_TYPE NTYPE> |
| 653 | void S_GridFunction<SCAL> :: LoadNodeType (istream & ist, int mdcomp) |
| 654 | { |
| 655 | static Timer t ("GridFunctionLoad node type"); RegionTimer r (t); |
| 656 | #ifdef PARALLEL |
| 657 | const auto& ma = fespace->GetMeshAccess(); |
| 658 | auto comm = ma->GetCommunicator(); |
| 659 | int id = comm.Rank(); |
| 660 | int ntasks = comm.Size(); |
| 661 | |
| 662 | const FESpace & fes = *GetFESpace(); |
| 663 | shared_ptr<ParallelDofs> par = fes.GetParallelDofs (); |
| 664 | |
| 665 | if(id > 0) |
| 666 | { |
| 667 | int nnodes = ma->GetNNodes (NTYPE); |
| 668 | |
| 669 | Array<Vec<N+1, int> > nodekeys; |
| 670 | Array<int> master_nodes; |
| 671 | Array<DofId> dnums, pnums; |
| 672 | |
| 673 | for(int i = 0; i < nnodes; i++) |
| 674 | { |
| 675 | fes.GetDofNrs (NodeId(NTYPE, i), dnums); |
| 676 | |
| 677 | if (dnums.Size() == 0) continue; |
| 678 | if (!par->IsMasterDof (dnums[0])) continue; |
| 679 | |
| 680 | master_nodes.Append(i); |
| 681 | |
| 682 | switch (NTYPE) |
| 683 | { |
| 684 | case NT_VERTEX: pnums.SetSize(1); pnums[0] = i; break; |
| 685 | // case NT_EDGE: ma->GetEdgePNums (i, pnums); break; |
| 686 | case NT_EDGE: pnums = ma->GetEdgePNums (i); break; |
| 687 | // case NT_FACE: ma->GetFacePNums (i, pnums); break; |
| 688 | case NT_FACE: pnums = ma->GetFacePNums (i); break; |
| 689 | // case NT_CELL: ma->GetElVertices (i, pnums); break; |
| 690 | case NT_CELL: pnums = ma->GetElVertices (ElementId(VOL,i)); break; |
| 691 | } |
| 692 | |
| 693 | Vec<N+1, int> key; |
| 694 | key = -1; |
| 695 | for (int j = 0; j < pnums.Size(); j++) |
| 696 | key[j] = ma->GetGlobalVertexNum (pnums[j]); |
| 697 | key[N] = dnums.Size(); |
| 698 | |
| 699 | nodekeys.Append (key); |
| 700 | } |
| 701 | |
| 702 | comm.Send (nodekeys, 0, 12); |
| 703 | |
| 704 | Array<SCAL> loc_data; |
| 705 | comm.Recv (loc_data, 0, 13); |
| 706 | |
| 707 | for (int i = 0, cnt = 0; i < master_nodes.Size(); i++) |
| 708 | { |
| 709 | // fes.GetNodeDofNrs (NTYPE, master_nodes[i], dnums); |
| 710 | fes.GetDofNrs (NodeId(NTYPE, master_nodes[i]), dnums); |
nothing calls this directly
no test coverage detected