LifeV
Exporter< MeshType > Class Template Referenceabstract

Exporter - Pure virtual class that describes a generic exporter. More...

#include <Exporter.hpp>

+ Inheritance diagram for Exporter< MeshType >:
+ Collaboration diagram for Exporter< MeshType >:

Public typedefs

typedef MeshType mesh_Type
 
typedef std::shared_ptr< MeshTypemeshPtr_Type
 
typedef Epetra_Comm comm_Type
 
typedef std::shared_ptr< comm_TypecommPtr_Type
 
typedef ExporterData< mesh_TypeexporterData_Type
 
typedef exporterData_Type::vector_Type vector_Type
 
typedef exporterData_Type::vectorPtr_Type vectorPtr_Type
 
typedef exporterData_Type::feSpace_Type feSpace_Type
 
typedef exporterData_Type::feSpacePtr_Type feSpacePtr_Type
 
typedef exporterData_Type::WhereEnum WhereEnum
 
typedef exporterData_Type::FieldTypeEnum FieldTypeEnum
 
typedef exporterData_Type::FieldRegimeEnum FieldRegimeEnum
 
typedef std::vector< exporterData_TypedataVector_Type
 
typedef dataVector_Type::iterator dataVectorIterator_Type
 
typedef std::multimap< WhereEnum, UIntwhereToDataIdMap_Type
 
typedef std::multimap< FE_TYPE, UIntfeTypeToDataIdMap_Type
 

Constructor & Destructor

 Exporter ()
 Empty constructor for Exporter. More...
 
 Exporter (const GetPot &dfile, const std::string &prefix)
 Constructor for Exporter without prefix and procID. More...
 
virtual ~Exporter ()
 Destructor. More...
 

Methods

void addVariable (const FieldTypeEnum &type, const std::string &variableName, const feSpacePtr_Type &feSpacePtr, const vectorPtr_Type &vectorPtr, const UInt &start, const FieldRegimeEnum &regime=exporterData_Type::UnsteadyRegime, const WhereEnum &where=exporterData_Type::Node)
 Adds a new variable to be post-processed. More...
 
virtual void postProcess (const Real &time)=0
 Post-process the variables added to the list. More...
 
virtual UInt importFromTime (const Real &Time)=0
 Import data from previous simulations at a certain time. More...
 
virtual void import (const Real &startTime, const Real &dt)=0
 Import data from previous simulations. More...
 
virtual void import (const Real &startTime)=0
 Read only last timestep. More...
 
virtual void readVariable (exporterData_Type &dvar)
 
virtual void exportPID (meshPtr_Type &mesh, commPtr_Type &comm, const bool binaryFormat=false)
 Export the Processor ID as P0 variable. More...
 
void exportRegionMarkerID (std::shared_ptr< MeshType > mesh, std::shared_ptr< Epetra_Comm > comm)
 Export the region marker ID as P0 variable. More...
 
virtual void exportFlags (std::shared_ptr< MeshType > mesh, std::shared_ptr< Epetra_Comm > comm, flag_Type const &flag=EntityFlags::ALL)
 Export entity flags. More...
 

Set Methods

virtual void setDataFromGetPot (const GetPot &dataFile, const std::string &section="exporter")
 Set data from file. More...
 
void setPrefix (const std::string &prefix)
 Set prefix. More...
 
void setPostDir (const std::string &Directory)
 Set the folder for pre/postprocessing. More...
 
void setTimeIndex (const UInt &timeIndex)
 Set the current time index. More...
 
void setTimeIndexStart (const UInt &timeIndexStart)
 Set the time index of the first file. More...
 
void setSave (const UInt &save)
 Set how many time step between two snapshots. More...
 
void setMultimesh (const bool &multimesh)
 Set if to save the mesh at each time step. More...
 
virtual void setMeshProcId (const meshPtr_Type mesh, const int &procId)
 
virtual void closeFile ()
 Close the output file. More...
 

Get Methods

const UIntsave () const
 returns how many time steps between two snapshots More...
 
const UInttimeIndexStart () const
 returns the time index of the first snapshot More...
 
const UInttimeIndex () const
 returns the time index of the current snapshot More...
 
virtual MapEpetraType mapType () const =0
 returns the type of the map to use for the VectorEpetra More...
 

Protected methods

void computePostfix ()
 compute postfix More...
 
