37 #include "Hdf5ToTxtConverter.hpp" 40 #include "ReplicatableVector.hpp" 41 #include "DistributedVector.hpp" 42 #include "DistributedVectorFactory.hpp" 43 #include "DistributedTetrahedralMesh.hpp" 44 #include "Warnings.hpp" 46 template <
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
48 const std::string& rFileBaseName,
50 :
AbstractHdf5Converter<ELEMENT_DIM,SPACE_DIM>(rInputDirectory, rFileBaseName, pMesh,
"txt_output", 0u)
59 unsigned num_timesteps = this->
mpReader->GetUnlimitedDimensionValues().size();
66 for (
unsigned time_step=0; time_step<num_timesteps; time_step++)
69 for (
unsigned var_index=0; var_index<this->
mNumVariables; var_index++)
71 std::string variable_name = this->
mpReader->GetVariableNames()[var_index];
74 std::stringstream file_name;
75 file_name << rFileBaseName <<
"_" << variable_name <<
"_" << time_step <<
".txt";
78 this->
mpReader->GetVariableOverNodes(data, variable_name, time_step);
81 assert(repl_data.
GetSize() == num_nodes);
85 for (
unsigned i=0; i<num_nodes; i++)
87 *p_file << repl_data[i] <<
"\n";
virtual DistributedVectorFactory * GetDistributedVectorFactory()
std::string mRelativeSubdirectory
boost::shared_ptr< Hdf5DataReader > mpReader
virtual unsigned GetNumNodes() const
out_stream OpenOutputFile(const std::string &rFileName, std::ios_base::openmode mode=std::ios::out|std::ios::trunc) const
void ReplicatePetscVector(Vec vec)
Hdf5ToTxtConverter(const FileFinder &rInputDirectory, const std::string &rFileBaseName, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh)