COMP: Function1 - propagated API change resulting from new objectRegistry access

This commit is contained in:
Andrew Heather
2021-10-05 10:13:24 +01:00
committed by Mark Olesen
parent c1a04abd96
commit 70b55be684
48 changed files with 332 additions and 204 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -33,10 +33,11 @@ template<class Type>
Foam::Function1Types::Function1Expression<Type>::Function1Expression
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
Function1<Type>(entryName, dict),
Function1<Type>(entryName, dict, obrPtr),
dict_(dict),
valueExpr_(),
driver_(1, dict_)
@ -88,6 +89,8 @@ Type Foam::Function1Types::Function1Expression<Type>::value
driver_.setArgument(x);
driver_.resetDb(this->whichDb());
driver_.parse(this->valueExpr_);
expressions::exprResult result(driver_.result());
@ -98,7 +101,9 @@ Type Foam::Function1Types::Function1Expression<Type>::value
if (!result.hasValue() || !result.size() || !result.isType<Type>())
{
FatalErrorInFunction
<< "Could not evaluate: " << this->valueExpr_
<< "Could not evaluate: " << this->valueExpr_ << nl
<< "Result size:" << result.size()
<< " type:" << result.valueType() << nl
<< exit(FatalError);
}
@ -124,7 +129,7 @@ void Foam::Function1Types::Function1Expression<Type>::writeData
Ostream& os
) const
{
// Function1-from-subdict so out dictionary contains
// Function1-from-subdict so output dictionary contains
// only the relevant entries.
dict_.writeEntry(this->name(), os);
}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -113,8 +113,13 @@ public:
// Constructors
//- Construct from entry name and dictionary
Function1Expression(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
Function1Expression
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Copy construct
explicit Function1Expression(const Function1Expression<Type>& rhs);

View File

@ -210,10 +210,11 @@ Foam::Function1Types::CSV<Type>::CSV
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr,
const fileName& fName
)
:
TableBase<Type>(entryName, dict),
TableBase<Type>(entryName, dict, obrPtr),
nHeaderLine_(dict.get<label>("nHeaderLine")),
refColumn_(dict.get<label>("refColumn")),
componentColumns_(getComponentColumns("componentColumns", dict)),

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -125,11 +125,12 @@ public:
// Constructors
//- Construct from entry name and dictionary
//- Construct from entry name, dictionary and optional registry
CSV
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr,
const fileName& fName = fileName::null
);

View File

