From 4e183e33d43d883cfa5e4accf9c90ed654e000fc Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 16 Nov 2020 23:48:47 +0000 Subject: [PATCH] Function1::Table: simplified and rationalised TableBase, TableFile and Table now combined into a single simpler Table class which handle both the reading of embedded and file data using the generalised TableReader. The new EmbeddedTableReader handles the embedded data reading providing the functionality of the original Table class within the same structure that can read the data from separate files. The input format defaults to 'embedded' unless the 'file' entry is present and the Table class is added to the run-time selection table under the name 'table' and 'tableFile' which provides complete backward comparability. However it is advisable to migrate cases to use the new 'table' entry and all tutorial cases have been updated. --- .../saturationModels/function1/function1.H | 2 +- .../utilities/postProcessing/noise/noise.C | 8 +- src/OpenFOAM/Make/files | 2 +- .../functions/Function1/Function1/Function1.H | 6 +- .../functions/Function1/Table/Table.C | 292 +++++++++++++-- .../functions/Function1/Table/Table.H | 97 ++++- .../functions/Function1/Table/TableBase.C | 335 ------------------ .../functions/Function1/Table/TableBase.H | 175 --------- .../TableReader/Csv/CsvTableReader.C | 0 .../TableReader/Csv/CsvTableReader.H | 0 .../Embedded/EmbeddedTableReader.C | 0 .../Embedded/EmbeddedTableReader.H | 0 .../TableReader/Foam/FoamTableReader.C | 0 .../TableReader/Foam/FoamTableReader.H | 0 .../TableFileReader/TableFileReader.C | 0 .../TableFileReader/TableFileReader.H | 0 .../TableReader/TableReader/TableReader.C | 0 .../TableReader/TableReader/TableReader.H | 0 .../TableReader/TableReader/TableReaderNew.C | 0 .../TableReader/makeTableReaders.C | 0 .../functions/Function1/Table/tableBase.C | 14 +- .../functions/Function1/Table/tableBase.H | 7 +- .../functions/Function1/TableFile/TableFile.C | 72 ---- .../functions/Function1/TableFile/TableFile.H | 133 ------- .../functions/Function1/makeFunction1s.C | 1 - .../displacementLayeredMotionMotionSolver.C | 6 +- .../sixDoFMotion/sixDoFMotion.C | 1 - src/engine/engineTime/freePiston/freePiston.H | 4 +- .../fanPressureFvPatchScalarField.H | 10 +- .../fanPressureJumpFvPatchScalarField.H | 4 +- .../fixedProfile/fixedProfileFvPatchField.H | 2 +- .../sixDoFAccelerationSource.C | 1 - .../tabulatedAxialAngularSpring.C | 2 +- .../tabulatedAxialAngularSpring.H | 4 +- .../constant/dynamicMeshDict | 2 +- .../RAS/wallBoiling/constant/phaseProperties | 2 +- .../wallBoilingIATE/constant/phaseProperties | 2 +- .../constant/phaseProperties | 2 +- .../constant/phaseProperties | 4 +- .../laminar/titaniaSynthesis/0/T.particles | 2 +- .../laminar/titaniaSynthesis/0/T.vapor | 2 +- .../titaniaSynthesisSurface/0/T.particles | 2 +- .../laminar/titaniaSynthesisSurface/0/T.vapor | 2 +- 43 files changed, 377 insertions(+), 821 deletions(-) delete mode 100644 src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C delete mode 100644 src/OpenFOAM/primitives/functions/Function1/Table/TableBase.H rename src/OpenFOAM/primitives/functions/Function1/{TableFile => Table}/TableReader/Csv/CsvTableReader.C (100%) rename src/OpenFOAM/primitives/functions/Function1/{TableFile => Table}/TableReader/Csv/CsvTableReader.H (100%) rename src/OpenFOAM/primitives/functions/Function1/{TableFile => Table}/TableReader/Embedded/EmbeddedTableReader.C (100%) rename src/OpenFOAM/primitives/functions/Function1/{TableFile => Table}/TableReader/Embedded/EmbeddedTableReader.H (100%) rename src/OpenFOAM/primitives/functions/Function1/{TableFile => Table}/TableReader/Foam/FoamTableReader.C (100%) rename src/OpenFOAM/primitives/functions/Function1/{TableFile => Table}/TableReader/Foam/FoamTableReader.H (100%) rename src/OpenFOAM/primitives/functions/Function1/{TableFile => Table}/TableReader/TableFileReader/TableFileReader.C (100%) rename src/OpenFOAM/primitives/functions/Function1/{TableFile => Table}/TableReader/TableFileReader/TableFileReader.H (100%) rename src/OpenFOAM/primitives/functions/Function1/{TableFile => Table}/TableReader/TableReader/TableReader.C (100%) rename src/OpenFOAM/primitives/functions/Function1/{TableFile => Table}/TableReader/TableReader/TableReader.H (100%) rename src/OpenFOAM/primitives/functions/Function1/{TableFile => Table}/TableReader/TableReader/TableReaderNew.C (100%) rename src/OpenFOAM/primitives/functions/Function1/{TableFile => Table}/TableReader/makeTableReaders.C (100%) delete mode 100644 src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.C delete mode 100644 src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.H diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H index b65fa0fd89..0fa2e73657 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCompositionModels/saturationModels/function1/function1.H @@ -52,7 +52,7 @@ Description \verbatim type function1; - function tableFile; + function table; functionCoeffs { file "filename.csv"; diff --git a/applications/utilities/postProcessing/noise/noise.C b/applications/utilities/postProcessing/noise/noise.C index 5bf07c0903..802cfa37d4 100644 --- a/applications/utilities/postProcessing/noise/noise.C +++ b/applications/utilities/postProcessing/noise/noise.C @@ -30,7 +30,7 @@ Description Control settings are read from the $FOAM_CASE/system/noiseDict dictionary, or user-specified dictionary using the -dict option. Pressure data is - read using a TableFile Function1: + read using a Table Function1: Usage \verbatim @@ -72,7 +72,7 @@ Usage - one-third-octave-band pressure spectrum See also - TableFile.H + Table.H noiseFFT.H \*---------------------------------------------------------------------------*/ @@ -81,7 +81,7 @@ See also #include "noiseFFT.H" #include "argList.H" #include "Time.H" -#include "TableFile.H" +#include "Table.H" #include "IOdictionary.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -134,7 +134,7 @@ int main(int argc, char *argv[]) #include "createFields.H" Info<< "Reading data file" << endl; - Function1s::TableFile pData + Function1s::Table pData ( "pressure", dict.subDict("pressureData") diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 9c4167ba7e..d4cb1afaa7 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -97,7 +97,7 @@ primitives/functions/Function1/quarterSineRamp/quarterSineRamp.C primitives/functions/Function1/quarterCosineRamp/quarterCosineRamp.C primitives/functions/Function1/halfCosineRamp/halfCosineRamp.C primitives/functions/Function1/Table/tableBase.C -primitives/functions/Function1/TableFile/TableReader/makeTableReaders.C +primitives/functions/Function1/Table/TableReader/makeTableReaders.C primitives/functions/Function2/makeFunction2s.C diff --git a/src/OpenFOAM/primitives/functions/Function1/Function1/Function1.H b/src/OpenFOAM/primitives/functions/Function1/Function1/Function1.H index 1a5d25634d..16b91cbf96 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Function1/Function1.H +++ b/src/OpenFOAM/primitives/functions/Function1/Function1/Function1.H @@ -233,10 +233,8 @@ public: #define makeNamedFunction1Type(SS, Type, Name) \ \ - defineNamedTemplateTypeNameAndDebug(Function1s::SS, 0); \ - \ Function1::adddictionaryConstructorToTable> \ - addFunction1##SS##Type##ConstructorToTable_(#Name); + addFunction1##Name##Type##ConstructorToTable_(#Name); #define makeScalarFunction1(SS) \ @@ -257,7 +255,7 @@ public: makeFunction1Type(Sine, Type); \ makeFunction1Type(Square, Type); \ makeFunction1Type(Table, Type); \ - makeFunction1Type(TableFile, Type); \ + makeNamedFunction1Type(Table, Type, tableFile); \ makeFunction1Type(Scale, Type); \ makeFunction1Type(Coded, Type); diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/Table.C b/src/OpenFOAM/primitives/functions/Function1/Table/Table.C index 73c511296e..f59c55b39e 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Table/Table.C +++ b/src/OpenFOAM/primitives/functions/Function1/Table/Table.C @@ -24,40 +24,114 @@ License \*---------------------------------------------------------------------------*/ #include "Table.H" +#include "linearInterpolationWeights.H" -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // template -Foam::Function1s::Table::Table -( - const word& entryName, - const dictionary& dict -) -: - TableBase>(entryName, dict) +const Foam::interpolationWeights& +Foam::Function1s::Table::interpolator() const { - if (!dict.found(entryName)) + if (interpolatorPtr_.empty()) { - dict.lookup("values") >> this->table_; - } - else - { - Istream& is(dict.lookup(entryName)); - word entryType(is); - if (is.eof()) + // Re-work table into linear list + tableSamplesPtr_.reset(new scalarField(table_.size())); + scalarField& tableSamples = tableSamplesPtr_(); + forAll(table_, i) { - dict.lookup("values") >> this->table_; - } - else - { - is >> this->table_; + tableSamples[i] = table_[i].first(); } + interpolatorPtr_ = interpolationWeights::New + ( + interpolationScheme_, + tableSamples + ); } - TableBase>::check(); + return interpolatorPtr_(); } +template +void Foam::Function1s::Table::check() const +{ + if (!table_.size()) + { + FatalErrorInFunction + << "Table for entry " << this->name() << " is invalid (empty)" + << nl << exit(FatalError); + } + + label n = table_.size(); + scalar prevValue = table_[0].first(); + + for (label i = 1; i < n; ++i) + { + const scalar currValue = table_[i].first(); + + // avoid duplicate values (divide-by-zero error) + if (currValue <= prevValue) + { + FatalErrorInFunction + << "out-of-order value: " << currValue << " at index " << i + << exit(FatalError); + } + prevValue = currValue; + } +} + + +template +Foam::scalar Foam::Function1s::Table::bound +( + const scalar x +) const +{ + const bool under = x < table_.first().first(); + const bool over = x > table_.last().first(); + + auto errorMessage = [&]() + { + return "value (" + name(x) + ") " + (under ? "under" : "over") + "flow"; + }; + + if (under || over) + { + switch (boundsHandling_) + { + case tableBase::boundsHandling::error: + { + FatalErrorInFunction + << errorMessage() << nl << exit(FatalError); + break; + } + case tableBase::boundsHandling::warn: + { + WarningInFunction + << errorMessage() << nl << endl; + break; + } + case tableBase::boundsHandling::clamp: + { + break; + } + case tableBase::boundsHandling::repeat: + { + const scalar t0 = table_.first().first(); + const scalar t1 = table_.last().first(); + const scalar dt = t1 - t0; + const label n = floor((x - t0)/dt); + return x - n*dt; + } + } + } + + return x; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + template Foam::Function1s::Table::Table ( @@ -67,20 +141,52 @@ Foam::Function1s::Table::Table const List>& table ) : - TableBase> - ( - name, - boundsHandling, - interpolationScheme, - table - ) + FieldFunction1>(name), + boundsHandling_(boundsHandling), + interpolationScheme_(interpolationScheme), + table_(table) {} +template +Foam::Function1s::Table::Table +( + const word& name, + const dictionary& dict +) +: + FieldFunction1>(name), + boundsHandling_ + ( + dict.found("outOfBounds") + ? tableBase::boundsHandlingNames_.read(dict.lookup("outOfBounds")) + : tableBase::boundsHandling::clamp + ), + interpolationScheme_ + ( + dict.lookupOrDefault + ( + "interpolationScheme", + linearInterpolationWeights::typeName + ) + ), + table_(), + reader_(TableReader::New(name, dict, this->table_)) +{ + check(); +} + + template Foam::Function1s::Table::Table(const Table& tbl) : - TableBase>(tbl) + FieldFunction1>(tbl), + boundsHandling_(tbl.boundsHandling_), + interpolationScheme_(tbl.interpolationScheme_), + table_(tbl.table_), + tableSamplesPtr_(tbl.tableSamplesPtr_), + interpolatorPtr_(tbl.interpolatorPtr_), + reader_(tbl.reader_, false) {} @@ -94,14 +200,130 @@ Foam::Function1s::Table::~Table() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void Foam::Function1s::Table::writeEntries +Type Foam::Function1s::Table::value ( - Ostream& os, - const List>& table + const scalar x ) const { - os << indent << "values" << table - << token::END_STATEMENT << endl; + const scalar bx = bound(x); + + Type y = Zero; + + interpolator().valueWeights(bx, indices_, weights_); + forAll(indices_, i) + { + y += weights_[i]*table_[indices_[i]].second(); + } + + return y; +} + + +template +Type Foam::Function1s::Table::integrate +( + const scalar x1, + const scalar x2 +) const +{ + const scalar bx1 = bound(x1), bx2 = bound(x2); + + Type sumY = Zero; + + interpolator().integrationWeights(bx1, bx2, indices_, weights_); + forAll(indices_, i) + { + sumY += weights_[i]*table_[indices_[i]].second(); + } + + if (boundsHandling_ == tableBase::boundsHandling::repeat) + { + const scalar t0 = table_.first().first(); + const scalar t1 = table_.last().first(); + const scalar dt = t1 - t0; + const label n = floor((x2 - t0)/dt) - floor((x1 - t0)/dt); + + if (n != 0) + { + Type sumY01 = Zero; + + interpolator().integrationWeights(t0, t1, indices_, weights_); + + forAll(indices_, i) + { + sumY01 += weights_[i]*table_[indices_[i]].second(); + } + sumY += n*sumY01; + } + } + + return sumY; +} + + +template +Foam::tmp +Foam::Function1s::Table::x() const +{ + tmp tfld(new scalarField(table_.size(), 0.0)); + scalarField& fld = tfld.ref(); + + forAll(table_, i) + { + fld[i] = table_[i].first(); + } + + return tfld; +} + + +template +Foam::tmp> +Foam::Function1s::Table::y() const +{ + tmp> tfld(new Field(table_.size(), Zero)); + Field& fld = tfld.ref(); + + forAll(table_, i) + { + fld[i] = table_[i].second(); + } + + return tfld; +} + + +template +void Foam::Function1s::Table::writeData +( + Ostream& os +) const +{ + Function1::writeData(os); + os << token::END_STATEMENT << nl; + + os << indent << word(this->name() + "Coeffs") << nl; + os << indent << token::BEGIN_BLOCK << incrIndent << nl; + + writeEntryIfDifferent + ( + os, + "outOfBounds", + tableBase::boundsHandlingNames_[tableBase::boundsHandling::clamp], + tableBase::boundsHandlingNames_[boundsHandling_] + ); + + writeEntryIfDifferent + ( + os, + "interpolationScheme", + linearInterpolationWeights::typeName, + interpolationScheme_ + ); + + reader_->write(os, table_); + + os << decrIndent << indent << token::END_BLOCK << endl; } diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/Table.H b/src/OpenFOAM/primitives/functions/Function1/Table/Table.H index b6313be29b..521eaaa5d4 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Table/Table.H +++ b/src/OpenFOAM/primitives/functions/Function1/Table/Table.H @@ -25,10 +25,10 @@ Class Foam::Function1s::Table Description - Templated table container function. + Templated interpolated tabulated data Function1. Items are stored in a list of Tuple2's. First column is always stored as - scalar entries. Data is read in Tuple2 form. + scalar entries. Data is read in Tuple2 form: Usage: \verbatim @@ -39,32 +39,93 @@ Description ); \endverbatim + The data may be read from a separate file in either native or CSV format: + + Usage: + \verbatim + table; + file ""; // Name/path of thedata file + format foam; // data format (optional) + outOfBounds clamp; // optional out-of-bounds handling + interpolationScheme linear; // optional interpolation method + \endverbatim + SourceFiles Table.C +See also + FoamTableReader.C + CsvTableReader.C + \*---------------------------------------------------------------------------*/ #ifndef Table_H #define Table_H -#include "TableBase.H" +#include "tableBase.H" +#include "Function1.H" +#include "TableReader.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { + +class interpolationWeights; + namespace Function1s { /*---------------------------------------------------------------------------*\ - Class Table Declaration + Class Table Declaration \*---------------------------------------------------------------------------*/ template class Table : - public TableBase> + public tableBase, + public FieldFunction1> { + // Private Data + + //- Enumeration for handling out-of-bound values + const tableBase::boundsHandling boundsHandling_; + + //- Interpolation type + const word interpolationScheme_; + + //- Table data + List> table_; + + //- Extracted values + mutable autoPtr tableSamplesPtr_; + + //- Interpolator method + mutable autoPtr interpolatorPtr_; + + //- Cached indices + mutable labelList indices_; + + //- Cached weights + mutable scalarField weights_; + + //- Table reader + const autoPtr> reader_; + + + // Protected Member Functions + + //- Return (demand driven) interpolator + const interpolationWeights& interpolator() const; + + //- Check the table for size and consistency + void check() const; + + //- Bound the argument to the table. Errors or warns, or shifts the + // value if the table repeats. Does not clamp to the ends of the table + // as the interpolator already performs that function. + scalar bound(const scalar x) const; + public: @@ -74,9 +135,6 @@ public: // Constructors - //- Construct from entry name and Istream - Table(const word& entryName, const dictionary& dict); - //- Construct from components Table ( @@ -86,6 +144,9 @@ public: const List>& table ); + //- Construct from entry name and dictionary + Table(const word& name, const dictionary& dict); + //- Copy constructor Table(const Table& tbl); @@ -96,12 +157,20 @@ public: // Member Functions - //- Write entries only in dictionary format - virtual void writeEntries - ( - Ostream& os, - const List>& table - ) const; + //- Return Table value as a function of scalar x + virtual Type value(const scalar x) const; + + //- Integrate between two scalars + virtual Type integrate(const scalar x1, const scalar x2) const; + + //- Return the reference values + virtual tmp x() const; + + //- Return the dependent values + virtual tmp> y() const; + + //- Write all table data in dictionary format + virtual void writeData(Ostream& os) const; // Member Operators diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C deleted file mode 100644 index cce68a7d2a..0000000000 --- a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C +++ /dev/null @@ -1,335 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "TableBase.H" -#include "linearInterpolationWeights.H" - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -template -const Foam::interpolationWeights& -Foam::Function1s::TableBase::interpolator() const -{ - if (interpolatorPtr_.empty()) - { - // Re-work table into linear list - tableSamplesPtr_.reset(new scalarField(table_.size())); - scalarField& tableSamples = tableSamplesPtr_(); - forAll(table_, i) - { - tableSamples[i] = table_[i].first(); - } - interpolatorPtr_ = interpolationWeights::New - ( - interpolationScheme_, - tableSamples - ); - } - - return interpolatorPtr_(); -} - - -template -void Foam::Function1s::TableBase::check() const -{ - if (!table_.size()) - { - FatalErrorInFunction - << "Table for entry " << this->name_ << " is invalid (empty)" - << nl << exit(FatalError); - } - - label n = table_.size(); - scalar prevValue = table_[0].first(); - - for (label i = 1; i < n; ++i) - { - const scalar currValue = table_[i].first(); - - // avoid duplicate values (divide-by-zero error) - if (currValue <= prevValue) - { - FatalErrorInFunction - << "out-of-order value: " << currValue << " at index " << i - << exit(FatalError); - } - prevValue = currValue; - } -} - - -template -Foam::scalar Foam::Function1s::TableBase::bound -( - const scalar x -) const -{ - const bool under = x < table_.first().first(); - const bool over = x > table_.last().first(); - - auto errorMessage = [&]() - { - return "value (" + name(x) + ") " + (under ? "under" : "over") + "flow"; - }; - - if (under || over) - { - switch (boundsHandling_) - { - case tableBase::boundsHandling::error: - { - FatalErrorInFunction - << errorMessage() << nl << exit(FatalError); - break; - } - case tableBase::boundsHandling::warn: - { - WarningInFunction - << errorMessage() << nl << endl; - break; - } - case tableBase::boundsHandling::clamp: - { - break; - } - case tableBase::boundsHandling::repeat: - { - const scalar t0 = table_.first().first(); - const scalar t1 = table_.last().first(); - const scalar dt = t1 - t0; - const label n = floor((x - t0)/dt); - return x - n*dt; - } - } - } - - return x; -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::Function1s::TableBase::TableBase -( - const word& name, - const dictionary& dict -) -: - tableBase(), - FieldFunction1(name), - name_(name), - boundsHandling_ - ( - dict.found("outOfBounds") - ? tableBase::boundsHandlingNames_.read(dict.lookup("outOfBounds")) - : tableBase::boundsHandling::clamp - ), - interpolationScheme_ - ( - dict.lookupOrDefault - ( - "interpolationScheme", - linearInterpolationWeights::typeName - ) - ), - table_() -{} - - -template -Foam::Function1s::TableBase::TableBase -( - const word& name, - const tableBase::boundsHandling boundsHandling, - const word& interpolationScheme, - const List>& table -) -: - tableBase(), - FieldFunction1(name), - name_(name), - boundsHandling_(boundsHandling), - interpolationScheme_(interpolationScheme), - table_(table) -{} - - -template -Foam::Function1s::TableBase::TableBase -( - const TableBase& tbl -) -: - tableBase(), - FieldFunction1(tbl), - name_(tbl.name_), - boundsHandling_(tbl.boundsHandling_), - interpolationScheme_(tbl.interpolationScheme_), - table_(tbl.table_), - tableSamplesPtr_(tbl.tableSamplesPtr_), - interpolatorPtr_(tbl.interpolatorPtr_) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::Function1s::TableBase::~TableBase() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -Type Foam::Function1s::TableBase::value -( - const scalar x -) const -{ - const scalar bx = bound(x); - - Type y = Zero; - - interpolator().valueWeights(bx, indices_, weights_); - forAll(indices_, i) - { - y += weights_[i]*table_[indices_[i]].second(); - } - - return y; -} - - -template -Type Foam::Function1s::TableBase::integrate -( - const scalar x1, - const scalar x2 -) const -{ - const scalar bx1 = bound(x1), bx2 = bound(x2); - - Type sumY = Zero; - - interpolator().integrationWeights(bx1, bx2, indices_, weights_); - forAll(indices_, i) - { - sumY += weights_[i]*table_[indices_[i]].second(); - } - - if (boundsHandling_ == tableBase::boundsHandling::repeat) - { - const scalar t0 = table_.first().first(); - const scalar t1 = table_.last().first(); - const scalar dt = t1 - t0; - const label n = floor((x2 - t0)/dt) - floor((x1 - t0)/dt); - - if (n != 0) - { - Type sumY01 = Zero; - - interpolator().integrationWeights(t0, t1, indices_, weights_); - - forAll(indices_, i) - { - sumY01 += weights_[i]*table_[indices_[i]].second(); - } - sumY += n*sumY01; - } - } - - return sumY; -} - - -template -Foam::tmp -Foam::Function1s::TableBase::x() const -{ - tmp tfld(new scalarField(table_.size(), 0.0)); - scalarField& fld = tfld.ref(); - - forAll(table_, i) - { - fld[i] = table_[i].first(); - } - - return tfld; -} - - -template -Foam::tmp> -Foam::Function1s::TableBase::y() const -{ - tmp> tfld(new Field(table_.size(), Zero)); - Field& fld = tfld.ref(); - - forAll(table_, i) - { - fld[i] = table_[i].second(); - } - - return tfld; -} - - -template -void Foam::Function1s::TableBase::writeData -( - Ostream& os -) const -{ - Function1::writeData(os); - os << token::END_STATEMENT << nl; - - os << indent << word(this->name() + "Coeffs") << nl; - os << indent << token::BEGIN_BLOCK << incrIndent << nl; - - writeEntryIfDifferent - ( - os, - "outOfBounds", - tableBase::boundsHandlingNames_[tableBase::boundsHandling::clamp], - tableBase::boundsHandlingNames_[boundsHandling_] - ); - - writeEntryIfDifferent - ( - os, - "interpolationScheme", - linearInterpolationWeights::typeName, - interpolationScheme_ - ); - - writeEntries(os, table_); - - os << decrIndent << indent << token::END_BLOCK << endl; -} - - -// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.H b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.H deleted file mode 100644 index e5e6a7dd5b..0000000000 --- a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.H +++ /dev/null @@ -1,175 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::Function1s::TableBase - -Description - Base class for table with bounds handling, interpolation and integration - -SourceFiles - TableBase.C - -\*---------------------------------------------------------------------------*/ - -#ifndef TableBase_H -#define TableBase_H - -#include "tableBase.H" -#include "Function1.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -class interpolationWeights; - -namespace Function1s -{ - -/*---------------------------------------------------------------------------*\ - Class TableBase Declaration -\*---------------------------------------------------------------------------*/ - -template -class TableBase -: - public tableBase, - public FieldFunction1 -{ -protected: - - // Protected data - - //- Table name - const word name_; - - //- Enumeration for handling out-of-bound values - const tableBase::boundsHandling boundsHandling_; - - //- Interpolation type - const word interpolationScheme_; - - //- Table data - List> table_; - - //- Extracted values - mutable autoPtr tableSamplesPtr_; - - //- Interpolator method - mutable autoPtr interpolatorPtr_; - - //- Cached indices - mutable labelList indices_; - - //- Cached weights - mutable scalarField weights_; - - - // Protected Member Functions - - //- Return (demand driven) interpolator - const interpolationWeights& interpolator() const; - - //- Check the table for size and consistency - void check() const; - - //- Bound the argument to the table. Errors or warns, or shifts the - // value if the table repeats. Does not clamp to the ends of the table - // as the interpolator already performs that function. - scalar bound(const scalar x) const; - - -public: - - // Constructors - - //- Construct from dictionary. Table is not populated. - TableBase(const word& name, const dictionary& dict); - - //- Construct from components - TableBase - ( - const word& name, - const tableBase::boundsHandling boundsHandling, - const word& interpolationScheme, - const List>& table - ); - - //- Copy constructor. Note: Steals interpolator and tableSamples. - TableBase(const TableBase& tbl); - - - //- Destructor - virtual ~TableBase(); - - - // Member Functions - - //- Return Table value as a function of scalar x - virtual Type value(const scalar x) const; - - //- Integrate between two scalars - virtual Type integrate(const scalar x1, const scalar x2) const; - - //- Return the reference values - virtual tmp x() const; - - //- Return the dependent values - virtual tmp> y() const; - - //- Write entries only in dictionary format - virtual void writeEntries - ( - Ostream& os, - const List>& table - ) const = 0; - - //- Write all table data in dictionary format - virtual void writeData(Ostream& os) const; - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const TableBase&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Function1s -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "TableBase.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/Csv/CsvTableReader.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableReader/Csv/CsvTableReader.C similarity index 100% rename from src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/Csv/CsvTableReader.C rename to src/OpenFOAM/primitives/functions/Function1/Table/TableReader/Csv/CsvTableReader.C diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/Csv/CsvTableReader.H b/src/OpenFOAM/primitives/functions/Function1/Table/TableReader/Csv/CsvTableReader.H similarity index 100% rename from src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/Csv/CsvTableReader.H rename to src/OpenFOAM/primitives/functions/Function1/Table/TableReader/Csv/CsvTableReader.H diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/Embedded/EmbeddedTableReader.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableReader/Embedded/EmbeddedTableReader.C similarity index 100% rename from src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/Embedded/EmbeddedTableReader.C rename to src/OpenFOAM/primitives/functions/Function1/Table/TableReader/Embedded/EmbeddedTableReader.C diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/Embedded/EmbeddedTableReader.H b/src/OpenFOAM/primitives/functions/Function1/Table/TableReader/Embedded/EmbeddedTableReader.H similarity index 100% rename from src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/Embedded/EmbeddedTableReader.H rename to src/OpenFOAM/primitives/functions/Function1/Table/TableReader/Embedded/EmbeddedTableReader.H diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/Foam/FoamTableReader.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableReader/Foam/FoamTableReader.C similarity index 100% rename from src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/Foam/FoamTableReader.C rename to src/OpenFOAM/primitives/functions/Function1/Table/TableReader/Foam/FoamTableReader.C diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/Foam/FoamTableReader.H b/src/OpenFOAM/primitives/functions/Function1/Table/TableReader/Foam/FoamTableReader.H similarity index 100% rename from src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/Foam/FoamTableReader.H rename to src/OpenFOAM/primitives/functions/Function1/Table/TableReader/Foam/FoamTableReader.H diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/TableFileReader/TableFileReader.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableReader/TableFileReader/TableFileReader.C similarity index 100% rename from src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/TableFileReader/TableFileReader.C rename to src/OpenFOAM/primitives/functions/Function1/Table/TableReader/TableFileReader/TableFileReader.C diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/TableFileReader/TableFileReader.H b/src/OpenFOAM/primitives/functions/Function1/Table/TableReader/TableFileReader/TableFileReader.H similarity index 100% rename from src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/TableFileReader/TableFileReader.H rename to src/OpenFOAM/primitives/functions/Function1/Table/TableReader/TableFileReader/TableFileReader.H diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/TableReader/TableReader.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableReader/TableReader/TableReader.C similarity index 100% rename from src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/TableReader/TableReader.C rename to src/OpenFOAM/primitives/functions/Function1/Table/TableReader/TableReader/TableReader.C diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/TableReader/TableReader.H b/src/OpenFOAM/primitives/functions/Function1/Table/TableReader/TableReader/TableReader.H similarity index 100% rename from src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/TableReader/TableReader.H rename to src/OpenFOAM/primitives/functions/Function1/Table/TableReader/TableReader/TableReader.H diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/TableReader/TableReaderNew.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableReader/TableReader/TableReaderNew.C similarity index 100% rename from src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/TableReader/TableReaderNew.C rename to src/OpenFOAM/primitives/functions/Function1/Table/TableReader/TableReader/TableReaderNew.C diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/makeTableReaders.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableReader/makeTableReaders.C similarity index 100% rename from src/OpenFOAM/primitives/functions/Function1/TableFile/TableReader/makeTableReaders.C rename to src/OpenFOAM/primitives/functions/Function1/Table/TableReader/makeTableReaders.C diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/tableBase.C b/src/OpenFOAM/primitives/functions/Function1/Table/tableBase.C index 393960e6ec..c0656949fb 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Table/tableBase.C +++ b/src/OpenFOAM/primitives/functions/Function1/Table/tableBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,16 +39,4 @@ const Foam::NamedEnum Foam::Function1s::tableBase::boundsHandlingNames_; -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::Function1s::tableBase::tableBase() -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::Function1s::tableBase::~tableBase() -{} - - // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/tableBase.H b/src/OpenFOAM/primitives/functions/Function1/Table/tableBase.H index 83b9845307..8de94b7779 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Table/tableBase.H +++ b/src/OpenFOAM/primitives/functions/Function1/Table/tableBase.H @@ -67,11 +67,8 @@ public: // Constructors //- Construct null - tableBase(); - - - //- Destructor - virtual ~tableBase(); + tableBase() + {} }; diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.C b/src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.C deleted file mode 100644 index 5eaf485f8d..0000000000 --- a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.C +++ /dev/null @@ -1,72 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "TableFile.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::Function1s::TableFile::TableFile -( - const word& name, - const dictionary& dict -) -: - TableBase>(name, dict), - reader_(TableReader::New(name, dict, this->table_)) -{ - TableBase>::check(); -} - - -template -Foam::Function1s::TableFile::TableFile(const TableFile& tbl) -: - TableBase>(tbl), - reader_(tbl.reader_, false) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::Function1s::TableFile::~TableFile() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -void Foam::Function1s::TableFile::writeEntries -( - Ostream& os, - const List>& table -) const -{ - reader_->write(os, table); -} - - -// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.H b/src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.H deleted file mode 100644 index 5ce90321bb..0000000000 --- a/src/OpenFOAM/primitives/functions/Function1/TableFile/TableFile.H +++ /dev/null @@ -1,133 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::Function1s::TableFile - -Description - Templated table container function where data is read from file. Data is - stored as a list of Tuple2's. The first column is scalar. Data is read in - the form specified by the format entry, which defaults to the native - OpenFOAM format. - - Usage: - \verbatim - tableFile; - Coeffs - { - file dataFile; // name of data file - format foam; // data format (optional) - outOfBounds clamp; // optional out-of-bounds handling - interpolationScheme linear; // optional interpolation method - } - \endverbatim - -SourceFiles - TableFile.C - -See also - FoamTableReader.C - CsvTableReader.C - -\*---------------------------------------------------------------------------*/ - -#ifndef TableFile_H -#define TableFile_H - -#include "TableBase.H" -#include "TableReader.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace Function1s -{ - -/*---------------------------------------------------------------------------*\ - Class TableFile Declaration -\*---------------------------------------------------------------------------*/ - -template -class TableFile -: - public TableBase> -{ - // Private Data - - //- Table reader - const autoPtr> reader_; - - -public: - - //- Runtime type information - TypeName("tableFile"); - - - // Constructors - - //- Construct from entry name and dictionary - TableFile(const word& entryName, const dictionary& dict); - - //- Copy constructor - TableFile(const TableFile& tbl); - - - //- Destructor - virtual ~TableFile(); - - - // I/O - - //- Write entries only in dictionary format - virtual void writeEntries - ( - Ostream& os, - const List>& table - ) const; - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const TableFile&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Function1s -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "TableFile.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Function1/makeFunction1s.C b/src/OpenFOAM/primitives/functions/Function1/makeFunction1s.C index 1fb6263fe4..681a5a976b 100644 --- a/src/OpenFOAM/primitives/functions/Function1/makeFunction1s.C +++ b/src/OpenFOAM/primitives/functions/Function1/makeFunction1s.C @@ -31,7 +31,6 @@ License #include "Sine.H" #include "Square.H" #include "Table.H" -#include "TableFile.H" #include "Scale.H" #include "CodedFunction1.H" diff --git a/src/dynamicMesh/motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C index 57302fc6c8..05f75749b5 100644 --- a/src/dynamicMesh/motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C +++ b/src/dynamicMesh/motionSolvers/displacement/layeredSolver/displacementLayeredMotionMotionSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,7 +29,7 @@ License #include "pointFields.H" #include "PointEdgeWave.H" #include "syncTools.H" -#include "TableFile.H" +#include "Table.H" #include "pointConstraints.H" #include "mapPolyMesh.H" @@ -233,7 +233,7 @@ Foam::displacementLayeredMotionMotionSolver::faceZoneEvaluate } else if (type == "timeVaryingUniformFixedValue") { - Function1s::TableFile timeSeries(word::null, dict); + Function1s::Table timeSeries(word::null, dict); fld = timeSeries.value(mesh().time().timeOutputValue()); } diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/sixDoFMotion/sixDoFMotion.C b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/sixDoFMotion/sixDoFMotion.C index 20a4941cd9..2e79d2dc73 100644 --- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/sixDoFMotion/sixDoFMotion.C +++ b/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/sixDoFMotion/sixDoFMotion.C @@ -56,7 +56,6 @@ namespace solidBodyMotionFunctions #include "Sine.H" #include "Square.H" #include "Table.H" -#include "TableFile.H" #include "EmbeddedTableReader.H" #include "FoamTableReader.H" #include "Scale.H" diff --git a/src/engine/engineTime/freePiston/freePiston.H b/src/engine/engineTime/freePiston/freePiston.H index 74356e7050..d32d5ad454 100644 --- a/src/engine/engineTime/freePiston/freePiston.H +++ b/src/engine/engineTime/freePiston/freePiston.H @@ -37,9 +37,9 @@ Description pistonPositionTime table ( (0 0.13) (0.020 0.03) ); \endverbatim - or with a tableFile + or from a file \verbatim - pistonPositionTime tableFile; + pistonPositionTime table; pistonPositionTimeCoeffs { file "data"; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.H index 649cf9b616..c6ec91fea2 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.H @@ -40,8 +40,8 @@ Usage inlet { type fanPressure; - fanCurve tableFile; - tableFileCoeffs + fanCurve table; + fanCurveCoeffs { file "$FOAM_CASE/constant/pressureVsQ"; format csv; @@ -61,8 +61,8 @@ Usage outlet { type fanPressure; - fanCurve tableFile; - tableFileCoeffs + fanCurve table; + fanCurveCoeffs { file "$FOAM_CASE/constant/pressureVsQ"; format csv; @@ -96,7 +96,7 @@ SourceFiles #define fanPressureFvPatchScalarField_H #include "totalPressureFvPatchScalarField.H" -#include "TableFile.H" +#include "Function1.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fanPressureJump/fanPressureJumpFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fanPressureJump/fanPressureJumpFvPatchScalarField.H index 48e9d8640b..cd58f0129d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fanPressureJump/fanPressureJumpFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fanPressureJump/fanPressureJumpFvPatchScalarField.H @@ -53,8 +53,8 @@ Usage { type fanPressureJump; patchType cyclic; - fanCurve tableFile; - tableFileCoeffs + fanCurve table; + fanCurveCoeffs { file "$FOAM_CASE/constant/pressureVsQ"; format csv; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.H index 21e4209006..ccbaaf404d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedProfile/fixedProfileFvPatchField.H @@ -42,7 +42,7 @@ Usage { type fixedProfile; - profile tableFile; + profile table; profileCoeffs { file "UProfile"; diff --git a/src/fvOptions/sources/derived/sixDoFAccelerationSource/sixDoFAccelerationSource.C b/src/fvOptions/sources/derived/sixDoFAccelerationSource/sixDoFAccelerationSource.C index 11491fdead..89dd35799b 100644 --- a/src/fvOptions/sources/derived/sixDoFAccelerationSource/sixDoFAccelerationSource.C +++ b/src/fvOptions/sources/derived/sixDoFAccelerationSource/sixDoFAccelerationSource.C @@ -55,7 +55,6 @@ namespace fv #include "Sine.H" #include "Square.H" #include "Table.H" -#include "TableFile.H" #include "EmbeddedTableReader.H" #include "FoamTableReader.H" #include "Scale.H" diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C index 2393b867c7..f5d21cb41e 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C @@ -177,7 +177,7 @@ bool Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::read moment_.reset ( - new Function1s::TableFile("moment", sDoFRBMRCoeffs_) + new Function1s::Table("moment", sDoFRBMRCoeffs_) ); const word angleFormat = sDoFRBMRCoeffs_.lookup("angleFormat"); diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.H index 0478580bf2..53be16b187 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.H @@ -39,7 +39,7 @@ SourceFiles #include "sixDoFRigidBodyMotionRestraint.H" #include "point.H" #include "tensor.H" -#include "TableFile.H" +#include "Table.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -66,7 +66,7 @@ class tabulatedAxialAngularSpring vector axis_; //- Spring moment as a function of angle - autoPtr> moment_; + autoPtr> moment_; //- Boolean stating whether the angle around the axis needs to // be converted to degrees before evaluating the moment function diff --git a/tutorials/multiphase/interFoam/laminar/sloshingTank3D6DoF/constant/dynamicMeshDict b/tutorials/multiphase/interFoam/laminar/sloshingTank3D6DoF/constant/dynamicMeshDict index 790de21728..d887a20f96 100644 --- a/tutorials/multiphase/interFoam/laminar/sloshingTank3D6DoF/constant/dynamicMeshDict +++ b/tutorials/multiphase/interFoam/laminar/sloshingTank3D6DoF/constant/dynamicMeshDict @@ -23,7 +23,7 @@ solidBodyMotionFunction sixDoFMotion; CofG (0 0 0); -translationRotation tableFile; +translationRotation table; // interpolationScheme spline; file "$FOAM_CASE/constant/6DoF.dat"; diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/constant/phaseProperties b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/constant/phaseProperties index ec1dacd357..0f6085aca2 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/constant/phaseProperties +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoiling/constant/phaseProperties @@ -152,7 +152,7 @@ saturation scale 1; value { - type tableFile; + type table; format csv; nHeaderLine 1; refColumn 1; diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/constant/phaseProperties b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/constant/phaseProperties index a028acb3ed..cc4400b501 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/constant/phaseProperties +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingIATE/constant/phaseProperties @@ -189,7 +189,7 @@ saturation scale 1; value { - type tableFile; + type table; format csv; nHeaderLine 1; refColumn 1; diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/constant/phaseProperties b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/constant/phaseProperties index a3d4b9a181..85ad24c1da 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/constant/phaseProperties +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperse/constant/phaseProperties @@ -235,7 +235,7 @@ saturation scale 1; value { - type tableFile; + type table; format csv; nHeaderLine 1; refColumn 1; diff --git a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/constant/phaseProperties b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/constant/phaseProperties index f86bdab27e..fa2016c2e8 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/constant/phaseProperties +++ b/tutorials/multiphase/multiphaseEulerFoam/RAS/wallBoilingPolydisperseTwoGroups/constant/phaseProperties @@ -326,7 +326,7 @@ saturation scale 1; value { - type tableFile; + type table; format csv; nHeaderLine 1; refColumn 1; @@ -351,7 +351,7 @@ saturation scale 1; value { - type tableFile; + type table; format csv; nHeaderLine 1; refColumn 1; diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/0/T.particles b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/0/T.particles index 0873f46db4..8031abf2e2 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/0/T.particles +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/0/T.particles @@ -36,7 +36,7 @@ boundaryField wall { type fixedProfile; - profile tableFile; + profile table; profileCoeffs { diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/0/T.vapor b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/0/T.vapor index a5e2a27698..93f6da69a9 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/0/T.vapor +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/0/T.vapor @@ -36,7 +36,7 @@ boundaryField wall { type fixedProfile; - profile tableFile; + profile table; profileCoeffs { diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/0/T.particles b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/0/T.particles index 0873f46db4..8031abf2e2 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/0/T.particles +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/0/T.particles @@ -36,7 +36,7 @@ boundaryField wall { type fixedProfile; - profile tableFile; + profile table; profileCoeffs { diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/0/T.vapor b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/0/T.vapor index a5e2a27698..93f6da69a9 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/0/T.vapor +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/0/T.vapor @@ -36,7 +36,7 @@ boundaryField wall { type fixedProfile; - profile tableFile; + profile table; profileCoeffs {