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
64 
65  //- Master patch ID
67 
68  //- Slave patch ID
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
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 // ************************************************************************* //
Foam::perfectInterface::~perfectInterface
virtual ~perfectInterface()
Destructor.
Definition: perfectInterface.C:130
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::perfectInterface::slavePatchID_
polyPatchID slavePatchID_
Slave patch ID.
Definition: perfectInterface.H:68
Foam::perfectInterface::tol_
static const scalar tol_
Tolerance used for distance comparison (fraction of minimum edge.
Definition: perfectInterface.H:72
Foam::polyTopoChanger
List of mesh modifiers defining the mesh dynamics.
Definition: polyTopoChanger.H:56
Foam::perfectInterface::modifyMotionPoints
virtual void modifyMotionPoints(pointField &motionPoints) const
Modify motion points to comply with the topological change.
Definition: perfectInterface.C:479
Foam::polyTopoChange
Direct mesh changes based on v1.3 polyTopoChange syntax.
Definition: polyTopoChange.H:97
Foam::polyMeshModifier::index
label index() const
Return the index of this modifier.
Definition: polyMeshModifier.H:149
Foam::perfectInterface::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
Definition: perfectInterface.C:486
ZoneIDs.H
Foam::perfectInterface::masterPatchID_
polyPatchID masterPatchID_
Master patch ID.
Definition: perfectInterface.H:65
Foam::perfectInterface::setRefinement
virtual void setRefinement(polyTopoChange &) const
Insert the layer addition/removal instructions.
Definition: perfectInterface.C:435
Foam::DynamicID< faceZoneMesh >
Foam::perfectInterface::calcFaceCentres
static pointField calcFaceCentres(const indirectPrimitivePatch &)
Calculate face centres on patch.
Definition: perfectInterface.C:63
Foam::perfectInterface::writeDict
virtual void writeDict(Ostream &) const
Write dictionary.
Definition: perfectInterface.C:507
polyPatchID.H
Foam::label
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
Foam::perfectInterface::TypeName
TypeName("perfectInterface")
Runtime type information.
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::perfectInterface::operator=
void operator=(const perfectInterface &)
Disallow default bitwise assignment.
Foam::perfectInterface::changeTopology
virtual bool changeTopology() const
Check for topology change.
Definition: perfectInterface.C:136
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::perfectInterface
Hack of attachDetach to couple patches when they perfectly align. Does not decouple....
Definition: perfectInterface.H:55
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::polyMeshModifier
Virtual base class for mesh modifiers.
Definition: polyMeshModifier.H:61
Foam::polyMeshModifier::name
const word & name() const
Return name of this modifier.
Definition: polyMeshModifier.H:143
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::perfectInterface::perfectInterface
perfectInterface(const perfectInterface &)
Disallow default bitwise copy construct.
polyMeshModifier.H
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatchTemplate.H:88
Foam::perfectInterface::faceZoneID_
faceZoneID faceZoneID_
Master face zone ID.
Definition: perfectInterface.H:62
Foam::perfectInterface::write
virtual void write(Ostream &) const
Write.
Definition: perfectInterface.C:497