51 std::string filename =
"";
52 if (this->mDatasetNames[this->mOpenDatasetIndex] ==
"Data")
54 filename += this->mFileBaseName +
"_";
56 filename += type +
".dat";
58 out_stream p_file = out_stream(
nullptr);
61 p_file = this->mpOutputFileHandler->OpenOutputFile(filename);
64 if (this->mPrecision != 0)
66 p_file->precision(this->mPrecision);
70 unsigned num_nodes = this->mpReader->GetNumberOfRows();
71 unsigned num_timesteps = this->mpReader->GetUnlimitedDimensionValues().size();
77 for (
unsigned time_step=0; time_step<num_timesteps; time_step++)
79 this->mpReader->GetVariableOverNodes(data, type, time_step);
82 assert(repl_data.
GetSize() == num_nodes);
86 for (
unsigned i=0; i<num_nodes; i++)
88 *p_file << repl_data[i] <<
"\n";
103 const std::string& rFileBaseName,
105 bool usingOriginalNodeOrdering,
107 :
AbstractHdf5Converter<ELEMENT_DIM,SPACE_DIM>(rInputDirectory, rFileBaseName, pMesh,
"output", precision)
111 std::vector<std::string> variable_names = this->
mpReader->GetVariableNames();
112 for (
unsigned i=0; i<variable_names.size(); i++)
114 Write(variable_names[i]);
131 if (!usingOriginalNodeOrdering || !this->
mpMesh->IsMeshOnDisk())
141 std::string original_file = this->
mpMesh->GetMeshFileBaseName();
142 std::shared_ptr<AbstractMeshReader<ELEMENT_DIM, SPACE_DIM> > p_original_mesh_reader
143 = GenericMeshReader<ELEMENT_DIM, SPACE_DIM>(original_file);
Hdf5ToMeshalyzerConverter(const FileFinder &rInputDirectory, const std::string &rFileBaseName, AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, bool usingOriginalNodeOrdering, unsigned precision=0)