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

Method Do

comp/vtkoutput.cpp:874–1063  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

872 }
873 template <int D>
874 void VTKOutput<D>::Do(LocalHeap &lh, double time, VorB vb, const BitArray *drawelems)
875 {
876 ostringstream filenamefinal;
877 stringstream appended;
878 vector<int> datalength;
879 int offs = 0;
880
881 filenamefinal << filename;
882
883 auto comm = ma->GetCommunicator();
884 if (comm.Size() > 1)
885 filenamefinal << "_proc" << comm.Rank();
886 if (output_cnt > 0)
887 filenamefinal << "_step" << setw(5) << setfill('0') << output_cnt;
888 lastoutputname = filenamefinal.str();
889 if (!legacy)
890 filenamefinal << ".vtu";
891 else
892 filenamefinal << ".vtk";
893
894
895 if ((comm.Size() == 1) || (comm.Rank() > 0) )
896 cout << IM(4) << " Writing VTK-Output (" << lastoutputname << ")";
897 if (output_cnt > 0)
898 {
899 //cout << IM(4) << " ( " << output_cnt << " )";
900 if (time == -1)
901 {
902 times.push_back(output_cnt);
903 }
904 else
905 {
906 times.push_back(time);
907 }
908 }
909 else
910 {
911 if (time != -1)
912 times[0] = time;
913 }
914 output_cnt++;
915
916 if (!legacy)
917 {
918 if ((comm.Size()==1 && output_cnt > 1) || (comm.Size() > 1 && comm.Rank()==0))
919 PvdFile(filename, output_cnt);
920 }
921
922 if ((comm.Size() == 1) || (comm.Rank() > 0) )
923 cout << IM(4) << ":" << flush;
924 else
925 return;
926
927 if(legacy)
928 fileout = make_shared<ofstream>(filenamefinal.str());
929 else
930 fileout = make_shared<ofstream>(filenamefinal.str(), ofstream::binary);
931

Callers 8

H1AMG_MatrixMethod · 0.45
AddElementMatrixMethod · 0.45
DoArchiveMethod · 0.45
DoArchiveFunction · 0.45
DoArchiveMethod · 0.45

Calls 6

IMClass · 0.85
GetCommunicatorMethod · 0.45
SizeMethod · 0.45
AppendMethod · 0.45
DimensionMethod · 0.45
EvaluateMethod · 0.45

Tested by

no test coverage detected