mappedPolyPatch.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::mappedPolyPatch
26 
27 Description
28  Poly patch which can do interpolative mapping of values from another
29  globally conforming poly patch
30 
31 SourceFiles
32  mappedPolyPatch.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef mappedPolyPatch_H
37 #define mappedPolyPatch_H
38 
39 #include "polyPatch.H"
40 #include "mappedPatchBase.H"
41 
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class mappedPolyPatch Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class mappedPolyPatch
53 :
54  public polyPatch,
55  public mappedPatchBase
56 {
57 
58 protected:
59 
60  // Protected Member Functions
61 
62  //- Calculate the patch geometry
63  virtual void calcGeometry(PstreamBuffers&);
64 
65  //- Correct patches after moving points
66  virtual void movePoints(PstreamBuffers&, const pointField&);
67 
68  //- Update of the patch topology
69  virtual void topoChange(PstreamBuffers&);
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("mapped");
76 
77 
78  // Constructors
79 
80  //- Construct from components
82  (
83  const word& name,
84  const label size,
85  const label start,
86  const label index,
87  const polyBoundaryMesh& bm,
88  const word& patchType
89  );
90 
91  //- Construct from dictionary
93  (
94  const word& name,
95  const dictionary& dict,
96  const label index,
97  const polyBoundaryMesh& bm,
98  const word& patchType
99  );
100 
101  //- Construct as copy, resetting the boundary mesh
103  (
104  const mappedPolyPatch&,
105  const polyBoundaryMesh&
106  );
107 
108  //- Construct given the original patch and resetting the
109  // face list and boundary mesh information
111  (
112  const mappedPolyPatch& pp,
113  const polyBoundaryMesh& bm,
114  const label index,
115  const label newSize,
116  const label newStart
117  );
118 
119  //- Construct and return a clone, resetting the boundary mesh
120  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
121  {
122  return autoPtr<polyPatch>(new mappedPolyPatch(*this, bm));
123  }
124 
125  //- Construct and return a clone, resetting the face list
126  // and boundary mesh
127  virtual autoPtr<polyPatch> clone
128  (
129  const polyBoundaryMesh& bm,
130  const label index,
131  const label newSize,
132  const label newStart
133  ) const
134  {
135  return autoPtr<polyPatch>
136  (
137  new mappedPolyPatch(*this, bm, index, newSize, newStart)
138  );
139  }
140 
141 
142  //- Destructor
143  virtual ~mappedPolyPatch();
144 
145 
146  // Member Functions
147 
148  //- Write the polyPatch data as a dictionary
149  virtual void write(Ostream&) const;
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
autoPtr< PrimitivePatch< SubList< face >, const pointField & > > clone() const
Construct and return a clone.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
label size() const
Return the number of elements in the UList.
Definition: UListI.H:311
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Engine and base class for poly patches which provides interpolative mapping between two globally conf...
Poly patch which can do interpolative mapping of values from another globally conforming poly patch.
TypeName("mapped")
Runtime type information.
virtual ~mappedPolyPatch()
Destructor.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
mappedPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
virtual void topoChange(PstreamBuffers &)
Update of the patch topology.
label index() const
Return the index of this patch in the boundaryMesh.
const word & name() const
Return name.
Foam::polyBoundaryMesh.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:280
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
dictionary dict