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 | Copyright (C) 2011 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  //- Disallow default bitwise copy construct
83 
84  //- Disallow default bitwise assignment
85  void operator=(const perfectInterface&);
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("perfectInterface");
92 
93 
94  // Constructors
95 
96  //- Construct from components
98  (
99  const word& name,
100  const label index,
101  const polyTopoChanger& mme,
102  const word& faceZoneName,
103  const word& masterPatchName,
104  const word& slavePatchName
105  );
106 
107  //- Construct from dictionary
109  (
110  const word& name,
111  const dictionary& dict,
112  const label index,
113  const polyTopoChanger& mme
114  );
115 
116 
117  //- Destructor
118  virtual ~perfectInterface();
119 
120 
121  // Member Functions
122 
123  //- Check for topology change
124  virtual bool changeTopology() const;
125 
126  //- Insert the layer addition/removal instructions
127  // into the topological change
128  virtual void setRefinement(polyTopoChange&) const;
129 
130  //- Insert the layer addition/removal instructions
131  // into the topological change. Uses only mesh, not any of the
132  // patch and zone indices. Bit of a workaround - used in extruding
133  // a mesh.
134  virtual void setRefinement
135  (
136  const indirectPrimitivePatch& pp0,
137  const indirectPrimitivePatch& pp1,
139  ) const;
140 
141  //- Modify motion points to comply with the topological change
142  virtual void modifyMotionPoints(pointField& motionPoints) const;
143 
144  //- Force recalculation of locally stored data on topological change
145  virtual void updateMesh(const mapPolyMesh&);
146 
147  //- Write
148  virtual void write(Ostream&) const;
149 
150  //- Write dictionary
151  virtual void writeDict(Ostream&) const;
152 
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
dictionary dict
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
TypeName("perfectInterface")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
virtual void write(Ostream &) const
Write.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
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
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:53
virtual ~perfectInterface()
Destructor.
Direct mesh changes based on v1.3 polyTopoChange syntax.
virtual void writeDict(Ostream &) const
Write dictionary.
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.
Namespace for OpenFOAM.