faPatchData.H
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) 2016-2017 Wikki Ltd
9 Copyright (C) 2021 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
27Class
28 Foam::faPatchData
29
30Description
31 Helper class for holding data during faPatch construction.
32 Most data members are exposed at the moment.
33
34\*---------------------------------------------------------------------------*/
35
36#ifndef faPatchData_H
37#define faPatchData_H
38
39#include "labelList.H"
40#include "labelPair.H"
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
46
47// Forward Declarations
48class faPatch;
49class dictionary;
50
51/*---------------------------------------------------------------------------*\
52 Class faPatchData Declaration
53\*---------------------------------------------------------------------------*/
55class faPatchData
56{
57public:
58
59 // Data Members
62 word type_;
66
67 //- The owner/neighbour for processor patches
69 int neighProcId_;
70
71 // Storge (temporary or otherwise) for edge labels
73
74
75 // Constructors
76
77 //- Default construct
79
80
81 // Member Functions
82
83 // Opaque read-only access
84
85 //- Return the name
86 const word& name() const noexcept;
87
88 //- Contents transcribed into a patch dictionary,
89 //- usually including the edge labels.
90 dictionary dict(const bool withEdgeLabels = true) const;
91
92
93 // Other Functions
94
95 //- Reset data
96 void clear();
97
98 //- Clear and populate with values from finiteArea patch
99 void assign(const faPatch& fap);
100
101 //- Set values consistent with a processor coupling
102 bool assign_coupled(int ownProci, int neiProci);
103
104 //- True if owner/neighbour processor ids are non-equal
105 bool coupled() const noexcept
106 {
107 return (ownerProcId_ != neighProcId_);
108 }
109
110 //- Does this side own the patch? Also true for non-coupled patches
111 bool owner() const noexcept
112 {
113 return (ownerProcId_ <= neighProcId_);
114 }
115
116 //- Does the other side own the patch?
117 bool neighbour() const noexcept
118 {
119 return !owner();
120 }
121
122 //- Ordered match with owner/neighbour patchPair.
123 // \return
124 // - 0: matched none
125 // - 1: matched first only (owner)
126 // - 2: matched second only (neighbour)
127 // - 3: matched both (owner/neighbour)
128 // .
129 int matchPatchPair(const labelPair& patchPair) const noexcept;
130
131 //- Unordered comparison with owner/neighbour patchPair.
132 int comparePatchPair(const labelPair& patchPair) const noexcept;
133};
134
135
136// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137
138} // End namespace Foam
139
140// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141
142#endif
143
144// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Helper class for holding data during faPatch construction. Most data members are exposed at the momen...
Definition: faPatchData.H:55
int matchPatchPair(const labelPair &patchPair) const noexcept
Ordered match with owner/neighbour patchPair.
Definition: faPatchData.C:131
const word & name() const noexcept
Return the name.
Definition: faPatchData.C:46
bool coupled() const noexcept
True if owner/neighbour processor ids are non-equal.
Definition: faPatchData.H:104
bool assign_coupled(int ownProci, int neiProci)
Set values consistent with a processor coupling.
Definition: faPatchData.C:112
int comparePatchPair(const labelPair &patchPair) const noexcept
Unordered comparison with owner/neighbour patchPair.
Definition: faPatchData.C:149
labelList edgeLabels_
Definition: faPatchData.H:71
faPatchData()
Default construct.
Definition: faPatchData.C:35
label ownerPolyPatchId_
Definition: faPatchData.H:63
label neighPolyPatchId_
Definition: faPatchData.H:64
int ownerProcId_
The owner/neighbour for processor patches.
Definition: faPatchData.H:67
void assign(const faPatch &fap)
Clear and populate with values from finiteArea patch.
Definition: faPatchData.C:92
void clear()
Reset data.
Definition: faPatchData.C:77
bool neighbour() const noexcept
Does the other side own the patch?
Definition: faPatchData.H:116
bool owner() const noexcept
Does this side own the patch? Also true for non-coupled patches.
Definition: faPatchData.H:110
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:78
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
const direction noexcept
Definition: Scalar.H:223
dictionary dict