diff --git a/src/fileFormats/vtk/output/foamVtkOutput.C b/src/fileFormats/vtk/output/foamVtkOutput.C index ea5f533cb6771cc439ee10cbeae762dd5d4f7e0a..5311fd0db1d3bb9dd7a793f1e031194026085730 100644 --- a/src/fileFormats/vtk/output/foamVtkOutput.C +++ b/src/fileFormats/vtk/output/foamVtkOutput.C @@ -89,101 +89,6 @@ Foam::vtk::newFormatter } -void Foam::vtk::seriesInfo -( - Ostream& os, - const fileName& base, - const UList<instant>& series, - const char sep -) -{ - // Split the base into (stem, ext) components - // - // base = "path/file.vtm" - // - // stem = "file" - // ext = ".vtm" - - const word stem = base.nameLessExt(); - const word ext = "." + base.ext(); - - // Begin file-series (JSON) - os << "{\n \"file-series-version\" : \"1.0\",\n \"files\" : [\n"; - - // Track how many entries are remaining - // - trailing commas on all but the final entry (JSON requirement) - label nremain = series.size(); - - // Each entry - // { "name" : "<stem><sep>name<ext>", "time" : value } - - for (const instant& inst : series) - { - os << " { \"name\" : \"" - << stem << sep << inst.name() << ext - << "\", \"time\" : " << inst.value() << " }"; - - if (--nremain) - { - os << ','; - } - os << nl; - } - - os << " ]\n}\n"; -} - - -void Foam::vtk::seriesWrite -( - const fileName& base, - const UList<instant>& series, - const char sep -) -{ - mkDir(base.path()); - - autoPtr<OFstream> osPtr = - ( - base.hasExt("series") - ? autoPtr<OFstream>::New(base) - : autoPtr<OFstream>::New(base + ".series") - ); - - seriesInfo(*osPtr, base, series, sep); -} - - -Foam::fileName Foam::vtk::seriesBase -( - const fileName& outputName, - const char sep -) -{ - const auto dash = outputName.rfind(sep); - - // No separator? Or separator in path() instead of name()? - if - ( - std::string::npos == dash - || std::string::npos != outputName.find('/', dash) - ) - { - // Warn? - return outputName; - } - - const auto dot = outputName.find('.', dash); - - if (std::string::npos == dot) - { - return outputName.substr(0, dash); - } - - return outputName.substr(0, dash) + outputName.substr(dot); -} - - void Foam::vtk::writeList ( vtk::formatter& fmt, diff --git a/src/fileFormats/vtk/output/foamVtkOutput.H b/src/fileFormats/vtk/output/foamVtkOutput.H index 9cd5434847a8aedefe6397973890d839fe90a601..4696a4089056785de0abc2c0e2ec6c7cd4b48969 100644 --- a/src/fileFormats/vtk/output/foamVtkOutput.H +++ b/src/fileFormats/vtk/output/foamVtkOutput.H @@ -84,40 +84,6 @@ namespace vtk ); - //- Print file series (JSON format) for specified time instances - // - // \param os The output stream - // \param base The name for the series (eg, "path/file.vtm") - // \param series The list of suffix/value entries - // \param sep The separator used between file stem and suffix. - void seriesInfo - ( - Ostream& os, - const fileName& base, - const UList<instant>& series, - const char sep = '_' - ); - - //- Write file series (JSON format) to disk, for specified time instances - // - // \param base The name for the series (eg, "path/file.vtm") - // \param series The list of suffix/value entries - // \param sep The separator used between file stem and suffix. - void seriesWrite - ( - const fileName& base, - const UList<instant>& series, - const char sep = '_' - ); - - //- Extract the base name for a file series - // - // \param outputName The name of the data output file - // Eg, "somefile_0001.vtm" would extract to "somefile.vtm" - // \param sep The separator used between file stem and suffix. - fileName seriesBase(const fileName& outputName, const char sep = '_'); - - //- Write a list of uint8_t values. // The output does not include the payload size. void writeList