1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "multiMotion.H"
27 #include "addToRunTimeSelectionTable.H"
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 namespace solidBodyMotionFunctions
35 defineTypeNameAndDebug(multiMotion, 0);
36 addToRunTimeSelectionTable
38 solidBodyMotionFunction,
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 Foam::solidBodyMotionFunctions::multiMotion::multiMotion
50 const dictionary& SBMFCoeffs,
54 solidBodyMotionFunction(SBMFCoeffs, runTime)
60 // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
62 Foam::solidBodyMotionFunctions::multiMotion::~multiMotion()
66 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
69 Foam::solidBodyMotionFunctions::multiMotion::transformation() const
71 scalar t = time_.value();
73 septernion TR = SBMFs_[0].transformation();
75 for (label i = 1; i < SBMFs_.size(); i++)
77 TR *= SBMFs_[i].transformation();
80 Info<< "solidBodyMotionFunctions::multiMotion::transformation(): "
81 << "Time = " << t << " transformation: " << TR << endl;
87 bool Foam::solidBodyMotionFunctions::multiMotion::read
89 const dictionary& SBMFCoeffs
92 solidBodyMotionFunction::read(SBMFCoeffs);
95 SBMFs_.setSize(SBMFCoeffs_.size());
97 forAllConstIter(IDLList<entry>, SBMFCoeffs_, iter)
104 solidBodyMotionFunction::New(iter().dict(), time_)
107 Info<< "Constructed SBMF " << i << " : "
108 << iter().keyword() << " of type "
109 << SBMFs_[i].type() << endl;
119 // ************************************************************************* //