solidBodyMotionSolver.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) 2016 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
31#include "transformField.H"
32
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34
35namespace Foam
36{
39 (
43 );
44}
45
46
47// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48
50(
51 const polyMesh& mesh,
52 const IOdictionary& dict
53)
54:
55 points0MotionSolver(mesh, dict, typeName),
56 SBMFPtr_(solidBodyMotionFunction::New(coeffDict(), mesh.time()))
57{}
58
59
60// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
61
63{
64 if (moveAllCells())
65 {
66 return transformPoints(SBMFPtr_().transformation(), points0_);
67 }
68 else
69 {
70 auto ttransformedPts = tmp<pointField>::New(mesh().points());
71 pointField& transformedPts = ttransformedPts.ref();
72
73 UIndirectList<point>(transformedPts, pointIDs()) = transformPoints
74 (
75 SBMFPtr_().transformation(),
76 pointField(points0_, pointIDs())
77 );
78
79 return ttransformedPts;
80 }
81}
82
83
84// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
A List with indirect addressing. Like IndirectList but does not store addressing.
Definition: IndirectList.H:79
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Virtual base class for mesh motion solver.
Definition: motionSolver.H:61
Virtual base class for displacement motion solvers, where the point motion is relative to a set of fi...
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Base class for defining solid-body motions.
Solid-body motion of the mesh specified by a run-time selectable motion function.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
A class for managing temporary objects.
Definition: tmp.H:65
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
dynamicFvMesh & mesh
const pointField & points
Namespace for OpenFOAM.
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
void transformPoints(vectorField &, const septernion &, const vectorField &)
Transform given vectorField of coordinates with the given septernion.
dictionary dict
Spatial transformation functions for primitive fields.