mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: coded bc: evaluate if no 'value' supplied. Fixes #2561
This commit is contained in:
@ -165,7 +165,7 @@ Foam::codedFixedValuePointPatchField<Type>::codedFixedValuePointPatchField
|
|||||||
const bool valueRequired
|
const bool valueRequired
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
parent_bctype(p, iF, dict, valueRequired),
|
parent_bctype(p, iF, dict, false),
|
||||||
codedBase(),
|
codedBase(),
|
||||||
dict_
|
dict_
|
||||||
(
|
(
|
||||||
@ -185,6 +185,15 @@ Foam::codedFixedValuePointPatchField<Type>::codedFixedValuePointPatchField
|
|||||||
redirectPatchFieldPtr_(nullptr)
|
redirectPatchFieldPtr_(nullptr)
|
||||||
{
|
{
|
||||||
updateLibrary(name_);
|
updateLibrary(name_);
|
||||||
|
|
||||||
|
// Note: 'value' is used even with valueRequired = false ! This is
|
||||||
|
// inconsistent with fixedValueFvPatchField behaviour.
|
||||||
|
|
||||||
|
if (!dict.found("value")) // Q: check for valueRequired?
|
||||||
|
{
|
||||||
|
// Evaluate to assign a value
|
||||||
|
this->evaluate(Pstream::commsTypes::blocking);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
Copyright (C) 2016-2021 OpenCFD Ltd.
|
Copyright (C) 2016-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -164,7 +164,7 @@ Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
parent_bctype(p, iF, dict),
|
parent_bctype(p, iF, dict, dict.found("value")), // Note: optional 'value'
|
||||||
codedBase(),
|
codedBase(),
|
||||||
dict_
|
dict_
|
||||||
(
|
(
|
||||||
@ -184,6 +184,14 @@ Foam::codedFixedValueFvPatchField<Type>::codedFixedValueFvPatchField
|
|||||||
redirectPatchFieldPtr_(nullptr)
|
redirectPatchFieldPtr_(nullptr)
|
||||||
{
|
{
|
||||||
updateLibrary(name_);
|
updateLibrary(name_);
|
||||||
|
|
||||||
|
if (!dict.found("value"))
|
||||||
|
{
|
||||||
|
// Assign dummy value to get redirectPatchField not fail
|
||||||
|
this->operator==(this->patchInternalField());
|
||||||
|
|
||||||
|
this->evaluate(Pstream::commsTypes::blocking);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user