diff --git a/etc/codeTemplates/dynamicCode/codedPatchFunction1Template.H b/etc/codeTemplates/dynamicCode/codedPatchFunction1Template.H index 8e53867c03..46d7d08086 100644 --- a/etc/codeTemplates/dynamicCode/codedPatchFunction1Template.H +++ b/etc/codeTemplates/dynamicCode/codedPatchFunction1Template.H @@ -129,12 +129,6 @@ public: //- Return value as a function of (scalar) independent variable virtual tmp> value(const scalar x) const; - //- Is value constant (i.e. independent of x) - virtual bool constant() const - { - return false; - } - //- Is value uniform (i.e. independent of coordinate) virtual bool uniform() const { diff --git a/src/OpenFOAM/primitives/functions/Function1/Constant/Constant.C b/src/OpenFOAM/primitives/functions/Function1/Constant/Constant.C index f2f1f592f9..f9b4b47cf4 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Constant/Constant.C +++ b/src/OpenFOAM/primitives/functions/Function1/Constant/Constant.C @@ -117,7 +117,8 @@ void Foam::Function1Types::Constant::writeData(Ostream& os) const { Function1::writeData(os); - os << token::SPACE << value_ << token::END_STATEMENT << nl; + os << token::SPACE << value_; + os.endEntry(); } diff --git a/src/OpenFOAM/primitives/functions/Function1/Constant/Constant.H b/src/OpenFOAM/primitives/functions/Function1/Constant/Constant.H index e7916f4313..3ddc1ed670 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Constant/Constant.H +++ b/src/OpenFOAM/primitives/functions/Function1/Constant/Constant.H @@ -134,6 +134,9 @@ public: //- Change the constant value inline void reset(const Type& val); + //- Value is independent of x + virtual inline bool constant() const { return true; } + //- Return constant value virtual inline Type value(const scalar) const; diff --git a/src/OpenFOAM/primitives/functions/Function1/Function1/Function1.H b/src/OpenFOAM/primitives/functions/Function1/Function1/Function1.H index 0a85b62ca3..881e95d4ec 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Function1/Function1.H +++ b/src/OpenFOAM/primitives/functions/Function1/Function1/Function1.H @@ -240,23 +240,30 @@ public: // Member Functions - // Evaluation + //- Is value constant (i.e. independent of x) + virtual bool constant() const + { + return false; + } - //- Return value as a function of (scalar) independent variable - virtual Type value(const scalar x) const; - //- Return value as a function of (scalar) independent variable - virtual tmp> value(const scalarField& x) const; + // Evaluation - //- Integrate between two (scalar) values - virtual Type integrate(const scalar x1, const scalar x2) const; + //- Return value as a function of (scalar) independent variable + virtual Type value(const scalar x) const; - //- Integrate between two (scalar) values - virtual tmp> integrate - ( - const scalarField& x1, - const scalarField& x2 - ) const; + //- Return value as a function of (scalar) independent variable + virtual tmp> value(const scalarField& x) const; + + //- Integrate between two (scalar) values + virtual Type integrate(const scalar x1, const scalar x2) const; + + //- Integrate between two (scalar) values + virtual tmp> integrate + ( + const scalarField& x1, + const scalarField& x2 + ) const; // I/O @@ -312,20 +319,18 @@ public: // Member Functions - // Evaluation + using Function1Type::value; + using Function1Type::integrate; - using Function1Type::value; - using Function1Type::integrate; + //- Return value as a function of (scalar) independent variable + virtual tmp> value(const scalarField& x) const; - //- Return value as a function of (scalar) independent variable - virtual tmp> value(const scalarField& x) const; - - //- Integrate between two (scalar) values - virtual tmp> integrate - ( - const scalarField& x1, - const scalarField& x2 - ) const; + //- Integrate between two (scalar) values + virtual tmp> integrate + ( + const scalarField& x1, + const scalarField& x2 + ) const; }; diff --git a/src/OpenFOAM/primitives/functions/Function1/None/NoneFunction1.C b/src/OpenFOAM/primitives/functions/Function1/None/NoneFunction1.C new file mode 100644 index 0000000000..741231938b --- /dev/null +++ b/src/OpenFOAM/primitives/functions/Function1/None/NoneFunction1.C @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2021 OpenCFD Ltd. +------------------------------------------------------------------------------- +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 "NoneFunction1.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::Function1Types::None::None +( + const word& entryName, + const dictionary& dict, + const objectRegistry* obrPtr +) +: + Function1(entryName, dict, obrPtr), + context_(dict.relativeName()) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Type Foam::Function1Types::None::value(const scalar) const +{ + FatalErrorInFunction + << "Function " << this->name() << " is 'none' in " << context_ << nl + << exit(FatalError); + + return pTraits::zero; +} + + +template +Type Foam::Function1Types::None::integral +( + const scalar x1, + const scalar x2 +) +const +{ + FatalErrorInFunction + << "Function " << this->name() << " is 'none' in " << context_ << nl + << exit(FatalError); + + return pTraits::zero; +} + + +template +Foam::tmp> Foam::Function1Types::None::value +( + const scalarField& x +) const +{ + FatalErrorInFunction + << "Function " << this->name() << " is 'none' in " << context_ << nl + << exit(FatalError); + + return nullptr; +} + + +template +void Foam::Function1Types::None::writeData(Ostream& os) const +{ + // OR: os.writeEntry(this->name(), this->type()); + Function1::writeData(os); + os.endEntry(); +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Function1/None/NoneFunction1.H b/src/OpenFOAM/primitives/functions/Function1/None/NoneFunction1.H new file mode 100644 index 0000000000..f73f3446a9 --- /dev/null +++ b/src/OpenFOAM/primitives/functions/Function1/None/NoneFunction1.H @@ -0,0 +1,132 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | www.openfoam.com + \\/ M anipulation | +------------------------------------------------------------------------------- + Copyright (C) 2021 OpenCFD Ltd. +------------------------------------------------------------------------------- +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::Function1Types::None + +Description + Templated placeholder function that returns an error message if called. + + This is principally useful for interfaces that expect a Function1 + but where it is not necessarily used by a particular submodel. + +\*---------------------------------------------------------------------------*/ + +#ifndef Function1Types_None_H +#define Function1Types_None_H + +#include "Function1.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace Function1Types +{ + +/*---------------------------------------------------------------------------*\ + Class None Declaration +\*---------------------------------------------------------------------------*/ + +template +class None +: + public Function1 +{ + // Private Member Data + + //- Context (eg, dictionary name) for the function + string context_; + + +public: + + //- Runtime type information + TypeName("none"); + + + // Generated Methods + + //- Default copy constructor + None(const None& rhs) = default; + + //- No copy assignment + void operator=(const None&) = delete; + + + // Constructors + + //- Construct from entry name, dictionary and optional registry + None + ( + const word& entryName, + const dictionary& dict, + const objectRegistry* obrPtr = nullptr + ); + + //- Construct and return a clone + virtual tmp> clone() const + { + return tmp>(new None(*this)); + } + + + //- Destructor + virtual ~None() = default; + + + // Member Functions + + //- Value is independent of x + virtual inline bool constant() const { return true; } + + //- Placeholder: generates an error if called + virtual Type value(const scalar x) const; + + //- Placeholder: generates an error if called + virtual Type integral(const scalar x1, const scalar x2) const; + + //- Placeholder: generates an error if called + virtual tmp> value(const scalarField& x) const; + + //- Write as primitive (inline) format + virtual void writeData(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Function1Types +} // End namespace Foam + +#ifdef NoRepository + #include "NoneFunction1.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/functions/Function1/One/OneConstant.H b/src/OpenFOAM/primitives/functions/Function1/One/OneConstant.H index ea50b0e998..2981578177 100644 --- a/src/OpenFOAM/primitives/functions/Function1/One/OneConstant.H +++ b/src/OpenFOAM/primitives/functions/Function1/One/OneConstant.H @@ -103,6 +103,9 @@ public: // Member Functions + //- Value is independent of x + virtual inline bool constant() const { return true; } + //- Return constant value virtual inline Type value(const scalar) const; diff --git a/src/OpenFOAM/primitives/functions/Function1/Polynomial/PolynomialEntry.C b/src/OpenFOAM/primitives/functions/Function1/Polynomial/PolynomialEntry.C index 1a477262c3..5f5d496d67 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Polynomial/PolynomialEntry.C +++ b/src/OpenFOAM/primitives/functions/Function1/Polynomial/PolynomialEntry.C @@ -90,7 +90,7 @@ Foam::Function1Types::Polynomial::Polynomial } else { - // Dictionary format - "values" lookup. Eg, + // Dictionary format - "coeffs" lookup. Eg, // // key { type polynomial; coeffs ((0 0) (10 1)); } @@ -203,7 +203,8 @@ void Foam::Function1Types::Polynomial::writeData(Ostream& os) const { Function1::writeData(os); - os << nl << indent << coeffs_ << token::END_STATEMENT << nl; + os << nl << indent << coeffs_; + os.endEntry(); } diff --git a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C index 36ec5a6f8b..d5e82d49a3 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C +++ b/src/OpenFOAM/primitives/functions/Function1/Table/TableBase.C @@ -369,7 +369,10 @@ template void Foam::Function1Types::TableBase::writeData(Ostream& os) const { Function1::writeData(os); - os << nl << indent << table_ << token::END_STATEMENT << nl; + + os << nl << indent << table_; + os.endEntry(); + writeEntries(os); } diff --git a/src/OpenFOAM/primitives/functions/Function1/Zero/ZeroConstant.H b/src/OpenFOAM/primitives/functions/Function1/Zero/ZeroConstant.H index d0eb1e69db..de270d0b71 100644 --- a/src/OpenFOAM/primitives/functions/Function1/Zero/ZeroConstant.H +++ b/src/OpenFOAM/primitives/functions/Function1/Zero/ZeroConstant.H @@ -106,6 +106,9 @@ public: // Member Functions + //- Value is independent of x + virtual inline bool constant() const { return true; } + //- Return constant value virtual inline Type value(const scalar) const; diff --git a/src/OpenFOAM/primitives/functions/Function1/makeFunction1s.C b/src/OpenFOAM/primitives/functions/Function1/makeFunction1s.C index 03279221ad..06f07ca8fd 100644 --- a/src/OpenFOAM/primitives/functions/Function1/makeFunction1s.C +++ b/src/OpenFOAM/primitives/functions/Function1/makeFunction1s.C @@ -30,6 +30,7 @@ License #include "Uniform.H" #include "ZeroConstant.H" #include "OneConstant.H" +#include "NoneFunction1.H" #include "PolynomialEntry.H" #include "Sine.H" #include "Cosine.H" @@ -49,6 +50,7 @@ License makeFunction1(Type); \ makeFunction1Type(Constant, Type); \ makeFunction1Type(Uniform, Type); \ + makeFunction1Type(None, Type); \ makeFunction1Type(ZeroConstant, Type); \ makeFunction1Type(OneConstant, Type); \ makeFunction1Type(Polynomial, Type); \ @@ -73,6 +75,7 @@ namespace Foam { makeFunction1(label); makeFunction1Type(Constant, label); + makeFunction1Type(None, label); makeFunction1Type(FunctionObjectTrigger, label); makeFunction1Type(FunctionObjectTrigger, scalar); diff --git a/src/meshTools/PatchFunction1/ConstantField/ConstantField.C b/src/meshTools/PatchFunction1/ConstantField/ConstantField.C index 0bc684e76d..0a81ac8c13 100644 --- a/src/meshTools/PatchFunction1/ConstantField/ConstantField.C +++ b/src/meshTools/PatchFunction1/ConstantField/ConstantField.C @@ -291,8 +291,8 @@ void Foam::PatchFunction1Types::ConstantField::writeData if (isUniform_) { os.writeKeyword(this->name()) - << word("constant") << token::SPACE << uniformValue_ - << token::END_STATEMENT << nl; + << word("constant") << token::SPACE << uniformValue_; + os.endEntry(); } else { diff --git a/src/meshTools/PatchFunction1/ConstantField/ConstantField.H b/src/meshTools/PatchFunction1/ConstantField/ConstantField.H index e53b363f35..820c93a6ff 100644 --- a/src/meshTools/PatchFunction1/ConstantField/ConstantField.H +++ b/src/meshTools/PatchFunction1/ConstantField/ConstantField.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -170,23 +170,24 @@ public: // Member Functions + //- Value is independent of x + virtual inline bool constant() const + { + return true; + } + + //- Is value uniform (i.e. independent of coordinate) + virtual inline bool uniform() const + { + return isUniform_ && PatchFunction1::uniform(); + } + + // Evaluation //- Return constant value virtual inline tmp> value(const scalar x) const; - //- Is value constant (i.e. independent of x) - virtual inline bool constant() const - { - return true; - } - - //- Is value uniform (i.e. independent of coordinate) - virtual inline bool uniform() const - { - return isUniform_ && PatchFunction1::uniform(); - } - //- Integrate between two values virtual inline tmp> integrate ( diff --git a/src/meshTools/PatchFunction1/MappedFile/MappedFile.H b/src/meshTools/PatchFunction1/MappedFile/MappedFile.H index 4ac1fc917f..0e2d0944ad 100644 --- a/src/meshTools/PatchFunction1/MappedFile/MappedFile.H +++ b/src/meshTools/PatchFunction1/MappedFile/MappedFile.H @@ -64,8 +64,8 @@ SourceFiles #define PatchFunction1Types_MappedFile_H #include "PatchFunction1.H" -#include "pointToPointPlanarInterpolation.H" #include "Function1.H" +#include "pointToPointPlanarInterpolation.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -204,23 +204,24 @@ public: // Member Functions + //- Value is independent of x if there is only a single sample time + virtual bool constant() const + { + return sampleTimes_.size() == 1; + } + + //- Is value uniform (i.e. independent of coordinate) + virtual inline bool uniform() const + { + return PatchFunction1::uniform(); + } + + // Evaluation //- Return MappedFile value virtual tmp> value(const scalar) const; - //- Is value constant (i.e. independent of x) - virtual bool constant() const - { - return sampleTimes_.size() == 1; - } - - //- Is value uniform (i.e. independent of coordinate) - virtual bool uniform() const - { - return PatchFunction1::uniform(); - } - //- Integrate between two values virtual tmp> integrate ( diff --git a/src/meshTools/PatchFunction1/PatchFunction1/PatchFunction1.C b/src/meshTools/PatchFunction1/PatchFunction1/PatchFunction1.C index 3f0d4721d2..9046280efb 100644 --- a/src/meshTools/PatchFunction1/PatchFunction1/PatchFunction1.C +++ b/src/meshTools/PatchFunction1/PatchFunction1/PatchFunction1.C @@ -79,6 +79,13 @@ Foam::PatchFunction1::PatchFunction1 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +bool Foam::PatchFunction1::uniform() const +{ + return !coordSys_.active(); +} + + template Foam::tmp> Foam::PatchFunction1::value ( @@ -89,12 +96,6 @@ Foam::tmp> Foam::PatchFunction1::value return nullptr; } -template -bool Foam::PatchFunction1::uniform() const -{ - return !coordSys_.active(); -} - template Foam::tmp> Foam::PatchFunction1::integrate diff --git a/src/meshTools/PatchFunction1/PatchFunction1/PatchFunction1.H b/src/meshTools/PatchFunction1/PatchFunction1/PatchFunction1.H index 8072fb0193..1f844cfaa4 100644 --- a/src/meshTools/PatchFunction1/PatchFunction1/PatchFunction1.H +++ b/src/meshTools/PatchFunction1/PatchFunction1/PatchFunction1.H @@ -90,7 +90,7 @@ protected: // Protected Data - //- Optional local co-ordinate system and scaling + //- Optional local coordinate system and scaling coordinateScaling coordSys_; diff --git a/src/meshTools/PatchFunction1/PatchFunction1/patchFunction1Base.C b/src/meshTools/PatchFunction1/PatchFunction1/patchFunction1Base.C index d62c7d105b..0d7e5fbaae 100644 --- a/src/meshTools/PatchFunction1/PatchFunction1/patchFunction1Base.C +++ b/src/meshTools/PatchFunction1/PatchFunction1/patchFunction1Base.C @@ -84,7 +84,7 @@ Foam::patchFunction1Base::patchFunction1Base // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -const Foam::objectRegistry* Foam::patchFunction1Base::obrPtr() const +const Foam::objectRegistry* Foam::patchFunction1Base::whichDb() const { return &(patch_.boundaryMesh().mesh()); // mesh registry } diff --git a/src/meshTools/PatchFunction1/PatchFunction1/patchFunction1Base.H b/src/meshTools/PatchFunction1/PatchFunction1/patchFunction1Base.H index 826618336b..6efc2589d5 100644 --- a/src/meshTools/PatchFunction1/PatchFunction1/patchFunction1Base.H +++ b/src/meshTools/PatchFunction1/PatchFunction1/patchFunction1Base.H @@ -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. @@ -78,9 +78,6 @@ protected: // Protected Member Functions - //- Return the object registry (ie, the mesh) as pointer - const objectRegistry* obrPtr() const; - //- No copy assignment void operator=(const patchFunction1Base&) = delete; @@ -149,16 +146,14 @@ public: return (faceValues_ ? patch_.size() : patch_.nPoints()); } - //- Has an associated objectRegistry (ie, from mesh) - /// bool hasDb() const noexcept - /// { - /// return true; - /// } + + //- Return the associated registry (ie, the mesh) + const objectRegistry* whichDb() const; //- Return the object registry (ie, the mesh) const objectRegistry& obr() const; - //- False: not created with time + //- Return false: function not created with time database /// bool isTime() const noexcept /// { /// return false; diff --git a/src/meshTools/PatchFunction1/UniformValueField/UniformValueField.C b/src/meshTools/PatchFunction1/UniformValueField/UniformValueField.C index aabdc82bd6..aafc6abdc2 100644 --- a/src/meshTools/PatchFunction1/UniformValueField/UniformValueField.C +++ b/src/meshTools/PatchFunction1/UniformValueField/UniformValueField.C @@ -48,7 +48,7 @@ Foam::PatchFunction1Types::UniformValueField::UniformValueField entryName, dict, redirectType, - patchFunction1Base::obrPtr() // mesh registry + patchFunction1Base::whichDb() // mesh registry ) ) {} @@ -76,7 +76,7 @@ Foam::PatchFunction1Types::UniformValueField::UniformValueField { if (uniformValuePtr_) { - uniformValuePtr_->resetDb(patchFunction1Base::obrPtr()); + uniformValuePtr_->resetDb(patchFunction1Base::whichDb()); } } diff --git a/src/meshTools/PatchFunction1/UniformValueField/UniformValueField.H b/src/meshTools/PatchFunction1/UniformValueField/UniformValueField.H index b942323531..2daafafd47 100644 --- a/src/meshTools/PatchFunction1/UniformValueField/UniformValueField.H +++ b/src/meshTools/PatchFunction1/UniformValueField/UniformValueField.H @@ -67,6 +67,7 @@ class UniformValueField //- Source of uniform values (in local coordinate system) autoPtr> uniformValuePtr_; + public: // Runtime type information @@ -126,20 +127,24 @@ public: // Member Functions + //- Is value constant (i.e. independent of x) + virtual inline bool constant() const + { + return uniformValuePtr_ && uniformValuePtr_->constant(); + } + + //- Is value uniform (i.e. independent of coordinate) + virtual inline bool uniform() const + { + return PatchFunction1::uniform(); + } + + // Evaluation //- Return UniformValueField value virtual inline tmp> value(const scalar x) const; - //- Is value constant (i.e. independent of x) - virtual inline bool constant() const; - - //- Is value uniform (i.e. independent of coordinate) - virtual inline bool uniform() const - { - return PatchFunction1::uniform(); - } - //- Integrate between two values virtual inline tmp> integrate ( diff --git a/src/meshTools/PatchFunction1/UniformValueField/UniformValueFieldI.H b/src/meshTools/PatchFunction1/UniformValueField/UniformValueFieldI.H index c9093061fd..bdb297ee95 100644 --- a/src/meshTools/PatchFunction1/UniformValueField/UniformValueFieldI.H +++ b/src/meshTools/PatchFunction1/UniformValueField/UniformValueFieldI.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2020 OpenCFD Ltd. + Copyright (C) 2018-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -26,19 +26,10 @@ License \*---------------------------------------------------------------------------*/ #include "UniformValueField.H" -#include "SubField.H" -#include "Constant.H" +#include "Field.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -inline bool -Foam::PatchFunction1Types::UniformValueField::constant() const -{ - return uniformValuePtr_->type() == Function1Types::Constant::typeName; -} - - template inline Foam::tmp> Foam::PatchFunction1Types::UniformValueField::value diff --git a/src/meshTools/PatchFunction1/makePatchFunction1s.C b/src/meshTools/PatchFunction1/makePatchFunction1s.C index 53619a4e60..e445b5686b 100644 --- a/src/meshTools/PatchFunction1/makePatchFunction1s.C +++ b/src/meshTools/PatchFunction1/makePatchFunction1s.C @@ -30,6 +30,7 @@ License #include "ConstantField.H" #include "UniformValueField.H" #include "FunctionObjectValue.H" +#include "NoneFunction1.H" #include "MappedFile.H" #include "Table.H" #include "addToRunTimeSelectionTable.H" @@ -57,6 +58,14 @@ namespace Foam //- Option1 : add UniformFieldValue under the same name as Function1 // See makeFunction1s.C. Note that we do not need // Constant & Uniform + +/// Undecided if we actually need 'none': +/// addUniformValueFieldFunction1s(none, scalar); +/// addUniformValueFieldFunction1s(none, vector); +/// addUniformValueFieldFunction1s(none, sphericalTensor); +/// addUniformValueFieldFunction1s(none, symmTensor); +/// addUniformValueFieldFunction1s(none, tensor); + addUniformValueFieldFunction1s(zero, scalar); addUniformValueFieldFunction1s(zero, vector); addUniformValueFieldFunction1s(zero, sphericalTensor); diff --git a/src/rigidBodyDynamics/restraints/externalForce/externalForce.C b/src/rigidBodyDynamics/restraints/externalForce/externalForce.C index cc02dd14f0..26820cfc54 100644 --- a/src/rigidBodyDynamics/restraints/externalForce/externalForce.C +++ b/src/rigidBodyDynamics/restraints/externalForce/externalForce.C @@ -29,7 +29,6 @@ License #include "externalForce.H" #include "rigidBodyModel.H" #include "rigidBodyModelState.H" -#include "OneConstant.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/0.orig/U b/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/0.orig/U index 660ba748a4..ebe13c6d5d 100644 --- a/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/0.orig/U +++ b/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/0.orig/U @@ -68,7 +68,10 @@ boundaryField if (!baseVel) { - baseVel = Function1::New("timeFunction", dict); + baseVel = Function1::New + ( + "timeFunction", dict, &db() + ); } const bool verbose = dict.getOrDefault("verbose", false); @@ -76,7 +79,10 @@ boundaryField if (!baseDir && dict.found("directionFunction")) { // ie, NewIfPresent - baseDir = Function1::New("directionFunction", dict); + baseDir = Function1::New + ( + "directionFunction", dict, &db() + ); InfoErr << "Function1 for direction" << nl;