From b40d1d8e4f5ef08d0bf08ad3bea6799636b6de04 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 18 Nov 2019 16:59:51 +0100 Subject: [PATCH] BUG: decomposePar fails with csv table in binary (fixes #1498) --- .../primitives/functions/Function1/CSV/CSV.C | 37 ++++++++++--------- .../primitives/functions/Function1/CSV/CSV.H | 13 ++----- .../RAS/chokedNozzle/system/controlDict | 2 +- 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C b/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C index a936bb6e7c..76739c02a2 100644 --- a/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C +++ b/src/OpenFOAM/primitives/functions/Function1/CSV/CSV.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2016-2017 OpenCFD Ltd. + Copyright (C) 2016-2019 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -28,7 +28,6 @@ License #include "CSV.H" #include "DynamicList.H" -//#include "IFstream.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -36,7 +35,7 @@ template<> Foam::label Foam::Function1Types::CSV::readValue ( const List& splitted -) +) const { if (componentColumns_[0] >= splitted.size()) { @@ -54,7 +53,7 @@ template<> Foam::scalar Foam::Function1Types::CSV::readValue ( const List& splitted -) +) const { if (componentColumns_[0] >= splitted.size()) { @@ -69,7 +68,10 @@ Foam::scalar Foam::Function1Types::CSV::readValue template -Type Foam::Function1Types::CSV::readValue(const List& splitted) +Type Foam::Function1Types::CSV::readValue +( + const List& splitted +) const { Type result; @@ -94,7 +96,6 @@ template void Foam::Function1Types::CSV::read() { fileName expandedFile(fName_); - //IFstream is(expandedFile.expand()); autoPtr isPtr(fileHandler().NewIFstream(expandedFile.expand())); ISstream& is = isPtr(); @@ -214,17 +215,24 @@ Foam::Function1Types::CSV::CSV TableBase(entryName, dict), nHeaderLine_(dict.get