Function1s::Table: Added access functions

to enable tables to be constructed from the components of existing tables with
value transformations.
This commit is contained in:
Henry Weller
2021-07-19 14:16:08 +01:00
parent 689ea4224f
commit e2e88c3058
4 changed files with 36 additions and 5 deletions

View File

@ -122,6 +122,7 @@ Foam::diameterModels::binaryBreakupModels::LuoSvendsen::LuoSvendsen
"gamma2by11", "gamma2by11",
Function1s::tableBase::boundsHandling::clamp, Function1s::tableBase::boundsHandling::clamp,
linearInterpolationWeights::typeName, linearInterpolationWeights::typeName,
autoPtr<TableReader<scalar>>(nullptr),
gammaUpperReg2by11Table gammaUpperReg2by11Table
); );
@ -131,6 +132,7 @@ Foam::diameterModels::binaryBreakupModels::LuoSvendsen::LuoSvendsen
"gamma5by11", "gamma5by11",
Function1s::tableBase::boundsHandling::clamp, Function1s::tableBase::boundsHandling::clamp,
linearInterpolationWeights::typeName, linearInterpolationWeights::typeName,
autoPtr<TableReader<scalar>>(nullptr),
gammaUpperReg5by11Table gammaUpperReg5by11Table
); );
@ -140,6 +142,7 @@ Foam::diameterModels::binaryBreakupModels::LuoSvendsen::LuoSvendsen
"gamma8by11", "gamma8by11",
Function1s::tableBase::boundsHandling::clamp, Function1s::tableBase::boundsHandling::clamp,
linearInterpolationWeights::typeName, linearInterpolationWeights::typeName,
autoPtr<TableReader<scalar>>(nullptr),
gammaUpperReg8by11Table gammaUpperReg8by11Table
); );
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -138,13 +138,15 @@ Foam::Function1s::Table<Type>::Table
const word& name, const word& name,
const tableBase::boundsHandling boundsHandling, const tableBase::boundsHandling boundsHandling,
const word& interpolationScheme, const word& interpolationScheme,
const autoPtr<TableReader<Type>>& reader,
const List<Tuple2<scalar, Type>>& table const List<Tuple2<scalar, Type>>& table
) )
: :
FieldFunction1<Type, Table<Type>>(name), FieldFunction1<Type, Table<Type>>(name),
boundsHandling_(boundsHandling), boundsHandling_(boundsHandling),
interpolationScheme_(interpolationScheme), interpolationScheme_(interpolationScheme),
values_(table) values_(table),
reader_(reader, false)
{} {}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -127,7 +127,7 @@ class Table
//- Enumeration for handling out-of-bound values //- Enumeration for handling out-of-bound values
const tableBase::boundsHandling boundsHandling_; const tableBase::boundsHandling boundsHandling_;
//- Interpolation type //- Interpolation scheme
const word interpolationScheme_; const word interpolationScheme_;
//- Table data //- Table data
@ -177,6 +177,7 @@ public:
const word& name, const word& name,
const tableBase::boundsHandling boundsHandling, const tableBase::boundsHandling boundsHandling,
const word& interpolationScheme, const word& interpolationScheme,
const autoPtr<TableReader<Type>>& reader,
const List<Tuple2<scalar, Type>>& table const List<Tuple2<scalar, Type>>& table
); );
@ -193,6 +194,30 @@ public:
// Member Functions // Member Functions
//- Return the handling out-of-bound values
const tableBase::boundsHandling& boundsHandling() const
{
return boundsHandling_;
}
//- Return the interpolation scheme
const word& interpolationScheme() const
{
return interpolationScheme_;
}
//- Return the reader
const autoPtr<TableReader<Type>>& reader() const
{
return reader_;
}
//- Return table data
const List<Tuple2<scalar, Type>>& values() const
{
return values_;
}
//- Return Table value as a function of scalar x //- Return Table value as a function of scalar x
virtual Type value(const scalar x) const; virtual Type value(const scalar x) const;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -149,6 +149,7 @@ Foam::radiationModels::blackBodyEmission::blackBodyEmission
"blackBodyEmissivePower", "blackBodyEmissivePower",
Function1s::tableBase::boundsHandling::clamp, Function1s::tableBase::boundsHandling::clamp,
linearInterpolationWeights::typeName, linearInterpolationWeights::typeName,
autoPtr<TableReader<scalar>>(nullptr),
emissivePowerTable emissivePowerTable
), ),
C1_("C1", dimensionSet(1, 4, 3, 0, 0, 0, 0), 3.7419e-16), C1_("C1", dimensionSet(1, 4, 3, 0, 0, 0, 0), 3.7419e-16),