LifeV
ExporterEnsight< MeshType > Class Template Reference

ExporterEnsight data exporter. More...

#include <ExporterEnsight.hpp>

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

Public typedefs

typedef MeshType mesh_Type
 
typedef Exporter< mesh_Typesuper
 
typedef super::meshPtr_Type meshPtr_Type
 
typedef super::commPtr_Type commPtr_Type
 
typedef super::vectorPtr_Type vectorPtr_Type
 
typedef super::exporterData_Type exporterData_Type
 

Static members

static MapEpetraType const MapType
 returns the type of the map to use for the VectorEpetra More...
 

Constructors and destructor

 ExporterEnsight ()
 Default constructor. More...
 
 ExporterEnsight (const GetPot &dfile, meshPtr_Type mesh, const std::string &prefix, const Int &procId)
 Constructor for ExporterEnsight. More...
 
 ExporterEnsight (const GetPot &dfile, const std::string &prefix)
 Constructor for ExporterEnsight. More...
 

Public methods

void postProcess (const Real &time)
 Post-process the variables added to the list. More...
 
UInt importFromTime (const Real &)
 Import data from previous simulations at a certain time. More...
 
void import (const Real &importTime, const Real &dt)
 Import data from previous simulations and rebuild the internal time counters. More...
 
void import (const Real &importTime)
 Import data from previous simulations. More...
 
void readVariable (exporterData_Type &dvar)
 Read variable. More...
 
void setMeshProcId (const meshPtr_Type mesh, const Int &procId)
 Set the mesh and the processor id. More...
 
void exportPID (meshPtr_Type, commPtr_Type comm, const bool=false)
 temporary: the method should work form the Exporter class More...
 

Get methods

MapEpetraType mapType () const
 returns the type of the map to use for the VectorEpetra More...
 

Private methods

void writeCase (const Real &time)
 Compose the .case file. More...
 
void writeAsciiGeometry (const std::string geoFile)
 Compose the .geo file. More...
 
void writeAscii (const exporterData_Type &dvar)
 The ASCII writer. More...
 
void writeAsciiValues (const exporterData_Type &dvar, const std::string &suffix)
 The ASCII writer. More...
 
void caseMeshSection (std::ofstream &casef)
 Compose the "mesh" section of the .case file. More...
 
void caseVariableSection (std::ofstream &casef)
 Compose the "variable" section of the .case file. More...
 
void caseTimeSection (std::ofstream &casef, const Real &time)
 Compose the "time" section of the .case file. More...
 
void writeGlobalIDs (const std::string &filename)
 Dump on file the IDs of the global DOFs associated to this process. More...
 
void readAscii (exporterData_Type &dvar)
 The ASCII reader. More...
 
void readAsciiValues (exporterData_Type &dvar, const std::string &suffix)
 The ASCII reader. More...
 
void readGlobalIDs (const std::string &filename, std::vector< Real > &globalDOF)
 Read from file and store in a vector a list of global IDs. More...
 
void readScalar (exporterData_Type &dvar)
 The generic reader (specialization of the parent class method) More...
 
void readVector (exporterData_Type &dvar)
 The generic reader (specialization of the parent class method) More...
 
void initProcId ()
 initialize the internal data structures storing the ID of the current process More...
 
void setNodesMap (std::vector< Int > ltGNodesMap)
 Set the local-to-global map of DOFs. More...
 
void initNodesMap ()
 Build the local-to-global map of DOFs. More...
 

Private members

UInt M_steps
 the counter of the number of steps processed More...
 
std::vector< IntM_ltGNodesMap
 the local-to-global map: ltGNodesMap[i] is the global ID of the i-th DOF owned by the current process More...
 
std::string M_me
 the ID of the current process More...
 
std::string M_FEstr
 a string label for the FE space More...
 
std::string M_bdFEstr
 a string label for the boundary FE space More...
 
UInt M_nbLocalDof
 the number of local DOFs (per element) More...
 
UInt M_nbLocalBdDof
 the number of local boundary DOFs (per element) More...
 
bool M_firstTimeStep
 are we performing the first post-processing operation? More...
 

Additional Inherited Members

- Public Types inherited from Exporter< MeshType >
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
 
- Public Member Functions inherited from Exporter< MeshType >
 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...
 
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 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...
 
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...
 
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...
 
- Protected Member Functions inherited from Exporter< MeshType >
void computePostfix ()
 compute postfix More...
 
- Protected Attributes inherited from Exporter< MeshType >
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::ExporterEnsight< MeshType >

