STYLE: more consistency in writeEntry() signatures

- boundary entries with writeEntry(const word&, ...) instead of
  writeEntry(const keyType&, ...) to match with most other
  writeEntry() signatures. Also, this content will not be used
  to supply regex matched sub-dictionaries.

STYLE: more consistent patch initEvaluate()/evaluate() coding
This commit is contained in:
Mark Olesen
2024-05-13 12:31:57 +02:00
parent 1406f9ec26
commit ffc9894033
22 changed files with 136 additions and 145 deletions

View File

@ -36,10 +36,9 @@ void Foam::functionObjects::mapFields::evaluateConstraintTypes
GeometricField<Type, fvPatchField, volMesh>& fld
) const
{
auto& fldBf = fld.boundaryFieldRef();
auto& bfld = fld.boundaryFieldRef();
const UPstream::commsTypes commsType = UPstream::defaultCommsType;
const label startOfRequests = UPstream::nRequests();
if
(
@ -47,37 +46,32 @@ void Foam::functionObjects::mapFields::evaluateConstraintTypes
|| commsType == UPstream::commsTypes::nonBlocking
)
{
forAll(fldBf, patchi)
{
fvPatchField<Type>& tgtField = fldBf[patchi];
const label startOfRequests = UPstream::nRequests();
for (auto& pfld : bfld)
{
if
(
tgtField.type() == tgtField.patch().patch().type()
&& polyPatch::constraintType(tgtField.patch().patch().type())
pfld.type() == pfld.patch().patch().type()
&& polyPatch::constraintType(pfld.patch().patch().type())
)
{
tgtField.initEvaluate(commsType);
pfld.initEvaluate(commsType);
}
}
// Wait for outstanding requests
if (commsType == UPstream::commsTypes::nonBlocking)
{
UPstream::waitRequests(startOfRequests);
}
// Wait for outstanding requests (non-blocking)
UPstream::waitRequests(startOfRequests);
forAll(fldBf, patchi)
for (auto& pfld : bfld)
{
fvPatchField<Type>& tgtField = fldBf[patchi];
if
(
tgtField.type() == tgtField.patch().patch().type()
&& polyPatch::constraintType(tgtField.patch().patch().type())
pfld.type() == pfld.patch().patch().type()
&& polyPatch::constraintType(pfld.patch().patch().type())
)
{
tgtField.evaluate(commsType);
pfld.evaluate(commsType);
}
}
}
@ -89,22 +83,21 @@ void Foam::functionObjects::mapFields::evaluateConstraintTypes
for (const auto& schedEval : patchSchedule)
{
const label patchi = schedEval.patch;
fvPatchField<Type>& tgtField = fldBf[patchi];
auto& pfld = bfld[patchi];
if
(
tgtField.type() == tgtField.patch().patch().type()
&& polyPatch::constraintType(tgtField.patch().patch().type())
pfld.type() == pfld.patch().patch().type()
&& polyPatch::constraintType(pfld.patch().patch().type())
)
{
if (schedEval.init)
{
tgtField.initEvaluate(commsType);
pfld.initEvaluate(commsType);
}
else
{
tgtField.evaluate(commsType);
pfld.evaluate(commsType);
}
}
}

View File

@ -37,11 +37,9 @@ bool Foam::functionObjects::zeroGradient::accept
const GeometricField<Type, fvPatchField, volMesh>& input
)
{
const auto& patches = input.boundaryField();
forAll(patches, patchi)
for (const auto& pfld : input.boundaryField())
{
if (!polyPatch::constraintType(patches[patchi].patch().patch().type()))
if (!polyPatch::constraintType(pfld.patch().patch().type()))
{
return true;
}