BUG: zeroFixedValue pointPatch not set correctly (fixes #2807)

This commit is contained in:
Mark Olesen 2023-06-19 16:54:53 +02:00
parent 34f12219bd
commit e54ead28e8
2 changed files with 23 additions and 37 deletions

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,43 +28,35 @@ License
#include "zeroFixedValuePointPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
template<class Type>
zeroFixedValuePointPatchField<Type>::
zeroFixedValuePointPatchField
Foam::zeroFixedValuePointPatchField<Type>::zeroFixedValuePointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF
)
:
fixedValuePointPatchField<Type>(p, iF)
// Field is zero
fixedValuePointPatchField<Type>(p, iF, Type(Zero))
{}
template<class Type>
zeroFixedValuePointPatchField<Type>::
zeroFixedValuePointPatchField
Foam::zeroFixedValuePointPatchField<Type>::zeroFixedValuePointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const dictionary& dict
)
:
fixedValuePointPatchField<Type>(p, iF, dict, false)
{
fixedValuePointPatchField<Type>::operator=(Type(Zero));
}
// Field is zero
fixedValuePointPatchField<Type>(p, iF, Type(Zero))
{}
template<class Type>
zeroFixedValuePointPatchField<Type>::
zeroFixedValuePointPatchField
Foam::zeroFixedValuePointPatchField<Type>::zeroFixedValuePointPatchField
(
const zeroFixedValuePointPatchField<Type>& ptf,
const pointPatch& p,
@ -71,27 +64,26 @@ zeroFixedValuePointPatchField
const pointPatchFieldMapper& mapper
)
:
fixedValuePointPatchField<Type>(ptf, p, iF, mapper)
{
// For safety re-evaluate
fixedValuePointPatchField<Type>::operator=(Type(Zero));
}
// Field is zero : no mapping needed
fixedValuePointPatchField<Type>(p, iF, Type(Zero))
{}
template<class Type>
zeroFixedValuePointPatchField<Type>::
zeroFixedValuePointPatchField
Foam::zeroFixedValuePointPatchField<Type>::zeroFixedValuePointPatchField
(
const zeroFixedValuePointPatchField<Type>& ptf
)
:
fixedValuePointPatchField<Type>(ptf)
{}
{
// Field is zero. For safety, re-assign
valuePointPatchField<Type>::operator=(Type(Zero));
}
template<class Type>
zeroFixedValuePointPatchField<Type>::
zeroFixedValuePointPatchField
Foam::zeroFixedValuePointPatchField<Type>::zeroFixedValuePointPatchField
(
const zeroFixedValuePointPatchField<Type>& ptf,
const DimensionedField<Type, pointMesh>& iF
@ -99,13 +91,9 @@ zeroFixedValuePointPatchField
:
fixedValuePointPatchField<Type>(ptf, iF)
{
// For safety re-evaluate
fixedValuePointPatchField<Type>::operator=(Type(Zero));
// Field is zero. For safety, re-assign
valuePointPatchField<Type>::operator=(Type(Zero));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -42,8 +42,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef zeroFixedValuePointPatchField_H
#define zeroFixedValuePointPatchField_H
#ifndef Foam_zeroFixedValuePointPatchField_H
#define Foam_zeroFixedValuePointPatchField_H
#include "fixedValuePointPatchField.H"
@ -61,7 +61,6 @@ class zeroFixedValuePointPatchField
:
public fixedValuePointPatchField<Type>
{
public:
//- Runtime type information
@ -135,7 +134,6 @@ public:
)
);
}
};