ExporterEnsight data exporter.

Definition at line 55 of file ExporterEnsight.hpp.

Member Typedef Documentation

◆ mesh_Type

Definition at line 61 of file ExporterEnsight.hpp.

◆ super

Definition at line 62 of file ExporterEnsight.hpp.

◆ meshPtr_Type

Definition at line 63 of file ExporterEnsight.hpp.

◆ commPtr_Type

Definition at line 64 of file ExporterEnsight.hpp.

◆ vectorPtr_Type

Definition at line 65 of file ExporterEnsight.hpp.

◆ exporterData_Type

Constructor & Destructor Documentation

◆ ExporterEnsight() [1/3]

Default constructor.

Definition at line 314 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

◆ ExporterEnsight() [2/3]

ExporterEnsight ( const GetPot dfile,
meshPtr_Type  mesh,
const std::string &  prefix,
const Int procId 
)

Constructor for ExporterEnsight.

Parameters
dfilethe GetPot data file where you must provide and [ensight] section with: "start" (start index for filenames 0 for 000, 1 for 001 etc.), "save" (how many time steps per posptrocessing) "multimesh" (=true if the mesh has to be saved at each post-processing step)
meshthe mesh
theprefix for the case file (ex. "test" for test.case)
theprocId determines de CPU id. if negative, it ussemes there is only one processor

Definition at line 324 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

◆ ExporterEnsight() [3/3]

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

Constructor for ExporterEnsight.

Definition at line 338 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

Member Function Documentation

◆ postProcess()

void postProcess ( const Real time)
virtual

Post-process the variables added to the list.

Parameters
timethe solver time

Implements Exporter< MeshType >.

Definition at line 353 of file ExporterEnsight.hpp.

◆ importFromTime()

UInt importFromTime ( const Real )
inlinevirtual

Import data from previous simulations at a certain time.

Parameters
Timethe time of the data to be imported

Not yet implemented for ExporterEnsight

Implements Exporter< MeshType >.

Definition at line 115 of file ExporterEnsight.hpp.

◆ import() [1/2]

void import ( const Real importTime,
const Real dt 
)
virtual

Import data from previous simulations and rebuild the internal time counters.

Parameters
importTimethe time of the snapshot to be imported
dtthe time step, is used to rebuild the history up to now

Implements Exporter< MeshType >.

Definition at line 413 of file ExporterEnsight.hpp.

◆ import() [2/2]

void import ( const Real importTime)
virtual

Import data from previous simulations.

Parameters
importTimethe time of the snapshot to be imported

Implements Exporter< MeshType >.

Definition at line 432 of file ExporterEnsight.hpp.

◆ readVariable()

void readVariable ( exporterData_Type dvar)
inlinevirtual

Read variable.

Parameters
dvarthe ExporterData object

Reimplemented from Exporter< MeshType >.

Definition at line 138 of file ExporterEnsight.hpp.

◆ setMeshProcId()

void setMeshProcId ( const meshPtr_Type  mesh,
const Int procId 
)

Set the mesh and the processor id.

Parameters
mesha pointer to the mesh
procIdthe ID of the current process

Definition at line 463 of file ExporterEnsight.hpp.

◆ exportPID()

void exportPID ( meshPtr_Type  ,
commPtr_Type  comm,
const bool  = false 
)
inline

temporary: the method should work form the Exporter class

Definition at line 151 of file ExporterEnsight.hpp.

◆ mapType()

MapEpetraType mapType ( ) const
inlinevirtual

returns the type of the map to use for the VectorEpetra

Implements Exporter< MeshType >.

Definition at line 164 of file ExporterEnsight.hpp.

◆ writeCase()

void writeCase ( const Real time)
private

Compose the .case file.

Parameters
Timethe time of the snapshot

Definition at line 514 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

◆ writeAsciiGeometry()

void writeAsciiGeometry ( const std::string  geoFile)
private

Compose the .geo file.

Parameters
geoFilethe name of the file to be produced

Definition at line 528 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

◆ writeAscii()

void writeAscii ( const exporterData_Type dvar)
private

The ASCII writer.

Parameters
dvarthe ExporterData object

Definition at line 578 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

◆ writeAsciiValues()

void writeAsciiValues ( const exporterData_Type dvar,
const std::string &  suffix 
)
private

The ASCII writer.

Parameters
dvarthe ExporterData object
suffixthe file suffix (.scl or .vct)

Definition at line 597 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

◆ caseMeshSection()

void caseMeshSection ( std::ofstream &  casef)
private

