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-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::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 "polyMeshModifier.H"
40 #include "polyPatchID.H"
41 #include "ZoneIDs.H"
42 #include "indirectPrimitivePatch.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward declaration of classes
50 class Time;
51 
52 /*---------------------------------------------------------------------------*\
53  Class perfectInterface Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class perfectInterface
57 :
58  public polyMeshModifier
59 {
60  // Private Data
61 
62  //- Master face zone ID
63  faceZoneID faceZoneID_;
64 
65  //- Master patch ID
66  polyPatchID masterPatchID_;
67 
68  //- Slave patch ID
69  polyPatchID slavePatchID_;
70 
71  //- Tolerance used for distance comparison (fraction of minimum edge
72  // length)
73  static const scalar tol_;
74 
75  // Private Member Functions
76 
77  //- Calculate face centres on patch
78  static pointField calcFaceCentres(const indirectPrimitivePatch&);
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("perfectInterface");
85 
86 
87  // Constructors
88 
89  //- Construct from components
91  (
92  const word& name,
93  const label index,
94  const polyTopoChanger& mme,
95  const word& faceZoneName,
96  const word& masterPatchName,
97  const word& slavePatchName
98  );
99 
100  //- Construct from dictionary
102  (
103  const word& name,
104  const dictionary& dict,
105  const label index,
106  const polyTopoChanger& mme
107  );
108 
109  //- Disallow default bitwise copy construction
110  perfectInterface(const perfectInterface&) = delete;
111 
112 
113  //- Destructor
114  virtual ~perfectInterface();
115 
116 
117  // Member Functions
118 
119  //- Check for topology change
120  virtual bool changeTopology() const;
121 
122  //- Insert the layer addition/removal instructions
123  // into the topological change
124  virtual void setRefinement(polyTopoChange&) const;
125 
126  //- Insert the layer addition/removal instructions
127  // into the topological change. Uses only mesh, not any of the
128  // patch and zone indices. Bit of a workaround - used in extruding
129  // a mesh.
130  virtual void setRefinement
131  (
132  const indirectPrimitivePatch& pp0,
133  const indirectPrimitivePatch& pp1,
135  ) const;
136 
137  //- Modify motion points to comply with the topological change
138  virtual void modifyMotionPoints(pointField& motionPoints) const;
139 
140  //- Force recalculation of locally stored data on topological change
141  virtual void topoChange(const polyTopoChangeMap&);
142 
143  //- Write
144  virtual void write(Ostream&) const;
145 
146  //- Write dictionary
147  virtual void writeDict(Ostream&) const;
148 
149 
150  // Member Operators
151 
152  //- Disallow default bitwise assignment
153  void operator=(const perfectInterface&) = delete;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
virtual void topoChange(const polyTopoChangeMap &)
Force recalculation of locally stored data on topological change.
dictionary dict
TypeName("perfectInterface")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
virtual void write(Ostream &) const
Write.
A list of faces which address into the list of points.
List of mesh modifiers defining the mesh dynamics.
A class for handling words, derived from string.
Definition: word.H:59
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
virtual void setRefinement(polyTopoChange &) const
Insert the layer addition/removal instructions.
Virtual base class for mesh modifiers.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual ~perfectInterface()
Destructor.
Direct mesh changes based on v1.3 polyTopoChange syntax.
virtual void writeDict(Ostream &) const
Write dictionary.
void operator=(const perfectInterface &)=delete
Disallow default bitwise assignment.
const word & name() const
Return name of this modifier.
label index() const
Return the index of this modifier.
Hack of attachDetach to couple patches when they perfectly align. Does not decouple. Used by stitchMesh app. Does geometric matching.
virtual bool changeTopology() const
Check for topology change.
perfectInterface(const word &name, const label index, const polyTopoChanger &mme, const word &faceZoneName, const word &masterPatchName, const word &slavePatchName)
Construct from components.
Namespace for OpenFOAM.