All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
externalDisplacementMeshMover.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) 2013-2019 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::externalDisplacementMeshMover
26 
27 Description
28  Virtual base class for mesh movers with externally provided displacement
29  field giving the boundary conditions. Move the mesh from the current
30  location to a new location (so modify the mesh; v.s. motionSolver that
31  only returns the new location).
32 
33  All mesh movers are expected to read the dictionary settings at invocation
34  of move(), i.e. not cache any settings.
35 
36 SourceFiles
37  externalDisplacementMeshMover.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef externalDisplacementMeshMover_H
42 #define externalDisplacementMeshMover_H
43 
44 #include "pointFields.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 class mapPolyMesh;
52 
53 /*---------------------------------------------------------------------------*\
54  Class externalDisplacementMeshMover Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 {
59 protected:
60 
61  // Protected data
62 
63  //- Baffles in the mesh
65 
66  //- Reference to point motion field
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("externalDisplacementMeshMover");
74 
75 
76  // Declare run-time New selection table
77 
79  (
80  autoPtr,
82  dictionary,
83  (
84  const dictionary& dict,
85  const List<labelPair>& baffles,
87  ),
88  (dict, baffles, pointDisplacement)
89  );
90 
91 
92  // Constructors
93 
94  //- Construct from dictionary and displacement field. Dictionary is
95  // allowed to go out of scope!
97  (
98  const dictionary& dict,
99  const List<labelPair>& baffles,
100  pointVectorField& pointDisplacement
101  );
102 
103  //- Disallow default bitwise copy construction
105  (
107  );
108 
109 
110  // Selectors
111 
112  //- Return a reference to the selected meshMover model
114  (
115  const word& type,
116  const dictionary& dict,
117  const List<labelPair>& baffles,
118  pointVectorField& pointDisplacement
119  );
120 
121 
122  //- Destructor
124 
125 
126  // Member Functions
127 
128  // Access
129 
130  //- Return reference to the point motion displacement field
132  {
133  return pointDisplacement_;
134  }
135 
136  //- Return const reference to the point motion displacement field
137  const pointVectorField& pointDisplacement() const
138  {
139  return pointDisplacement_;
140  }
142  const pointMesh& pMesh() const
143  {
144  return pointDisplacement_.mesh();
145  }
147  const polyMesh& mesh() const
148  {
149  return pMesh()();
150  }
151 
152 
153  // Mesh mover
154 
155  //- Move mesh using current pointDisplacement boundary values
156  // and current dictionary settings. Return true if successful
157  // (errors on checkFaces less than allowable). Updates
158  // pointDisplacement.
159  virtual bool move
160  (
161  const dictionary&,
162  const label nAllowableErrors,
163  labelList& checkFaces
164  ) = 0;
165 
166  //- Update local data for geometry changes
167  virtual void movePoints(const pointField&);
168 
169  //- Update local data for topology changes
170  virtual void updateMesh(const mapPolyMesh&);
171 
172 
173  // Member Operators
174 
175  //- Disallow default bitwise assignment
176  void operator=(const externalDisplacementMeshMover&) = delete;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
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
virtual void movePoints(const pointField &)
Update local data for geometry changes.
TypeName("externalDisplacementMeshMover")
Runtime type information.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
static autoPtr< externalDisplacementMeshMover > New(const word &type, const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement)
Return a reference to the selected meshMover model.
externalDisplacementMeshMover(const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement)
Construct from dictionary and displacement field. Dictionary is.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:48
declareRunTimeSelectionTable(autoPtr, externalDisplacementMeshMover, dictionary,(const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement),(dict, baffles, pointDisplacement))
pointVectorField & pointDisplacement()
Return reference to the point motion displacement field.
A class for handling words, derived from string.
Definition: word.H:59
virtual bool move(const dictionary &, const label nAllowableErrors, labelList &checkFaces)=0
Move mesh using current pointDisplacement boundary values.
pointVectorField & pointDisplacement_
Reference to point motion field.
const Mesh & mesh() const
Return mesh.
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
Virtual base class for mesh movers with externally provided displacement field giving the boundary co...
List< labelPair > baffles_
Baffles in the mesh.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
void operator=(const externalDisplacementMeshMover &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.