1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 6-DOF solver for multiple bodies
31 Dubravko Matijasevic, FSB Zagreb. All rights reserved.
33 \*---------------------------------------------------------------------------*/
35 #include "objectRegistry.H"
36 #include "sixDOFbodies.H"
38 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
40 void Foam::sixDOFbodies::setBodies()
42 // Find if duplicate name existes
43 forAll (names_, bodyI)
47 label otherBody = bodyI + 1;
48 otherBody < names_.size();
52 if (names_[bodyI] == names_[otherBody])
54 FatalErrorIn("sixDOFbodies::setBodies()")
55 << "Duplicate names of bodies: this is not allowed"
61 odes_.setSize(names_.size());
62 solvers_.setSize(names_.size());
64 forAll (names_, bodyI)
95 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
97 Foam::sixDOFbodies::sixDOFbodies
116 names_(lookup("bodies"))
122 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
124 void Foam::sixDOFbodies::solve()
126 const scalar tol = readScalar(lookup("eps"));
128 forAll (odes_, bodyI)
130 Info << "Solving 6-DOF for " << names_[bodyI] << " in time"
131 << tab << "T = " << runTime_.value() << " s" << endl;
133 solvers_[bodyI].solve
136 runTime_.value() + runTime_.deltaT().value(),
138 runTime_.deltaT().value()
144 const Foam::wordList& Foam::sixDOFbodies::names() const
150 const Foam::PtrList<Foam::sixDOFqODE>& Foam::sixDOFbodies::operator()() const
156 // ************************************************************************* //