PhyStar  v0.0.0 thu24
fileionew::FluidCartRegularD< N_dim > Class Template Reference

fluid io for cartesian coordinates, double percision More...

#include <FluidIOnew.hpp>

Collaboration diagram for fileionew::FluidCartRegularD< N_dim >:

Public Member Functions

 FluidCartRegularD ()
 Construct a new Fluid Cart Regular D object. More...
 
 ~FluidCartRegularD ()
 Destroy the Fluid Cart Regular D object. More...
 
auto & SetMeshc (const int dim, const int N, const double meshc[])
 Set the Mesh [center] object. More...
 
auto & SetMeshf (int dim, int N, const double meshf[])
 Set the Mesh [face] object. More...
 
auto & SetGhostMesh (std::vector< int > gh_down, std::vector< int > gh_up={})
 Set the Ghost Mesh object if gh_up={}, it means that gh_down and gh_up have the same size of ghost mesh if the size of gh_down n is below N_dim, the size of ghost mesh of gh_down[n] and gh_down[n+1]...gh_down[N_dim-1] should equal to gh_down[n-1];. More...
 
auto & SetGhostMesh (std::vector< std::vector< int >> gh)
 
auto & SetGhostMesh (int gh_down, int gh_up=-1)
 Set the Ghost Mesh object if only input gh_down, it means that gh_up=gh_down. More...
 
auto & SetDomain (std::vector< double > domain_down, std::vector< double > domain_up)
 Set the compuational Domain object if the size of domain_down/up n is below N_dim, the value of domain_down/up[n] ,[n+1]should equal to domain_down/up[n-1];. More...
 
auto & SetDomain (std::vector< std::vector< double >> domain)
 
auto & SetFileAttr (std::string name, std::string val)
 Set the File Attributes object not to create attribute, just set the standard attribute to the buffer in current object. More...
 
auto & SetFileAttr (std::string name, double val)
 Set the File Attributes object not to create attribute, just set the standard attribute to the buffer in current object. More...
 
void Print ()
 Print the abstract of the current file attributes. More...
 
void CreateFile (const int istep, const std::string ftype)
 Create a hdf5 File. More...
 
void CloseFile ()
 Close opened hdf5 file. More...
 
void OpenFile (const int istep, const std::string ftype)
 add extra attribute to different groups [string] More...
 
auto & AddAttributeTo (const std::string &grouppath, const std::string attrname, const std::string str)
 
auto & AddAttributeTo (const std::string &grouppath, const std::string attrname, const int in)
 
template<typename T >
auto & AddDataSetTo (const std::string &grouppath, const std::string dataname, const T indata[], const std::vector< size_t > dims)
 
void CalOffset (const std::vector< int > &shape, const std::vector< int > &gridflag, std::vector< hsize_t > &offset)
 
void MemSlice (const auto *in, auto *out, const std::vector< int > &shape, const std::vector< hsize_t > &offset, const std::vector< hsize_t > &count)
 
void MemExtend (const auto *in, auto *out, const std::vector< int > &shape, const std::vector< hsize_t > &offset, const std::vector< hsize_t > &count)
 
auto & AddField (const std::string fieldname, const double data[], const std::vector< int > shape, const std::vector< int > gridflag, const std::vector< int > shapetotal)
 
auto & ReadField (const std::string fieldname, double data[], const std::vector< int > shape, const std::vector< int > gridflag, const std::vector< int > shapetotal)
 
auto & AddField (const std::string fieldname, double data[], std::vector< int > shape, std::vector< int > gridflag)
 add Field to Field group only support serial version More...
 

Static Public Member Functions

static void AllocateBuffer (const int &maxlength)
 
static void DeallocateBuffer ()
 

Public Attributes

hid_t fileid
 handles of HDF5 More...
 
hid_t filepropid
 
hid_t geomeshid
 
hid_t physparaid
 
hid_t otherinfoid
 
hid_t fieldid
 

Private Attributes

const int _dim = N_dim
 
h5::FileAccessProps _fapl
 
std::string _casename = "default"
 
std::string _space = "physical"
 
std::string _filestyle = "onestep"
 
std::string _storagestyle = "cartregular"
 
std::string _dataspacestyle = "c-style"
 
std::string _filepath = "./"
 
std::string _filenameprefix = "fluidfield"
 
std::string _filename
 
int _meshnumc [N_dim] = {0}
 
int _meshnumf [N_dim] = {0}
 
int _gh_down [N_dim] = {0}
 
int _gh_up [N_dim] = {0}
 
double * _ptr_meshc [N_dim]
 
double * _ptr_meshf [N_dim]
 
int _numbernamelength = 7
 
double _domain_down [N_dim] = {0}
 
double _domain_up [N_dim] = {0}
 
double _visc0 = 0.
 
double _rho0 = 0.
 
