displacementMotionSolver.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) 2012-2015 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::displacementMotionSolver
26 
27 Description
28  Virtual base class for displacement motion solver
29 
30  The boundary displacement is set as a boundary condition
31  on the pointDisplacement pointVectorField.
32 
33 SourceFiles
34  displacementMotionSolver.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef displacementMotionSolver_H
39 #define displacementMotionSolver_H
40 
41 #include "motionSolver.H"
42 #include "pointFields.H"
43 #include "pointIOField.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 class mapPolyMesh;
51 
52 /*---------------------------------------------------------------------------*\
53  Class displacementMotionSolver Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
58  public motionSolver
59 {
60 protected:
61 
62  // Protected data
63 
64  //- Point motion field
66 
67  //- Starting points
69 
70 
71 private:
72 
73  // Private Member Functions
74 
75  //- Disallow default bitwise copy construct
77 
78  //- Disallow default bitwise assignment
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("displacementMotionSolver");
86 
87 
88  // Declare run-time constructor selection tables
89 
91  (
92  autoPtr,
94  displacement,
95  (
96  const polyMesh& mesh,
97  const IOdictionary& dict,
99  const pointIOField& points0
100  ),
102  );
103 
104  // Static Member Functions
105 
106  //- Return IO object for points0
107  static IOobject points0IO(const polyMesh& mesh);
108 
109 
110  // Selectors
111 
112  //- Select constructed from polyMesh, dictionary and components.
113  // If dictionary was registered this will 'steal' that registration.
115  (
116  const word& solverTypeName,
117  const polyMesh&,
118  const IOdictionary&,
120  const pointIOField& points0
121  );
122 
123 
124  // Constructors
125 
126  //- Construct from mesh and dictionary
128  (
129  const polyMesh&,
130  const IOdictionary&,
131  const word& type
132  );
133 
134  //- Construct from mesh and dictionary
136  (
137  const polyMesh&,
138  const IOdictionary&,
140  const pointIOField& points0,
141  const word& type
142  );
143 
144 
145  //- Destructor
146  virtual ~displacementMotionSolver();
147 
148 
149  // Member Functions
150 
151  //- Return reference to the reference field
153  {
154  return points0_;
155  }
156 
157  //- Return reference to the reference field
158  const pointField& points0() const
159  {
160  return points0_;
161  }
162 
163  //- Return reference to the point motion displacement field
165  {
166  return pointDisplacement_;
167  }
168 
169  //- Return const reference to the point motion displacement field
170  const pointVectorField& pointDisplacement() const
171  {
172  return pointDisplacement_;
173  }
174 
175  //- Update local data for geometry changes
176  virtual void movePoints(const pointField&);
177 
178  //- Update local data for topology changes
179  virtual void updateMesh(const mapPolyMesh&);
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::displacementMotionSolver::New
static autoPtr< displacementMotionSolver > New(const word &solverTypeName, const polyMesh &, const IOdictionary &, const pointVectorField &pointDisplacement, const pointIOField &points0)
Select constructed from polyMesh, dictionary and components.
Definition: displacementMotionSolver.C:182
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::IOField< vector >
Foam::displacementMotionSolver::pointDisplacement
pointVectorField & pointDisplacement()
Return reference to the point motion displacement field.
Definition: displacementMotionSolver.H:163
motionSolver.H
Foam::displacementMotionSolver::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
Definition: displacementMotionSolver.C:248
pointIOField.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::displacementMotionSolver::pointDisplacement
const pointVectorField & pointDisplacement() const
Return const reference to the point motion displacement field.
Definition: displacementMotionSolver.H:169
Foam::displacementMotionSolver::~displacementMotionSolver
virtual ~displacementMotionSolver()
Destructor.
Definition: displacementMotionSolver.C:236
Foam::displacementMotionSolver::points0
const pointField & points0() const
Return reference to the reference field.
Definition: displacementMotionSolver.H:157
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::displacementMotionSolver::pointDisplacement_
pointVectorField pointDisplacement_
Point motion field.
Definition: displacementMotionSolver.H:64
Foam::displacementMotionSolver::points0_
pointIOField points0_
Starting points.
Definition: displacementMotionSolver.H:67
Foam::displacementMotionSolver
Virtual base class for displacement motion solver.
Definition: displacementMotionSolver.H:55
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::displacementMotionSolver::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, displacementMotionSolver, displacement,(const polyMesh &mesh, const IOdictionary &dict, const pointVectorField &pointDisplacement, const pointIOField &points0),(mesh, dict, pointDisplacement, points0))
Foam::displacementMotionSolver::points0
pointField & points0()
Return reference to the reference field.
Definition: displacementMotionSolver.H:151
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::motionSolver
Virtual base class for mesh motion solver.
Definition: motionSolver.H:53
Foam::displacementMotionSolver::movePoints
virtual void movePoints(const pointField &)
Update local data for geometry changes.
Definition: displacementMotionSolver.C:242
Foam::displacementMotionSolver::operator=
void operator=(const displacementMotionSolver &)
Disallow default bitwise assignment.
Foam::displacementMotionSolver::displacementMotionSolver
displacementMotionSolver(const displacementMotionSolver &)
Disallow default bitwise copy construct.
Foam::motionSolver::mesh
const polyMesh & mesh() const
Return reference to mesh.
Definition: motionSolver.H:125
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::displacementMotionSolver::points0IO
static IOobject points0IO(const polyMesh &mesh)
Return IO object for points0.
Definition: displacementMotionSolver.C:40
Foam::displacementMotionSolver::TypeName
TypeName("displacementMotionSolver")
Runtime type information.
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
pointFields.H