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-2022 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 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 namespace patchToPatches
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class nearby Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class nearby
53 :
54  public patchToPatch
55 {
56 protected:
57 
58  // Private Member Data
59 
60  //- For each source face, the bounding sphere
62 
63  //- For each target face, the bounding sphere
65 
66 
67  // Private Member Functions
68 
69  //- Get the bound box for a source face
70  virtual treeBoundBox srcBox
71  (
72  const face& srcFace,
73  const pointField& srcPoints,
74  const vectorField& srcPointNormals
75  ) const;
76 
77  //- Intersect two faces
78  virtual bool intersectFaces
79  (
80  const primitiveOldTimePatch& srcPatch,
81  const vectorField& srcPointNormals,
82  const vectorField& srcPointNormals0,
83  const primitiveOldTimePatch& tgtPatch,
84  const label srcFacei,
85  const label tgtFacei
86  );
87 
88  //- Initialisation
89  virtual void initialise
90  (
91  const primitiveOldTimePatch& srcPatch,
92  const vectorField& srcPointNormals,
93  const vectorField& srcPointNormals0,
94  const primitiveOldTimePatch& tgtPatch
95  );
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("nearby");
102 
103 
104  // Constructors
105 
106  //- Construct from components
107  nearby(const bool reverse);
108 
109 
110  //- Destructor
111  ~nearby();
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace patchToPatches
118 } // End namespace Foam
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #endif
123 
124 // ************************************************************************* //
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.
List< Tuple2< point, scalar > > srcSpheres_
For each source face, the bounding sphere.
virtual treeBoundBox srcBox(const face &srcFace, const pointField &srcPoints, const vectorField &srcPointNormals) const
Get the bound box for a source face.
List< Tuple2< point, scalar > > tgtSpheres_
For each target face, the bounding sphere.
virtual void initialise(const primitiveOldTimePatch &srcPatch, const vectorField &srcPointNormals, const vectorField &srcPointNormals0, const primitiveOldTimePatch &tgtPatch)
Initialisation.
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