int _mpi_coord [N_dim]
 
int _mpi_proc [N_dim]
 

Static Private Attributes

static double * _rtemp = nullptr
 
static std::complex< double > * _ctemp = nullptr
 
static int _maxlength = 0
 

Detailed Description

template<int N_dim>
class fileionew::FluidCartRegularD< N_dim >

fluid io for cartesian coordinates, double percision

Constructor & Destructor Documentation

◆ FluidCartRegularD()

◆ ~FluidCartRegularD()

template<int N_dim>
fileionew::FluidCartRegularD< N_dim >::~FluidCartRegularD ( )
inline

Member Function Documentation

◆ AddAttributeTo() [1/2]

template<int N_dim>
auto& fileionew::FluidCartRegularD< N_dim >::AddAttributeTo ( const std::string &  grouppath,
const std::string  attrname,
const int  in 
)
inline

◆ AddAttributeTo() [2/2]

template<int N_dim>
auto& fileionew::FluidCartRegularD< N_dim >::AddAttributeTo ( const std::string &  grouppath,
const std::string  attrname,
const std::string  str 
)
inline

References fileionew::FluidCartRegularD< N_dim >::_fapl, and fileionew::FluidCartRegularD< N_dim >::_filename.

Here is the caller graph for this function:

◆ AddDataSetTo()

template<int N_dim>
template<typename T >
auto& fileionew::FluidCartRegularD< N_dim >::AddDataSetTo ( const std::string &  grouppath,
const std::string  dataname,
const T  indata[],
const std::vector< size_t >  dims 
)
inline

◆ AddField() [1/2]

template<int N_dim>
auto & fileionew::FluidCartRegularD< N_dim >::AddField ( const std::string  fieldname,
const double  data[],
const std::vector< int >  shape,
const std::vector< int >  gridflag,
const std::vector< int >  shapetotal 
)

References fileionew::check_collective_io(), fileionew::DataSpace(), and fileionew::Fields().

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

◆ AddField() [2/2]

template<int N_dim>
auto& fileionew::FluidCartRegularD< N_dim >::AddField ( const std::string  fieldname,
double  data[],
std::vector< int >  shape,
std::vector< int >  gridflag 
)
inline

add Field to Field group only support serial version

Parameters
fieldnamefield name
datadouble data
shapeshape of field at current proc
gridflaggrid flag (1,0,1),(F,c,F)
Returns
auto& *this

References fileionew::FluidCartRegularD< N_dim >::AddField().

Here is the call graph for this function:

◆ AllocateBuffer()

template<int N_dim>
static void fileionew::FluidCartRegularD< N_dim >::AllocateBuffer ( const int &  maxlength)
inlinestatic

◆ CalOffset()

template<int N_dim>
void fileionew::FluidCartRegularD< N_dim >::CalOffset ( const std::vector< int > &  shape,
const std::vector< int > &  gridflag,
std::vector< hsize_t > &  offset 
)

◆ CloseFile()

template<int N_dim>
void fileionew::FluidCartRegularD< N_dim >::CloseFile

Close opened hdf5 file.

Here is the caller graph for this function:

◆ CreateFile()

template<int N_dim>
void fileionew::FluidCartRegularD< N_dim >::CreateFile ( const int  istep,
const std::string  ftype 
)

Create a hdf5 File.

Parameters
istepcomputation step
ftypeselect a file style, onestep/mid
Returns
auto id of opened file

References fileionew::DataSpace(), fileionew::Fields(), fileionew::FileProps(), fileionew::intTostr(), fileionew::Others(), and fileionew::PhysParams().

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

◆ DeallocateBuffer()

◆ MemExtend()

template<int N_dim>
void fileionew::FluidCartRegularD< N_dim >::MemExtend ( const auto *  in,
auto *  out,
const std::vector< int > &  shape,
const std::vector< hsize_t > &  offset,
const std::vector< hsize_t > &  count 
)

◆ MemSlice()

template<int N_dim>
void fileionew::FluidCartRegularD< N_dim >::MemSlice ( const auto *  in,
auto *  out,
const std::vector< int > &  shape,
const std::vector< hsize_t > &  offset,
const std::vector< hsize_t > &  count 
)

◆ OpenFile()

template<int N_dim>
void fileionew::FluidCartRegularD< N_dim >::OpenFile ( const int  istep,
const std::string  ftype 
)

add extra attribute to different groups [string]

Parameters
groupwhich group ,a enum constant
attrnameattribute name
strattribute val
Returns
auto& *this

References fileionew::DataSpace(), fileionew::FileProps(), fileionew::intTostr(), and fileionew::PhysParams().

Here is the call graph for this function:

◆ Print()

template<int N_dim>
void fileionew::FluidCartRegularD< N_dim >::Print

Print the abstract of the current file attributes.

