ENH: use concise forms for walking processor and cyclic boundaries

This commit is contained in:
Mark Olesen
2021-01-22 13:29:00 +01:00
parent f24e3f113f
commit 6cdf89dced
22 changed files with 525 additions and 699 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -649,12 +649,12 @@ void Foam::FaceCellWave<Type, TrackingData>::handleCyclicPatches()
for (const polyPatch& patch : mesh_.boundaryMesh())
{
if (isA<cyclicPolyPatch>(patch))
{
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(patch);
const cyclicPolyPatch* cpp = isA<cyclicPolyPatch>(patch);
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
if (cpp)
{
const auto& cycPatch = *cpp;
const auto& nbrPatch = cycPatch.neighbPatch();
// Allocate buffers
label nReceiveFaces;
@ -733,12 +733,12 @@ void Foam::FaceCellWave<Type, TrackingData>::handleAMICyclicPatches()
for (const polyPatch& patch : mesh_.boundaryMesh())
{
if (isA<cyclicAMIPolyPatch>(patch))
{
const cyclicAMIPolyPatch& cycPatch =
refCast<const cyclicAMIPolyPatch>(patch);
const cyclicAMIPolyPatch* cpp = isA<cyclicAMIPolyPatch>(patch);
const cyclicAMIPolyPatch& nbrPatch = cycPatch.neighbPatch();
if (cpp)
{
const auto& cycPatch = *cpp;
const auto& nbrPatch = cycPatch.neighbPatch();
List<Type> receiveInfo;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -435,10 +436,12 @@ void Foam::PointEdgeWave<Type, TrackingData>::handleCyclicPatches()
{
const polyPatch& patch = mesh_.boundaryMesh()[patchi];
if (isA<cyclicPolyPatch>(patch))
const cyclicPolyPatch* cpp = isA<cyclicPolyPatch>(patch);
if (cpp)
{
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(patch);
const auto& cycPatch = *cpp;
const auto& nbrPatch = cycPatch.neighbPatch();
nbrInfo.clear();
nbrInfo.reserve(cycPatch.nPoints());
@ -449,7 +452,6 @@ void Foam::PointEdgeWave<Type, TrackingData>::handleCyclicPatches()
// Collect nbrPatch points that have changed
{
const cyclicPolyPatch& nbrPatch = cycPatch.neighbPatch();
const edgeList& pairs = cycPatch.coupledPoints();
const labelList& meshPoints = nbrPatch.meshPoints();