Reorganized sixDOFbodies in terms of sixDOFODE
This commit is contained in:
parent
fd575d39b1
commit
3232e008ea
4 changed files with 30 additions and 29 deletions
|
@ -36,7 +36,7 @@ Description
|
|||
#include "objectRegistry.H"
|
||||
#include "foamTime.H"
|
||||
#include "ODESolver.H"
|
||||
#include "sixDOFbodies.H"
|
||||
#include "sixDOFBodies.H"
|
||||
#include "OFstream.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
@ -48,7 +48,7 @@ int main(int argc, char *argv[])
|
|||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
|
||||
sixDOFbodies structure(runTime);
|
||||
sixDOFBodies structure(runTime);
|
||||
OFstream of(runTime.path()/"motion.dat");
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
|
|
@ -12,10 +12,11 @@ $(ODESolvers)/SIBS/polyExtrapolate.C
|
|||
sixDOF = sixDOF
|
||||
$(sixDOF)/finiteRotation/finiteRotation.C
|
||||
$(sixDOF)/sixDOFqODE/sixDOFqODE.C
|
||||
$(sixDOF)/sixDOFbodies/sixDOFbodies.C
|
||||
|
||||
$(sixDOF)/sixDOFODE/sixDOFODE.C
|
||||
$(sixDOF)/sixDOFODE/newSixDOFODE.C
|
||||
$(sixDOF)/quaternionSixDOF/quaternionSixDOF.C
|
||||
|
||||
$(sixDOF)/sixDOFBodies/sixDOFBodies.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libODE
|
||||
|
|
|
@ -22,7 +22,7 @@ License
|
|||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
sixDOFbodies
|
||||
sixDOFBodies
|
||||
|
||||
Description
|
||||
6-DOF solver for multiple bodies
|
||||
|
@ -33,11 +33,11 @@ Author
|
|||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "objectRegistry.H"
|
||||
#include "sixDOFbodies.H"
|
||||
#include "sixDOFBodies.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::sixDOFbodies::setBodies()
|
||||
void Foam::sixDOFBodies::setBodies()
|
||||
{
|
||||
// Find if duplicate name existes
|
||||
forAll (names_, bodyI)
|
||||
|
@ -51,8 +51,9 @@ void Foam::sixDOFbodies::setBodies()
|
|||
{
|
||||
if (names_[bodyI] == names_[otherBody])
|
||||
{
|
||||
FatalErrorIn("sixDOFbodies::setBodies()")
|
||||
<< "Duplicate names of bodies: this is not allowed"
|
||||
FatalErrorIn("sixDOFBodies::setBodies()")
|
||||
<< "Found duplicate name: " << names_[bodyI]
|
||||
<< " for bodies. This is not allowed."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +67,7 @@ void Foam::sixDOFbodies::setBodies()
|
|||
odes_.set
|
||||
(
|
||||
bodyI,
|
||||
new sixDOFqODE
|
||||
sixDOFODE::New
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
|
@ -94,7 +95,7 @@ void Foam::sixDOFbodies::setBodies()
|
|||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::sixDOFbodies::sixDOFbodies
|
||||
Foam::sixDOFBodies::sixDOFBodies
|
||||
(
|
||||
const Time& runTime
|
||||
)
|
||||
|
@ -121,7 +122,7 @@ Foam::sixDOFbodies::sixDOFbodies
|
|||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::sixDOFbodies::solve()
|
||||
void Foam::sixDOFBodies::solve()
|
||||
{
|
||||
const scalar tol = readScalar(lookup("eps"));
|
||||
|
||||
|
@ -141,13 +142,13 @@ void Foam::sixDOFbodies::solve()
|
|||
}
|
||||
|
||||
|
||||
const Foam::wordList& Foam::sixDOFbodies::names() const
|
||||
const Foam::wordList& Foam::sixDOFBodies::names() const
|
||||
{
|
||||
return names_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::PtrList<Foam::sixDOFqODE>& Foam::sixDOFbodies::operator()() const
|
||||
const Foam::PtrList<Foam::sixDOFODE>& Foam::sixDOFBodies::operator()() const
|
||||
{
|
||||
return odes_;
|
||||
}
|
|
@ -22,7 +22,7 @@ License
|
|||
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
sixDOFbodies
|
||||
sixDOFBodies
|
||||
|
||||
Description
|
||||
6-DOF solver for multiple bodies
|
||||
|
@ -31,18 +31,17 @@ Author
|
|||
Dubravko Matijasevic, FSB Zagreb. All rights reserved.
|
||||
|
||||
SourceFiles
|
||||
sixDOFbodies.C
|
||||
sixDOFBodies.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef sixDOFbodies_H
|
||||
#define sixDOFbodies_H
|
||||
#ifndef sixDOFBodies_H
|
||||
#define sixDOFBodies_H
|
||||
|
||||
#include "foamTime.H"
|
||||
#include "IOdictionary.H"
|
||||
#include "sixDOFqODE.H"
|
||||
#include "sixDOFODE.H"
|
||||
#include "ODESolver.H"
|
||||
#include "finiteRotation.H"
|
||||
#include "primitiveFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
@ -51,10 +50,10 @@ namespace Foam
|
|||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class sixDOFbodies Declaration
|
||||
Class sixDOFBodies Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class sixDOFbodies
|
||||
class sixDOFBodies
|
||||
:
|
||||
public IOdictionary
|
||||
{
|
||||
|
@ -63,10 +62,10 @@ class sixDOFbodies
|
|||
//- Reference to time
|
||||
const Time& runTime_;
|
||||
|
||||
// Pointer list of Foam::sixDOFqODE objects
|
||||
PtrList<sixDOFqODE> odes_;
|
||||
// Pointer list of Foam::sixDOFODE objects
|
||||
PtrList<sixDOFODE> odes_;
|
||||
|
||||
// Pointer list of Foam::sixDOFqODE solvers
|
||||
// Pointer list of Foam::sixDOFODE solvers
|
||||
PtrList<ODESolver> solvers_;
|
||||
|
||||
// Name list of solved bodies
|
||||
|
@ -76,10 +75,10 @@ class sixDOFbodies
|
|||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
sixDOFbodies(const sixDOFbodies&);
|
||||
sixDOFBodies(const sixDOFBodies&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const sixDOFbodies&);
|
||||
void operator=(const sixDOFBodies&);
|
||||
|
||||
//- Set bodies
|
||||
void setBodies();
|
||||
|
@ -90,12 +89,12 @@ public:
|
|||
// Constructors
|
||||
|
||||
//- Construct from Time
|
||||
sixDOFbodies(const Time& runTime);
|
||||
sixDOFBodies(const Time& runTime);
|
||||
|
||||
|
||||
// Destructor
|
||||
|
||||
virtual ~sixDOFbodies()
|
||||
virtual ~sixDOFBodies()
|
||||
{}
|
||||
|
||||
|
||||
|
@ -105,7 +104,7 @@ public:
|
|||
const wordList& names() const;
|
||||
|
||||
//- Return list of bodies
|
||||
const PtrList<sixDOFqODE>& operator()() const;
|
||||
const PtrList<sixDOFODE>& operator()() const;
|
||||
|
||||
//- Solve ODEs and update position
|
||||
void solve();
|
Reference in a new issue