| 791 | |
| 792 | template <class SCAL> |
| 793 | void S_GridFunction<SCAL> :: Save (ostream & ost, int mdcomp) const |
| 794 | { |
| 795 | static Timer t ("GridFunctionSave"); RegionTimer r (t); |
| 796 | if (mdcomp == -1) |
| 797 | { |
| 798 | for (int comp = 0; comp < GetMultiDim(); comp++) |
| 799 | Save (ost, comp); |
| 800 | return; |
| 801 | } |
| 802 | |
| 803 | |
| 804 | const auto& ma = fespace->GetMeshAccess(); |
| 805 | auto comm = ma->GetCommunicator(); |
| 806 | int ntasks = comm.Size(); |
| 807 | const FESpace & fes = *GetFESpace(); |
| 808 | |
| 809 | if (ntasks == 1) |
| 810 | { |
| 811 | Array<DofId> dnums; |
| 812 | // for (NODE_TYPE nt = NT_VERTEX; nt <= NT_CELL; nt++) |
| 813 | for (NODE_TYPE nt : { NT_VERTEX, NT_EDGE, NT_FACE, NT_CELL }) |
| 814 | { |
| 815 | size_t nnodes = ma->GetNNodes (nt); |
| 816 | |
| 817 | Array<Vec<8, int> > nodekeys; |
| 818 | Array<int> pnums, compress; |
| 819 | for(size_t i = 0; i < nnodes; i++) |
| 820 | { |
| 821 | fes.GetDofNrs (NodeId(nt, i), dnums); |
| 822 | if (dnums.Size() == 0) continue; |
| 823 | |
| 824 | switch (nt) |
| 825 | { |
| 826 | case NT_VERTEX: pnums.SetSize(1); pnums[0] = i; break; |
| 827 | case NT_EDGE: pnums = ma->GetEdgePNums (i); break; |
| 828 | case NT_FACE: pnums = ma->GetFacePNums (i); break; |
| 829 | case NT_CELL: pnums = ma->GetElVertices (ElementId(VOL,i)); break; |
| 830 | default: |
| 831 | __assume(false); |
| 832 | break; |
| 833 | } |
| 834 | Vec<8> key; |
| 835 | key = -1; |
| 836 | for (int j = 0; j < pnums.Size(); j++) |
| 837 | key[j] = pnums[j]; |
| 838 | nodekeys.Append (key); |
| 839 | compress.Append (i); |
| 840 | } |
| 841 | |
| 842 | nnodes = nodekeys.Size(); |
| 843 | |
| 844 | Array<int> index(nnodes); |
| 845 | for( int i = 0; i < index.Size(); i++) index[i] = i; |
| 846 | |
| 847 | QuickSortI (nodekeys, index, MyLess<8>); |
| 848 | |
| 849 | |
| 850 | for( int i = 0; i < nnodes; i++) |
nothing calls this directly
no test coverage detected