Added member function to initialize force and moment in sixDOFODE

This commit is contained in:
Vuko Vukcevic 2017-03-14 14:57:49 +01:00 committed by Hrvoje Jasak
parent 5a249bc26a
commit 65b8ad2fc7
2 changed files with 22 additions and 0 deletions

View file

@ -316,6 +316,13 @@ public:
const dimensionedVector& externalMoment
);
//- Initialize force and moment for the first time step
inline void initExternalForceAndMoment
(
const dimensionedVector& externalForce,
const dimensionedVector& externalMoment
);
// Access to motion constraints

View file

@ -114,6 +114,21 @@ void Foam::sixDOFODE::setExternalForceAndMoment
}
void Foam::sixDOFODE::initExternalForceAndMoment
(
const dimensionedVector& externalForce,
const dimensionedVector& externalMoment
)
{
// Initialise force and moment only for the first time step
if (curTimeIndex_ == -1)
{
force_ = externalForce;
moment_ = externalMoment;
}
}
const Foam::PtrList<Foam::translationalConstraint>&
Foam::sixDOFODE::translationalConstraints() const
{