35 #ifndef EXPORTERPOLICYHDF5_HPP 36 #define EXPORTERPOLICYHDF5_HPP 40 #include <boost/shared_ptr.hpp> 44 #include <Epetra_MpiComm.h> 46 #include <Epetra_SerialComm.h> 49 #include <Teuchos_ParameterList.hpp> 50 #include <Teuchos_XMLParameterListHelpers.hpp> 51 #include <Teuchos_RCP.hpp> 54 #include <lifev/core/LifeV.hpp> 55 #include <lifev/core/array/VectorEpetra.hpp> 56 #include <lifev/core/util/Displayer.hpp> 57 #include <lifev/core/mesh/RegionMesh.hpp> 58 #include <lifev/core/fem/FESpace.hpp> 59 #include <lifev/core/filter/ExporterHDF5.hpp> 60 #include <lifev/core/util/LifeChrono.hpp> 66 template<
class mesh_Type >
95 template<
class mesh_Type >
101 std::string outputPath = list.get (
"Output path",
"." );
102 outputPath.append (
"/");
103 std::string outputFilename = list.get (
"Output filename",
"solution" );
106 bool multipleMesh = list.get (
"Multiple mesh",
false );
109 datafile
.set ( "exporter/multimesh", "true" );
113 datafile
.set ( "exporter/multimesh", "false" );
115 int start = list.get (
"Start", 0 );
116 datafile
.set ( "exporter/start", start
);
117 int save = list.get (
"Save", 1 );
118 datafile
.set ( "exporter/save", save
);
123 displayer().leaderPrint (
"Defining the exporter... " );
124 M_exporter.reset (
new exporter_Type ( datafile, outputFilename ) );
125 M_exporter->setPostDir ( outputPath );
126 M_exporter->setMeshProcId ( mesh(), mesh()->comm()->MyPID() );
129 displayer().leaderPrint (
"Updating the exporter... " );
134 M_exporter->addVariable ( ExporterData<mesh_Type>::VectorField,
"velocity", uFESpace(),
135 solution, UInt ( 0 ) );
136 M_exporter->addVariable ( ExporterData<mesh_Type>::ScalarField,
"pressure", pFESpace(),
137 solution, pressureOffset );
141 displayer().leaderPrintMax (
"Exporter setup time: ", exporterSetupChrono
.diff(),
" s.\n");
144 template<
class mesh_Type >
149 M_exporter->postProcess ( currentTime() );
152 template<
class mesh_Type >
158 M_exporter->closeFile();
160 displayer().leaderPrintMax (
"Exporter finalization time: ", finalizeChrono
.diff(),
" s.\n");
VectorEpetra - The Epetra Vector format Wrapper.
virtual fespacePtr_Type uFESpace() const =0
virtual fespacePtr_Type pFESpace() const =0
virtual meshPtr_Type mesh() const =0
void start()
Start the timer.
std::shared_ptr< exporter_Type > exporterPtr_Type
std::shared_ptr< map_Type > mapPtr_Type
virtual Displayer displayer()=0
void updateInverseJacobian(const UInt &iQuadPt)
std::shared_ptr< VectorEpetra > vectorPtr_Type
std::shared_ptr< fespace_Type > fespacePtr_Type
FESpace< mesh_Type, map_Type > fespace_Type
virtual Real currentTime() const =0
Epetra_Import const & importer()
Getter for the Epetra_Import.
ExporterHDF5< mesh_Type > exporter_Type
Real diff()
Compute the difference in time between start and stop.
void set(const char *VarName, const int Value, const bool Requested=true)
exporterPtr_Type M_exporter
double Real
Generic real data.
void set(const char *VarName, const char *Value, const bool Requested=true)
void initExporter(Teuchos::ParameterList &list, vectorPtr_Type solution)
std::shared_ptr< mesh_Type > meshPtr_Type
void stop()
Stop the timer.
Displayer - This class is used to display messages in parallel simulations.
uint32_type UInt
generic unsigned integer (used mainly for addressing)