Loading...
Searching...
No Matches
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-2023 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 Foam_faPatchData_H
37#define Foam_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\*---------------------------------------------------------------------------*/
56{
57public:
59 // Data Members
60
61 word name_;
62 word type_;
66
67 //- The owner/neighbour for processor patches
68 int ownerProcId_;
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 //- Has name/type etc
96 bool good() const;
97
98 //- Reset data
99 void clear();
100
101 //- Clear and populate with values from finiteArea patch
102 void assign(const faPatch& fap);
103
104 //- Set values consistent with a processor coupling
105 bool assign_coupled(int ownProci, int neiProci);
106
107 //- True if owner/neighbour processor ids are non-equal
108 bool coupled() const noexcept
109 {
110 return (ownerProcId_ != neighProcId_);
111 }
112
113 //- Does this side own the patch? Also true for non-coupled patches
114 bool owner() const noexcept
115 {
116 return (ownerProcId_ <= neighProcId_);
117 }
118
119 //- Does the other side own the patch?
120 bool neighbour() const noexcept
121 {
122 return !owner();
123 }
124
125 //- Ordered match with owner/neighbour patchPair.
126 // \return
127 // - 0: matched none
128 // - 1: matched first only (owner)
129 // - 2: matched second only (neighbour)
130 // - 3: matched both (owner/neighbour)
131 // .
132 int matchPatchPair(const labelPair& patchPair) const noexcept;
133
134 //- Unordered comparison with owner/neighbour patchPair.
135 int comparePatchPair(const labelPair& patchPair) const noexcept;
136};
137
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141} // End namespace Foam
142
143// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144
145#endif
146
147// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
int matchPatchPair(const labelPair &patchPair) const noexcept
Ordered match with owner/neighbour patchPair.
const word & name() const noexcept
Return the name.
Definition faPatchData.C:39
bool coupled() const noexcept
True if owner/neighbour processor ids are non-equal.
dictionary dict(const bool withEdgeLabels=true) const
Contents transcribed into a patch dictionary, usually including the edge labels.
Definition faPatchData.C:45
bool assign_coupled(int ownProci, int neiProci)
Set values consistent with a processor coupling.
int comparePatchPair(const labelPair &patchPair) const noexcept
Unordered comparison with owner/neighbour patchPair.
labelList edgeLabels_
Definition faPatchData.H:67
faPatchData()
Default construct.
Definition faPatchData.C:28
int ownerProcId_
The owner/neighbour for processor patches.
Definition faPatchData.H:63
void assign(const faPatch &fap)
Clear and populate with values from finiteArea patch.
Definition faPatchData.C:91
bool good() const
Has name/type etc.
Definition faPatchData.C:70
void clear()
Reset data.
Definition faPatchData.C:76
bool neighbour() const noexcept
Does the other side own the patch?
bool owner() const noexcept
Does this side own the patch? Also true for non-coupled patches.
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition faPatch.H:76
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
Pair< label > labelPair
A pair of labels.
Definition Pair.H:54
List< label > labelList
A List of labels.
Definition List.H:62
const direction noexcept
Definition scalarImpl.H:265