# PhasicFlow: dataIO< T > Class Template Reference
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

dataIO< T > Class Template Referenceabstract
Inheritance diagram for dataIO< T >:
[legend]
Collaboration diagram for dataIO< T >:
[legend]

## Public Member Functions

| TypeInfo ("dataIO")
| Type info. More...
| dataIO (const IOPattern &iop)
| dataIO (const dataIO &)=default
| dataIO (dataIO &&)=default
dataIO & | operator= (const dataIO &)=default
dataIO & | operator= (dataIO &&)=default
virtual | ~dataIO ()=default
| create_vCtor (dataIO, IOPattern,(const IOPattern &iop),(iop))
bool | writeData (iOstream &os, span< T > data)
| Write data to the end of file from all processors. More...
bool | readData (iIstream &is, std::vector< T > &data)
bool | writeData (iOstream &os, span< word > data)

## Static Public Member Functions

static uniquePtr< dataIO > | create (const IOPattern &iop)

## Protected Member Functions

virtual bool | gatherData (span< T > data)=0
| gather data from all processors and put the results in buffer_ More...

## Protected Attributes

IOPattern | ioPattern_
std::vector< T > | buffer_
span< T > | bufferSpan_

## Detailed Description

### template<typename T>
class pFlow::dataIO< T >

Definition at line 67 of file dataIO.hpp.

## Constructor & Destructor Documentation

## dataIO() [1/3]

dataIO | ( | const IOPattern & | iop | ) |

inline

Definition at line 86 of file dataIO.hpp.

## dataIO() [2/3]

dataIO | ( | const dataIO< T > & |  | ) |

default

## dataIO() [3/3]

dataIO | ( | dataIO< T > && |  | ) |

default

## ~dataIO()

virtual ~dataIO | ( |  | ) |

virtualdefault

## Member Function Documentation

## gatherData()

virtual bool gatherData | ( | span< T > | data | ) |

protectedpure virtual

gather data from all processors and put the results in buffer_

Implemented in dataIORegular< T >.

## TypeInfo()

TypeInfo | ( | "dataIO< T >" |  | ) |

Type info.

## operator=() [1/2]

dataIO& operator= | ( | const dataIO< T > & |  | ) |

default

## operator=() [2/2]

dataIO& operator= | ( | dataIO< T > && |  | ) |

default

## create_vCtor()

create_vCtor | ( | dataIO< T > | ,
|  | IOPattern | ,
|  | (const IOPattern &iop) | ,
|  | (iop) |
| ) |  |

## writeData() [1/2]

bool writeData | ( | iOstream & | os,
|  | span< T > | data
| ) |  |

Write data to the end of file from all processors.

This method should be called from all processors.

first gather data from all processors (if any)

Definition at line 193 of file dataIO.cpp.

References pFlow::endl(), fatalErrorInFunction, IOstream::name(), and pFlow::writeDataAsciiBinary().

Here is the call graph for this function:

## readData()

bool readData | ( | iIstream & | is,
|  | std::vector< T > & | data
| ) |  |

Definition at line 245 of file dataIO.cpp.

References pFlow::readDataAsciiBinary().

Here is the call graph for this function:

## create()

pFlow::uniquePtr< pFlow::dataIO< T > > create | ( | const IOPattern & | iop | ) |

static

Definition at line 263 of file dataIO.cpp.

References pFlow::angleBracketsNames2(), fatalError, fatalExit, pFlow::pFlowProcessors(), and pFlow::printKeys().

Referenced by pFlow::readStdVector(), and pFlow::writeSpan().

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

## writeData() [2/2]

bool writeData | ( | iOstream & | os,
|  | span< word > | data
| ) |  |

inline

first gather data from all processors (if any)

Definition at line 215 of file dataIO.cpp.

References pFlow::endl(), fatalErrorInFunction, fatalExit, IOstream::name(), notImplementedFunction, and pFlow::writeDataASCII().

Here is the call graph for this function:

## Member Data Documentation

## ioPattern_

IOPattern ioPattern_

protected

Definition at line 71 of file dataIO.hpp.

## buffer_

std::vector<T> buffer_

protected

Definition at line 73 of file dataIO.hpp.

## bufferSpan_

span<T> bufferSpan_

protected

Definition at line 75 of file dataIO.hpp.

Referenced by dataIORegular< T >::gatherData().

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

- src/phasicFlow/streams/dataIO/dataIO.hpp
- src/phasicFlow/streams/dataIO/dataIO.cpp