ECOGEN 4.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
Output Class Reference

#include <Output.h>

Inherited by OutputGNU, and OutputXML.

Public Member Functions

 Output ()
 Default constructor for specific output without specific needs.
 
 Output (std::string casTest, std::string nameRun, tinyxml2::XMLElement *element, std::string fileName, Input *entree)
 Main constructor for datasets used for OutputXML and OutputGNU according to outputMode.
 
 Output (std::string nameRun, int fileNumberRestartMeshMapping, Input *input)
 Constructor for datasets used for OutputXML when mesh mapping restart option is activated.
 
 Output (tinyxml2::XMLElement *element)
 Constructor for specific derived GNU outputs (boundary, probe, cut)
 
virtual ~Output ()
 
virtual void locateProbeInMesh (const TypeMeshContainer< Cell * > &, const int &, bool=false)
 
virtual CelllocateProbeInAMRSubMesh (std::vector< Cell * > *, const int &)
 
void copyInputFiles () const
 
void initializeOutput (const Cell &cell)
 
void initializeOutput (std::vector< CellInterface * > *cellInterfacesLvl)
 To initialize OutputBoundaryMassflowGNU.
 
void initializeOutputMeshMapping (const Cell &cell)
 To initialize output for Mesh Mapping Restart.
 
virtual void initializeOutputInfos ()
 
virtual void writeResults (Mesh *, std::vector< Cell * > *)
 
virtual void writeResults (std::vector< CellInterface * > *)
 
void printTree (Mesh *mesh, std::vector< Cell * > *cellsLvl, int m_restartAMRsaveFreq)
 
virtual void writeInfos ()
 
virtual void writeProgress ()
 
void saveInfoCells () const
 
virtual void initializeSpecificOutput ()
 
virtual void initializeSpecificOutput (std::vector< CellInterface * > *)
 
void readInfos ()
 Currently only used for OutputBoundaryMassflowGNU.
 
int readNbCpu ()
 Read and return the number of cpu from the infoCalcul file of a performed simulation.
 
virtual void readResults (Mesh *, std::vector< Cell * > *)
 Read results of a previous simulation to restart from it.
 
virtual void readResultsCpu (Mesh *, std::vector< Cell * > *, int)
 Read results of a single partition of a previous simulation to restart from it.
 
void readDomainDecompostion (Mesh *mesh)
 
void readTree (Mesh *mesh, TypeMeshContainer< Cell * > *cellsLvl, TypeMeshContainer< Cell * > *cellsLvlGhost, TypeMeshContainer< CellInterface * > *cellInterfacesLvl, const std::vector< AddPhys * > &addPhys, int &nbCellsTotalAMR)
 
int getNumFile () const
 
virtual double getNextTime ()
 
virtual bool possesses ()
 
const std::string & getFolderOutput ()
 
const TypeOutputgetType () const
 
bool getReducedOutput () const
 

Protected Member Functions

void printWritingInfo () const
 
void saveInfos () const
 
std::string createFilename (const char *name, int lvl=-1, int proc=-1, int numFichier=-1) const
 
void writeDataset (std::vector< double > dataset, std::ofstream &fileStream, TypeData typeData)
 
void getDataset (std::istringstream &data, std::vector< double > &dataset)
 

Protected Attributes

Inputm_input
 Pointer to input.
 
Runm_run
 Pointer to run.
 
TypeOutput m_type
 Type of output.
 
std::string m_simulationName
 Test case name (defined in "main.xml")
 
std::string m_infoCalcul
 Filename to save useful info of computation.
 
std::string m_infoMesh
 Filename of mesh info file.
 
std::string m_treeStructure
 Filename for tree structure backup.
 
std::string m_domainDecomposition
 Filename for domain decomposition backup.
 
std::string m_fileNameResults
 Filename of result file.
 
std::string m_filenameCollectionParaview
 Name of the collection containing the results files (for Paraview)
 
std::string m_filenameCollectionVisIt
 Name of the collection containing the results files (for VisIt)
 
std::string m_folderOutput
 Folder to store results.
 
std::string m_folderSavesInput
 Folder to store a copy of input files.
 
std::string m_folderDatasets
 Folder to save the datasets.
 
std::string m_folderInfoMesh
 Folder to store mesh info.
 
std::string m_folderCuts
 Cuts results folder location.
 
std::string m_folderProbes
 Probes results folder location.
 
std::string m_folderGlobalQuantities
 Global quantity (e.g. mass) results folder location.
 
std::string m_folderBoundaries
 Boundaries flux results folder location.
 
std::string m_fileCollectionParaview
 Chemin du file collection regroupant les fichiers resultats (for Paraview)
 
std::string m_fileCollectionVisIt
 Chemin du file collection regroupant les fichiers resultats (for VisIt)
 
std::string m_folderErrorsAndWarnings
 File path for errors and warnings.
 
bool m_writeBinary
 Choice to write binary/ASCII.
 
bool m_splitData
 Choice print data in separate files.
 
int m_precision
 Output files precision (number of digits) //default: 0.
 
