May 18, 2010, 10:50am
this issue is not really related to Palabos, but maybe someone has an idea.
In order to save disk space I would like to write the simulation data as binary vtk file. Does anybody know the specifications for that? Or does anybody have a simple example code? In principle, it doesn’t need to be vtk. I just want to import the files in ParaView.
There is also a related question: Is there a data format readable by ParaView which can story data from more than one time step? If I have 5000 files of 5 MB each, it takes ages for the OS to access and copy the data. It would be much better to have only one or few large files containing many time steps. Is there a data format which can handle that?
Thanks a lot,
May 18, 2010, 11:23am
Tecplot data format is redable from para view 3.8
It is one of the strongest data format
I am using tacplot data format. It supports binary format, and you can store more than one time step in a single file
you can look to this refrence
also they have Pre-compiled library to read and write the data in their format.
I hope It will Help you.
May 18, 2010, 12:49pm
this seems to be very helpful.
Thank you very much!
June 10, 2010, 5:56pm
I can send you small VTK XML writer cpp code that you can use it - it does it in binary format. Let me know if you are still interested in it.
June 10, 2010, 9:23pm
yes, that would be nice. I just take all I can get and see which option is the best one for me.
I’d be interested, too.
Could you just post the code here?
June 28, 2010, 6:08pm
Sorry for being late - was just really busy with everything. So here it is:
void Solver::writeVTKWholePhase(std::string name)
fout<<"# vtk DataFile Version 3.0\n";
fout<<"Binary liquid phase field vtk representation\n";
fout<<"DIMENSIONS "<<NX<<" "<<NY<<" "<<NZ<<"\n";
//fout<<"ORIGIN "<<floor(NX/2)<<" "<<floor(NY/2)<<" "<<floor(NZ/2)<<"\n";
//fout<<"SPACING 1 1 1\n";
fout<<"POINTS "<<NX*NY*NZ<<" double\n";
fout<<counterX<<" "<<counterY<<" "<<counterZ<<"\n";
fout<<"SCALARS phase double\n";
void Solver::writeWholePhase(std::string name)
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
vtkSmartPointer<vtkDoubleArray> data = vtkSmartPointer<vtkDoubleArray>::New();
for(vtkIdType i = 0; i < points->GetNumberOfPoints(); i++)
double * temp_data=&phase[i];
vtkSmartPointer<vtkStructuredGrid> structuredGrid = vtkSmartPointer<vtkStructuredGrid>::New();
vtkSmartPointer<vtkXMLStructuredGridWriter> writer = vtkSmartPointer<vtkXMLStructuredGridWriter>::New();