mantaflow  0.10
A framework for fluid simulation
Classes | Functions
fileio.cpp File Reference
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <zlib.h>
#include "fileio.h"
#include "grid.h"
#include "mesh.h"
#include "vortexsheet.h"
#include "particle.h"
#include "vector4d.h"
#include "grid4d.h"
#include <cstring>

Classes

struct  Manta::UniHeader
 uni file header, v4 More...
 
struct  Manta::UniPartHeader
 pdata uni header, v3 (similar to grid header) More...
 
struct  Manta::UniLegacyHeader
 legacy headers for reading old files More...
 
struct  Manta::UniLegacyHeader2
 
struct  Manta::UniLegacyHeader3
 
struct  Manta::volHeader
 

Functions

void Manta::readBobjFile (const string &name, Mesh *mesh, bool append)
 
void Manta::writeBobjFile (const string &name, Mesh *mesh)
 
void Manta::readObjFile (const std::string &name, Mesh *mesh, bool append)
 
void Manta::writeObjFile (const string &name, Mesh *mesh)
 
template<class GRIDT >
void Manta::gridConvertWrite (gzFile &gzf, GRIDT &grid, void *ptr, UniHeader &head)
 
template<>
void Manta::gridConvertWrite (gzFile &gzf, Grid< int > &grid, void *ptr, UniHeader &head)
 
template<>
void Manta::gridConvertWrite (gzFile &gzf, Grid< double > &grid, void *ptr, UniHeader &head)
 
template<>
void Manta::gridConvertWrite (gzFile &gzf, Grid< Vector3D< double > > &grid, void *ptr, UniHeader &head)
 
template<>
void Manta::gridConvertWrite (gzFile &gzf, Grid4d< int > &grid, void *ptr, UniHeader &head)
 
template<>
void Manta::gridConvertWrite (gzFile &gzf, Grid4d< double > &grid, void *ptr, UniHeader &head)
 
template<>
void Manta::gridConvertWrite (gzFile &gzf, Grid4d< Vector3D< double > > &grid, void *ptr, UniHeader &head)
 
template<>
void Manta::gridConvertWrite (gzFile &gzf, Grid4d< Vector4D< double > > &grid, void *ptr, UniHeader &head)
 
template<class T >
void Manta::pdataConvertWrite (gzFile &gzf, ParticleDataImpl< T > &pdata, void *ptr, UniPartHeader &head)
 
template<>
void Manta::pdataConvertWrite (gzFile &gzf, ParticleDataImpl< int > &pdata, void *ptr, UniPartHeader &head)
 
template<>
void Manta::pdataConvertWrite (gzFile &gzf, ParticleDataImpl< double > &pdata, void *ptr, UniPartHeader &head)
 
template<>
void Manta::pdataConvertWrite (gzFile &gzf, ParticleDataImpl< Vec3 > &pdata, void *ptr, UniPartHeader &head)
 
template<class T >
void Manta::gridReadConvert (gzFile &gzf, Grid< T > &grid, void *ptr, int bytesPerElement)
 
template<>
void Manta::gridReadConvert< int > (gzFile &gzf, Grid< int > &grid, void *ptr, int bytesPerElement)
 
template<>
void Manta::gridReadConvert< double > (gzFile &gzf, Grid< double > &grid, void *ptr, int bytesPerElement)
 
template<>
void Manta::gridReadConvert< Vec3 > (gzFile &gzf, Grid< Vec3 > &grid, void *ptr, int bytesPerElement)
 
template<class T >
void Manta::pdataReadConvert (gzFile &gzf, ParticleDataImpl< T > &grid, void *ptr, int bytesPerElement)
 
template<>
void Manta::pdataReadConvert< int > (gzFile &gzf, ParticleDataImpl< int > &pdata, void *ptr, int bytesPerElement)
 
template<>
void Manta::pdataReadConvert< double > (gzFile &gzf, ParticleDataImpl< double > &pdata, void *ptr, int bytesPerElement)
 
template<>
void Manta::pdataReadConvert< Vec3 > (gzFile &gzf, ParticleDataImpl< Vec3 > &pdata, void *ptr, int bytesPerElement)
 
