mappedInternalPolyPatch.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) 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::mappedInternalPolyPatch
26 
27 Description
28  Patch which holds a mapping engine to map cell values onto the patch
29 
30 SourceFiles
31  mappedInternalPolyPatch.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef mappedInternalPolyPatch_H
36 #define mappedInternalPolyPatch_H
37 
38 #include "polyPatch.H"
40 
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class polyMesh;
48 
49 /*---------------------------------------------------------------------------*\
50  Class mappedInternalPolyPatch Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public polyPatch,
57 {
58 
59 protected:
60 
61  //- Initialise the calculation of the patch geometry
62  virtual void initCalcGeometry(PstreamBuffers&);
63 
64  //- Calculate the patch geometry
65  virtual void calcGeometry(PstreamBuffers&);
66 
67  //- Initialise the patches for moving points
68  virtual void initMovePoints(PstreamBuffers&, const pointField&);
69 
70  //- Correct patches after moving points
71  virtual void movePoints(PstreamBuffers&, const pointField&);
72 
73  //- Initialise the update of the patch topology
74  virtual void initTopoChange(PstreamBuffers&);
75 
76  //- Update of the patch topology
77  virtual void topoChange(PstreamBuffers&);
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("mappedInternal");
84 
85 
86  // Constructors
87 
88  //- Construct from components
90  (
91  const word& name,
92  const label size,
93  const label start,
94  const label index,
95  const polyBoundaryMesh& bm,
96  const word& patchType
97  );
98 
99  //- Construct from dictionary
101  (
102  const word& name,
103  const dictionary& dict,
104  const label index,
105  const polyBoundaryMesh& bm,
106  const word& patchType
107  );
108 
109  //- Construct as copy, resetting the boundary mesh
111  (
113  const polyBoundaryMesh&
114  );
115 
116  //- Construct given the original patch and resetting the
117  // face list and boundary mesh information
119  (
120  const mappedInternalPolyPatch& pp,
121  const polyBoundaryMesh& bm,
122  const label index,
123  const label newSize,
124  const label newStart
125  );
126 
127  //- Construct and return a clone, resetting the boundary mesh
128  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
129  {
130  return autoPtr<polyPatch>(new mappedInternalPolyPatch(*this, bm));
131  }
132 
133  //- Construct and return a clone, resetting the face list
134  // and boundary mesh
135  virtual autoPtr<polyPatch> clone
136  (
137  const polyBoundaryMesh& bm,
138  const label index,
139  const label newSize,
140  const label newStart
141  ) const
142  {
143  return autoPtr<polyPatch>
144  (
145  new mappedInternalPolyPatch(*this, bm, index, newSize, newStart)
146  );
147  }
148 
149 
150  //- Destructor
151  virtual ~mappedInternalPolyPatch();
152 
153 
154  // Member Functions
155 
156  //- Write the polyPatch data as a dictionary
157  virtual void write(Ostream&) const;
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
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 which provides mapping from cells to patch faces.
Patch which holds a mapping engine to map cell values onto the patch.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
mappedInternalPolyPatch(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 initCalcGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
virtual ~mappedInternalPolyPatch()
Destructor.
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
virtual void initTopoChange(PstreamBuffers &)
Initialise the update of the patch topology.
TypeName("mappedInternal")
Runtime type information.
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