solidBodyMotionSolver.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) 2016-2023 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::solidBodyMotionSolver
26 
27 Description
28  Solid-body motion of the mesh specified by a run-time selectable
29  motion function.
30 
31 SourceFiles
32  solidBodyMotionSolver.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef solidBodyMotionSolver_H
37 #define solidBodyMotionSolver_H
38 
39 #include "points0MotionSolver.H"
41 #include "polyCellSet.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class solidBodyMotionSolver Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public points0MotionSolver
55 {
56  // Private Data
57 
58  //- The motion control function
60 
61  //- The name of the cell zone to restrict motion to
62  polyCellSet set_;
63 
64  //- Points to move when cell zone is supplied
65  labelList setPointIndices_;
66 
67  //- Cache the current transform for topoChange
68  mutable septernion transform_;
69 
70 
71  // Private Member Functions
72 
73  //- Re-calculate the set point ID-s from the set, following mesh change
74  void updateSetPointIndices();
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("solidBody");
81 
82 
83  // Constructors
84 
85  //- Construct from mesh and dictionary
87  (
88  const word& name,
89  const polyMesh&,
90  const dictionary&
91  );
92 
93  //- Disallow default bitwise copy construction
95 
96 
97  //- Destructor
99 
100 
101  // Member Functions
102 
103  //- Return point location obtained from the current motion field
104  virtual tmp<pointField> curPoints() const;
105 
106  //- This is a solid body motion
107  virtual bool solidBody() const
108  {
109  return true;
110  }
111 
112  //- Solve for motion
113  virtual void solve()
114  {}
115 
116  //- Update local data for topology changes
117  virtual void topoChange(const polyTopoChangeMap&);
118 
119  //- Update corresponding to the given distribution map
120  virtual void distribute(const polyDistributionMap&);
121 
122  //- Update from another mesh using the given map
123  virtual void mapMesh(const polyMeshMap&);
124 
125 
126  // Member Operators
127 
128  //- Disallow default bitwise assignment
129  void operator=(const solidBodyMotionSolver&) = delete;
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
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
const word & name() const
Return name.
Definition: motionSolver.H:125
Virtual base class for displacement motion solvers.
General run-time selected cell set selection class for polyMesh.
Definition: polyCellSet.H:82
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Septernion class used to perform translations and rotations in 3D space.
Definition: septernion.H:66
Solid-body motion of the mesh specified by a run-time selectable motion function.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
solidBodyMotionSolver(const word &name, const polyMesh &, const dictionary &)
Construct from mesh and dictionary.
void operator=(const solidBodyMotionSolver &)=delete
Disallow default bitwise assignment.
virtual void topoChange(const polyTopoChangeMap &)
Update local data for topology changes.
virtual void distribute(const polyDistributionMap &)
Update corresponding to the given distribution map.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual bool solidBody() const
This is a solid body motion.
TypeName("solidBody")
Runtime type information.
virtual void solve()
Solve for motion.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.