@ -34,10 +34,11 @@ template<class Type>
Foam::Function1Types::Constant<Type>::Constant
(
const word& entryName,
const Type& value
const Type& value,
const objectRegistry* obrPtr
)
:
Function1<Type>(entryName),
Function1<Type>(entryName, obrPtr),
value_(value)
{}
@ -46,10 +47,11 @@ template<class Type>
Foam::Function1Types::Constant<Type>::Constant
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
Function1<Type>(entryName, dict),
Function1<Type>(entryName, dict, obrPtr),
value_(Zero)
{
const entry* eptr = dict.findEntry(entryName, keyType::LITERAL);

View File

@ -95,10 +95,20 @@ public:
// Constructors
//- Construct from components
Constant(const word& entryName, const Type& value);
Constant
(
const word& entryName,
const Type& value,
const objectRegistry* obrPtr = nullptr
);
//- Construct from entry name and dictionary
Constant(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
Constant
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Construct from entry name and Istream
// Reads the constant value without the Function1 type

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -131,10 +131,15 @@ public:
// Constructors
//- Construct from entry name and dictionary
Cosine(const word& entryName, const dictionary& dict)
//- Construct from entry name, dictionary and optional registry
Cosine
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
)
:
Sine<Type>(entryName, dict)
Sine<Type>(entryName, dict, obrPtr)
{}
//- Copy construct

View File

@ -126,10 +126,11 @@ template<class Function1Type>
Foam::FieldFunction1<Function1Type>::FieldFunction1
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
Function1Type(entryName, dict)
Function1Type(entryName, dict, obrPtr)
{}

View File

@ -104,6 +104,7 @@ class Function1
const entry* eptr, // Eg, dict.findEntry(entryName)
const dictionary& dict,
const word& redirectType,
const objectRegistry* obrPtr,
const bool mandatory
);
@ -131,9 +132,10 @@ public:
dictionary,
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
),
(entryName, dict)
(entryName, dict, obrPtr)
);
@ -146,7 +148,8 @@ public:
const objectRegistry* obrPtr = nullptr
);
//- Construct from entry name and dictionary (unused)
//- Construct from entry name, (unused) dictionary
//- and optional registry
Function1
(
const word& entryName,
@ -169,6 +172,7 @@ public:
const word& entryName,
const dictionary& dict,
const word& redirectType,
const objectRegistry* obrPtr = nullptr,
const bool mandatory = true
);
@ -179,6 +183,7 @@ public:
std::initializer_list<std::pair<const char*,int>> compat,
const dictionary& dict,
const word& redirectType = word::null,
const objectRegistry* obrPtr = nullptr,
const bool mandatory = true
);
@ -187,6 +192,7 @@ public:
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr,
const bool mandatory = true
);
@ -195,7 +201,8 @@ public:
(
const word& entryName,
const dictionary& dict,
const word& redirectType = word::null
const word& redirectType = word::null,
const objectRegistry* obrPtr = nullptr
);
@ -209,6 +216,7 @@ public:
const word& entryName,
const dictionary& dict,
enum keyType::option matchOpt = keyType::LITERAL,
const objectRegistry* obrPtr = nullptr,
const bool mandatory = true
);
@ -221,7 +229,8 @@ public:
/// const word& entryName,
/// const dictionary& dict,
/// const Type& deflt,
/// enum keyType::option matchOpt = keyType::LITERAL
/// enum keyType::option matchOpt = keyType::LITERAL,
/// const objectRegistry* obrPtr = nullptr
/// );
@ -286,7 +295,12 @@ public:
// Constructors
//- Construct from entry name and dictionary
FieldFunction1(const word& entryName, const dictionary& dict);
FieldFunction1
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Construct and return a clone
virtual tmp<Function1<Type>> clone() const;

View File

@ -38,6 +38,7 @@ Foam::Function1<Type>::New
const entry* eptr,
const dictionary& dict,
const word& redirectType,
const objectRegistry* obrPtr,
const bool mandatory
)
{
@ -86,7 +87,12 @@ Foam::Function1<Type>::New
return autoPtr<Function1<Type>>
(
new Function1Types::Constant<Type>(entryName, constValue)
new Function1Types::Constant<Type>
(
entryName,
constValue,
obrPtr
)
);
}
@ -135,7 +141,7 @@ Foam::Function1<Type>::New
<< exit(FatalIOError);
}
return ctorPtr(entryName, *coeffs);
return ctorPtr(entryName, *coeffs, obrPtr);
}
@ -146,6 +152,7 @@ Foam::Function1<Type>::New
const word& entryName,
const dictionary& dict,
const word& redirectType,
const objectRegistry* obrPtr,
const bool mandatory
)
{
@ -155,6 +162,7 @@ Foam::Function1<Type>::New
dict.findEntry(entryName, keyType::LITERAL),
dict,
redirectType,
obrPtr,
mandatory
);
}
@ -168,6 +176,7 @@ Foam::Function1<Type>::NewCompat
std::initializer_list<std::pair<const char*,int>> compat,
const dictionary& dict,
const word& redirectType,
const objectRegistry* obrPtr,
const bool mandatory
)
{
@ -177,6 +186,7 @@ Foam::Function1<Type>::NewCompat
dict.findCompat(entryName, compat, keyType::LITERAL),
dict,
redirectType,
obrPtr,
mandatory
);
}
@ -188,10 +198,11 @@ Foam::Function1<Type>::New
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr,
const bool mandatory
)
{
return Function1<Type>::New(entryName, dict, word::null, mandatory);
return Function1<Type>::New(entryName, dict, word::null, obrPtr, mandatory);
}
@ -201,11 +212,12 @@ Foam::Function1<Type>::NewIfPresent
(
const word& entryName,
const dictionary& dict,
const word& redirectType
const word& redirectType,
const objectRegistry* obrPtr
)
{
// mandatory = false
return Function1<Type>::New(entryName, dict, redirectType, false);
return Function1<Type>::New(entryName, dict, redirectType, obrPtr, false);
}
@ -218,6 +230,7 @@ Foam::Function1<Type>::New
const word& entryName,
const dictionary& dict,
enum keyType::option matchOpt,
const objectRegistry* obrPtr,
const bool mandatory
)
{
@ -259,6 +272,7 @@ Foam::Function1<Type>::New
eptr, // Already resolved
dict,
word::null,
obrPtr,
mandatory
)
);
@ -292,12 +306,13 @@ Foam::Function1<Type>::New
/// const word& entryName,
/// const dictionary& dict,
/// const Type& deflt,
/// enum keyType::option matchOpt
/// enum keyType::option matchOpt,
/// const objectRegistry* obrPtr
/// )
/// {
/// auto fref
/// (
/// Function1<Type>::New(entryName, dict, cache, matchOpt, false)
/// Function1<Type>::New(entryName, dict, cache, matchOpt, obrPtr,false)
/// );
///
/// if (!fref)
@ -308,5 +323,4 @@ Foam::Function1<Type>::New
/// return fref;
/// }
// ************************************************************************* //

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -42,10 +42,11 @@ template<class Type>
Foam::Function1Types::LimitRange<Type>::LimitRange
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
Function1<Type>(entryName)
Function1<Type>(entryName, obrPtr)
{
read(dict);
}

