Loading...
Searching...
No Matches
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
32
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34
35namespace Foam
36{
39 (
43 );
44}
45
46
47// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48
49Foam::solidBodyMotionSolver::solidBodyMotionSolver
50(
51 const polyMesh& mesh,
52 const IOdictionary& dict
53)
54:
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(),
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...
const Time & time() const noexcept
Return Time associated with the objectRegistry.
Definition IOobject.C:456
A List with indirect addressing. Like IndirectList but does not store addressing.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Virtual base class for mesh motion solver.
const polyMesh & mesh() const
Return reference to mesh.
static autoPtr< motionSolver > New(const polyMesh &)
Select constructed from polyMesh.
const dictionary & coeffDict() const
Const access to the coefficients dictionary.
points0MotionSolver(const points0MotionSolver &)=delete
No copy construct.
pointIOField points0_
Starting points.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
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:75
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition tmp.H:215
const labelList & pointIDs() const noexcept
The point ids (for cell set/zone subset).
Definition zoneMotion.H:102
bool moveAllCells() const noexcept
Move all cells?
Definition zoneMotion.H:110
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
const pointField & points
Namespace for OpenFOAM.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
vectorField pointField
pointField is a vectorField.
void transformPoints(vectorField &, const septernion &, const vectorField &)
Transform given vectorField of coordinates with the given septernion.
dictionary dict
Spatial transformation functions for primitive fields.