Merge branch 'nextRelease' of ssh://git.code.sf.net/p/foam-extend/foam-extend-4.0 into nextRelease

This commit is contained in:
Hrvoje Jasak 2019-04-30 16:59:25 +02:00
commit 267fa0eba8
7 changed files with 60 additions and 39 deletions

View file

@ -1343,7 +1343,7 @@ void Foam::refinement::setRefinement(polyTopoChange& ref) const
mesh_, mesh_,
pointLevel_, pointLevel_,
maxEqOp<label>(), maxEqOp<label>(),
0, // Null value label(0), // Null value
true // Apply separation for parallel cyclics true // Apply separation for parallel cyclics
); );
@ -1512,7 +1512,7 @@ void Foam::refinement::updateMesh(const mapPolyMesh& map)
mesh_, mesh_,
newPointLevel, newPointLevel,
maxEqOp<label>(), maxEqOp<label>(),
0, // Null value label(0), // Null value
true // Apply separation for parallel cyclics true // Apply separation for parallel cyclics
); );

View file

@ -67,11 +67,20 @@ fixedGradientFvPatchField<Type>::fixedGradientFvPatchField
const dictionary& dict const dictionary& dict
) )
: :
// HR 15.12.18: Must not call evaluate during construction. Read value fvPatchField<Type>(p, iF, dict),
// instead. This is needed for PLB.
fvPatchField<Type>(p, iF, dict, true),
gradient_("gradient", dict, p.size()) gradient_("gradient", dict, p.size())
{} {
// Call evaluate only if the value is not found. Used to avoid evaluating
// when we have incomplete meshes during Parallel Load Balancing. When
// shipping the field over to another processor, we first call write, making
// sure that the value is written and read it on the other side (see
// write member function). If this proves to be problematic, we can always
// initialize with patch internal field for the start-up. VV, 12/Apr/2019.
if (!dict.found("value"))
{
evaluate();
}
}
template<class Type> template<class Type>
@ -190,6 +199,11 @@ void fixedGradientFvPatchField<Type>::write(Ostream& os) const
{ {
fvPatchField<Type>::write(os); fvPatchField<Type>::write(os);
gradient_.writeEntry("gradient", os); gradient_.writeEntry("gradient", os);
// Write value along with the gradient in order to avoid calling evaluate
// on construction (from dictionary constructor) for Parallel Load Balancing
// runs. See dictionary constructor for details. VV, 12/Apr/2019.
this->writeEntry("value", os);
} }

View file

@ -54,13 +54,22 @@ mixedFvPatchField<Type>::mixedFvPatchField
const dictionary& dict const dictionary& dict
) )
: :
// HR 15.12.18: Must not call evaluate during construction. Read value fvPatchField<Type>(p, iF, dict),
// instead. This is needed for PLB.
fvPatchField<Type>(p, iF, dict, true),
refValue_("refValue", dict, p.size()), refValue_("refValue", dict, p.size()),
refGrad_("refGradient", dict, p.size()), refGrad_("refGradient", dict, p.size()),
valueFraction_("valueFraction", dict, p.size()) valueFraction_("valueFraction", dict, p.size())
{} {
// Call evaluate only if the value is not found. Used to avoid evaluating
// when we have incomplete meshes during Parallel Load Balancing. When
// shipping the field over to another processor, we first call write, making
// sure that the value is written and read it on the other side (see
// write member function). If this proves to be problematic, we can always
// initialize with patch internal field for the start-up. VV, 12/Apr/2019.
if (!dict.found("value"))
{
evaluate();
}
}
template<class Type> template<class Type>

View file