virtual void readScalar (exporterData_Type &dvar)=0
 A method to read a scalar field (to be implemented in derived classes) More...
 
virtual void readVector (exporterData_Type &dvar)=0
 A method to read a vector field (to be implemented in derived classes) More...
 

Protected data members

std::string M_prefix
 the file prefix More...
 
std::string M_postDir
 the name of the folder where to read or write files More...
 
UInt M_timeIndexStart
 the time index of the first snapshot More...
 
UInt M_timeIndex
 the time index of the current snapshot More...
 
UInt M_save
 how many time steps between subsequent snapshots More...
 
bool M_multimesh
 do we want to save the mesh with each snapshot? More...
 
UInt M_timeIndexWidth
 how many digits (in the file suffix) for the time index More...
 
meshPtr_Type M_mesh
 a pointer to the mesh More...
 
Int M_procId
 the ID of the process More...
 
std::string M_postfix
 the file suffix More...
 
UInt M_numImportProc
 how many processes produced the data that we want to import More...
 
whereToDataIdMap_Type M_whereToDataIdMap
 a map to retrieve all data located in the same geo entities (node or element) More...
 
feTypeToDataIdMap_Type M_feTypeToDataIdMap
 a map to retrieve all data defined in the same FE space More...
 
dataVector_Type M_dataVector
 the vector of ExporterData objects More...
 
std::list< RealM_timeSteps
 the list of time steps (for use in import procedures) More...
 

Detailed Description

template<typename MeshType>
class LifeV::Exporter< MeshType >

Exporter - Pure virtual class that describes a generic exporter.

Author
Simone Deparis simon.nosp@m.e.de.nosp@m.paris.nosp@m.@epf.nosp@m.l.ch
Date
11-11-2008

This class is pure virtual and describes a generic exporter that can also do import

Definition at line 266 of file Exporter.hpp.

Member Typedef Documentation

◆ mesh_Type

Definition at line 272 of file Exporter.hpp.

◆ meshPtr_Type

typedef std::shared_ptr<MeshType> meshPtr_Type

Definition at line 273 of file Exporter.hpp.

◆ comm_Type

typedef Epetra_Comm comm_Type

Definition at line 274 of file Exporter.hpp.

◆ commPtr_Type

typedef std::shared_ptr<comm_Type> commPtr_Type

Definition at line 275 of file Exporter.hpp.

◆ exporterData_Type

Definition at line 276 of file Exporter.hpp.

◆ vector_Type

Definition at line 277 of file Exporter.hpp.

◆ vectorPtr_Type

◆ feSpace_Type

Definition at line 279 of file Exporter.hpp.

◆ feSpacePtr_Type

◆ WhereEnum

Definition at line 281 of file Exporter.hpp.

◆ FieldTypeEnum

Definition at line 282 of file Exporter.hpp.

◆ FieldRegimeEnum

◆ dataVector_Type

typedef std::vector<exporterData_Type > dataVector_Type

Definition at line 284 of file Exporter.hpp.

◆ dataVectorIterator_Type

typedef dataVector_Type::iterator dataVectorIterator_Type

Definition at line 285 of file Exporter.hpp.

◆ whereToDataIdMap_Type

typedef std::multimap<WhereEnum, UInt > whereToDataIdMap_Type

Definition at line 286 of file Exporter.hpp.

◆ feTypeToDataIdMap_Type

typedef std::multimap<FE_TYPE, UInt > feTypeToDataIdMap_Type

Definition at line 287 of file Exporter.hpp.

Constructor & Destructor Documentation

◆ Exporter() [1/2]

Exporter ( )

Empty constructor for Exporter.

Definition at line 606 of file Exporter.hpp.

◆ Exporter() [2/2]

Exporter ( const GetPot dfile,
const std::string &  prefix 
)

Constructor for Exporter without prefix and procID.

In this case prefix and procID should be set separately

Parameters
dfilethe GetPot data file where you must provide an [exporter] section with: "start" (start index for filenames 0 for 000, 1 for 001 etc.), "save" (how many time steps between snapshots) "multimesh" ( = true if the mesh has to be saved at each post-processing step)
theprefix for the case file (ex. "test" for test.case)

Definition at line 618 of file Exporter.hpp.

◆ ~Exporter()

virtual ~Exporter ( )
inlinevirtual

Destructor.

