perfectInterface.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::perfectInterface
29
30Description
31 Hack of attachDetach to couple patches when they perfectly align.
32 Does not decouple. Used by stitchMesh app. Does geometric matching.
33
34SourceFiles
35 perfectInterface.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef perfectInterface_H
40#define perfectInterface_H
41
42#include "polyMeshModifier.H"
43#include "polyPatchID.H"
44#include "ZoneIDs.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52// Forward Declarations
53class Time;
54
55/*---------------------------------------------------------------------------*\
56 Class perfectInterface Declaration
57\*---------------------------------------------------------------------------*/
60:
61 public polyMeshModifier
62{
63 // Private Data
64
65 //- Master face zone ID
66 faceZoneID faceZoneID_;
67
68 //- Master patch ID
69 polyPatchID masterPatchID_;
70
71 //- Slave patch ID
72 polyPatchID slavePatchID_;
73
74 //- Tolerance used for distance comparison
75 // (fraction of minimum edge length)
76 static const scalar tol_;
77
78
79 // Private Member Functions
80
81 //- Calculate face centres on patch
82 static pointField calcFaceCentres(const indirectPrimitivePatch&);
83
84
85 //- No copy construct
86 perfectInterface(const perfectInterface&) = delete;
87
88 //- No copy assignment
89 void operator=(const perfectInterface&) = delete;
90
91
92public:
93
94 //- Runtime type information
95 TypeName("perfectInterface");
96
97
98 // Constructors
99
100 //- Construct from components
102 (
103 const word& name,
104 const label index,
105 const polyTopoChanger& mme,
106 const word& faceZoneName,
107 const word& masterPatchName,
108 const word& slavePatchName
109 );
110
111 //- Construct from dictionary
113 (
114 const word& name,
115 const dictionary& dict,
116 const label index,
117 const polyTopoChanger& mme
118 );
119
120
121 //- Destructor
122 virtual ~perfectInterface() = default;
123
124
125 // Member Functions
126
127 //- Check for topology change
128 virtual bool changeTopology() const;
129
130 //- Insert the layer addition/removal instructions
131 // into the topological change
132 virtual void setRefinement(polyTopoChange&) const;
133
134 //- Insert the layer addition/removal instructions
135 // into the topological change. Uses only mesh, not any of the
136 // patch and zone indices. Bit of a workaround - used in extruding
137 // a mesh.
138 virtual void setRefinement
139 (
140 const indirectPrimitivePatch& pp0,
141 const indirectPrimitivePatch& pp1,
143 ) const;
144
145 //- Modify motion points to comply with the topological change
146 virtual void modifyMotionPoints(pointField& motionPoints) const;
147
148 //- Force recalculation of locally stored data on topological change
149 virtual void updateMesh(const mapPolyMesh&);
150
151 //- Write
152 virtual void write(Ostream&) const;
153
154 //- Write dictionary
155 virtual void writeDict(Ostream&) const;
156
157};
158
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162} // End namespace Foam
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166#endif
167
168// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of faces which address into the list of points.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Hack of attachDetach to couple patches when they perfectly align. Does not decouple....
TypeName("perfectInterface")
Runtime type information.
virtual bool changeTopology() const
Check for topology change.
virtual void writeDict(Ostream &) const
Write dictionary.
virtual ~perfectInterface()=default
Destructor.
virtual void setRefinement(polyTopoChange &) const
Insert the layer addition/removal instructions.
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
virtual void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Virtual base class for mesh modifiers.
label index() const
Return the index of this modifier.
const word & name() const
Return name of this modifier.
Direct mesh changes based on v1.3 polyTopoChange syntax.
List of mesh modifiers defining the mesh dynamics.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73