nearbyPatchToPatch.H
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-2026 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 Class
25  Foam::patchToPatches::nearby
26 
27 Description
28  Class to generate patchToPatch coupling geometry. Couples a face to the
29  single nearby opposite face only.
30 
31 SourceFiles
32  nearby.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef nearbyPatchToPatch_H
37 #define nearbyPatchToPatch_H
38 
39 #include "patchToPatch.H"
40 #include "boundSphere.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace patchToPatches
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class nearby Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class nearby
54 :
55  public patchToPatch
56 {
57 protected:
58 
59  // Private Data
60 
61  //- For each source face, the bounding sphere
63 
64  //- For each target face, the bounding sphere
66 
67 
68  // Private Member Functions
69 
70  //- Get the bound box for a source face
71  virtual treeBoundBox srcBox
72  (
73  const face& srcFace,
74  const pointField& srcPoints,
75  const vectorField& srcPointNormals
76  ) const;
77 
78  //- Intersect two faces
79  virtual bool intersectFaces
80  (
81  const primitiveOldTimePatch& srcPatch,
82  const vectorField& srcPointNormals,
83  const vectorField& srcPointNormals0,
84  const primitiveOldTimePatch& tgtPatch,
85  const label srcFacei,
86  const label tgtFacei
87  );
88 
89  //- Initialisation
90  virtual void initialise
91  (
92  const primitiveOldTimePatch& srcPatch,
93  const vectorField& srcPointNormals,
94  const vectorField& srcPointNormals0,
95  const primitiveOldTimePatch& tgtPatch
96  );
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("nearby");
103 
104 
105  // Constructors
106 
107  //- Construct from components
108  nearby(const bool reverse);
109 
110 
111  //- Destructor
112  ~nearby();
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace patchToPatches
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:76
Class to generate coupling geometry between two primitive patches.
Definition: patchToPatch.H:56
bool reverse() const
Flag to indicate that the two patches are co-directional and.
Definition: patchToPatchI.H:31
Class to generate patchToPatch coupling geometry. Couples a face to the single nearby opposite face o...
nearby(const bool reverse)
Construct from components.
TypeName("nearby")
Runtime type information.
virtual bool intersectFaces(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch, const label srcFacei, const label tgtFacei)
Intersect two faces.
virtual treeBoundBox srcBox(const face &srcFace, const pointField &srcPoints, const vectorField &srcPointNormals) const
Get the bound box for a source face.
virtual void initialise(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch)
Initialisation.
List< boundSphere > tgtSpheres_
For each target face, the bounding sphere.
List< boundSphere > srcSpheres_
For each source face, the bounding sphere.
Standard boundBox + extra functionality for use in octree.
Definition: treeBoundBox.H:90
Namespace for OpenFOAM.
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