Definition at line 308 of file Exporter.hpp.

Member Function Documentation

◆ addVariable()

void addVariable ( const FieldTypeEnum type,
const std::string &  variableName,
const feSpacePtr_Type feSpacePtr,
const vectorPtr_Type vectorPtr,
const UInt start,
const FieldRegimeEnum regime = exporterData_Type::UnsteadyRegime,
const WhereEnum where = exporterData_Type::Node 
)

Adds a new variable to be post-processed.

Parameters
typethe type of the variable exporterData_Type::FieldTypeEnum
variableNamethe name of the variable (to be used in file prefix)
feSpacePtra pointer to the FESpace of the variable
vectorPtra pointer to the vector containing the values of the variable
startlocation in the vector where the storing of the variable starts
regimeif UnsteadyRegime the filename should change at each time step
wherechoose whether the variable is defined on Nodes of Elements

Definition at line 628 of file Exporter.hpp.

◆ postProcess()

virtual void postProcess ( const Real time)
pure virtual

Post-process the variables added to the list.

Parameters
timethe solver time

Implemented in ExporterVTK< MeshType >, ExporterHDF5< MeshType >, ExporterHDF5Mesh3D< MeshType >, ExporterEnsight< MeshType >, and ExporterEmpty< MeshType >.

◆ importFromTime()

virtual UInt importFromTime ( const Real Time)
pure virtual

Import data from previous simulations at a certain time.

Parameters
Timethe time of the data to be imported

Implemented in ExporterVTK< MeshType >, ExporterHDF5< MeshType >, ExporterEnsight< MeshType >, and ExporterEmpty< MeshType >.

◆ import() [1/2]

virtual void import ( const Real startTime,
const Real dt 
)
pure virtual

Import data from previous simulations.

Parameters
timethe solver time
dttime step used to rebuild the history up to now

Implemented in ExporterVTK< MeshType >, ExporterHDF5< MeshType >, ExporterEnsight< MeshType >, and ExporterEmpty< MeshType >.

◆ import() [2/2]

virtual void import ( const Real startTime)
pure virtual

◆ readVariable()

void readVariable ( exporterData_Type dvar)
virtual

Reimplemented in ExporterHDF5< MeshType >, and ExporterEnsight< MeshType >.

Definition at line 642 of file Exporter.hpp.

◆ exportPID()

void exportPID ( meshPtr_Type mesh,
commPtr_Type comm,
const bool  binaryFormat = false 
)
virtual

Export the Processor ID as P0 variable.

Definition at line 695 of file Exporter.hpp.

◆ exportRegionMarkerID()

void exportRegionMarkerID ( std::shared_ptr< MeshType mesh,
std::shared_ptr< Epetra_Comm >  comm 
)

Export the region marker ID as P0 variable.

Definition at line 760 of file Exporter.hpp.

◆ exportFlags()

void exportFlags ( std::shared_ptr< MeshType mesh,
std::shared_ptr< Epetra_Comm >  comm,
flag_Type const &  flag = EntityFlags::ALL 
)
virtual

Export entity flags.

Definition at line 656 of file Exporter.hpp.

◆ setDataFromGetPot()

void setDataFromGetPot ( const GetPot dataFile,
const std::string &  section = "exporter" 
)
virtual

Set data from file.

Parameters
dataFiledata file.
sectionsection in the data file.

Reimplemented in ExporterVTK< MeshType >, and ExporterHDF5< MeshType >.

Definition at line 837 of file Exporter.hpp.

◆ setPrefix()

void setPrefix ( const std::string &  prefix)
inline

Set prefix.

Parameters
prefixprefix.

Definition at line 382 of file Exporter.hpp.

◆ setPostDir()

void setPostDir ( const std::string &  Directory)
inline

Set the folder for pre/postprocessing.

Parameters
Directoryoutput folder

Definition at line 391 of file Exporter.hpp.

◆ setTimeIndex()

void setTimeIndex ( const UInt timeIndex)
inline

Set the current time index.

Parameters
timeIndexindex of the current time frame

Definition at line 400 of file Exporter.hpp.

◆ setTimeIndexStart()

void setTimeIndexStart ( const UInt timeIndexStart)
inline

Set the time index of the first file.

Parameters
timeIndexStartindex of the first time frame

Definition at line 409 of file Exporter.hpp.

◆ setSave()

