layeredDisplacement_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) 2024-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::layeredDisplacement
26 
27 Description
28  Interpolating motion solver for extruded/layered meshes
29 
30  Uses a topological walk from points along edges to points from one patch to
31  the opposite, accumulating distance and propagating displacement and then
32  again in the return direction and uses the distances from each point to the
33  two opposite patches to linearly interpolate the displacements of
34  these two patches to the each point.
35 
36  This motion solver is very simple to configure, only the two opposite
37  patches between which the mesh is layered need be specified as a pair of
38  patch names following the \c oppositePatches keyword, e.g.
39 
40  \verbatim
41  mover
42  {
43  type pointMeshMover;
44 
45  libs ("libfvMotionSolvers.so");
46 
47  pointMeshMover displacementLayered;
48 
49  oppositePatches (top bottom);
50  }
51  \endverbatim
52 
53 SourceFiles
54  layeredDisplacement.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef layeredDisplacement_pointMeshMover_H
59 #define layeredDisplacement_pointMeshMover_H
60 
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 namespace pointMeshMovers
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class layeredDisplacement Declaration
72 \*---------------------------------------------------------------------------*/
73 
75 :
76  public displacement
77 {
78  // Private Data
79 
80  //- Names of the opposite patches of the layered mesh
81  Pair<word> oppositePatchNames_;
82 
83  //- Indices of the opposite patches of the layered mesh
84  Pair<label> oppositePatches_;
85 
86 
87  // Private Member Functions
88 
89  //- Walk across the layers from the startPatch to the opposite patch
90  // accumulating the distance and setting the displacement
91  void walkLayers
92  (
93  const polyPatch& startPatch,
94  scalarField& distance,
96  ) const;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("layeredDisplacement");
103 
104 
105  // Constructors
106 
107  //- Construct from polyMesh and dictionary
108  layeredDisplacement(const polyMesh&, const dictionary&);
109 
110  //- Disallow default bitwise copy construction
111  layeredDisplacement(const layeredDisplacement&) = delete;
112 
113 
114  //- Destructor
116 
117 
118  // Member Functions
119 
120  //- Return point location obtained from the current motion field
121  virtual tmp<pointField> newPoints();
122 
123  //- Update from another mesh using the given map (not implemented)
124  virtual void mapMesh(const polyMeshMap&);
125 
126 
127  // Member Operators
128 
129  //- Disallow default bitwise assignment
130  void operator=(const layeredDisplacement&) = delete;
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace pointMeshMovers
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Abstract base class for displacement pointMesh movers.
Interpolating motion solver for extruded/layered meshes.
TypeName("layeredDisplacement")
Runtime type information.
layeredDisplacement(const polyMesh &, const dictionary &)
Construct from polyMesh and dictionary.
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)
void operator=(const layeredDisplacement &)=delete
Disallow default bitwise assignment.
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:71
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.