Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
HDF5Export_def.hpp
1#ifndef HDF5EXPORT_DEF_hpp
2#define HDF5EXPORT_DEF_hpp
3
4namespace FEDD {
5
6template<class SC,class LO,class GO,class NO>
7HDF5Export<SC,LO,GO,NO>::HDF5Export(MapConstPtr_Type writeMap, std::string outputFilename):
8hdf5exporter_(),
9comm_()
10{
11
12 Teuchos::RCP<const Teuchos::MpiComm<int> > mpiComm = Teuchos::rcp_dynamic_cast<const Teuchos::MpiComm<int> >( writeMap->getComm() );
13
14 hdf5exporter_.reset( new HDF5_Type(mpiComm) ); // Building HDF5 Exporter
15
16 hdf5exporter_->create(outputFilename+".h5"); // Creating output file with the 'outoutFilename'
17
18 outputFilename_ = outputFilename;
19}
20
21template<class SC,class LO,class GO,class NO>
22void HDF5Export<SC,LO,GO,NO>::writeVariablesHDF5(std::string varName, const MultiVectorConstPtr_Type writeVector){
23
24 hdf5exporter_->write(varName,writeVector); // Writing u_export as variable 'varName' in file
25
26 if(writeVector->getMap()->getComm()->getRank() == 0 )
27 std::cout << " HDF5_Export:: Exporting to file " << outputFilename_ << " with variable name " << varName << std::endl;
28
29 hdf5exporter_->flush();
30
31}
32
33template<class SC,class LO,class GO,class NO>
35 hdf5exporter_->close();
36}
37
38
39}
40#endif
void closeExporter()
Closing Exporter.
Definition HDF5Export_def.hpp:34
HDF5Export(MapConstPtr_Type writeMap, std::string outputFilename)
Constructor for HDF5 Exporter.
Definition HDF5Export_def.hpp:7
void writeVariablesHDF5(std::string varName, const MultiVectorConstPtr_Type writeVector)
Exporting MultiVector writeVector as HDF5 File with the variable name varName.
Definition HDF5Export_def.hpp:22
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:36