bool m_reducedOutput
 Choice of reduced number of output variables when possible (depends on the model)
 
int m_numFichier
 
std::string m_endianMode
 
int m_nbCpusRestarted
 Number of CPUs of the simulation to be restarted.
 
Cell m_cellRef
 Reference cell to extract variables name.
 

Constructor & Destructor Documentation

◆ Output() [1/4]

Output::Output ( )

Default constructor for specific output without specific needs.

◆ Output() [2/4]

Output::Output ( std::string  casTest,
std::string  nameRun,
tinyxml2::XMLElement element,
std::string  fileName,
Input entree 
)

Main constructor for datasets used for OutputXML and OutputGNU according to outputMode.

Parameters
casTestTest case name (folder containing input xml files (main, mesh etc.)
nameRunFolder to store results
elementXML outputMode element
fileNameFull path to main.xml of current test case
entreeInput pointer to access run pointer and its information

◆ Output() [3/4]

Output::Output ( std::string  nameRun,
int  fileNumberRestartMeshMapping,
Input input 
)

Constructor for datasets used for OutputXML when mesh mapping restart option is activated.

Parameters
nameRunFolder to store results
fileNumberRestartMeshMappingResult file number of mapped mesh to be restarted from
inputInput pointer to access run pointer and its information

◆ Output() [4/4]

Output::Output ( tinyxml2::XMLElement element)

Constructor for specific derived GNU outputs (boundary, probe, cut)

Parameters
elementXML GNU output element to get stream precision

◆ ~Output()

Output::~Output ( )
virtual

Member Function Documentation

◆ copyInputFiles()

void Output::copyInputFiles ( ) const

◆ createFilename()

std::string Output::createFilename ( const char *  name,
int  lvl = -1,
int  proc = -1,
int  numFichier = -1 
) const
protected

◆ getDataset()

void Output::getDataset ( std::istringstream &  data,
std::vector< double > &  dataset 
)
protected

◆ getFolderOutput()

const std::string & Output::getFolderOutput ( )
inline

◆ getNextTime()

virtual double Output::getNextTime ( )
inlinevirtual

Reimplemented in OutputBoundaryGNU, and OutputProbeGNU.

◆ getNumFile()

int Output::getNumFile ( ) const
inline

◆ getReducedOutput()

bool Output::getReducedOutput ( ) const
inline

◆ getType()

const TypeOutput & Output::getType ( ) const
inline

◆ initializeOutput() [1/2]

void Output::initializeOutput ( const Cell cell)

◆ initializeOutput() [2/2]

void Output::initializeOutput ( std::vector< CellInterface * > *  cellInterfacesLvl)

To initialize OutputBoundaryMassflowGNU.

◆ initializeOutputInfos()

void Output::initializeOutputInfos ( )
virtual

Reimplemented in OutputCutGNU, and OutputProbeGNU.

◆ initializeOutputMeshMapping()

void Output::initializeOutputMeshMapping ( const Cell cell)

To initialize output for Mesh Mapping Restart.

◆ initializeSpecificOutput() [1/2]

virtual void Output::initializeSpecificOutput ( )
inlinevirtual

◆ initializeSpecificOutput() [2/2]

virtual void Output::initializeSpecificOutput ( std::vector< CellInterface * > *  )
inlinevirtual

Reimplemented in OutputGNU, and OutputBoundaryGNU.

◆ locateProbeInAMRSubMesh()

virtual Cell * Output::locateProbeInAMRSubMesh ( std::vector< Cell * > *  ,
const int &   
)
inlinevirtual

Reimplemented in OutputProbeGNU.

◆ locateProbeInMesh()

virtual void Output::locateProbeInMesh ( const TypeMeshContainer< Cell * > &  ,
const int &  ,
bool  = false 
)
inlinevirtual

Reimplemented in OutputProbeGNU.

◆ possesses()

virtual bool Output::possesses ( )
inlinevirtual

Reimplemented in OutputProbeGNU.

◆ printTree()

void Output::printTree ( Mesh mesh,
std::vector< Cell * > *  cellsLvl,
int  m_restartAMRsaveFreq 
)

◆ printWritingInfo()

void Output::printWritingInfo ( ) const
protected

◆ readDomainDecompostion()

void Output::readDomainDecompostion ( Mesh mesh)

◆ readInfos()

void Output::readInfos ( )

Currently only used for OutputBoundaryMassflowGNU.

Read the informations related to a previous simulation (number of cpu, time, file number, etc.) using infoCalcul file

Only the content since the file number to be restarted is kept (as the next files will overwrite the later content)

◆ readNbCpu()

int Output::readNbCpu ( )

Read and return the number of cpu from the infoCalcul file of a performed simulation.

◆ readResults()

virtual void Output::readResults ( Mesh ,
std::vector< Cell * > *   
)
inlinevirtual

Read results of a previous simulation to restart from it.

Available for all mesh types if the same number of cpus is used between both simulations

Parameters
meshMesh object of the current simulation
cellsLvlComputationnal cells to be filled with results of previous simulation

Reimplemented in OutputXML.

◆ readResultsCpu()

virtual void Output::readResultsCpu ( Mesh ,
std::vector< Cell * > *  ,
int   
)
inlinevirtual

Read results of a single partition of a previous simulation to restart from it.

Available for GmshV2 only but allow the use of mesh mapping and/or use of a different number of cpu than the previous simulation

Parameters
meshMesh object of a single partition of the previous simulation (either the same one as current or older one in case of mapping)
cellsLvlComputationnal cells to be filled with results of previous simulation
cpuCpu number of the partition to be read

Reimplemented in OutputXML.

◆ readTree()

void Output::readTree ( Mesh mesh,
TypeMeshContainer< Cell * > *  cellsLvl,
TypeMeshContainer< Cell * > *  cellsLvlGhost,
TypeMeshContainer< CellInterface * > *  cellInterfacesLvl,
const std::vector< AddPhys * > &  addPhys,
int &  nbCellsTotalAMR 
)

◆ saveInfoCells()

void Output::saveInfoCells ( ) const

◆ saveInfos()

void Output::saveInfos ( ) const
protected

◆ writeDataset()

void Output::writeDataset ( std::vector< double >  dataset,
std::ofstream &  fileStream,
TypeData  typeData 
)
protected

◆ writeInfos()

void Output::writeInfos ( )
virtual

Reimplemented in OutputCutGNU, and OutputProbeGNU.

◆ writeProgress()

void Output::writeProgress ( )
virtual

◆ writeResults() [1/2]

virtual void Output::writeResults ( Mesh ,
std::vector< Cell * > *   
)
inlinevirtual

◆ writeResults() [2/2]

virtual void Output::writeResults ( std::vector< CellInterface * > *  )
inlinevirtual

Member Data Documentation

◆ m_cellRef

Cell Output::m_cellRef
protected

Reference cell to extract variables name.

◆ m_domainDecomposition

std::string Output::m_domainDecomposition
protected

Filename for domain decomposition backup.

◆ m_endianMode

std::string Output::m_endianMode
protected

◆ m_fileCollectionParaview

std::string Output::m_fileCollectionParaview
protected

Chemin du file collection regroupant les fichiers resultats (for Paraview)

◆ m_fileCollectionVisIt

std::string Output::m_fileCollectionVisIt
protected

Chemin du file collection regroupant les fichiers resultats (for VisIt)

◆ m_filenameCollectionParaview

std::string Output::m_filenameCollectionParaview
protected

Name of the collection containing the results files (for Paraview)

◆ m_filenameCollectionVisIt

std::string Output::m_filenameCollectionVisIt
protected

Name of the collection containing the results files (for VisIt)

◆ m_fileNameResults

std::string Output::m_fileNameResults
protected

Filename of result file.

◆ m_folderBoundaries

std::string Output::m_folderBoundaries
protected

Boundaries flux results folder location.

◆ m_folderCuts

std::string Output::m_folderCuts
protected

Cuts results folder location.

◆ m_folderDatasets

std::string Output::m_folderDatasets
protected

Folder to save the datasets.

◆ m_folderErrorsAndWarnings

std::string Output::m_folderErrorsAndWarnings
protected

File path for errors and warnings.

◆ m_folderGlobalQuantities

std::string Output::m_folderGlobalQuantities
protected

Global quantity (e.g. mass) results folder location.

◆ m_folderInfoMesh

std::string Output::m_folderInfoMesh
protected

Folder to store mesh info.

◆ m_folderOutput

std::string Output::m_folderOutput
protected

Folder to store results.

◆ m_folderProbes

std::string Output::m_folderProbes
protected

Probes results folder location.

◆ m_folderSavesInput

std::string Output::m_folderSavesInput
protected

Folder to store a copy of input files.

◆ m_infoCalcul

std::string Output::m_infoCalcul
protected

Filename to save useful info of computation.

◆ m_infoMesh

std::string Output::m_infoMesh
protected

Filename of mesh info file.

◆ m_input

Input* Output::m_input
protected

Pointer to input.

◆ m_nbCpusRestarted

int Output::m_nbCpusRestarted
protected

Number of CPUs of the simulation to be restarted.

◆ m_numFichier

int Output::m_numFichier
protected

◆ m_precision

int Output::m_precision
protected

Output files precision (number of digits) //default: 0.

◆ m_reducedOutput

bool Output::m_reducedOutput
protected

Choice of reduced number of output variables when possible (depends on the model)

◆ m_run

Run* Output::m_run
protected

Pointer to run.

◆ m_simulationName

std::string Output::m_simulationName
protected

Test case name (defined in "main.xml")

◆ m_splitData

bool Output::m_splitData
protected

Choice print data in separate files.

◆ m_treeStructure

std::string Output::m_treeStructure
protected

Filename for tree structure backup.

◆ m_type

TypeOutput Output::m_type
protected

Type of output.

◆ m_writeBinary

bool Output::m_writeBinary
protected

Choice to write binary/ASCII.


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