Feel++  0.91.4
Classes | Protected Attributes | List of all members
Feel::Exporter< MeshType, N > Class Template Referenceabstract

export Feel generated data to some file formatsUse the visitor and factory pattern. More...

#include <exporter.hpp>

Inheritance diagram for Feel::Exporter< MeshType, N >:
Feel::VisitorBase Feel::Visitor< MeshType > Feel::ExporterEnsight< MeshType, N > Feel::ExporterGmsh< MeshType, N >

Classes

struct  Factory
 

Public Types

Typedefs
typedef VisitorBase super1
 
typedef Visitor< MeshType > super2
 
typedef TimeSet< MeshType, N > timeset_type
 
typedef boost::shared_ptr
< timeset_type > 
timeset_ptrtype
 
typedef std::vector
< timeset_ptrtype > 
timeset_set_type
 
typedef timeset_set_type::iterator timeset_iterator
 
typedef
timeset_set_type::const_iterator 
timeset_const_iterator
 
typedef timeset_type::step_type step_type
 
typedef timeset_type::step_ptrtype step_ptrtype
 
- Public Types inherited from Feel::Visitor< MeshType >
typedef void return_type
 

Public Member Functions

Accessors
bool doExport () const
 
std::string const & type () const
 
std::string const & prefix () const
 
int freq () const
 
int cptOfSave () const
 
file_type fileType () const
 
std::string path () const
 
Mutators
void setDoExport (bool do_export)
 
virtual Exporter< MeshType, N > * setOptions (po::variables_map const &vm, std::string const &exp_prefix="")
 
Exporter< MeshType, N > * setType (std::string const &__type)
 
Exporter< MeshType, N > * addPath (boost::format fmt)
 
Exporter< MeshType, N > * setPrefix (std::string const &__prefix)
 
Exporter< MeshType, N > * setFreq (int __freq)
 
Exporter< MeshType, N > * setFileType (file_type __ft)
 
timeset_iterator beginTimeSet ()
 
timeset_iterator endTimeSet ()
 
timeset_const_iterator beginTimeSet () const
 
timeset_const_iterator endTimeSet () const
 
timeset_ptrtype defaultTimeSet ()
 
timeset_ptrtype timeSet (int ts)
 
step_ptrtype step (double time)
 
step_ptrtype step (double time, int s)
 
Methods
void addTimeSet (timeset_ptrtype const &__ts)
 
virtual void save () const =0
 
void saveTimeSet () const
 
void restart (double __time)
 
WorldComm const & worldComm () const
 
- Public Member Functions inherited from Feel::Visitor< MeshType >
virtual ~Visitor ()
 virtual base destructor
 
virtual return_type visit (MeshType *)=0
 visit a data structure
 
return_type visit (MeshType &__t)
 visit a data structure
 

Protected Attributes

WorldComm M_worldComm
 
bool M_do_export
 
std::string M_type
 
std::string M_prefix
 
int M_freq
 
int M_cptOfSave
 
file_type M_ft
 
std::string M_path
 
timeset_set_type M_ts_set
 

Constructors, destructor

 Exporter (std::string const &type, std::string const &prefix="", int freq=1, WorldComm const &worldComm=WorldComm())
 
 Exporter (po::variables_map const &vm, std::string const &exporter_prefix="", WorldComm const &worldComm=WorldComm())
 
 Exporter (Exporter const &exporter)
 
virtual ~Exporter ()
 
static Exporter< MeshType, N > * New (std::string const &exportername, std::string prefix="export", WorldComm const &worldComm=WorldComm())
 
static Exporter< MeshType, N > * New (po::variables_map const &vm, std::string prefix="export", WorldComm const &worldComm=WorldComm())
 

Detailed Description

template<typename MeshType, int N = 1>
class Feel::Exporter< MeshType, N >

export Feel generated data to some file formats

Use the visitor and factory pattern.

Here is a snippet on how to use the Exporter class

