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) 2011-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::pointMeshMover
26 
27 Description
28  Abstract base class for pointMesh movers.
29 
30 SourceFiles
31  pointMeshMover.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef pointMeshMover_H
36 #define pointMeshMover_H
37 
38 #include "pointField.H"
39 #include "Time.H"
40 #include "dictionary.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward class declarations
48 class polyMesh;
49 class polyTopoChangeMap;
50 class polyMeshMap;
51 class polyDistributionMap;
52 
53 /*---------------------------------------------------------------------------*\
54  Class pointMeshMover Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class pointMeshMover
58 {
59  // Private Data
60 
61  //- Reference to mesh
62  const polyMesh& mesh_;
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("pointMeshMover");
69 
70 
71  // Declare run-time constructor selection tables
72 
74  (
75  autoPtr,
77  dictionary,
78  (
79  const polyMesh& mesh,
80  const dictionary& dict
81  ),
82  (mesh, dict)
83  );
84 
85 
86  // Selectors
87 
88  //- Select constructed from polyMesh and dictionary
90  (
91  const polyMesh&,
92  const dictionary&
93  );
94 
95 
96  // Constructors
97 
98  //- Construct from polyMesh and dictionary and type.
99  pointMeshMover(const polyMesh& mesh, const word& type);
100 
101  //- Clone function
102  virtual autoPtr<pointMeshMover> clone() const;
103 
104 
105  //- Destructor
106  virtual ~pointMeshMover();
107 
108 
109  // Member Functions
110 
111  //- Return reference to mesh
112  const polyMesh& poly() const
113  {
114  return mesh_;
115  }
116 
117  //- Provide new points for motion. Solves for motion
118  virtual tmp<pointField> newPoints() = 0;
119 
120  //- Correct point field for reduced-dimensionality cases
121  virtual void twoDCorrectPoints(pointField&) const;
122 
123  //- Is the motion solid body? I.e., are the volumes and area magnitudes
124  // unchanged? Defaults to false. Set to true by
125  // pointMeshMovers::solidBodyMotion.
126  virtual bool solidBodyMotion() const
127  {
128  return false;
129  }
130 
131  //- Update local data for geometry changes
132  virtual void movePoints(const pointField&) = 0;
133 
134  //- Update local data for topology changes
135  virtual void topoChange(const polyTopoChangeMap&) = 0;
136 
137  //- Update corresponding to the given distribution map
138  virtual void distribute(const polyDistributionMap&) = 0;
139 
140  //- Update from another mesh using the given map
141  virtual void mapMesh(const polyMeshMap&) = 0;
142 
143  //- Optionally write motion state information for restart
144  virtual bool write() const;
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
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
Abstract base class for pointMesh movers.
virtual void mapMesh(const polyMeshMap &)=0
Update from another mesh using the given map.
virtual void distribute(const polyDistributionMap &)=0
Update corresponding to the given distribution map.
virtual bool solidBodyMotion() const
Is the motion solid body? I.e., are the volumes and area magnitudes.
declareRunTimeSelectionTable(autoPtr, pointMeshMover, dictionary,(const polyMesh &mesh, const dictionary &dict),(mesh, dict))
TypeName("pointMeshMover")
Runtime type information.
virtual void movePoints(const pointField &)=0
Update local data for geometry changes.
virtual ~pointMeshMover()
Destructor.
static autoPtr< pointMeshMover > New(const polyMesh &, const dictionary &)
Select constructed from polyMesh and dictionary.
pointMeshMover(const polyMesh &mesh, const word &type)
Construct from polyMesh and dictionary and type.
virtual autoPtr< pointMeshMover > clone() const
Clone function.
virtual void twoDCorrectPoints(pointField &) const
Correct point field for reduced-dimensionality cases.
virtual bool write() const
Optionally write motion state information for restart.
virtual tmp< pointField > newPoints()=0
Provide new points for motion. Solves for motion.
const polyMesh & poly() const
Return reference to mesh.
virtual void topoChange(const polyTopoChangeMap &)=0
Update local data for topology changes.
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:78
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Namespace for OpenFOAM.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
dictionary dict