pointMeshMover_fvMeshMover.C
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) 2021-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 \*---------------------------------------------------------------------------*/
25 
27 #include "pointMeshMover.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace fvMeshMovers
35 {
39  (
42  fvMesh,
43  motionSolver,
44  "motionSolver"
45  );
46 }
47 }
48 
49 
50 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 
53 (
54  fvMesh& mesh,
55  const dictionary& dict
56 )
57 :
59  pointMeshMoverName_
60  (
61  dict.found("motionSolver") ? "motionSolver" : pointMeshMover::typeName
62  ),
63  pointMeshMoverPtr_
64  (
66  (
67  mesh,
68  dict.optionalTypeDict(pointMeshMoverName_)
69  )
70  )
71 {}
72 
73 
74 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
75 
77 {}
78 
79 
80 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
81 
83 {
84  return pointMeshMoverPtr_();
85 }
86 
87 
89 {
90  return pointMeshMoverPtr_->solidBodyMotion();
91 }
92 
93 
95 {
96  mesh().preChange();
97 
98  mesh().movePoints(pointMeshMoverPtr_->newPoints());
99 
100  return true;
101 }
102 
103 
105 (
106  const polyTopoChangeMap& map
107 )
108 {
109  pointMeshMoverPtr_->topoChange(map);
110 }
111 
112 
114 {
115  pointMeshMoverPtr_->mapMesh(map);
116 }
117 
118 
120 (
121  const polyDistributionMap& map
122 )
123 {
124  pointMeshMoverPtr_->distribute(map);
125 }
126 
127 
129 {
130  if (write)
131  {
132  return pointMeshMoverPtr_->write();
133  }
134  else
135  {
136  return true;
137  }
138 }
139 
140 
141 // ************************************************************************* //
bool found
Macros for easy insertion into run-time selection tables.
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 fvMesh movers.
Definition: fvMeshMover.H:53
Wrapper class so that a pointMeshMover can be instantiated to move an fvMesh.
const Foam::pointMeshMover & mover() const
Return the pointMeshMover.
virtual void topoChange(const polyTopoChangeMap &)
Update corresponding to the given map.
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 write(const bool write=true) const
Write the motion solver state.
virtual bool update()
Update the mesh for both mesh motion and topology change.
virtual bool solidBodyMotion() const
Is this motion solid body? Delegate to the motion solver.
pointMeshMover(fvMesh &mesh, const dictionary &dict)
Construct from fvMesh.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
Definition: fvMesh.C:1210
void preChange()
Prepare for a mesh change.
Definition: fvMesh.C:1188
Abstract base class for pointMesh movers.
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
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
defineTypeNameAndDebug(none, 0)
addToRunTimeSelectionTable(fvMeshMover, none, fvMesh)
addBackwardCompatibleToRunTimeSelectionTable(fvMeshMover, pointMeshMover, fvMesh, motionSolver, "motionSolver")
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
Namespace for OpenFOAM.
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
dictionary dict