mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user