//=========================================================================
void BuildReducedBasis::write( EpetraExt::HDF5& HDF5_exporter, DenseHDF5& HDF5dense_exporter )
{
	if ( M_comm->MyPID() == 0 )
	{
		std::string this_prefix = "/"+M_prefix+"/";
    	HDF5dense_exporter.WriteVectorDouble(this_prefix, "SingularValues", M_SingularValues);
 	}

	HDF5_exporter.Write("V", *M_PODbasis);// Save solution basis V
	HDF5_exporter.Write("info", "num_basis", M_NumPODbases);

}
void RefinementHistory::saveToHDF5(EpetraExt::HDF5 &hdf5) {
  vector<int> histArray;
  for (vector< Refinement >::iterator refIt = _refinements.begin(); refIt != _refinements.end(); refIt++) {
    Refinement ref = *refIt;
    RefinementType refType = ref.first;
    set<GlobalIndexType> cellIDs = ref.second;
    histArray.push_back(refType);
    histArray.push_back(cellIDs.size());
    for (set<GlobalIndexType>::iterator cellIt = cellIDs.begin(); cellIt != cellIDs.end(); cellIt++) {
      GlobalIndexType cellID = *cellIt;
      histArray.push_back(cellID);
    }
  }
  int histArraySize = histArray.size();
  hdf5.Write("Mesh", "histArraySize", histArraySize);
  if (histArraySize > 0) {
    hdf5.Write("Mesh", "refinementHistory", H5T_NATIVE_INT, histArraySize, &histArray[0]);
  } else {
  }
}
//=========================================================================
void BuildReducedBasis::write( EpetraExt::HDF5& HDF5_exporter )
{
	HDF5_exporter.Write("V", *M_PODbasis);// Save solution basis V
	HDF5_exporter.Write("info", "num_basis", M_NumPODbases);
}