linearDisplacement_pointMeshMover.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) 2018-2026 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::pointMeshMovers::linearDisplacement
26 
27 Description
28  Mesh motion solver simple linear expansion and contraction of a mesh
29  region defined by a motion axis and the extents of the motion.
30 
31  Example:
32  \verbatim
33  mover pointMeshMover;
34 
35  libs ("libfvMotionSolvers.so");
36 
37  pointMeshMover linearDisplacement;
38 
39  axis (0 1 0);
40  xFixed 0.8;
41  xMoving 0;
42  displacement table
43  (
44  (0 0)
45  (4 0.7)
46  );
47  \endverbatim
48 
49  This mesh is compressed between \c xFixed and \c xMoving in the direction
50  \c axis between time 0 and 4 with a maximum displacement of 0.7.
51  The mesh beyond \c xFixed is fixed and beyond \c xMoving moves with maximum
52  displacement.
53 
54 SourceFiles
55  linearDisplacement_pointMeshMover.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef linearDisplacement_pointMeshMover_H
60 #define linearDisplacement_pointMeshMover_H
61 
62 #include "displacementPoints0.H"
63 #include "Function1.H"
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 namespace pointMeshMovers
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class linearDisplacement Declaration
74 \*---------------------------------------------------------------------------*/
75 
77 :
78  public displacementPoints0
79 {
80  // Private Data
81 
82  //- Axis of the linear motion
83  vector axis_;
84 
85  //- The location of the end of motion
86  scalar xFixed_;
87 
88  //- The location moving with the specified displacement
89  scalar xMoving_;
90 
91  //- The displacement as a function of time
92  autoPtr<Function1<scalar>> displacement_;
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("linearDisplacement");
99 
100 
101  // Constructors
102 
103  //- Construct from polyMesh and dictionary
104  linearDisplacement(const polyMesh&, const dictionary&);
105 
106  //- Disallow default bitwise copy construction
108  (
109  const linearDisplacement&
110  ) = delete;
111 
112 
113  //- Destructor
115 
116 
117  // Member Functions
118 
119  //- Return point location obtained from the current motion field
120  virtual tmp<pointField> newPoints();
121 
122  //- Update from another mesh using the given map (not implemented)
123  virtual void mapMesh(const polyMeshMap&);
124 
125 
126  // Member Operators
127 
128  //- Disallow default bitwise assignment
129  void operator=(const linearDisplacement&) = delete;
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace pointMeshMovers
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh motion solver simple linear expansion and contraction of a mesh region defined by a motion axis ...
TypeName("linearDisplacement")
Runtime type information.
void operator=(const linearDisplacement &)=delete
Disallow default bitwise assignment.
virtual tmp< pointField > newPoints()
Return point location obtained from the current motion field.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map (not implemented)
linearDisplacement(const polyMesh &, const dictionary &)
Construct from polyMesh and dictionary.
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.