template<class T >
void Manta::gridReadConvert4d (gzFile &gzf, Grid4d< T > &grid, void *ptr, int bytesPerElement, int t)
 
template<>
void Manta::gridReadConvert4d< int > (gzFile &gzf, Grid4d< int > &grid, void *ptr, int bytesPerElement, int t)
 
template<>
void Manta::gridReadConvert4d< double > (gzFile &gzf, Grid4d< double > &grid, void *ptr, int bytesPerElement, int t)
 
template<>
void Manta::gridReadConvert4d< Vec3 > (gzFile &gzf, Grid4d< Vec3 > &grid, void *ptr, int bytesPerElement, int t)
 
template<>
void Manta::gridReadConvert4d< Vec4 > (gzFile &gzf, Grid4d< Vec4 > &grid, void *ptr, int bytesPerElement, int t)
 
template<class T >
void Manta::writeGridTxt (const string &name, Grid< T > *grid)
 
template<class T >
void Manta::writeGridRaw (const string &name, Grid< T > *grid)
 
template<class T >
void Manta::readGridRaw (const string &name, Grid< T > *grid)
 
void Manta::getUniFileSize (const string &name, int &x, int &y, int &z, int *t, std::string *info)
 for auto-init & check of results of test runs , optionally returns info string of header
 
PYTHON Vec3 Manta::getUniFileSize (const string &name)
 
PYTHON void Manta::printUniFileInfoString (const string &name)
 
template<class T >
void Manta::writeGridUni (const string &name, Grid< T > *grid)
 
template<class T >
void Manta::readGridUni (const string &name, Grid< T > *grid)
 
template<class T >
void Manta::writeGridVol (const string &name, Grid< T > *grid)
 
template<>
void Manta::writeGridVol< Real > (const string &name, Grid< Real > *grid)
 
template<class T >
void Manta::readGridVol (const string &name, Grid< T > *grid)
 
template<>
void Manta::readGridVol< Real > (const string &name, Grid< Real > *grid)
 
template<class T >
void Manta::writeGrid4dUni (const string &name, Grid4d< T > *grid)
 
template<class T >
void Manta::readGrid4dUni (const string &name, Grid4d< T > *grid, int readTslice, Grid4d< T > *slice, void **fileHandle)
 
void Manta::readGrid4dUniCleanup (void **fileHandle)
 
template<class T >
void Manta::writeGrid4dRaw (const string &name, Grid4d< T > *grid)
 
template<class T >
void Manta::readGrid4dRaw (const string &name, Grid4d< T > *grid)
 
void Manta::writeParticlesUni (const std::string &name, const BasicParticleSystem *parts)
 
void Manta::readParticlesUni (const std::string &name, BasicParticleSystem *parts)
 
template<class T >
void Manta::writePdataUni (const std::string &name, ParticleDataImpl< T > *pdata)
 
template<class T >
void Manta::readPdataUni (const std::string &name, ParticleDataImpl< T > *pdata)
 
void Manta::quantizeReal (Real &v, const Real step)
 
void Manta::knQuantize (Grid< Real > &grid, Real step)
 
PYTHON void Manta::quantizeGrid (Grid< Real > &grid, Real step)
 
void Manta::knQuantizeVec3 (Grid< Vec3 > &grid, Real step)
 
PYTHON void Manta::quantizeGridVec3 (Grid< Vec3 > &grid, Real step)
 
template void Manta::writeGridRaw< int > (const string &name, Grid< int > *grid)
 
template void Manta::writeGridRaw< Real > (const string &name, Grid< Real > *grid)
 
template void Manta::writeGridRaw< Vec3 > (const string &name, Grid< Vec3 > *grid)
 
template void Manta::writeGridUni< int > (const string &name, Grid< int > *grid)
 
template void Manta::writeGridUni< Real > (const string &name, Grid< Real > *grid)
 
template void Manta::writeGridUni< Vec3 > (const string &name, Grid< Vec3 > *grid)
 
template void Manta::writeGridVol< int > (const string &name, Grid< int > *grid)
 
template void Manta::writeGridVol< Vec3 > (const string &name, Grid< Vec3 > *grid)
 
