nonConformalFvPatch.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "nonConformalFvPatch.H"
27 #include "surfaceFields.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
34 }
35 
36 
37 // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
38 
40 (
41  const fvPatch& patch
42 )
43 :
44  patch_(patch),
45  nonConformalPolyPatch_(refCast<const nonConformalPolyPatch>(patch.patch())),
46  faceCells_()
47 {}
48 
49 
50 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
51 
53 {}
54 
55 
56 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
57 
59 {
60  return patch_;
61 }
62 
63 
66 {
67  return nonConformalPolyPatch_;
68 }
69 
70 
72 {
73  return nonConformalPolyPatch_.origPatchName();
74 }
75 
76 
78 {
79  return nonConformalPolyPatch_.origPatchIndex();
80 }
81 
82 
84 {
85  return patch_.boundaryMesh()[origPatchIndex()];
86 }
87 
88 
90 {
91  const fvMesh& mesh = patch_.boundaryMesh().mesh();
92 
93  return
94  mesh.conformal()
95  ? labelList::null()
96  : mesh.polyFacesBf()[patch_.index()];
97 }
98 
99 
101 {
102  if (size())
103  {
105  << "The start face is not defined for a " << typeName
106  << " patch with a non-zero number of faces"
107  << exit(FatalError);
108  }
109 
110  return patch_.patch().start();
111 }
112 
113 
115 {
116  return polyFaces().size();
117 }
118 
119 
121 {
122  const fvMesh& mesh = patch_.boundaryMesh().mesh();
123 
124  return
125  mesh.conformal()
126  ? labelList::null()
127  : mesh.ownerBf()[patch_.index()];
128 }
129 
130 
131 // ************************************************************************* //
static const List< label > & null()
Return a null List.
Definition: ListI.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
const GeometricBoundaryField< label, fvsPatchField, surfaceMesh > & ownerBf() const
Return face-owner addressing.
Definition: fvMesh.C:998
const GeometricBoundaryField< label, fvsPatchField, surfaceMesh > & polyFacesBf() const
Return face-poly-face addressing.
Definition: fvMesh.C:880
bool conformal() const
Return whether the fvMesh is conformal with the polyMesh.
Definition: fvMesh.C:874
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: fvPatch.H:162
Non-conformal FV patch. Provides the necessary interface for a FV patch which does not conform to the...
const fvPatch & patch() const
Reference to the fvPatch.
const labelList & polyFaces() const
Return face face-poly-faces.
const fvPatch & origPatch() const
Original patch.
label origPatchIndex() const
Original patch ID.
virtual label size() const
Return the size.
const word & origPatchName() const
Original patch name.
virtual ~nonConformalFvPatch()
Destructor.
const nonConformalPolyPatch & nonConformalPatch() const
Reference to the polyPatch.
virtual const labelUList & faceCells() const
Return the face-cells.
nonConformalFvPatch(const fvPatch &patch)
Construct from a patch.
virtual label start() const
Return the start label of this patch in the polyMesh face list.
Non-conformal poly patch. This patch is a placeholder and must have no faces. This patch is linked to...
const polyMesh & mesh() const
Return the mesh reference.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:404
A class for handling words, derived from string.
Definition: word.H:62
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:129
defineTypeNameAndDebug(combustionModel, 0)
error FatalError
Foam::surfaceFields.