Commit b6feaea5 authored by Henry Weller's avatar Henry Weller
Browse files

fvPatchFields: Constructors from dictionary now call the corresponding...

fvPatchFields: Constructors from dictionary now call the corresponding constructor of the fvPatchField base-class
to ensure 'patchType' is set as specified.

Required substantial change to the organization of the reading of the
'value' entry requiring careful testing and there may be some residual
issues remaining.  Please report any problems with the reading and
initialization of patch fields.

Resolves bug-report http://bugs.openfoam.org/view.php?id=2266
parent 93530f17
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -63,13 +63,8 @@ adjointOutletPressureFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF)
{
fvPatchField<scalar>::operator=
(
scalarField("value", dict, p.size())
);
}
fixedValueFvPatchScalarField(p, iF, dict)
{}
Foam::adjointOutletPressureFvPatchScalarField::
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -50,10 +50,8 @@ adjointOutletVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF)
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
fixedValueFvPatchVectorField(p, iF, dict)
{}
Foam::adjointOutletVelocityFvPatchVectorField::
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -56,7 +56,7 @@ atmBoundaryLayerInletEpsilonFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
atmBoundaryLayer(patch().Cf(), dict)
{
scalarField::operator=(epsilon(patch().Cf()));
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -56,7 +56,7 @@ atmBoundaryLayerInletKFvPatchScalarField
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
fixedValueFvPatchScalarField(p, iF, dict, false),
atmBoundaryLayer(patch().Cf(), dict)
{
scalarField::operator=(k(patch().Cf()));
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -56,7 +56,7 @@ atmBoundaryLayerInletVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict, false),
atmBoundaryLayer(patch().Cf(), dict)
{
vectorField::operator=(U(patch().Cf()));
......
......@@ -50,7 +50,7 @@ Foam::fixedShearStressFvPatchVectorField::fixedShearStressFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict, false),
tau0_(dict.lookupOrDefault<vector>("tau", Zero))
{
fvPatchField<vector>::operator=(patchInternalField());
......
......@@ -64,12 +64,10 @@ Foam::SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
fixedValueFvPatchVectorField(p, iF, dict),
relative_(dict.lookup("relative")),
inletValue_("inletValue", dict, p.size())
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
{}
Foam::SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField
......
......@@ -60,10 +60,8 @@ Foam::SRFWallVelocityFvPatchVectorField::SRFWallVelocityFvPatchVectorField
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF)
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
fixedValueFvPatchVectorField(p, iF, dict)
{}
Foam::SRFWallVelocityFvPatchVectorField::SRFWallVelocityFvPatchVectorField
......
......@@ -71,11 +71,12 @@ Foam::coupledFvPatchField<Type>::coupledFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
const dictionary& dict,
const bool valueRequired
)
:
LduInterfaceField<Type>(refCast<const lduInterface>(p)),
fvPatchField<Type>(p, iF, dict)
fvPatchField<Type>(p, iF, dict, valueRequired)
{}
......
......@@ -86,7 +86,8 @@ public:
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
const dictionary&,
const bool valueRequired=true
);
//- Construct by mapping the given coupledFvPatchField onto a new patch
......
......@@ -46,12 +46,13 @@ extrapolatedCalculatedFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict,
const bool valueRequired
const dictionary& dict
)
:
calculatedFvPatchField<Type>(p, iF, dict, valueRequired)
{}
calculatedFvPatchField<Type>(p, iF, dict, false)
{
evaluate();
}
template<class Type>
......
......@@ -87,8 +87,7 @@ public:
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&,
const bool valueRequired=false
const dictionary&
);
//- Construct by mapping given patchField<Type> onto a new patch
......
......@@ -48,7 +48,7 @@ Foam::fixedGradientFvPatchField<Type>::fixedGradientFvPatchField
const dictionary& dict
)
:
fvPatchField<Type>(p, iF, dict),
fvPatchField<Type>(p, iF, dict, false),
gradient_("gradient", dict, p.size())
{
evaluate();
......
......@@ -55,10 +55,11 @@ Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
const dictionary& dict,
const bool valueRequired
)
:
fvPatchField<Type>(p, iF, dict, true)
fvPatchField<Type>(p, iF, dict, valueRequired)
{}
......
......@@ -99,7 +99,8 @@ public:
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
const dictionary&,
const bool valueRequired=true
);
//- Construct by mapping the given fixedValueFvPatchField<Type>
......
......@@ -49,7 +49,7 @@ Foam::mixedFvPatchField<Type>::mixedFvPatchField
const dictionary& dict
)
:
fvPatchField<Type>(p, iF, dict),
fvPatchField<Type>(p, iF, dict, false),
refValue_("refValue", dict, p.size()),
refGrad_("refGradient", dict, p.size()),
valueFraction_("valueFraction", dict, p.size())
......
......@@ -61,7 +61,7 @@ Foam::slicedFvPatchField<Type>::slicedFvPatchField
const dictionary& dict
)
:
fvPatchField<Type>(p, iF, dict)
fvPatchField<Type>(p, iF, dict, false)
{
NotImplemented;
}
......
......@@ -61,7 +61,7 @@ Foam::transformFvPatchField<Type>::transformFvPatchField
const dictionary& dict
)
:
fvPatchField<Type>(p, iF, dict)
fvPatchField<Type>(p, iF, dict, false)
{}
......
......@@ -47,7 +47,7 @@ Foam::zeroGradientFvPatchField<Type>::zeroGradientFvPatchField
const dictionary& dict
)
:
fvPatchField<Type>(p, iF, dict)
fvPatchField<Type>(p, iF, dict, false)
{
fvPatchField<Type>::operator=(this->patchInternalField());
}
......
......@@ -48,7 +48,7 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField
const dictionary& dict
)
:
coupledFvPatchField<Type>(p, iF, dict),
coupledFvPatchField<Type>(p, iF, dict, false),
cyclicPatch_(refCast<const cyclicFvPatch>(p))
{
if (!isA<cyclicFvPatch>(p))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment