lduPrimitiveMeshTemplates.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2013 OpenFOAM Foundation
9 Copyright (C) 2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "lduPrimitiveMesh.H"
30
31// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
32
33template<class ProcPatch>
35(
36 const lduInterfacePtrsList& interfaces
37)
38{
39 lduSchedule schedule(2*interfaces.size());
40
41 // 1. All non-processor patches
42 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43
44 label patchEvali = 0;
45
46 forAll(interfaces, patchi)
47 {
48 if (interfaces.set(patchi) && !isA<ProcPatch>(interfaces[patchi]))
49 {
50 schedule[patchEvali++].setInitEvaluate(patchi);
51 schedule[patchEvali++].setEvaluate(patchi);
52 }
53 }
54
55 // 2. All processor patches
56 // ~~~~~~~~~~~~~~~~~~~~~~~~
57
58 forAll(interfaces, patchi)
59 {
60 if (interfaces.set(patchi) && isA<ProcPatch>(interfaces[patchi]))
61 {
62 schedule[patchEvali++].setInitEvaluate(patchi);
63 }
64 }
65
66 forAll(interfaces, patchi)
67 {
68 if (interfaces.set(patchi) && isA<ProcPatch>(interfaces[patchi]))
69 {
70 schedule[patchEvali++].setEvaluate(patchi);
71 }
72 }
73
74 return schedule;
75}
76
77
78// ************************************************************************* //
const T * set(const label i) const
Definition: UPtrList.H:248
label size() const noexcept
The number of elements in the list.
Definition: UPtrListI.H:106
static lduSchedule nonBlockingSchedule(const lduInterfacePtrsList &)
Get non-scheduled send/receive schedule.
virtual lduInterfacePtrsList interfaces() const
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333