ENH: place more patch field attributes under template invariant Base
- attributes such as assignable(), coupled() etc - common patchField types: calculatedType(), zeroGradientType() etc. This simplifies reference to these types without actually needing a typed patchField version. ENH: add some basic patchField types to fieldTypes namespace - allows more general use of the names ENH: set extrapolated/calculated from patchInternalField directly - avoids intermediate tmp
This commit is contained in:
parent
bd1e1ec9c7
commit
87eed5e3b8
@ -105,7 +105,8 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
|
|||||||
|
|
||||||
if (!this->readValueEntry(dict))
|
if (!this->readValueEntry(dict))
|
||||||
{
|
{
|
||||||
fvPatchField<scalar>::operator=(patchInternalField());
|
// Fallback: set to the internal field
|
||||||
|
fvPatchField<scalar>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
refValue() = *this;
|
refValue() = *this;
|
||||||
|
@ -47,7 +47,7 @@ tractionDisplacementFvPatchVectorField
|
|||||||
traction_(p.size(), Zero),
|
traction_(p.size(), Zero),
|
||||||
pressure_(p.size(), Zero)
|
pressure_(p.size(), Zero)
|
||||||
{
|
{
|
||||||
fvPatchVectorField::operator=(patchInternalField());
|
fvPatchField<vector>::patchInternalField(*this);
|
||||||
gradient() = Zero;
|
gradient() = Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ tractionDisplacementFvPatchVectorField
|
|||||||
traction_("traction", dict, p.size()),
|
traction_("traction", dict, p.size()),
|
||||||
pressure_("pressure", dict, p.size())
|
pressure_("pressure", dict, p.size())
|
||||||
{
|
{
|
||||||
fvPatchVectorField::operator=(patchInternalField());
|
fvPatchField<vector>::patchInternalField(*this);
|
||||||
gradient() = Zero;
|
gradient() = Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ tractionDisplacementCorrectionFvPatchVectorField
|
|||||||
traction_(p.size(), Zero),
|
traction_(p.size(), Zero),
|
||||||
pressure_(p.size(), Zero)
|
pressure_(p.size(), Zero)
|
||||||
{
|
{
|
||||||
fvPatchVectorField::operator=(patchInternalField());
|
fvPatchField<vector>::patchInternalField(*this);
|
||||||
gradient() = Zero;
|
gradient() = Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ tractionDisplacementCorrectionFvPatchVectorField
|
|||||||
traction_("traction", dict, p.size()),
|
traction_("traction", dict, p.size()),
|
||||||
pressure_("pressure", dict, p.size())
|
pressure_("pressure", dict, p.size())
|
||||||
{
|
{
|
||||||
fvPatchVectorField::operator=(patchInternalField());
|
fvPatchField<vector>::patchInternalField(*this);
|
||||||
gradient() = Zero;
|
gradient() = Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,13 +53,13 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
"U",
|
"U",
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
mesh,
|
pMesh.thisDb(),
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
pMesh,
|
pMesh,
|
||||||
dimensionedVector(dimLength, Zero),
|
dimensionedVector(dimLength, Zero)
|
||||||
pointPatchVectorField::calculatedType()
|
// pointPatchFieldBase::calculatedType()
|
||||||
);
|
);
|
||||||
|
|
||||||
pointVectorField V(U + 2*U);
|
pointVectorField V(U + 2*U);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2018 OpenCFD Ltd.
|
Copyright (C) 2018-2023 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -42,4 +42,27 @@ const Foam::wordList Foam::fieldTypes::basic
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Commonly used patch field types
|
||||||
|
|
||||||
|
const Foam::word Foam::fieldTypes::emptyType
|
||||||
|
(
|
||||||
|
Foam::fieldTypes::emptyTypeName_()
|
||||||
|
);
|
||||||
|
|
||||||
|
const Foam::word Foam::fieldTypes::calculatedType
|
||||||
|
(
|
||||||
|
Foam::fieldTypes::calculatedTypeName_()
|
||||||
|
);
|
||||||
|
|
||||||
|
const Foam::word Foam::fieldTypes::extrapolatedCalculatedType
|
||||||
|
(
|
||||||
|
Foam::fieldTypes::extrapolatedCalculatedTypeName_()
|
||||||
|
);
|
||||||
|
|
||||||
|
const Foam::word Foam::fieldTypes::zeroGradientType
|
||||||
|
(
|
||||||
|
Foam::fieldTypes::zeroGradientTypeName_()
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2018 OpenCFD Ltd.
|
Copyright (C) 2018-2023 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -24,8 +24,15 @@ License
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Namespace
|
||||||
|
Foam::fieldTypes
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Header files for all the primitive types that Fields are instantiated for.
|
Collection of common field types
|
||||||
|
|
||||||
|
Note
|
||||||
|
The fieldTypes header contains macros for primitive types
|
||||||
|
that Fields are instantiated for.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -69,9 +76,40 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace fieldTypes
|
namespace fieldTypes
|
||||||
{
|
{
|
||||||
//- Standard basic field types (label, scalar, vector, tensor, etc)
|
|
||||||
// These also correspond to cloud output fields.
|
//- Standard basic field types (label, scalar, vector, tensor, etc)
|
||||||
extern const wordList basic;
|
// These also correspond to cloud output fields.
|
||||||
|
extern const wordList basic;
|
||||||
|
|
||||||
|
|
||||||
|
// Commonly used patch field types
|
||||||
|
|
||||||
|
//- An \c empty patch field type
|
||||||
|
inline const char* emptyTypeName_() noexcept { return "empty"; }
|
||||||
|
|
||||||
|
//- An \c empty patch field type
|
||||||
|
extern const word emptyType;
|
||||||
|
|
||||||
|
//- A \c calculated patch field type
|
||||||
|
inline const char* calculatedTypeName_() noexcept { return "calculated"; }
|
||||||
|
|
||||||
|
//- A \c calculated patch field type
|
||||||
|
extern const word calculatedType;
|
||||||
|
|
||||||
|
//- A combined \c zero-gradient and \c calculated patch field type
|
||||||
|
inline const char* extrapolatedCalculatedTypeName_() noexcept
|
||||||
|
{
|
||||||
|
return "extrapolatedCalculated";
|
||||||
|
}
|
||||||
|
|
||||||
|
//- A combined \c zero-gradient and \c calculated patch field type
|
||||||
|
extern const word extrapolatedCalculatedType;
|
||||||
|
|
||||||
|
//- A \c zeroGradient patch field type
|
||||||
|
inline const char* zeroGradientTypeName_() noexcept { return "zeroGradient"; }
|
||||||
|
|
||||||
|
//- A \c zeroGradient patch field type
|
||||||
|
extern const word zeroGradientType;
|
||||||
|
|
||||||
} // End namespace fieldTypes
|
} // End namespace fieldTypes
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
@ -28,15 +28,6 @@ License
|
|||||||
|
|
||||||
#include "calculatedPointPatchField.H"
|
#include "calculatedPointPatchField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
const Foam::word& Foam::pointPatchField<Type>::calculatedType()
|
|
||||||
{
|
|
||||||
return Foam::calculatedPointPatchField<Type>::typeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
|
@ -53,11 +53,10 @@ class calculatedPointPatchField
|
|||||||
:
|
:
|
||||||
public pointPatchField<Type>
|
public pointPatchField<Type>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("calculated");
|
TypeName("calculated"); // fieldTypes::calculatedTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
@ -139,18 +139,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- True: this patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
//- Return true if this patch field fixes a value
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member Operators
|
||||||
|
|
||||||
// Disable assignment operators
|
// Disable assignment operators
|
||||||
|
|
||||||
|
@ -27,15 +27,6 @@ License
|
|||||||
|
|
||||||
#include "zeroGradientPointPatchField.H"
|
#include "zeroGradientPointPatchField.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
const Foam::word& Foam::pointPatchField<Type>::zeroGradientType()
|
|
||||||
{
|
|
||||||
return Foam::zeroGradientPointPatchField<Type>::typeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
|
@ -56,7 +56,7 @@ class zeroGradientPointPatchField
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("zeroGradient");
|
TypeName("zeroGradient"); // fieldTypes::zeroGradientTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
@ -34,8 +34,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef emptyPointPatchField_H
|
#ifndef Foam_emptyPointPatchField_H
|
||||||
#define emptyPointPatchField_H
|
#define Foam_emptyPointPatchField_H
|
||||||
|
|
||||||
#include "pointPatchField.H"
|
#include "pointPatchField.H"
|
||||||
#include "emptyPointPatch.H"
|
#include "emptyPointPatch.H"
|
||||||
@ -54,11 +54,10 @@ class emptyPointPatchField
|
|||||||
:
|
:
|
||||||
public pointPatchField<Type>
|
public pointPatchField<Type>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName(emptyPointPatch::typeName_());
|
TypeName(emptyPointPatch::typeName_()); // fieldTypes::emptyTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2019-2022 OpenCFD Ltd.
|
Copyright (C) 2019-2023 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -140,8 +140,50 @@ public:
|
|||||||
virtual ~pointPatchFieldBase() = default;
|
virtual ~pointPatchFieldBase() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Static Member Functions
|
||||||
|
|
||||||
|
//- The type name for \c empty patch fields
|
||||||
|
static const word& emptyType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::emptyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- The type name for \c calculated patch fields
|
||||||
|
static const word& calculatedType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::calculatedType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- The type name for \c zeroGradient patch fields
|
||||||
|
static const word& zeroGradientType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::zeroGradientType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
|
||||||
|
//- True if the patch field fixes a value
|
||||||
|
virtual bool fixesValue() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- True if the patch field is coupled
|
||||||
|
virtual bool coupled() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- The constraint type the pointPatchField implements
|
||||||
|
virtual const word& constraintType() const
|
||||||
|
{
|
||||||
|
return word::null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- The associated objectRegistry
|
//- The associated objectRegistry
|
||||||
@ -366,34 +408,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- The type name for calculated patch fields
|
|
||||||
static const word& calculatedType();
|
|
||||||
|
|
||||||
//- The type name for zeroGradient patch fields
|
|
||||||
static const word& zeroGradientType();
|
|
||||||
|
|
||||||
|
|
||||||
// Attributes
|
|
||||||
|
|
||||||
//- True if this patch field fixes a value
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- True if this patch field is coupled
|
|
||||||
virtual bool coupled() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- The constraint type this pointPatchField implements.
|
|
||||||
virtual const word& constraintType() const
|
|
||||||
{
|
|
||||||
return word::null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return the patch size
|
//- Return the patch size
|
||||||
|
@ -56,7 +56,7 @@ Foam::fixedShearStressFvPatchVectorField::fixedShearStressFvPatchVectorField
|
|||||||
fixedValueFvPatchVectorField(p, iF, dict, IOobjectOption::NO_READ),
|
fixedValueFvPatchVectorField(p, iF, dict, IOobjectOption::NO_READ),
|
||||||
tau0_(dict.getOrDefault<vector>("tau", Zero))
|
tau0_(dict.getOrDefault<vector>("tau", Zero))
|
||||||
{
|
{
|
||||||
fvPatchField<vector>::operator=(patchInternalField());
|
fvPatchField<vector>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -366,7 +366,7 @@ epsilonWallFunctionFvPatchScalarField
|
|||||||
cornerWeights_()
|
cornerWeights_()
|
||||||
{
|
{
|
||||||
// Apply zero-gradient condition on start-up
|
// Apply zero-gradient condition on start-up
|
||||||
this->operator==(patchInternalField());
|
fvPatchField<scalar>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -359,7 +359,7 @@ Foam::omegaWallFunctionFvPatchScalarField::omegaWallFunctionFvPatchScalarField
|
|||||||
cornerWeights_()
|
cornerWeights_()
|
||||||
{
|
{
|
||||||
// apply zero-gradient condition on start-up
|
// apply zero-gradient condition on start-up
|
||||||
this->operator==(patchInternalField());
|
fvPatchField<scalar>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -114,8 +114,8 @@ atmTurbulentHeatFluxTemperatureFvPatchScalarField
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fvPatchField<scalar>::operator=(patchInternalField());
|
fvPatchField<scalar>::patchInternalField(*this);
|
||||||
gradient() = 0.0;
|
gradient() = Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ freeSurfaceVelocityFvPatchVectorField
|
|||||||
fixedGradientFvPatchVectorField(p, iF)
|
fixedGradientFvPatchVectorField(p, iF)
|
||||||
{
|
{
|
||||||
fvPatchFieldBase::readDict(dict);
|
fvPatchFieldBase::readDict(dict);
|
||||||
fvPatchVectorField::operator=(patchInternalField());
|
fvPatchField<vector>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,15 +29,6 @@ License
|
|||||||
#include "calculatedFaPatchField.H"
|
#include "calculatedFaPatchField.H"
|
||||||
#include "faPatchFieldMapper.H"
|
#include "faPatchFieldMapper.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
const Foam::word& Foam::faPatchField<Type>::calculatedType()
|
|
||||||
{
|
|
||||||
return Foam::calculatedFaPatchField<Type>::typeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
|
@ -60,7 +60,7 @@ class calculatedFaPatchField
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("calculated");
|
TypeName("calculated"); // fieldTypes::calculatedTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -126,17 +126,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- True: this patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
//- Return true if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
@ -54,7 +54,8 @@ extrapolatedCalculatedFaPatchField
|
|||||||
:
|
:
|
||||||
calculatedFaPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
calculatedFaPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
||||||
{
|
{
|
||||||
calculatedFaPatchField<Type>::operator==(this->patchInternalField());
|
// Set to the internal field
|
||||||
|
faPatchField<Type>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@ public:
|
|||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("extrapolatedCalculated");
|
TypeName("extrapolatedCalculated");
|
||||||
|
// fieldTypes::extrapolatedCalculatedTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
@ -127,17 +127,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- True: this patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
//- Return true if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
@ -164,17 +164,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- True: the patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
//- Return true if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Return defining fields
|
// Return defining fields
|
||||||
|
@ -139,12 +139,10 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
|
||||||
|
|
||||||
//- True: this patch field fixes a value.
|
//- True: this patch field fixes a value.
|
||||||
virtual bool fixesValue() const { return true; }
|
virtual bool fixesValue() const { return true; }
|
||||||
|
|
||||||
//- False: this patch field is not altered by assignment
|
//- False: this patch field is not altered by assignment.
|
||||||
virtual bool assignable() const { return false; }
|
virtual bool assignable() const { return false; }
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,15 +28,6 @@ License
|
|||||||
#include "zeroGradientFaPatchField.H"
|
#include "zeroGradientFaPatchField.H"
|
||||||
#include "faPatchFieldMapper.H"
|
#include "faPatchFieldMapper.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
const Foam::word& Foam::faPatchField<Type>::zeroGradientType()
|
|
||||||
{
|
|
||||||
return Foam::zeroGradientFaPatchField<Type>::typeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -109,7 +100,8 @@ void Foam::zeroGradientFaPatchField<Type>::evaluate(const Pstream::commsTypes)
|
|||||||
this->updateCoeffs();
|
this->updateCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
this->operator==(this->patchInternalField());
|
// Set to the internal field
|
||||||
|
faPatchField<Type>::patchInternalField(*this);
|
||||||
faPatchField<Type>::evaluate();
|
faPatchField<Type>::evaluate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,8 +38,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef zeroGradientFaPatchField_H
|
#ifndef Foam_zeroGradientFaPatchField_H
|
||||||
#define zeroGradientFaPatchField_H
|
#define Foam_zeroGradientFaPatchField_H
|
||||||
|
|
||||||
#include "faPatchField.H"
|
#include "faPatchField.H"
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ class zeroGradientFaPatchField
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("zeroGradient");
|
TypeName("zeroGradient"); // fieldTypes::zeroGradientTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -132,16 +132,14 @@ public:
|
|||||||
//- Return gradient at boundary
|
//- Return gradient at boundary
|
||||||
virtual tmp<Field<Type>> snGrad() const
|
virtual tmp<Field<Type>> snGrad() const
|
||||||
{
|
{
|
||||||
return tmp<Field<Type>>
|
return tmp<Field<Type>>::New(this->size(), Zero);
|
||||||
(
|
|
||||||
new Field<Type>(this->size(), Zero)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Evaluate the patch field
|
//- Evaluate the patch field
|
||||||
virtual void evaluate
|
virtual void evaluate
|
||||||
(
|
(
|
||||||
const Pstream::commsTypes commsType = Pstream::commsTypes::blocking
|
const Pstream::commsTypes commsType =
|
||||||
|
Pstream::commsTypes::blocking
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Return the matrix diagonal coefficients corresponding to the
|
//- Return the matrix diagonal coefficients corresponding to the
|
||||||
|
@ -58,7 +58,8 @@ clampedPlateFaPatchField<Type>::clampedPlateFaPatchField
|
|||||||
:
|
:
|
||||||
faPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
faPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
||||||
{
|
{
|
||||||
faPatchField<Type>::operator=(this->patchInternalField());
|
// Set to the internal field
|
||||||
|
faPatchField<Type>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,17 +125,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- True: the patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
//- Return true if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
@ -145,8 +145,53 @@ public:
|
|||||||
virtual ~faPatchFieldBase() = default;
|
virtual ~faPatchFieldBase() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Static Member Functions
|
||||||
|
|
||||||
|
//- The type name for \c empty patch fields
|
||||||
|
static const word& emptyType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::emptyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- The type name for \c calculated patch fields
|
||||||
|
static const word& calculatedType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::calculatedType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- The type name for \c extrapolatedCalculated patch fields
|
||||||
|
//- combines \c zero-gradient and \c calculated
|
||||||
|
static const word& extrapolatedCalculatedType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::extrapolatedCalculatedType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- The type name for \c zeroGradient patch fields
|
||||||
|
static const word& zeroGradientType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::zeroGradientType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
|
||||||
|
//- True if the patch field fixes a value.
|
||||||
|
// Needed to check if a level has to be specified while solving
|
||||||
|
// Poissons equations.
|
||||||
|
virtual bool fixesValue() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- True if the patch field is coupled
|
||||||
|
virtual bool coupled() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- The associated objectRegistry
|
//- The associated objectRegistry
|
||||||
@ -411,30 +456,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- The type name for calculated patch fields
|
|
||||||
static const word& calculatedType();
|
|
||||||
|
|
||||||
//- The type name for zeroGradient patch fields
|
|
||||||
static const word& zeroGradientType();
|
|
||||||
|
|
||||||
|
|
||||||
// Attributes
|
|
||||||
|
|
||||||
//- True if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- True if this patch field is coupled
|
|
||||||
virtual bool coupled() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return const-reference to the dimensioned internal field
|
//- Return const-reference to the dimensioned internal field
|
||||||
|
@ -29,15 +29,6 @@ License
|
|||||||
#include "calculatedFaePatchField.H"
|
#include "calculatedFaePatchField.H"
|
||||||
#include "faPatchFieldMapper.H"
|
#include "faPatchFieldMapper.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
const Foam::word& Foam::faePatchField<Type>::calculatedType()
|
|
||||||
{
|
|
||||||
return Foam::calculatedFaePatchField<Type>::typeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
|
@ -60,7 +60,7 @@ class calculatedFaePatchField
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("calculated");
|
TypeName("calculated"); // fieldTypes::calculatedTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -128,16 +128,11 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- True: the patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
|
|
||||||
//- Return true if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Other
|
||||||
|
|
||||||
//- Write
|
//- Write
|
||||||
virtual void write(Ostream&) const;
|
virtual void write(Ostream&) const;
|
||||||
|
@ -130,24 +130,19 @@ public:
|
|||||||
virtual ~fixedValueFaePatchField() = default;
|
virtual ~fixedValueFaePatchField() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- True: this patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
|
|
||||||
//- Return true if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Other
|
||||||
|
|
||||||
//- Write
|
//- Write
|
||||||
virtual void write(Ostream&) const;
|
virtual void write(Ostream&) const;
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member Operators
|
||||||
|
|
||||||
virtual void operator=(const UList<Type>&) {}
|
virtual void operator=(const UList<Type>&) {}
|
||||||
|
|
||||||
|
@ -132,8 +132,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
|
||||||
|
|
||||||
//- True: this patch field fixes a value.
|
//- True: this patch field fixes a value.
|
||||||
virtual bool fixesValue() const { return true; }
|
virtual bool fixesValue() const { return true; }
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class emptyFaePatchField
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("empty");
|
TypeName(emptyFaPatch::typeName_()); // fieldTypes::emptyTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
@ -131,8 +131,40 @@ public:
|
|||||||
virtual ~faePatchFieldBase() = default;
|
virtual ~faePatchFieldBase() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Static Member Functions
|
||||||
|
|
||||||
|
//- The type name for \c empty patch fields
|
||||||
|
static const word& emptyType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::emptyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- The type name for \c calculated patch fields
|
||||||
|
static const word& calculatedType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::calculatedType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
|
||||||
|
//- True if the patch field fixes a value.
|
||||||
|
// Needed to check if a level has to be specified while solving
|
||||||
|
// Poissons equations.
|
||||||
|
virtual bool fixesValue() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- True if the patch field is coupled
|
||||||
|
virtual bool coupled() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- The associated objectRegistry
|
//- The associated objectRegistry
|
||||||
@ -390,27 +422,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- The type name for calculated patch fields
|
|
||||||
static const word& calculatedType();
|
|
||||||
|
|
||||||
|
|
||||||
// Attributes
|
|
||||||
|
|
||||||
//- True if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- True if this patch field is coupled
|
|
||||||
virtual bool coupled() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return const-reference to the dimensioned internal field
|
//- Return const-reference to the dimensioned internal field
|
||||||
|
@ -29,15 +29,6 @@ License
|
|||||||
#include "calculatedFvPatchField.H"
|
#include "calculatedFvPatchField.H"
|
||||||
#include "fvPatchFieldMapper.H"
|
#include "fvPatchFieldMapper.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
const Foam::word& Foam::fvPatchField<Type>::calculatedType()
|
|
||||||
{
|
|
||||||
return Foam::calculatedFvPatchField<Type>::typeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
|
@ -69,11 +69,10 @@ class calculatedFvPatchField
|
|||||||
:
|
:
|
||||||
public fvPatchField<Type>
|
public fvPatchField<Type>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("calculated");
|
TypeName("calculated"); // fieldTypes::calculatedTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -154,17 +153,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
//- Return true if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
@ -130,23 +130,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
|
|
||||||
//- Return true: this patch field fixes a value.
|
//- False: this patch field is not altered by assignment.
|
||||||
// Needed to check if a level has to be specified while solving
|
virtual bool assignable() const { return false; }
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return false: this patch field is not altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Mapping functions
|
// Mapping functions
|
||||||
|
@ -54,7 +54,8 @@ extrapolatedCalculatedFvPatchField
|
|||||||
:
|
:
|
||||||
calculatedFvPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
calculatedFvPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
||||||
{
|
{
|
||||||
calculatedFvPatchField<Type>::operator==(this->patchInternalField());
|
// Set to the internal field
|
||||||
|
fvPatchField<Type>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -108,7 +109,8 @@ void Foam::extrapolatedCalculatedFvPatchField<Type>::evaluate
|
|||||||
this->updateCoeffs();
|
this->updateCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
calculatedFvPatchField<Type>::operator==(this->patchInternalField());
|
// Set to the internal field
|
||||||
|
fvPatchField<Type>::patchInternalField(*this);
|
||||||
calculatedFvPatchField<Type>::evaluate();
|
calculatedFvPatchField<Type>::evaluate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ public:
|
|||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("extrapolatedCalculated");
|
TypeName("extrapolatedCalculated");
|
||||||
|
// fieldTypes::extrapolatedCalculatedTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
@ -166,23 +166,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
|
|
||||||
//- Return true if this patch field fixes a value.
|
//- False: this patch field is not altered by assignment.
|
||||||
// Needed to check if a level has to be specified while solving
|
virtual bool assignable() const { return false; }
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return false: this patch field is not altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
@ -188,23 +188,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- True: this patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
|
|
||||||
//- Return true if this patch field fixes a value.
|
//- False: this patch field is not altered by assignment.
|
||||||
// Needed to check if a level has to be specified while solving
|
virtual bool assignable() const { return false; }
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return false: this patch field is not altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Return defining fields
|
// Return defining fields
|
||||||
|
@ -136,23 +136,13 @@ public:
|
|||||||
virtual ~slicedFvPatchField<Type>();
|
virtual ~slicedFvPatchField<Type>();
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
|
|
||||||
//- Return true if this patch field fixes a value.
|
//- False: this patch field is not altered by assignment.
|
||||||
// Needed to check if a level has to be specified while solving
|
virtual bool assignable() const { return false; }
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return false: this patch field is not altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
@ -113,16 +113,10 @@ public:
|
|||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment.
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true if the value of the patch field
|
|
||||||
// is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
@ -28,16 +28,6 @@ License
|
|||||||
#include "zeroGradientFvPatchField.H"
|
#include "zeroGradientFvPatchField.H"
|
||||||
#include "fvPatchFieldMapper.H"
|
#include "fvPatchFieldMapper.H"
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
const Foam::word& Foam::fvPatchField<Type>::zeroGradientType()
|
|
||||||
{
|
|
||||||
return zeroGradientFvPatchField<Type>::typeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -61,7 +51,8 @@ Foam::zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
|
|||||||
:
|
:
|
||||||
fvPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
fvPatchField<Type>(p, iF, dict, IOobjectOption::NO_READ)
|
||||||
{
|
{
|
||||||
fvPatchField<Type>::operator=(this->patchInternalField());
|
// Set to the internal field
|
||||||
|
fvPatchField<Type>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -109,7 +100,8 @@ void Foam::zeroGradientFvPatchField<Type>::evaluate(const Pstream::commsTypes)
|
|||||||
this->updateCoeffs();
|
this->updateCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
fvPatchField<Type>::operator==(this->patchInternalField());
|
// Set to the internal field
|
||||||
|
fvPatchField<Type>::patchInternalField(*this);
|
||||||
fvPatchField<Type>::evaluate();
|
fvPatchField<Type>::evaluate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef zeroGradientFvPatchField_H
|
#ifndef Foam_zeroGradientFvPatchField_H
|
||||||
#define zeroGradientFvPatchField_H
|
#define Foam_zeroGradientFvPatchField_H
|
||||||
|
|
||||||
#include "fvPatchField.H"
|
#include "fvPatchField.H"
|
||||||
|
|
||||||
@ -66,11 +66,10 @@ class zeroGradientFvPatchField
|
|||||||
:
|
:
|
||||||
public fvPatchField<Type>
|
public fvPatchField<Type>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("zeroGradient");
|
TypeName("zeroGradient"); // fieldTypes::zeroGradientTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -142,10 +141,7 @@ public:
|
|||||||
//- Return gradient at boundary
|
//- Return gradient at boundary
|
||||||
virtual tmp<Field<Type>> snGrad() const
|
virtual tmp<Field<Type>> snGrad() const
|
||||||
{
|
{
|
||||||
return tmp<Field<Type>>
|
return tmp<Field<Type>>::New(this->size(), Zero);
|
||||||
(
|
|
||||||
new Field<Type>(this->size(), Zero)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Evaluate the patch field
|
//- Evaluate the patch field
|
||||||
|
@ -77,7 +77,7 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fvPatchField<Type>::operator=(this->patchInternalField());
|
fvPatchField<Type>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,8 +49,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef emptyFvPatchField_H
|
#ifndef Foam_emptyFvPatchField_H
|
||||||
#define emptyFvPatchField_H
|
#define Foam_emptyFvPatchField_H
|
||||||
|
|
||||||
#include "fvPatchField.H"
|
#include "fvPatchField.H"
|
||||||
#include "emptyFvPatch.H"
|
#include "emptyFvPatch.H"
|
||||||
@ -69,11 +69,10 @@ class emptyFvPatchField
|
|||||||
:
|
:
|
||||||
public fvPatchField<Type>
|
public fvPatchField<Type>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName(emptyFvPatch::typeName_());
|
TypeName(emptyFvPatch::typeName_()); // fieldTypes::emptyTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
@ -89,7 +89,7 @@ Foam::processorFvPatchField<Type>::processorFvPatchField
|
|||||||
// Use 'value' supplied, or set to internal field
|
// Use 'value' supplied, or set to internal field
|
||||||
if (!this->readValueEntry(dict))
|
if (!this->readValueEntry(dict))
|
||||||
{
|
{
|
||||||
fvPatchField<Type>::operator=(this->patchInternalField());
|
fvPatchField<Type>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ Foam::advectiveFvPatchField<Type>::advectiveFvPatchField
|
|||||||
// Use 'value' supplied, or set to internal field
|
// Use 'value' supplied, or set to internal field
|
||||||
if (!this->readValueEntry(dict))
|
if (!this->readValueEntry(dict))
|
||||||
{
|
{
|
||||||
fvPatchField<Type>::operator=(this->patchInternalField());
|
fvPatchField<Type>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->refValue() = *this;
|
this->refValue() = *this;
|
||||||
|
@ -189,7 +189,7 @@ Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
|
|||||||
if (!this->readValueEntry(dict))
|
if (!this->readValueEntry(dict))
|
||||||
{
|
{
|
||||||
// Assign dummy value to get redirectPatchField not fail
|
// Assign dummy value to get redirectPatchField not fail
|
||||||
this->operator==(this->patchInternalField());
|
fvPatchField<Type>::patchInternalField(*this);
|
||||||
|
|
||||||
this->evaluate(Pstream::commsTypes::blocking);
|
this->evaluate(Pstream::commsTypes::blocking);
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,7 @@ electrostaticDepositionFvPatchScalarField
|
|||||||
{
|
{
|
||||||
if (!this->readValueEntry(dict))
|
if (!this->readValueEntry(dict))
|
||||||
{
|
{
|
||||||
fvPatchScalarField::operator=(patchInternalField());
|
fvPatchField<scalar>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If flow is multiphase
|
// If flow is multiphase
|
||||||
|
@ -65,7 +65,7 @@ Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fvPatchField<scalar>::operator=(patchInternalField());
|
fvPatchField<scalar>::patchInternalField(*this);
|
||||||
gradient() = Zero;
|
gradient() = Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -188,15 +188,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment.
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
@ -178,13 +178,11 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- False: this patch field is not altered by assignment.
|
||||||
|
virtual bool assignable() const { return false; }
|
||||||
|
|
||||||
//- This patch field is not altered by assignment
|
|
||||||
virtual bool assignable() const
|
// Access
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- User-defined input field (modifiable field)
|
//- User-defined input field (modifiable field)
|
||||||
virtual Field<Type>& fixedValue()
|
virtual Field<Type>& fixedValue()
|
||||||
|
@ -75,7 +75,7 @@ fluxCorrectedVelocityFvPatchVectorField
|
|||||||
rhoName_(dict.getOrDefault<word>("rho", "rho"))
|
rhoName_(dict.getOrDefault<word>("rho", "rho"))
|
||||||
{
|
{
|
||||||
fvPatchFieldBase::readDict(dict);
|
fvPatchFieldBase::readDict(dict);
|
||||||
fvPatchVectorField::operator=(patchInternalField());
|
fvPatchField<vector>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -166,13 +166,8 @@ public:
|
|||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment.
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
//- Update the coefficients associated with the patch field
|
||||||
|
@ -170,7 +170,8 @@ outletMappedUniformInletFvPatchField
|
|||||||
|
|
||||||
if (!this->readValueEntry(dict))
|
if (!this->readValueEntry(dict))
|
||||||
{
|
{
|
||||||
fvPatchField<Type>::operator=(this->patchInternalField());
|
// Fallback: set to the internal field
|
||||||
|
fvPatchField<Type>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,7 +204,8 @@ outletMappedUniformInletFvPatchField
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fvPatchField<Type>::operator=(this->patchInternalField());
|
// Fallback: set to the internal field
|
||||||
|
fvPatchField<Type>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ Foam::outletPhaseMeanVelocityFvPatchVectorField
|
|||||||
|
|
||||||
if (!this->readValueEntry(dict))
|
if (!this->readValueEntry(dict))
|
||||||
{
|
{
|
||||||
fvPatchVectorField::operator=(patchInternalField());
|
fvPatchField<vector>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,13 +166,10 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access/attributes
|
//- False: this patch field is not altered by assignment
|
||||||
|
virtual bool assignable() const { return false; }
|
||||||
|
|
||||||
//- This patch field is not altered by assignment
|
// Access
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual Field<Type>& refValue()
|
virtual Field<Type>& refValue()
|
||||||
{
|
{
|
||||||
|
@ -184,15 +184,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
@ -176,15 +176,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
@ -172,15 +172,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
|
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
|
@ -172,15 +172,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
@ -162,15 +162,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
@ -137,15 +137,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
//- Update the coefficients associated with the patch field
|
||||||
|
@ -155,15 +155,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
@ -171,15 +171,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
@ -194,13 +194,8 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
@ -76,7 +76,7 @@ supersonicFreestreamFvPatchVectorField
|
|||||||
|
|
||||||
if (!this->readValueEntry(dict))
|
if (!this->readValueEntry(dict))
|
||||||
{
|
{
|
||||||
fvPatchField<vector>::operator=(patchInternalField());
|
fvPatchField<vector>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
refValue() = *this;
|
refValue() = *this;
|
||||||
|
@ -169,13 +169,8 @@ public:
|
|||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Mapping functions
|
// Mapping functions
|
||||||
|
@ -82,13 +82,14 @@ Foam::variableHeightFlowRateFvPatchScalarField
|
|||||||
upperBound_(dict.get<scalar>("upperBound"))
|
upperBound_(dict.get<scalar>("upperBound"))
|
||||||
{
|
{
|
||||||
fvPatchFieldBase::readDict(dict);
|
fvPatchFieldBase::readDict(dict);
|
||||||
this->refValue() = 0.0;
|
|
||||||
|
|
||||||
if (!this->readValueEntry(dict))
|
if (!this->readValueEntry(dict))
|
||||||
{
|
{
|
||||||
fvPatchScalarField::operator=(this->patchInternalField());
|
// Fallback: set to the internal field
|
||||||
|
fvPatchField<scalar>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->refValue() = 0.0;
|
||||||
this->refGrad() = 0.0;
|
this->refGrad() = 0.0;
|
||||||
this->valueFraction() = 0.0;
|
this->valueFraction() = 0.0;
|
||||||
}
|
}
|
||||||
|
@ -169,7 +169,7 @@ Foam::fvPatchField<Type>::fvPatchField
|
|||||||
// For unmapped faces set to internal field value (zero-gradient)
|
// For unmapped faces set to internal field value (zero-gradient)
|
||||||
if (notNull(iF) && mapper.hasUnmapped())
|
if (notNull(iF) && mapper.hasUnmapped())
|
||||||
{
|
{
|
||||||
fvPatchField<Type>::operator=(this->patchInternalField());
|
fvPatchField<Type>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
this->map(ptf, mapper);
|
this->map(ptf, mapper);
|
||||||
}
|
}
|
||||||
@ -241,7 +241,7 @@ void Foam::fvPatchField<Type>::autoMap
|
|||||||
|
|
||||||
if (!this->size() && !mapper.distributed())
|
if (!this->size() && !mapper.distributed())
|
||||||
{
|
{
|
||||||
f.setSize(mapper.size());
|
f.resize_nocopy(mapper.size());
|
||||||
if (f.size())
|
if (f.size())
|
||||||
{
|
{
|
||||||
f = this->patchInternalField();
|
f = this->patchInternalField();
|
||||||
|
@ -154,8 +154,59 @@ public:
|
|||||||
virtual ~fvPatchFieldBase() = default;
|
virtual ~fvPatchFieldBase() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Static Member Functions
|
||||||
|
|
||||||
|
//- The type name for \c empty patch fields
|
||||||
|
static const word& emptyType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::emptyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- The type name for \c calculated patch fields
|
||||||
|
static const word& calculatedType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::calculatedType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- The type name for \c extrapolatedCalculated patch fields
|
||||||
|
//- combines \c zero-gradient and \c calculated
|
||||||
|
static const word& extrapolatedCalculatedType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::extrapolatedCalculatedType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- The type name for \c zeroGradient patch fields
|
||||||
|
static const word& zeroGradientType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::zeroGradientType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
|
||||||
|
//- True if the value of the patch field is altered by assignment
|
||||||
|
virtual bool assignable() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- True if the patch field fixes a value.
|
||||||
|
// Needed to check if a level has to be specified while solving
|
||||||
|
// Poissons equations.
|
||||||
|
virtual bool fixesValue() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- True if the patch field is coupled
|
||||||
|
virtual bool coupled() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- The associated objectRegistry
|
//- The associated objectRegistry
|
||||||
@ -473,37 +524,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- The type name for calculated patch fields
|
|
||||||
static const word& calculatedType();
|
|
||||||
|
|
||||||
//- The type name for zeroGradient patch fields
|
|
||||||
static const word& zeroGradientType();
|
|
||||||
|
|
||||||
|
|
||||||
// Attributes
|
|
||||||
|
|
||||||
//- True if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- True if the value of the patch field
|
|
||||||
//- is altered by assignment (the default)
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- True if this patch field is coupled
|
|
||||||
virtual bool coupled() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return const-reference to the dimensioned internal field
|
//- Return const-reference to the dimensioned internal field
|
||||||
|
@ -29,14 +29,6 @@ License
|
|||||||
#include "calculatedFvsPatchField.H"
|
#include "calculatedFvsPatchField.H"
|
||||||
#include "fvPatchFieldMapper.H"
|
#include "fvPatchFieldMapper.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
const Foam::word& Foam::fvsPatchField<Type>::calculatedType()
|
|
||||||
{
|
|
||||||
return Foam::calculatedFvsPatchField<Type>::typeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
|
@ -34,8 +34,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef calculatedFvsPatchField_H
|
#ifndef Foam_calculatedFvsPatchField_H
|
||||||
#define calculatedFvsPatchField_H
|
#define Foam_calculatedFvsPatchField_H
|
||||||
|
|
||||||
#include "fvsPatchField.H"
|
#include "fvsPatchField.H"
|
||||||
|
|
||||||
@ -53,11 +53,10 @@ class calculatedFvsPatchField
|
|||||||
:
|
:
|
||||||
public fvsPatchField<Type>
|
public fvsPatchField<Type>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("calculated");
|
TypeName("calculated"); // fieldTypes::calculatedTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -121,17 +120,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- True: this patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
//- Return true if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -122,17 +122,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- True: this patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
//- Return true if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
// Evaluation functions
|
||||||
|
@ -130,20 +130,13 @@ public:
|
|||||||
virtual ~slicedFvsPatchField<Type>();
|
virtual ~slicedFvsPatchField<Type>();
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
//- True: this patch field fixes a value.
|
||||||
|
virtual bool fixesValue() const { return true; }
|
||||||
//- Return true if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member Operators
|
||||||
|
|
||||||
virtual void operator=(const UList<Type>&) {}
|
virtual void operator=(const UList<Type>&) {}
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef emptyFvsPatchField_H
|
#ifndef Foam_emptyFvsPatchField_H
|
||||||
#define emptyFvsPatchField_H
|
#define Foam_emptyFvsPatchField_H
|
||||||
|
|
||||||
#include "fvsPatchField.H"
|
#include "fvsPatchField.H"
|
||||||
#include "emptyFvPatch.H"
|
#include "emptyFvPatch.H"
|
||||||
@ -54,11 +54,10 @@ class emptyFvsPatchField
|
|||||||
:
|
:
|
||||||
public fvsPatchField<Type>
|
public fvsPatchField<Type>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName(emptyFvPatch::typeName_());
|
TypeName(emptyFvPatch::typeName_()); // fieldTypes::emptyTypeName_()
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
@ -126,8 +126,40 @@ public:
|
|||||||
virtual ~fvsPatchFieldBase() = default;
|
virtual ~fvsPatchFieldBase() = default;
|
||||||
|
|
||||||
|
|
||||||
|
// Static Member Functions
|
||||||
|
|
||||||
|
//- The type name for \c empty patch fields
|
||||||
|
static const word& emptyType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::emptyType;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- The type name for \c calculated patch fields
|
||||||
|
static const word& calculatedType() noexcept
|
||||||
|
{
|
||||||
|
return Foam::fieldTypes::calculatedType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
// Attributes
|
||||||
|
|
||||||
|
//- True if the patch field fixes a value.
|
||||||
|
// Needed to check if a level has to be specified while solving
|
||||||
|
// Poissons equations.
|
||||||
|
virtual bool fixesValue() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//- True if the patch field is coupled
|
||||||
|
virtual bool coupled() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- The associated objectRegistry
|
//- The associated objectRegistry
|
||||||
@ -403,27 +435,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- The type name for calculated patch fields
|
|
||||||
static const word& calculatedType();
|
|
||||||
|
|
||||||
|
|
||||||
// Attributes
|
|
||||||
|
|
||||||
//- True if this patch field fixes a value.
|
|
||||||
// Needed to check if a level has to be specified while solving
|
|
||||||
// Poissons equations.
|
|
||||||
virtual bool fixesValue() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- True if this patch field is coupled
|
|
||||||
virtual bool coupled() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return const-reference to the dimensioned internal field
|
//- Return const-reference to the dimensioned internal field
|
||||||
|
@ -24,11 +24,8 @@ License
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Namespace
|
|
||||||
Foam::fieldTypes
|
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Collection of common field types
|
Forwards and collection of common volume field types
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
volFields.C
|
volFields.C
|
||||||
|
@ -160,7 +160,7 @@ externalCoupledTemperatureMixedFvPatchScalarField
|
|||||||
// or extrapolated value
|
// or extrapolated value
|
||||||
if (!this->readValueEntry(dict))
|
if (!this->readValueEntry(dict))
|
||||||
{
|
{
|
||||||
fvPatchField<scalar>::operator=(this->patchInternalField());
|
fvPatchField<scalar>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialise as a fixed value
|
// Initialise as a fixed value
|
||||||
|
@ -113,7 +113,7 @@ Foam::oversetFvPatchField<Type>::oversetFvPatchField
|
|||||||
// Use 'value' supplied, or set to internal field
|
// Use 'value' supplied, or set to internal field
|
||||||
if (!this->readValueEntry(dict))
|
if (!this->readValueEntry(dict))
|
||||||
{
|
{
|
||||||
Field<Type>::operator=(this->patchInternalField());
|
fvPatchField<Type>::patchInternalField(*this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,15 +176,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
// Attributes
|
//- True: this patch field is altered by assignment
|
||||||
|
virtual bool assignable() const { return true; }
|
||||||
//- Return true: this patch field is altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
@ -86,8 +86,8 @@ fixedIncidentRadiationFvPatchScalarField
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Still reading so cannot yet evaluate. Make up a value.
|
// Still reading so cannot yet evaluate. Make up a value.
|
||||||
fvPatchField<scalar>::operator=(patchInternalField());
|
fvPatchField<scalar>::patchInternalField(*this);
|
||||||
gradient() = 0.0;
|
gradient() = Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,8 +311,9 @@ sorptionWallFunctionFvPatchScalarField::sorptionWallFunctionFvPatchScalarField
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fvPatchField<scalar>::operator=(patchInternalField());
|
// Fallback: set to zero-gradient
|
||||||
gradient() = 0.0;
|
fvPatchField<scalar>::patchInternalField(*this);
|
||||||
|
gradient() = Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,8 @@ alphaContactAngleTwoPhaseFvPatchScalarField
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fvPatchField<scalar>::operator=(patchInternalField());
|
// Fallback: set to zero-gradient
|
||||||
|
fvPatchField<scalar>::patchInternalField(*this);
|
||||||
gradient() = Zero;
|
gradient() = Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user