Compose the "mesh" section of the .case file.

Parameters
casefthe file object

Specify whether or not the mesh is changing for each snapshot

Definition at line 689 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

◆ caseVariableSection()

void caseVariableSection ( std::ofstream &  casef)
private

Compose the "variable" section of the .case file.

Parameters
casefthe file object

The file name will be different based on the regime and the kind of field (scalar / vector)

Definition at line 712 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

◆ caseTimeSection()

void caseTimeSection ( std::ofstream &  casef,
const Real time 
)
private

Compose the "time" section of the .case file.

Parameters
casefthe file object
timethe current time

The file will contain the updated number of time steps and the complete list of time values

Definition at line 749 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

◆ writeGlobalIDs()

void writeGlobalIDs ( const std::string &  filename)
private

Dump on file the IDs of the global DOFs associated to this process.

Parameters
filenamethe file name

Definition at line 655 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

◆ readAscii()

void readAscii ( exporterData_Type dvar)
private

The ASCII reader.

Parameters
dvarthe ExporterData object

Definition at line 776 of file ExporterEnsight.hpp.

◆ readAsciiValues()

void readAsciiValues ( exporterData_Type dvar,
const std::string &  suffix 
)
private

The ASCII reader.

Parameters
dvarthe ExporterData object
suffixthe file suffix (.scl or .vct)

Definition at line 794 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

◆ readGlobalIDs()

void readGlobalIDs ( const std::string &  filename,
std::vector< Real > &  globalDOF 
)
private

Read from file and store in a vector a list of global IDs.

Parameters
filenamethe file name
globalDOFthe stored list of IDs

Definition at line 887 of file ExporterEnsight.hpp.

◆ readScalar()

void readScalar ( exporterData_Type dvar)
inlineprivatevirtual

The generic reader (specialization of the parent class method)

Parameters
dvarthe ExporterData object

Implements Exporter< MeshType >.

Definition at line 246 of file ExporterEnsight.hpp.

◆ readVector()

void readVector ( exporterData_Type dvar)
inlineprivatevirtual

The generic reader (specialization of the parent class method)

Parameters
dvarthe ExporterData object

Implements Exporter< MeshType >.

Definition at line 254 of file ExporterEnsight.hpp.

◆ initProcId()

void initProcId ( )
private

initialize the internal data structures storing the ID of the current process

Definition at line 863 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

◆ setNodesMap()

void setNodesMap ( std::vector< Int ltGNodesMap)
inlineprivate

Set the local-to-global map of DOFs.

Parameters
ltGNodesMapthe local-to-global map

ltGNodesMap[i] is the global ID of the i-th DOF owned by the current process

Definition at line 266 of file ExporterEnsight.hpp.

◆ initNodesMap()

void initNodesMap ( )
private

Build the local-to-global map of DOFs.

Parameters
ltGNodesMapthe local-to-global map

ltGNodesMap[i] is the global ID of the i-th DOF owned by the current process

Definition at line 876 of file ExporterEnsight.hpp.

+ Here is the caller graph for this function:

Field Documentation

◆ MapType

MapEpetraType const MapType
static

returns the type of the map to use for the VectorEpetra

Definition at line 72 of file ExporterEnsight.hpp.

◆ M_steps

UInt M_steps
private

the counter of the number of steps processed

Definition at line 282 of file ExporterEnsight.hpp.

◆ M_ltGNodesMap

std::vector<Int> M_ltGNodesMap
private

the local-to-global map: ltGNodesMap[i] is the global ID of the i-th DOF owned by the current process

Definition at line 285 of file ExporterEnsight.hpp.

◆ M_me

std::string M_me
private

the ID of the current process

Definition at line 287 of file ExporterEnsight.hpp.

◆ M_FEstr

std::string M_FEstr
private

a string label for the FE space

Definition at line 289 of file ExporterEnsight.hpp.

◆ M_bdFEstr

std::string M_bdFEstr
private

a string label for the boundary FE space

Definition at line 291 of file ExporterEnsight.hpp.

◆ M_nbLocalDof

UInt M_nbLocalDof
private

the number of local DOFs (per element)

Definition at line 293 of file ExporterEnsight.hpp.

◆ M_nbLocalBdDof

UInt M_nbLocalBdDof
private

the number of local boundary DOFs (per element)

Definition at line 295 of file ExporterEnsight.hpp.

◆ M_firstTimeStep

bool M_firstTimeStep
private

are we performing the first post-processing operation?

Definition at line 297 of file ExporterEnsight.hpp.


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