dynamicMotionSolverFvMesh.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2012 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
30 #include "motionSolver.H"
31 #include "volFields.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37  defineTypeNameAndDebug(dynamicMotionSolverFvMesh, 0);
39  (
40  dynamicFvMesh,
41  dynamicMotionSolverFvMesh,
42  IOobject
43  );
44 }
45 
46 
47 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 
49 Foam::dynamicMotionSolverFvMesh::dynamicMotionSolverFvMesh(const IOobject& io)
50 :
51  dynamicFvMesh(io),
52  motionPtr_(motionSolver::New(*this))
53 {}
54 
55 
56 Foam::dynamicMotionSolverFvMesh::dynamicMotionSolverFvMesh
57 (
58  const IOobject& io,
60  faceList&& faces,
61  labelList&& allOwner,
62  labelList&& allNeighbour,
63  const bool syncPar
64 )
65 :
67  (
68  io,
69  std::move(points),
70  std::move(faces),
71  std::move(allOwner),
72  std::move(allNeighbour),
73  syncPar
74  ),
75  motionPtr_(motionSolver::New(*this))
76 {}
77 
78 
79 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
80 
82 {}
83 
84 
85 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
86 
88 {
89  return *motionPtr_;
90 }
91 
92 
94 {
95  // Scan through AMI patches and update
96 
97 
98  fvMesh::movePoints(motionPtr_->newPoints());
99 
100  volVectorField* Uptr = getObjectPtr<volVectorField>("U");
101 
102  if (Uptr)
103  {
104  Uptr->correctBoundaryConditions();
105  }
106 
107  return true;
108 }
109 
110 
111 // ************************************************************************* //
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Foam::motionSolver::New
static autoPtr< motionSolver > New(const polyMesh &)
Select constructed from polyMesh.
Definition: motionSolver.C:150
volFields.H
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
motionSolver.H
Foam::dynamicMotionSolverFvMesh::update
virtual bool update()
Update the mesh for both mesh motion and topology change.
Definition: dynamicMotionSolverFvMesh.C:93
Foam::dynamicFvMesh
Abstract base class for geometry and/or topology changing fvMesh.
Definition: dynamicFvMesh.H:78
Foam::dynamicMotionSolverFvMesh::motion
const motionSolver & motion() const
Return the motionSolver.
Definition: dynamicMotionSolverFvMesh.C:87
Foam::Field< vector >
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::surfaceInterpolation::movePoints
bool movePoints()
Do what is necessary if the mesh has moved.
Definition: surfaceInterpolation.C:125
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
Foam::motionSolver
Virtual base class for mesh motion solver.
Definition: motionSolver.H:58
dynamicMotionSolverFvMesh.H
Foam::List< face >
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::GeometricField< vector, fvPatchField, volMesh >
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::dynamicMotionSolverFvMesh::~dynamicMotionSolverFvMesh
~dynamicMotionSolverFvMesh()
Destructor.
Definition: dynamicMotionSolverFvMesh.C:81