externalDisplacementMeshMover.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) 2013 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 private:
71 
72  // Private Member Functions
73 
74  //- Disallow default bitwise copy construct
76  (
78  );
79 
80  //- Disallow default bitwise assignment
81  void operator=(const externalDisplacementMeshMover&);
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("externalDisplacementMeshMover");
87 
88 
89  // Declare run-time New selection table
90 
92  (
93  autoPtr,
95  dictionary,
96  (
97  const dictionary& dict,
98  const List<labelPair>& baffles,
100  ),
101  (dict, baffles, pointDisplacement)
102  );
103 
104 
105  // Constructors
106 
107  //- Construct from dictionary and displacement field. Dictionary is
108  // allowed to go out of scope!
110  (
111  const dictionary& dict,
112  const List<labelPair>& baffles,
113  pointVectorField& pointDisplacement
114  );
115 
116 
117  // Selectors
118 
119  //- Return a reference to the selected meshMover model
121  (
122  const word& type,
123  const dictionary& dict,
124  const List<labelPair>& baffles,
125  pointVectorField& pointDisplacement
126  );
127 
128 
129  //- Destructor
131 
132 
133  // Member Functions
134 
135  // Access
136 
137  //- Return reference to the point motion displacement field
139  {
140  return pointDisplacement_;
141  }
142 
143  //- Return const reference to the point motion displacement field
144  const pointVectorField& pointDisplacement() const
145  {
146  return pointDisplacement_;
147  }
149  const pointMesh& pMesh() const
150  {
151  return pointDisplacement_.mesh();
152  }
154  const polyMesh& mesh() const
155  {
156  return pMesh()();
157  }
158 
159 
160  // Mesh mover
161 
162  //- Move mesh using current pointDisplacement boundary values
163  // and current dictionary settings. Return true if succesful
164  // (errors on checkFaces less than allowable). Updates
165  // pointDisplacement.
166  virtual bool move
167  (
168  const dictionary&,
169  const label nAllowableErrors,
170  labelList& checkFaces
171  ) = 0;
172 
173  //- Update local data for geometry changes
174  virtual void movePoints(const pointField&);
175 
176  //- Update local data for topology changes
177  virtual void updateMesh(const mapPolyMesh&);
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
TypeName("externalDisplacementMeshMover")
Runtime type information.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
virtual bool move(const dictionary &, const label nAllowableErrors, labelList &checkFaces)=0
Move mesh using current pointDisplacement boundary values.
static autoPtr< externalDisplacementMeshMover > New(const word &type, const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement)
Return a reference to the selected meshMover model.
A class for handling words, derived from string.
Definition: word.H:59
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
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:48
const Mesh & mesh() const
Return mesh.
pointVectorField & pointDisplacement()
Return reference to the point motion displacement field.
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 &)
Update local data for topology changes.
Namespace for OpenFOAM.
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
dictionary dict
declareRunTimeSelectionTable(autoPtr, externalDisplacementMeshMover, dictionary,( const dictionary &dict, const List< labelPair > &baffles, pointVectorField &pointDisplacement ),(dict, baffles, pointDisplacement))
pointVectorField & pointDisplacement_
Reference to point motion field.
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:589
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
List< labelPair > baffles_
Baffles in the mesh.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Virtual base class for mesh movers with externally provided displacement field giving the boundary co...