Loading...
Searching...
No Matches
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 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
32#include "volFields.H"
33
34// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35
36namespace Foam
37{
40 (
44 );
46 (
49 doInit
50 );
51}
52
53
54// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
55
56Foam::dynamicMotionSolverFvMesh::dynamicMotionSolverFvMesh
57(
58 const IOobject& io,
59 const bool doInit
60)
61:
62 dynamicFvMesh(io, doInit),
63 motionPtr_(nullptr)
64{
65 if (doInit)
66 {
67 init(false); // do not initialise lower levels
68 }
69}
70
71
72bool Foam::dynamicMotionSolverFvMesh::init(const bool doInit)
73{
74 if (doInit)
75 {
76 dynamicFvMesh::init(doInit);
77 }
78
79 motionPtr_ = motionSolver::New(*this);
80 return true;
81}
82
83
84Foam::dynamicMotionSolverFvMesh::dynamicMotionSolverFvMesh
85(
86 const IOobject& io,
88 faceList&& faces,
89 labelList&& allOwner,
90 labelList&& allNeighbour,
91 const bool syncPar
92)
93:
94 dynamicFvMesh
95 (
96 io,
97 std::move(points),
98 std::move(faces),
99 std::move(allOwner),
100 std::move(allNeighbour),
101 syncPar
102 ),
103 motionPtr_(motionSolver::New(*this))
104{}
105
106
107// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
110{
111 return *motionPtr_;
112}
113
114
116{
117 fvMesh::movePoints(motionPtr_->newPoints());
118
119 volVectorField* Uptr = getObjectPtr<volVectorField>("U");
120
121 if (Uptr)
122 {
124 }
125
126 return true;
127}
128
129
130// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
void correctBoundaryConditions()
Correct boundary field.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
Abstract base class for geometry and/or topology changing fvMesh.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
static autoPtr< dynamicFvMesh > New(const IOobject &io)
Select, construct and return the dynamicFvMesh.
The dynamicMotionSolverFvMesh.
virtual bool init(const bool doInit)
Initialise all non-demand-driven data.
virtual bool update()
Update the mesh for both mesh motion and topology change.
const motionSolver & motion() const
Return the motionSolver.
virtual bool movePoints()
Avoid masking surfaceInterpolation method.
Virtual base class for mesh motion solver.
static autoPtr< motionSolver > New(const polyMesh &)
Select constructed from polyMesh.
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
virtual const faceList & faces() const
Return raw faces.
Definition polyMesh.C:1088
virtual const pointField & points() const
Return raw points.
Definition polyMesh.C:1063
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
const auto & io
const pointField & points
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
List< label > labelList
A List of labels.
Definition List.H:62
List< face > faceList
List of faces.
Definition faceListFwd.H:41
vectorField pointField
pointField is a vectorField.