template void Manta::readGridVol< int > (const string &name, Grid< int > *grid)
 
template void Manta::readGridVol< Vec3 > (const string &name, Grid< Vec3 > *grid)
 
template void Manta::writeGridTxt< int > (const string &name, Grid< int > *grid)
 
template void Manta::writeGridTxt< Real > (const string &name, Grid< Real > *grid)
 
template void Manta::writeGridTxt< Vec3 > (const string &name, Grid< Vec3 > *grid)
 
template void Manta::readGridRaw< int > (const string &name, Grid< int > *grid)
 
template void Manta::readGridRaw< Real > (const string &name, Grid< Real > *grid)
 
template void Manta::readGridRaw< Vec3 > (const string &name, Grid< Vec3 > *grid)
 
template void Manta::readGridUni< int > (const string &name, Grid< int > *grid)
 
template void Manta::readGridUni< Real > (const string &name, Grid< Real > *grid)
 
template void Manta::readGridUni< Vec3 > (const string &name, Grid< Vec3 > *grid)
 
template void Manta::writePdataUni< int > (const std::string &name, ParticleDataImpl< int > *pdata)
 
template void Manta::writePdataUni< Real > (const std::string &name, ParticleDataImpl< Real > *pdata)
 
template void Manta::writePdataUni< Vec3 > (const std::string &name, ParticleDataImpl< Vec3 > *pdata)
 
template void Manta::readPdataUni< int > (const std::string &name, ParticleDataImpl< int > *pdata)
 
template void Manta::readPdataUni< Real > (const std::string &name, ParticleDataImpl< Real > *pdata)
 
template void Manta::readPdataUni< Vec3 > (const std::string &name, ParticleDataImpl< Vec3 > *pdata)
 
template void Manta::readGrid4dUni< int > (const string &name, Grid4d< int > *grid, int readTslice, Grid4d< int > *slice, void **fileHandle)
 
template void Manta::readGrid4dUni< Real > (const string &name, Grid4d< Real > *grid, int readTslice, Grid4d< Real > *slice, void **fileHandle)
 
template void Manta::readGrid4dUni< Vec3 > (const string &name, Grid4d< Vec3 > *grid, int readTslice, Grid4d< Vec3 > *slice, void **fileHandle)
 
template void Manta::readGrid4dUni< Vec4 > (const string &name, Grid4d< Vec4 > *grid, int readTslice, Grid4d< Vec4 > *slice, void **fileHandle)
 
template void Manta::writeGrid4dUni< int > (const string &name, Grid4d< int > *grid)
 
template void Manta::writeGrid4dUni< Real > (const string &name, Grid4d< Real > *grid)
 
template void Manta::writeGrid4dUni< Vec3 > (const string &name, Grid4d< Vec3 > *grid)
 
template void Manta::writeGrid4dUni< Vec4 > (const string &name, Grid4d< Vec4 > *grid)
 
template void Manta::readGrid4dRaw< int > (const string &name, Grid4d< int > *grid)
 
template void Manta::readGrid4dRaw< Real > (const string &name, Grid4d< Real > *grid)
 
template void Manta::readGrid4dRaw< Vec3 > (const string &name, Grid4d< Vec3 > *grid)
 
template void Manta::readGrid4dRaw< Vec4 > (const string &name, Grid4d< Vec4 > *grid)
 
template void Manta::writeGrid4dRaw< int > (const string &name, Grid4d< int > *grid)
 
template void Manta::writeGrid4dRaw< Real > (const string &name, Grid4d< Real > *grid)
 
template void Manta::writeGrid4dRaw< Vec3 > (const string &name, Grid4d< Vec3 > *grid)
 
template void Manta::writeGrid4dRaw< Vec4 > (const string &name, Grid4d< Vec4 > *grid)
 

Function Documentation

◆ readGrid4dUni()

template<class T >
void Manta::readGrid4dUni ( const string &  name,
Grid4d< T > *  grid,
int  readTslice,
Grid4d< T > *  slice,
void **  fileHandle 
)

note, reading 4d uni grids is slightly more complicated than 3d ones as it optionally supports sliced reading