References fileionew::intTostr().

Here is the call graph for this function:

◆ ReadField()

template<int N_dim>
auto & fileionew::FluidCartRegularD< N_dim >::ReadField ( const std::string  fieldname,
double  data[],
const std::vector< int >  shape,
const std::vector< int >  gridflag,
const std::vector< int >  shapetotal 
)

References fileionew::check_collective_io(), and fileionew::Fields().

Here is the call graph for this function:

◆ SetDomain() [1/2]

template<int N_dim>
auto& fileionew::FluidCartRegularD< N_dim >::SetDomain ( std::vector< double >  domain_down,
std::vector< double >  domain_up 
)
inline

Set the compuational Domain object if the size of domain_down/up n is below N_dim, the value of domain_down/up[n] ,[n+1]should equal to domain_down/up[n-1];.

Parameters
domain_downthe lower boundary of Domain
domain_upthe upper boundary of domain
Returns
auto& *this

References fileionew::FluidCartRegularD< N_dim >::_domain_down, and fileionew::FluidCartRegularD< N_dim >::_domain_up.

◆ SetDomain() [2/2]

template<int N_dim>
auto& fileionew::FluidCartRegularD< N_dim >::SetDomain ( std::vector< std::vector< double >>  domain)
inline

◆ SetFileAttr() [1/2]

template<int N_dim>
auto& fileionew::FluidCartRegularD< N_dim >::SetFileAttr ( std::string  name,
double  val 
)
inline

Set the File Attributes object not to create attribute, just set the standard attribute to the buffer in current object.

Parameters
nameattribute name
valattribute value
Returns
auto& *this

References fileionew::FluidCartRegularD< N_dim >::_rho0, fileionew::FluidCartRegularD< N_dim >::_visc0, and fileionew::strToLower().

Here is the call graph for this function:

◆ SetFileAttr() [2/2]

template<int N_dim>
auto& fileionew::FluidCartRegularD< N_dim >::SetFileAttr ( std::string  name,
std::string  val 
)
inline

Set the File Attributes object not to create attribute, just set the standard attribute to the buffer in current object.

Parameters
nameattribute name
valattribute value
Returns
auto& *this

References fileionew::FluidCartRegularD< N_dim >::_casename, fileionew::FluidCartRegularD< N_dim >::_dataspacestyle, fileionew::FluidCartRegularD< N_dim >::_filepath, fileionew::FluidCartRegularD< N_dim >::_filestyle, fileionew::FluidCartRegularD< N_dim >::_space, fileionew::FluidCartRegularD< N_dim >::_storagestyle, and fileionew::strToLower().

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

◆ SetGhostMesh() [1/3]

template<int N_dim>
auto& fileionew::FluidCartRegularD< N_dim >::SetGhostMesh ( int  gh_down,
int  gh_up = -1 
)
inline

Set the Ghost Mesh object if only input gh_down, it means that gh_up=gh_down.

Parameters
gh_downghost mesh size of lower boudnary
gh_upghost mesh size of upper boudnary
Returns
auto& *this

References fileionew::FluidCartRegularD< N_dim >::_gh_down, and fileionew::FluidCartRegularD< N_dim >::_gh_up.

◆ SetGhostMesh() [2/3]

template<int N_dim>
auto& fileionew::FluidCartRegularD< N_dim >::SetGhostMesh ( std::vector< int >  gh_down,
std::vector< int >  gh_up = {} 
)
inline

Set the Ghost Mesh object if gh_up={}, it means that gh_down and gh_up have the same size of ghost mesh if the size of gh_down n is below N_dim, the size of ghost mesh of gh_down[n] and gh_down[n+1]...gh_down[N_dim-1] should equal to gh_down[n-1];.

Parameters
gh_downghost mesh size of lower boudnary
gh_upghost mesh size of upper boudnary
Returns
auto& *this
Here is the caller graph for this function:

◆ SetGhostMesh() [3/3]

template<int N_dim>
auto& fileionew::FluidCartRegularD< N_dim >::SetGhostMesh ( std::vector< std::vector< int >>  gh)
inline

◆ SetMeshc()

template<int N_dim>
auto& fileionew::FluidCartRegularD< N_dim >::SetMeshc ( const int  dim,
const int  N,
const double  meshc[] 
)
inline

Set the Mesh [center] object.

Parameters
dimwhich dimension/direction
Nsize of mesh
meshcmesh [center]
Returns
auto& *this

References fileionew::FluidCartRegularD< N_dim >::_meshnumc, and fileionew::FluidCartRegularD< N_dim >::_ptr_meshc.

Here is the caller graph for this function:

◆ SetMeshf()

template<int N_dim>
auto& fileionew::FluidCartRegularD< N_dim >::SetMeshf ( int  dim,
int  N,
const double  meshf[] 
)
inline

