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

@ -26,8 +26,8 @@ License
\*---------------------------------------------------------------------------*/
#ifndef MapConsistentVolFields_H
#define MapConsistentVolFields_H
#ifndef Foam_MapConsistentVolFields_H
#define Foam_MapConsistentVolFields_H
#include "GeometricField.H"
#include "meshToMesh.H"
@ -41,10 +41,9 @@ namespace Foam
template<class Type>
void evaluateConstraintTypes(GeometricField<Type, fvPatchField, volMesh>& fld)
{
auto& fldBf = fld.boundaryFieldRef();
auto& bfld = fld.boundaryFieldRef();
const UPstream::commsTypes commsType = UPstream::defaultCommsType;
const label startOfRequests = UPstream::nRequests();
if
(
@ -52,37 +51,32 @@ void evaluateConstraintTypes(GeometricField<Type, fvPatchField, volMesh>& fld)
|| 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);
}
}
}
@ -94,22 +88,21 @@ void evaluateConstraintTypes(GeometricField<Type, fvPatchField, volMesh>& fld)
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);
}
}
}