@ -70,12 +70,7 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
"fvSchemes", "fvSchemes",
obr.time().system(), obr.time().system(),
obr, obr,
( IOobject::READ_IF_PRESENT_IF_MODIFIED, // Allow default dictionary creation
obr.readOpt() == IOobject::MUST_READ
|| obr.readOpt() == IOobject::READ_IF_PRESENT
? IOobject::MUST_READ_IF_MODIFIED
: obr.readOpt()
),
IOobject::NO_WRITE IOobject::NO_WRITE
) )
), ),
@ -173,17 +168,21 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
fluxRequired_(), // Do not read flux required option fluxRequired_(), // Do not read flux required option
defaultFluxRequired_(false) defaultFluxRequired_(false)
{ {
// HR 21.12.18 : Writing a default fvSchemes is not useful in PLB. Please if (!headerOk())
// specify MUST_READ on obr if you need this.
if
(
readOpt() == IOobject::MUST_READ
|| readOpt() == IOobject::MUST_READ_IF_MODIFIED
|| (readOpt() == IOobject::READ_IF_PRESENT && headerOk())
)
{ {
read(); if (debug)
{
InfoIn
(
"fvSchemes::fvSchemes(const objectRegistry& obr)"
) << "fvSchemes dictionary not found. Creating default."
<< endl;
} }
regIOobject::write();
}
read();
} }

View file

@ -457,8 +457,7 @@ static unsigned jenkins_hashbig
case 4 : a += k[3]; [[fallthrough]]; case 4 : a += k[3]; [[fallthrough]];
case 3 : a += static_cast<uint32_t>(k[2]) << 8; [[fallthrough]]; case 3 : a += static_cast<uint32_t>(k[2]) << 8; [[fallthrough]];
case 2 : a += static_cast<uint32_t>(k[1]) << 16; [[fallthrough]]; case 2 : a += static_cast<uint32_t>(k[1]) << 16; [[fallthrough]];
case 1 : a += static_cast<uint32_t>(k[0]) << 24; [[fallthrough]]; case 1 : a += static_cast<uint32_t>(k[0]) << 24; break;
break;
case 0 : return c; case 0 : return c;
} }
} }

View file

@ -674,7 +674,7 @@ void Foam::immersedBoundaryPolyPatch::calcImmersedBoundary() const
{ {
// Direct face cut, coupled on live side // Direct face cut, coupled on live side
// Get face index. Noye the difference between faceI // Get face index. Note the difference between faceI
// and patchFaceI // and patchFaceI
const label faceI = bMesh[patchI].start() + patchFaceI; const label faceI = bMesh[patchI].start() + patchFaceI;
@ -945,8 +945,8 @@ void Foam::immersedBoundaryPolyPatch::calcImmersedBoundary() const
// Wet on wet // Wet on wet
if if
( (
intersectedCell[patchFaceI] == immersedPoly::WET curOwnCut[patchFaceI] == immersedPoly::WET
&& intersectedCell[patchFaceI] == immersedPoly::WET && curNbrCut[patchFaceI] == immersedPoly::WET
) )
{ {
intersectedFace[patchStart + patchFaceI] = intersectedFace[patchStart + patchFaceI] =
@ -956,8 +956,8 @@ void Foam::immersedBoundaryPolyPatch::calcImmersedBoundary() const
// Dry on dry // Dry on dry
if if
( (
intersectedCell[patchFaceI] == immersedPoly::DRY curOwnCut[patchFaceI] == immersedPoly::DRY
&& intersectedCell[patchFaceI] == immersedPoly::DRY && curNbrCut[patchFaceI] == immersedPoly::DRY
) )
{ {
intersectedFace[patchStart + patchFaceI] = intersectedFace[patchStart + patchFaceI] =
@ -969,12 +969,12 @@ void Foam::immersedBoundaryPolyPatch::calcImmersedBoundary() const
if if
( (
( (
intersectedCell[patchFaceI] == immersedPoly::WET curOwnCut[patchFaceI] == immersedPoly::WET
&& intersectedCell[patchFaceI] == immersedPoly::CUT && curNbrCut[patchFaceI] == immersedPoly::CUT
) )
|| ( || (
intersectedCell[patchFaceI] == immersedPoly::CUT curOwnCut[patchFaceI] == immersedPoly::CUT
&& intersectedCell[patchFaceI] == immersedPoly::WET && curNbrCut[patchFaceI] == immersedPoly::WET
) )
) )
{ {