View File

@ -135,8 +135,13 @@ public:
// Constructors
//- Construct from entry name and dictionary
LimitRange(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
LimitRange
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Copy construct
explicit LimitRange(const LimitRange<Type>& rhs);

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -30,9 +31,13 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::Function1Types::OneConstant<Type>::OneConstant(const word& entryName)
Foam::Function1Types::OneConstant<Type>::OneConstant
(
const word& entryName,
const objectRegistry* obrPtr
)
:
Function1<Type>(entryName)
Function1<Type>(entryName, obrPtr)
{}
@ -40,10 +45,11 @@ template<class Type>
Foam::Function1Types::OneConstant<Type>::OneConstant
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
Function1<Type>(entryName, dict)
Function1<Type>(entryName, dict, obrPtr)
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -75,11 +75,20 @@ public:
// Constructors
//- Construct from entry name
explicit OneConstant(const word& entryName);
//- Construct from entry name and optional registry
explicit OneConstant
(
const word& entryName,
const objectRegistry* obrPtr = nullptr
);
//- Construct from entry name and dictionary
OneConstant(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
OneConstant
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Construct and return a clone
virtual tmp<Function1<Type>> clone() const

View File

@ -65,10 +65,11 @@ template<class Type>
Foam::Function1Types::Polynomial<Type>::Polynomial
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
Function1<Type>(entryName, dict),
Function1<Type>(entryName, dict, obrPtr),
coeffs_(),
canIntegrate_(true)
{
@ -104,10 +105,11 @@ template<class Type>
Foam::Function1Types::Polynomial<Type>::Polynomial
(
const word& entryName,
const List<Tuple2<Type, Type>>& coeffs
const List<Tuple2<Type, Type>>& coeffs,
const objectRegistry* obrPtr
)
:
Function1<Type>(entryName),
Function1<Type>(entryName, obrPtr),
coeffs_(coeffs),
canIntegrate_(true)
{

View File

@ -108,14 +108,20 @@ public:
// Constructors
//- Construct from entry name and dictionary
Polynomial(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
Polynomial
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Construct from components
Polynomial
(
const word& entryName,
const List<Tuple2<Type, Type>>& coeffs
const List<Tuple2<Type, Type>>& coeffs,
const objectRegistry* obrPtr = nullptr
);
//- Copy constructor

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -28,7 +28,7 @@ License
#include "Scale.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::Function1Types::Scale<Type>::read(const dictionary& coeffs)
@ -38,14 +38,17 @@ void Foam::Function1Types::Scale<Type>::read(const dictionary& coeffs)
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::Function1Types::Scale<Type>::Scale
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
Function1<Type>(entryName)
Function1<Type>(entryName, obrPtr)
{
read(dict);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -122,11 +122,12 @@ public:
// Constructors
//- Construct from entry name and dictionary
//- Construct from entry name, dictionary and optional registry
Scale
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Copy construct

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -34,10 +34,11 @@ template<class Type>
Foam::Function1Types::Sine<Type>::Sine
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
Function1<Type>(entryName, dict),
Function1<Type>(entryName, dict, obrPtr),
t0_(dict.getOrDefault<scalar>("t0", 0)),
amplitude_(Function1<scalar>::NewIfPresent("amplitude", dict)),
period_(Function1<scalar>::NewIfPresent("period", dict)),

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -181,8 +181,13 @@ public:
// Constructors
//- Construct from entry name and dictionary
Sine(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
Sine
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Copy construct
explicit Sine(const Sine<Type>& rhs);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -34,10 +34,11 @@ template<class Type>
Foam::Function1Types::Square<Type>::Square
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
Sine<Type>(entryName, dict),
Sine<Type>(entryName, dict, obrPtr),
mark_(dict.getOrDefaultCompat<scalar>("mark", {{"markSpace", 2006}}, 1)),
space_(dict.getOrDefault<scalar>("space", 1))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -144,8 +144,13 @@ public:
// Constructors
//- Construct from entry name and dictionary
Square(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
Square
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Copy construct
explicit Square(const Square<Type>& rhs);

View File

@ -34,10 +34,11 @@ template<class Type>
Foam::Function1Types::Table<Type>::Table
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
TableBase<Type>(entryName, dict),
TableBase<Type>(entryName, dict, obrPtr),
fName_()
{
const entry* eptr = dict.findEntry(entryName, keyType::LITERAL);

View File

@ -119,8 +119,13 @@ public:
// Constructors
//- Construct from entry name and dictionary.
Table(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
Table
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Copy construct
explicit Table(const Table<Type>& tbl);

View File

@ -62,10 +62,11 @@ template<class Type>
Foam::Function1Types::TableBase<Type>::TableBase
(
const word& name,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
Function1<Type>(name, dict),
Function1<Type>(name, dict, obrPtr),
bounding_
(
bounds::repeatableBoundingNames.getOrDefault
@ -103,13 +104,6 @@ Foam::Function1Types::TableBase<Type>::TableBase(const TableBase<Type>& tbl)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::Function1Types::TableBase<Type>::~TableBase()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -101,14 +101,19 @@ public:
// Constructors
//- Construct from dictionary - note table is not populated
TableBase(const word& name, const dictionary& dict);
TableBase
(
const word& name,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Copy constructor. Note: steals interpolator, tableSamples
explicit TableBase(const TableBase<Type>& tbl);
//- Destructor
virtual ~TableBase();
virtual ~TableBase() = default;
// Member Functions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2019 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -34,10 +34,11 @@ template<class Type>
Foam::Function1Types::TableFile<Type>::TableFile
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
TableBase<Type>(entryName, dict),
TableBase<Type>(entryName, dict, obrPtr),
fName_()
{
dict.readEntry("file", fName_);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -101,7 +101,12 @@ public:
// Constructors
//- Construct from entry name and "file" found in dictionary
TableFile(const word& entryName, const dictionary& dict);
TableFile
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Copy construct
explicit TableFile(const TableFile<Type>& tbl);

View File

@ -1,43 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
-------------------------------------------------------------------------------
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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "Uniform.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::Function1Types::Uniform<Type>::Uniform
(
const word& entryName,
const dictionary& dict
)
:
Constant<Type>(entryName, dict)
{}
// ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -38,15 +38,12 @@ Description
<entryName> uniform <value>
\endverbatim
SourceFiles
Uniform.C
\*---------------------------------------------------------------------------*/
#ifndef Function1Types_Uniform_H
#define Function1Types_Uniform_H
#include "Function1.H"
#include "Constant.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -81,8 +78,16 @@ public:
// Constructors
//- Construct from entry name and dictionary
Uniform(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
Uniform
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
)
:
Constant<Type>(entryName, dict, obrPtr)
{}
};
@ -93,12 +98,6 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "Uniform.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -31,9 +31,13 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::Function1Types::ZeroConstant<Type>::ZeroConstant(const word& entryName)
Foam::Function1Types::ZeroConstant<Type>::ZeroConstant
(
const word& entryName,
const objectRegistry* obrPtr
)
:
Function1<Type>(entryName)
Function1<Type>(entryName, obrPtr)
{}
@ -41,10 +45,11 @@ template<class Type>
Foam::Function1Types::ZeroConstant<Type>::ZeroConstant
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
Function1<Type>(entryName, dict)
Function1<Type>(entryName, dict, obrPtr)
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -84,11 +84,20 @@ public:
// Constructors
//- Construct from entry name
explicit ZeroConstant(const word& entryName);
//- Construct from entry name and optional registry
explicit ZeroConstant
(
const word& entryName,
const objectRegistry* obrPtr = nullptr
);
//- Construct from entry name and dictionary
ZeroConstant(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
ZeroConstant
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Destructor

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,10 +44,11 @@ namespace Function1Types
Foam::Function1Types::halfCosineRamp::halfCosineRamp
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
ramp(entryName, dict)
ramp(entryName, dict, obrPtr)
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -67,8 +67,13 @@ public:
// Constructors
//- Construct from entry name and dictionary
halfCosineRamp(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
halfCosineRamp
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Destructor

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,10 +44,11 @@ namespace Function1Types
Foam::Function1Types::linearRamp::linearRamp
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
ramp(entryName, dict)
ramp(entryName, dict, obrPtr)
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -67,8 +67,13 @@ public:
// Constructors
//- Construct from entry name and dictionary
linearRamp(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
linearRamp
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Destructor

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,10 +44,11 @@ namespace Function1Types
Foam::Function1Types::quadraticRamp::quadraticRamp
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
ramp(entryName, dict)
ramp(entryName, dict, obrPtr)
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -67,8 +67,13 @@ public:
// Constructors
//- Construct from entry name and dictionary
quadraticRamp(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
quadraticRamp
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Destructor

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,7 +44,8 @@ namespace Function1Types
Foam::Function1Types::quarterCosineRamp::quarterCosineRamp
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
ramp(entryName, dict)

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -67,8 +67,13 @@ public:
// Constructors
//- Construct from entry name and dictionary
quarterCosineRamp(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
quarterCosineRamp
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Destructor

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,10 +44,11 @@ namespace Function1Types
Foam::Function1Types::quarterSineRamp::quarterSineRamp
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
ramp(entryName, dict)
ramp(entryName, dict, obrPtr)
{}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -66,8 +67,13 @@ public:
// Constructors
//- Construct from entry name and dictionary
quarterSineRamp(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
quarterSineRamp
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Destructor

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -40,10 +40,11 @@ void Foam::Function1Types::ramp::read(const dictionary& coeffs)
Foam::Function1Types::ramp::ramp
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
Function1<scalar>(entryName, dict)
Function1<scalar>(entryName, dict, obrPtr)
{
read(dict);
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -119,11 +119,12 @@ public:
// Constructors
//- Construct from entry name and dictionary
//- Construct from entry name, dictionary and optional registry
ramp
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,10 +43,11 @@ namespace Function1Types
Foam::Function1Types::stepFunction::stepFunction
(
const word& entryName,
const dictionary& dict
const dictionary& dict,
const objectRegistry* obrPtr
)
:
ramp(entryName, dict)
ramp(entryName, dict, obrPtr)
{}

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -66,8 +66,13 @@ public:
// Constructors
//- Construct from entry name and dictionary
stepFunction(const word& entryName, const dictionary& dict);
//- Construct from entry name, dictionary and optional registry
stepFunction
(
const word& entryName,
const dictionary& dict,
const objectRegistry* obrPtr = nullptr
);
//- Destructor

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -40,7 +40,7 @@ Foam::TimeFunction1<Type>::TimeFunction1
:
time_(runTime),
name_(entryName),
entry_(Function1<Type>::New(entryName, dict))
entry_(Function1<Type>::New(entryName, dict, &runTime))
{
entry_->convertTimeBase(runTime);
}
@ -81,7 +81,7 @@ Foam::TimeFunction1<Type>::TimeFunction1
template<class Type>
void Foam::TimeFunction1<Type>::reset(const dictionary& dict)
{
entry_ = Function1<Type>::New(name_, dict);
entry_ = Function1<Type>::New(name_, dict, &time_);
entry_->convertTimeBase(time_);
}

View File

@ -253,7 +253,7 @@ void pointNoise::calculate()
fName = argList::envGlobalPath()/fName;
}
Function1Types::CSV<scalar> data("pressure", dict_, fName);
Function1Types::CSV<scalar> data("pressure", dict_, nullptr, fName);
processData(filei, data);
}
}