functionalRigidBody_pointMeshMover.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) 2018-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 
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace pointMeshMovers
35 {
37 
39  (
43  );
44 }
45 }
46 
47 
48 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
49 
51 Foam::pointMeshMovers::functionalRigidBody::transforms0() const
52 {
53  List<septernion> transforms0(SBMFs_.size());
54 
55  forAll(SBMFs_, i)
56  {
57  transforms0[i] = SBMFs_[i].transformation();
58  }
59 
60  return transforms0;
61 }
62 
63 
64 void Foam::pointMeshMovers::functionalRigidBody::moveBodies()
65 {}
66 
67 
68 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
69 
71 (
72  const polyMesh& mesh,
73  const dictionary& dict
74 )
75 :
77 {
78  SBMFs_.setSize(bodyMeshes_.size());
79 
80  if (dict.isDict("bodies"))
81  {
82  const dictionary& bodiesDict = dict.subDict("bodies");
83 
84  label i = 0;
85  forAllConstIter(IDLList<entry>, bodiesDict, iter)
86  {
87  const dictionary& bodyDict = iter().dict();
88 
89  SBMFs_.set
90  (
91  i++,
92  solidBodyMotionFunction::New(bodyDict, mesh.time(), "function")
93  );
94  }
95  }
96  else
97  {
98  SBMFs_.set
99  (
100  0,
102  );
103  }
104 
105  if (dict.isDict("exterior") && dict.subDict("exterior").found("function"))
106  {
107  SBMFs_.set
108  (
109  SBMFs_.size() - 1,
111  (
112  dict.subDict("exterior"),
113  mesh.time(),
114  "function"
115  )
116  );
117  }
118  else
119  {
120  SBMFs_.set
121  (
122  SBMFs_.size() - 1,
123  new solidBodyMotionFunctions::none("function", mesh.time())
124  );
125  }
126 }
127 
128 
129 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
130 
132 {}
133 
134 
135 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:449
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Definition: UList.H:492
Macros for easy insertion into run-time selection tables.
Template class for intrusive linked lists.
Definition: ILList.H:67
label size() const
Return the number of elements in the UPtrList.
Definition: UPtrListI.H:29
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:433
Abstract base class for pointMesh movers.
Motion of the mesh specified as a list of pointMeshMovers.
Multiple rigid body mesh motion in which movement is specified as a solidBodyMotionFunction for each ...
functionalRigidBody(const polyMesh &, const dictionary &dict)
Construct from polyMesh and dictionary.
Abstract base-class for multiple rigid body mesh motion.
PtrList< bodyMesh > bodyMeshes_
List of the bodyMeshes containing the patches and point motion.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
static autoPtr< solidBodyMotionFunction > New(const dictionary &SBMFCoeffs, const Time &runTime, const word &name="solidBodyMotionFunction")
Select constructed from the SBMFCoeffs dictionary and Time.
Dummy motion function for stationary regions.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
addToRunTimeSelectionTable(pointMeshMover, externalDisplacement, dictionary)
defineTypeNameAndDebug(externalDisplacement, 0)
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dictionary dict