Set the Mesh [face] object.

Parameters
dimwhich dimension/direction
Nsize of mesh
meshfmesh [face]
Returns
auto& *this

References fileionew::FluidCartRegularD< N_dim >::_meshnumf, and fileionew::FluidCartRegularD< N_dim >::_ptr_meshf.

Member Data Documentation

◆ _casename

template<int N_dim>
std::string fileionew::FluidCartRegularD< N_dim >::_casename = "default"
private

◆ _ctemp

template<int N_dim>
std::complex<double>* fileionew::FluidCartRegularD< N_dim >::_ctemp = nullptr
inlinestaticprivate

◆ _dataspacestyle

template<int N_dim>
std::string fileionew::FluidCartRegularD< N_dim >::_dataspacestyle = "c-style"
private

◆ _dim

template<int N_dim>
const int fileionew::FluidCartRegularD< N_dim >::_dim = N_dim
private

◆ _domain_down

template<int N_dim>
double fileionew::FluidCartRegularD< N_dim >::_domain_down[N_dim] = {0}
private

◆ _domain_up

template<int N_dim>
double fileionew::FluidCartRegularD< N_dim >::_domain_up[N_dim] = {0}
private

◆ _fapl

template<int N_dim>
h5::FileAccessProps fileionew::FluidCartRegularD< N_dim >::_fapl
private

◆ _filename

template<int N_dim>
std::string fileionew::FluidCartRegularD< N_dim >::_filename
private

◆ _filenameprefix

template<int N_dim>
std::string fileionew::FluidCartRegularD< N_dim >::_filenameprefix = "fluidfield"
private

◆ _filepath

template<int N_dim>
std::string fileionew::FluidCartRegularD< N_dim >::_filepath = "./"
private

◆ _filestyle

template<int N_dim>
std::string fileionew::FluidCartRegularD< N_dim >::_filestyle = "onestep"
private

◆ _gh_down

template<int N_dim>
int fileionew::FluidCartRegularD< N_dim >::_gh_down[N_dim] = {0}
private

◆ _gh_up

template<int N_dim>
int fileionew::FluidCartRegularD< N_dim >::_gh_up[N_dim] = {0}
private

◆ _maxlength

template<int N_dim>
int fileionew::FluidCartRegularD< N_dim >::_maxlength = 0
inlinestaticprivate

◆ _meshnumc

template<int N_dim>
int fileionew::FluidCartRegularD< N_dim >::_meshnumc[N_dim] = {0}
private

◆ _meshnumf

template<int N_dim>
int fileionew::FluidCartRegularD< N_dim >::_meshnumf[N_dim] = {0}
private

◆ _mpi_coord

template<int N_dim>
int fileionew::FluidCartRegularD< N_dim >::_mpi_coord[N_dim]
private

◆ _mpi_proc

template<int N_dim>
int fileionew::FluidCartRegularD< N_dim >::_mpi_proc[N_dim]
private

◆ _numbernamelength

template<int N_dim>
int fileionew::FluidCartRegularD< N_dim >::_numbernamelength = 7
private

◆ _ptr_meshc

template<int N_dim>
double* fileionew::FluidCartRegularD< N_dim >::_ptr_meshc[N_dim]
private

◆ _ptr_meshf

template<int N_dim>
double* fileionew::FluidCartRegularD< N_dim >::_ptr_meshf[N_dim]
private

◆ _rho0

template<int N_dim>
double fileionew::FluidCartRegularD< N_dim >::_rho0 = 0.
private

◆ _rtemp

template<int N_dim>
double* fileionew::FluidCartRegularD< N_dim >::_rtemp = nullptr
inlinestaticprivate

◆ _space

template<int N_dim>
std::string fileionew::FluidCartRegularD< N_dim >::_space = "physical"
private

◆ _storagestyle

template<int N_dim>
std::string fileionew::FluidCartRegularD< N_dim >::_storagestyle = "cartregular"
private

◆ _visc0

template<int N_dim>
double fileionew::FluidCartRegularD< N_dim >::_visc0 = 0.
private

◆ fieldid

template<int N_dim>
hid_t fileionew::FluidCartRegularD< N_dim >::fieldid

◆ fileid

template<int N_dim>
hid_t fileionew::FluidCartRegularD< N_dim >::fileid

handles of HDF5

◆ filepropid

template<int N_dim>
hid_t fileionew::FluidCartRegularD< N_dim >::filepropid

◆ geomeshid

template<int N_dim>
hid_t fileionew::FluidCartRegularD< N_dim >::geomeshid

◆ otherinfoid

template<int N_dim>
hid_t fileionew::FluidCartRegularD< N_dim >::otherinfoid

◆ physparaid

template<int N_dim>
hid_t fileionew::FluidCartRegularD< N_dim >::physparaid

The documentation for this class was generated from the following file: