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