perfectInterface.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) 2011-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 Class
25  Foam::perfectInterface
26 
27 Description
28  Hack of attachDetach to couple patches when they perfectly align.
29  Does not decouple. Used by stitchMesh app. Does geometric matching.
30 
31 SourceFiles
32  perfectInterface.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef perfectInterface_H
37 #define perfectInterface_H
38 
39 #include "polyMesh.H"
40 #include "indirectPrimitivePatch.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class polyTopoChange;
48 
49 /*---------------------------------------------------------------------------*\
50  Class perfectInterface Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class perfectInterface
54 {
55  // Private Data
56 
57  const polyMesh& mesh_;
58 
59  //- Master patch ID
60  label masterPatchIndex_;
61 
62  //- Slave patch ID
63  label slavePatchIndex_;
64 
65  //- Tolerance used for distance comparison
66  // (fraction of minimum edge length)
67  static const scalar tol_;
68 
69  // Private Member Functions
70 
71  //- Calculate face centres on patch
72  static pointField calcFaceCentres(const indirectPrimitivePatch&);
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("perfectInterface");
79 
80 
81  // Constructors
82 
83  //- Construct from components
85  (
86  const word& name,
87  const polyMesh& mesh,
88  const word& masterPatchName,
89  const word& slavePatchName
90  );
91 
92  //- Disallow default bitwise copy construction
93  perfectInterface(const perfectInterface&) = delete;
94 
95 
96  //- Destructor
97  virtual ~perfectInterface();
98 
99 
100  // Member Functions
101 
102  //- Insert the layer addition/removal instructions
103  // into the topological change
104  virtual void setRefinement(polyTopoChange&) const;
105 
106  //- Insert the layer addition/removal instructions
107  // into the topological change. Uses only mesh, not any of the
108  // patch indices. Bit of a workaround - used in extruding
109  // a mesh.
110  virtual void setRefinement
111  (
112  const indirectPrimitivePatch& pp0,
113  const indirectPrimitivePatch& pp1,
115  ) const;
116 
117 
118  // Member Operators
119 
120  //- Disallow default bitwise assignment
121  void operator=(const perfectInterface&) = delete;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
Hack of attachDetach to couple patches when they perfectly align. Does not decouple....
perfectInterface(const word &name, const polyMesh &mesh, const word &masterPatchName, const word &slavePatchName)
Construct from components.
TypeName("perfectInterface")
Runtime type information.
virtual ~perfectInterface()
Destructor.
virtual void setRefinement(polyTopoChange &) const
Insert the layer addition/removal instructions.
void operator=(const perfectInterface &)=delete
Disallow default bitwise assignment.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Direct mesh changes based on v1.3 polyTopoChange syntax.
A class for handling words, derived from string.
Definition: word.H:62
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
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39