#include <feel/feelfilters/exporter.hpp>
typedef Exporter<mesh_type> export_type;
typedef boost::shared_ptr<export_type> export_ptrtype;
// vm is a po::variables_map to get the command lines options
export_ptrtype exporter( export_type::New( vm );
// U is an element of a function space which we want to visualise
exporter->step(0)->setMesh( U.functionSpace()->mesh() );
exporter->step(0)->add( "u", U );
See Also
Laplacian
Author
Christophe Prud'homme

Constructor & Destructor Documentation

template<typename MeshType , int N>
Feel::Exporter< MeshType, N >::Exporter ( std::string const &  type,
std::string const &  prefix = "",
int  freq = 1,
WorldComm const &  worldComm = WorldComm() 
)

Constructor

Parameters
typestring containing the type of exporter (gmsh, ensight,...)
prefixthe prefix for the file names of the exported data
freqan integer giving the frequency at which the data should be saved
template<typename MeshType , int N>
Feel::Exporter< MeshType, N >::Exporter ( po::variables_map const &  vm,
std::string const &  exporter_prefix = "",
WorldComm const &  worldComm = WorldComm() 
)

Constructor

Parameters
vmvariables_map containing the type of exporter and other exporter options
prefixthe prefix for the file names of the exported data
freqan integer giving the frequency at which the data should be saved

References Feel::Exporter< MeshType, N >::doExport().

template<typename MeshType , int N>
Feel::Exporter< MeshType, N >::Exporter ( Exporter< MeshType, N > const &  exporter)

copy constructor

template<typename MeshType , int N>
Feel::Exporter< MeshType, N >::~Exporter ( )
virtual

destructor

Member Function Documentation

template<typename MeshType , int N>
Exporter< MeshType, N > * Feel::Exporter< MeshType, N >::addPath ( boost::format  fmt)

add an extra path to the current directory to save the data using the boost::format object fmt

template<typename MeshType, int N = 1>
void Feel::Exporter< MeshType, N >::addTimeSet ( timeset_ptrtype const &  __ts)
inline

add the timeset __ts to the Exporter

Referenced by Feel::Exporter< MeshType, N >::New().

template<typename MeshType, int N = 1>
int Feel::Exporter< MeshType, N >::cptOfSave ( ) const
inline
Returns
the frequency at which the results are saved
template<typename MeshType, int N = 1>
bool Feel::Exporter< MeshType, N >::doExport ( ) const
inline
Returns
true if doing the export, false otherwise

Referenced by Feel::Exporter< MeshType, N >::Exporter().

template<typename MeshType, int N = 1>
file_type Feel::Exporter< MeshType, N >::fileType ( ) const
inline
Returns
the file type format (ASCII or BINARY)
template<typename MeshType, int N = 1>
int Feel::Exporter< MeshType, N >::freq ( ) const
inline
Returns
the frequency at which the results are saved
template<typename MeshType , int N>
Exporter< MeshType, N > * Feel::Exporter< MeshType, N >::New ( std::string const &  exportername,
std::string  prefix = "export",
WorldComm const &  worldComm = WorldComm() 
)
static

Static function instantiating from the Exporter Factory an exporter out of the exportername and using prefix for the prefix of the data files.

References Feel::Exporter< MeshType, N >::addTimeSet(), and Feel::Exporter< MeshType, N >::setPrefix().

template<typename MeshType , int N>
Exporter< MeshType, N > * Feel::Exporter< MeshType, N >::New ( po::variables_map const &  vm,
std::string  prefix = "export",
WorldComm const &  worldComm = WorldComm() 
)
static

Static function instantiating from the Exporter Factory an exporter out of the variables_map vm and using prefix for the prefix of the data files.

References Feel::ExporterGmsh< MeshType, N >::setOptions().

template<typename MeshType, int N = 1>
std::string Feel::Exporter< MeshType, N >::path ( ) const
inline
Returns
the path to the saved files

Referenced by Feel::Exporter< MeshType >::restart(), and Feel::Exporter< MeshType >::saveTimeSet().

template<typename MeshType, int N = 1>
std::string const& Feel::Exporter< MeshType, N >::prefix ( ) const
inline
Returns
the prefix of the exported file names

Referenced by Feel::Exporter< MeshType >::restart(), and Feel::Exporter< MeshType >::saveTimeSet().

template<typename MeshType, int N = 1>
void Feel::Exporter< MeshType, N >::restart ( double  __time)
inline

reload from file set of time which are been exported

template<typename MeshType, int N = 1>
virtual void Feel::Exporter< MeshType, N >::save ( ) const
pure virtual

this p save function is defined by the Exporter subclasses and implement saving the data to files

Implemented in Feel::ExporterEnsight< MeshType, N >, Feel::ExporterGnuplot< MeshType >, and Feel::ExporterGmsh< MeshType, N >.

template<typename MeshType, int N = 1>
void Feel::Exporter< MeshType, N >::saveTimeSet ( ) const
inline

save in a file set of time which are been exported

template<typename MeshType, int N = 1>
void Feel::Exporter< MeshType, N >::setDoExport ( bool  do_export)
inline

set the doExport to do_export

template<typename MeshType, int N = 1>
Exporter<MeshType,N>* Feel::Exporter< MeshType, N >::setFileType ( file_type  __ft)
inline

set the file type to __ft (binary or ascii)

template<typename MeshType, int N = 1>
Exporter<MeshType,N>* Feel::Exporter< MeshType, N >::setFreq ( int  __freq)
inline

set the save frequency to __freq

template<typename MeshType , int N>
Exporter< MeshType, N > * Feel::Exporter< MeshType, N >::setOptions ( po::variables_map const &  vm,
std::string const &  exp_prefix = "" 
)
virtual
template<typename MeshType, int N = 1>
Exporter<MeshType,N>* Feel::Exporter< MeshType, N >::setPrefix ( std::string const &  __prefix)
inline

set the prefix to __prefix

Referenced by Feel::Exporter< MeshType, N >::New().

template<typename MeshType, int N = 1>
Exporter<MeshType,N>* Feel::Exporter< MeshType, N >::setType ( std::string const &  __type)
inline

set to __type the type of exporter (gmsh, ensight...)

template<typename MeshType, int N = 1>
std::string const& Feel::Exporter< MeshType, N >::type ( ) const
inline
Returns
the type of exporter