From 97b460110fe5246da7108cb66cb776464c1cb163 Mon Sep 17 00:00:00 2001 From: Dave Pugmire Date: Wed, 15 Mar 2023 12:45:45 -0400 Subject: [PATCH] Fix issues....... --- vtkm/io/VTKVisItFileReader.cxx | 11 ++++++----- vtkm/io/VTKVisItFileReader.h | 27 ++++++++++++++------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/vtkm/io/VTKVisItFileReader.cxx b/vtkm/io/VTKVisItFileReader.cxx index 66de8e22a..513576787 100644 --- a/vtkm/io/VTKVisItFileReader.cxx +++ b/vtkm/io/VTKVisItFileReader.cxx @@ -38,7 +38,7 @@ vtkm::cont::PartitionedDataSet VTKVisItFileReader::ReadPartitionedDataSet() //Get the base dir name auto pos = this->FileName.rfind("/"); if (pos != std::string::npos) - baseDirPath = baseDirPath.substr(0, pos); + baseDirPath = this->FileName.substr(0, pos); //Open up the file of filenames. std::ifstream stream(this->FileName); @@ -58,12 +58,12 @@ vtkm::cont::PartitionedDataSet VTKVisItFileReader::ReadPartitionedDataSet() //!NBLOCKS is already set!! if (numBlocks > 0) throw vtkm::io::ErrorIO("Invalid file: " + this->FileName + - ". Number of blocks already specified"); + ". `!NBLOCKS` specified more than once."); numBlocks = std::atoi(line.substr(8, line.size()).c_str()); if (numBlocks <= 0) throw vtkm::io::ErrorIO("Invalid file: " + this->FileName + - ". Number of blocks must be > 0"); + ". Number of blocks (!NBLOCKS) must be > 0."); } else if (numBlocks > 0) { @@ -82,7 +82,8 @@ vtkm::cont::PartitionedDataSet VTKVisItFileReader::ReadPartitionedDataSet() } else { - VTKM_LOG_S(vtkm::cont::LogLevel::Info, "Skipping line: " << line); + VTKM_LOG_S(vtkm::cont::LogLevel::Info, + "Skipping line that occurs before `!NBLOCKS`: " << line); continue; } } @@ -98,7 +99,7 @@ vtkm::cont::PartitionedDataSet VTKVisItFileReader::ReadPartitionedDataSet() vtkm::cont::PartitionedDataSet pds; //Read all the files. - for (const auto fn : fileNames) + for (auto&& fn : fileNames) { vtkm::io::VTKDataSetReader reader(fn); pds.AppendPartition(reader.ReadDataSet()); diff --git a/vtkm/io/VTKVisItFileReader.h b/vtkm/io/VTKVisItFileReader.h index 718ac41d0..caed9e9e9 100644 --- a/vtkm/io/VTKVisItFileReader.h +++ b/vtkm/io/VTKVisItFileReader.h @@ -21,19 +21,20 @@ namespace vtkm namespace io { -// -// Reader for ".visit" files, a simple file format for partioned data sets. -// The file format consists of the keyword "!NBLOCKS ", where N is the number of -// partitions, followed by a list of the N files. For example: -// -/* -!NBLOCKS 2 -file1.vtk -file2.vtk -*/ -// -// Note: .visit files support time varying partitione data, but it is not supported -// in this reader. +/// Reader for ".visit" files, a simple file format for partioned data sets. +/// The file format consists of the keyword "!NBLOCKS ", where N is the number of +/// partitions, followed by a list of the N files. For example: +/// +/// ``` +/// # This is a comment +/// !NBLOCKS 2 +/// file1.vtk +/// file2.vtk +/// ``` +/// +/// Note: .visit files support time varying partitioned data, but it is not supported +/// in this reader. +/// class VTKM_IO_EXPORT VTKVisItFileReader {