mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: change uniformGradient from Function1 to PatchFunction1
This commit is contained in:
@ -38,7 +38,7 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
|
||||
)
|
||||
:
|
||||
fixedGradientFvPatchField<Type>(p, iF),
|
||||
uniformGradient_()
|
||||
uniformGradient_(nullptr)
|
||||
{}
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
|
||||
)
|
||||
:
|
||||
fixedGradientFvPatchField<Type>(p, iF, fld),
|
||||
uniformGradient_()
|
||||
uniformGradient_(nullptr)
|
||||
{}
|
||||
|
||||
|
||||
@ -64,7 +64,10 @@ Foam::uniformFixedGradientFvPatchField<Type>::uniformFixedGradientFvPatchField
|
||||
)
|
||||
:
|
||||
fixedGradientFvPatchField<Type>(p, iF),
|
||||
uniformGradient_(Function1<Type>::New("uniformGradient", dict))
|
||||
uniformGradient_
|
||||
(
|
||||
PatchFunction1<Type>::New(p.patch(), "uniformGradient", dict)
|
||||
)
|
||||
{
|
||||
this->patchType() = dict.getOrDefault<word>("patchType", word::null);
|
||||
this->evaluate();
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -34,8 +35,8 @@ Description
|
||||
|
||||
Usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
uniformGradient | uniform gradient | yes |
|
||||
Property | Description | Required | Default
|
||||
uniformGradient | uniform gradient | yes |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -48,9 +49,9 @@ Usage
|
||||
\endverbatim
|
||||
|
||||
Note
|
||||
The uniformGradient entry is a Function1 type, able to describe time
|
||||
varying functions. The example above gives the usage for supplying a
|
||||
constant value.
|
||||
The uniformGradient entry is a PatchFunction1 type,
|
||||
able to describe time and spatial varying functions.
|
||||
The example above gives the usage for supplying a constant value.
|
||||
|
||||
See also
|
||||
Foam::Function1Types
|
||||
@ -65,7 +66,7 @@ SourceFiles
|
||||
#define uniformFixedGradientFvPatchField_H
|
||||
|
||||
#include "fixedGradientFvPatchFields.H"
|
||||
#include "Function1.H"
|
||||
#include "PatchFunction1.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -81,10 +82,10 @@ class uniformFixedGradientFvPatchField
|
||||
:
|
||||
public fixedGradientFvPatchField<Type>
|
||||
{
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
//- Gradient
|
||||
autoPtr<Function1<Type>> uniformGradient_;
|
||||
autoPtr<PatchFunction1<Type>> uniformGradient_;
|
||||
|
||||
|
||||
public:
|
||||
@ -118,8 +119,7 @@ public:
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given uniformFixedGradientFvPatchField
|
||||
// onto a new patch
|
||||
//- Construct by mapping onto a new patch
|
||||
uniformFixedGradientFvPatchField
|
||||
(
|
||||
const uniformFixedGradientFvPatchField<Type>&,
|
||||
@ -169,7 +169,7 @@ public:
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,7 +38,7 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(p, iF),
|
||||
uniformValue_()
|
||||
uniformValue_(nullptr)
|
||||
{}
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ Foam::uniformFixedValueFvPatchField<Type>::uniformFixedValueFvPatchField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<Type>(p, iF, fld),
|
||||
uniformValue_()
|
||||
uniformValue_(nullptr)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -35,8 +35,8 @@ Description
|
||||
|
||||
Usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
uniformValue | uniform value | yes |
|
||||
Property | Description | Required | Default
|
||||
uniformValue | uniform value | yes |
|
||||
\endtable
|
||||
|
||||
Example of the boundary condition specification:
|
||||
@ -49,9 +49,9 @@ Usage
|
||||
\endverbatim
|
||||
|
||||
Note
|
||||
The uniformValue entry is a Function1 type, able to describe time
|
||||
varying functions. The example above gives the usage for supplying a
|
||||
constant value.
|
||||
The uniformValue entry is a PatchFunction1 type,
|
||||
able to describe time and spatial varying functions.
|
||||
The example above gives the usage for supplying a constant value.
|
||||
|
||||
See also
|
||||
Foam::Function1Types
|
||||
@ -82,8 +82,9 @@ class uniformFixedValueFvPatchField
|
||||
:
|
||||
public fixedValueFvPatchField<Type>
|
||||
{
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
//- Value
|
||||
autoPtr<PatchFunction1<Type>> uniformValue_;
|
||||
|
||||
|
||||
@ -118,8 +119,7 @@ public:
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given uniformFixedValueFvPatchField
|
||||
// onto a new patch
|
||||
//- Construct by mapping onto a new patch
|
||||
uniformFixedValueFvPatchField
|
||||
(
|
||||
const uniformFixedValueFvPatchField<Type>&,
|
||||
@ -185,7 +185,7 @@ public:
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
virtual void write(Ostream& os) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user