void setSave ( const UInt save)
inline

Set how many time step between two snapshots.

Parameters
savesteps

Definition at line 418 of file Exporter.hpp.

◆ setMultimesh()

void setMultimesh ( const bool &  multimesh)
inline

Set if to save the mesh at each time step.

Parameters
multimeshmultimesh

Definition at line 427 of file Exporter.hpp.

◆ setMeshProcId()

void setMeshProcId ( const meshPtr_Type  mesh,
const int &  procId 
)
virtual

Definition at line 849 of file Exporter.hpp.

◆ closeFile()

virtual void closeFile ( )
inlinevirtual

Close the output file.

This method is only used by some of the exporter which derive from this class.

Reimplemented in ExporterHDF5< MeshType >.

Definition at line 438 of file Exporter.hpp.

◆ save()

const UInt& save ( ) const
inline

returns how many time steps between two snapshots

Definition at line 444 of file Exporter.hpp.

◆ timeIndexStart()

const UInt& timeIndexStart ( ) const
inline

returns the time index of the first snapshot

Definition at line 450 of file Exporter.hpp.

◆ timeIndex()

const UInt& timeIndex ( ) const
inline

returns the time index of the current snapshot

Definition at line 456 of file Exporter.hpp.

◆ mapType()

virtual MapEpetraType mapType ( ) const
pure virtual

◆ computePostfix()

void computePostfix ( )
protected

compute postfix

Definition at line 808 of file Exporter.hpp.

◆ readScalar()

virtual void readScalar ( exporterData_Type dvar)
protectedpure virtual

A method to read a scalar field (to be implemented in derived classes)

Parameters
dvarthe ExporterData object

Implemented in ExporterEnsight< MeshType >, and ExporterHDF5< MeshType >.

◆ readVector()

virtual void readVector ( exporterData_Type dvar)
protectedpure virtual

A method to read a vector field (to be implemented in derived classes)

Parameters
dvarthe ExporterData object

Implemented in ExporterEnsight< MeshType >, and ExporterHDF5< MeshType >.

Field Documentation

◆ M_prefix

std::string M_prefix
protected

the file prefix

Definition at line 488 of file Exporter.hpp.

◆ M_postDir

std::string M_postDir
protected

the name of the folder where to read or write files

Definition at line 490 of file Exporter.hpp.

◆ M_timeIndexStart

UInt M_timeIndexStart
protected

the time index of the first snapshot

Definition at line 492 of file Exporter.hpp.

◆ M_timeIndex

UInt M_timeIndex
protected

the time index of the current snapshot

Definition at line 494 of file Exporter.hpp.

◆ M_save

UInt M_save
protected

how many time steps between subsequent snapshots

Definition at line 496 of file Exporter.hpp.

◆ M_multimesh

bool M_multimesh
protected

do we want to save the mesh with each snapshot?

Definition at line 498 of file Exporter.hpp.

◆ M_timeIndexWidth

UInt M_timeIndexWidth
protected

how many digits (in the file suffix) for the time index

Definition at line 500 of file Exporter.hpp.

◆ M_mesh

meshPtr_Type M_mesh
protected

a pointer to the mesh

Definition at line 502 of file Exporter.hpp.

◆ M_procId

Int M_procId
protected

the ID of the process

Definition at line 504 of file Exporter.hpp.

◆ M_postfix

std::string M_postfix
protected

the file suffix

Definition at line 506 of file Exporter.hpp.

◆ M_numImportProc

UInt M_numImportProc
protected

how many processes produced the data that we want to import

Definition at line 508 of file Exporter.hpp.

◆ M_whereToDataIdMap

whereToDataIdMap_Type M_whereToDataIdMap
protected

a map to retrieve all data located in the same geo entities (node or element)

Definition at line 510 of file Exporter.hpp.

◆ M_feTypeToDataIdMap

feTypeToDataIdMap_Type M_feTypeToDataIdMap
protected

a map to retrieve all data defined in the same FE space

Definition at line 512 of file Exporter.hpp.

◆ M_dataVector

dataVector_Type M_dataVector
protected

the vector of ExporterData objects

Definition at line 514 of file Exporter.hpp.

◆ M_timeSteps

std::list<Real> M_timeSteps
protected

the list of time steps (for use in import procedures)

Definition at line 516 of file Exporter.hpp.


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