fvMeshMoversInterpolator.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-2022 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 "volFields.H"
28 #include "pointFields.H"
29 #include "points0MotionSolver.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace fvMeshMovers
37 {
38  defineTypeNameAndDebug(interpolator, 0);
39  addToRunTimeSelectionTable(fvMeshMover, interpolator, fvMesh);
40 }
41 }
42 
43 
44 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 
47 :
48  fvMeshMover(mesh),
49  meshCoeffs_(dict()),
50  pointInterpolator_(mesh, meshCoeffs_),
51  displacement_(meshCoeffs_.lookup("displacement")),
52  points0_
53  (
54  displacement_
55  ? new pointVectorField(points0MotionSolver::readPoints0(mesh))
56  : nullptr
57  ),
58  velocityMotionCorrection_(mesh, dict())
59 {}
60 
61 
62 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
63 
65 {}
66 
67 
68 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
69 
70 
72 {
73  if (displacement_)
74  {
75  mesh().movePoints(points0_() + pointInterpolator_.curPointField()());
76  }
77  else
78  {
79  mesh().movePoints(pointInterpolator_.curPointField());
80  }
81 
82  velocityMotionCorrection_.update();
83 
84  return true;
85 }
86 
87 
89 {
91 }
92 
93 
95 {
96  if (displacement_)
97  {
98  points0_() == mesh().points();
99  }
100 }
101 
102 
104 (
105  const polyDistributionMap&
106 )
107 {
109 }
110 
111 
112 // ************************************************************************* //
virtual void distribute(const polyDistributionMap &)
Update corresponding to the given distribution map.
dictionary dict
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Abstract base class for fvMesh movers.
Definition: fvMeshMover.H:52
fvMesh & mesh
Macros for easy insertion into run-time selection tables.
virtual bool update()
Update the mesh for both mesh motion and topology change.
virtual const pointField & points() const
Return raw points.
Definition: polyMesh.C:1211
defineTypeNameAndDebug(none, 0)
stressControl lookup("compactNormalStress") >> compactNormalStress
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
interpolator(fvMesh &mesh)
Construct from fvMesh.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
Definition: fvMesh.C:1065
Virtual base class for displacement motion solvers.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
virtual void topoChange(const polyTopoChangeMap &)
Update corresponding to the given map.
fvMesh & mesh()
Return the fvMesh.
Definition: fvMeshMover.H:132
tmp< pointVectorField > curPointField() const
Return interpolated pointField for the currentTime.
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:50
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:353
addToRunTimeSelectionTable(fvMeshMover, none, fvMesh)
Namespace for OpenFOAM.