ESyS-Particle  2.3.4
read.cpp File Reference
#include "read.h"
#include <vector>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <map>
#include "Foundation/vec3.h"
Include dependency graph for read.cpp:

Functions

int get_version (const string &infilename)
 
vector< string > get_filenames (const string &infilename, int version)
 
void read_and_write_profile_r (const string &infilename, const string &outfilename, double min, double max, int nbin, bool debug_on, bool grad, int dir, int mintag)
 
void read_and_write_profile_rel (const string &infilename1, const string &infilename2, const string &outfilename, double min, double max, int nbin, bool debug_on, bool grad, int dir)
 
void write_vtk_header (ofstream &outfile, int nx, int ny, int nz, double x0, double dx, double y0, double dy, double z0, double dz)
 
void read_and_write_disp_grid (const string &infilename, const string &outfilename, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double cellsize, bool grad, int udim, int gdim)
 
void read_and_write_poros_grid (const string &infilename, const string &outfilename, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double cellsize)
 

Function Documentation

◆ get_filenames()

vector<string> get_filenames ( const string &  infilename,
int  version 
)

◆ get_version()

int get_version ( const string &  infilename)

Get snapshot version.

Parameters
infilenamethe file name of the header file (incl. the _0.txt part)

Referenced by read_and_write_disp_grid(), read_and_write_poros_grid(), read_and_write_profile_r(), and read_and_write_profile_rel().

Here is the caller graph for this function:

◆ read_and_write_disp_grid()

void read_and_write_disp_grid ( const string &  infilename,
const string &  outfilename,
double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  zmin,
double  zmax,
double  cellsize,
bool  grad,
int  udim,
int  gdim 
)

read snapshot and write 3D grid VTK file of x-displacement

Parameters
infilenamename of the input file (the *_0.txt)
outfilenamename of the output file
xminminimum of the x-range
xmaxmaximum of the x-range
yminminimum of the y-range
ymaxmaximum of the y-range
zminminimum of the z-range
zmaxmaximum of the z-range
cellsizethe size of a grid cell (1 dimension, cells are cubes)
graddisplacement (gdim=false) or strain (grad=true)
udimcomponent of displacement
gdimdirection of derivative

References get_filenames(), get_version(), esys::lsm::bpu::iter(), write_vtk_header(), Vec3::X(), Vec3::Y(), and Vec3::Z().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_and_write_poros_grid()

void read_and_write_poros_grid ( const string &  infilename,
const string &  outfilename,
double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  zmin,
double  zmax,
double  cellsize 
)

read snapshot and write 3D grid VTK file of porosity

Parameters
infilenamename of the input file (the *_0.txt)
outfilenamename of the output file
xminminimum of the x-range
xmaxmaximum of the x-range
yminminimum of the y-range
ymaxmaximum of the y-range
zminminimum of the z-range
zmaxmaximum of the z-range
cellsizethe size of a grid cell (1 dimension, cells are cubes)

References get_filenames(), get_version(), esys::lsm::bpu::iter(), write_vtk_header(), Vec3::X(), Vec3::Y(), and Vec3::Z().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_and_write_profile_r()

void read_and_write_profile_r ( const string &  infilename,
const string &  outfilename,
double  min,
double  max,
int  nbin,
bool  debug_on,
bool  grad,
int  dir,
int  mintag 
)

read snapshot and write y-profile of x-displacement

Parameters
infilenamename of the input file (the *_0.txt)
outfilenamename of the output file
yminminimum of the y-range
ymaxmaximum of the y-range
nbinnumber of bins
dirdirection of binning : 0->x, 1->y, 2->z
mintagminimum particle tag considered

References get_filenames(), get_version(), esys::lsm::bpu::iter(), Vec3::X(), Vec3::Y(), and Vec3::Z().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_and_write_profile_rel()

void read_and_write_profile_rel ( const string &  infilename1,
const string &  infilename2,
const string &  outfilename,
double  min,
double  max,
int  nbin,
bool  debug_on,
bool  grad,
int  dir 
)

read 2 snapshot and write y-profile of x-displacement between snapshots

Parameters
infilename1name of the 1st input file (the *_0.txt)
infilename2name of the 2nd input file (the *_0.txt)
outfilenamename of the output file
yminminimum of the y-range
ymaxmaximum of the y-range
nbinnumber of bins
dirdirection of binning : 0->x, 1->y, 2->z

References get_filenames(), get_version(), esys::lsm::bpu::iter(), Vec3::X(), Vec3::Y(), and Vec3::Z().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_vtk_header()

void write_vtk_header ( ofstream &  outfile,
int  nx,
int  ny,
int  nz,
double  x0,
double  dx,
double  y0,
double  dy,
double  z0,
double  dz 
)

write VTK header

Parameters
outfilethe output file
nx
ny
nz
x0
dx
y0
dy
z0
dz

Referenced by read_and_write_disp_grid(), and read_and_write_poros_grid().

Here is the caller graph for this function: