mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
sixDoFRigidBodyMotion: support re-reading of motion coefficients
This commit is contained in:
@ -190,4 +190,19 @@ bool Foam::motionSolver::writeObject
|
||||
}
|
||||
|
||||
|
||||
bool Foam::motionSolver::read()
|
||||
{
|
||||
if (regIOobject::read())
|
||||
{
|
||||
coeffDict_ = subDict(type() + "Coeffs");
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -156,6 +156,9 @@ public:
|
||||
IOstream::versionNumber ver,
|
||||
IOstream::compressionType cmp
|
||||
) const;
|
||||
|
||||
//- Read dynamicMeshDict dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -493,4 +493,22 @@ Foam::tmp<Foam::pointField> Foam::sixDoFRigidBodyMotion::scaledPosition
|
||||
}
|
||||
|
||||
|
||||
bool Foam::sixDoFRigidBodyMotion::read(const dictionary& dict)
|
||||
{
|
||||
dict.lookup("momentOfInertia") >> momentOfInertia_;
|
||||
dict.lookup("mass") >> mass_;
|
||||
aRelax_ = dict.lookupOrDefault<scalar>("accelerationRelaxation", 1.0);
|
||||
aDamp_ = dict.lookupOrDefault<scalar>("accelerationDamping", 1.0);
|
||||
report_ = dict.lookupOrDefault<Switch>("report", false);
|
||||
|
||||
restraints_.clear();
|
||||
addRestraints(dict);
|
||||
|
||||
constraints_.clear();
|
||||
addConstraints(dict);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -404,6 +404,11 @@ public:
|
||||
void write(Ostream&) const;
|
||||
|
||||
|
||||
//- Read coefficients dictionary and update system parameters,
|
||||
// constraints and restraints but not the current state
|
||||
bool read(const dictionary& dict);
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
friend Istream& operator>>(Istream&, sixDoFRigidBodyMotion&);
|
||||
|
||||
@ -250,4 +250,19 @@ bool Foam::sixDoFRigidBodyMotionSolver::writeObject
|
||||
}
|
||||
|
||||
|
||||
bool Foam::sixDoFRigidBodyMotionSolver::read()
|
||||
{
|
||||
if (displacementMotionSolver::read())
|
||||
{
|
||||
motion_.read(coeffDict());
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -133,6 +133,9 @@ public:
|
||||
IOstream::versionNumber ver,
|
||||
IOstream::compressionType cmp
|
||||
) const;
|
||||
|
||||
//- Read dynamicMeshDict dictionary
|
||||
virtual bool read();
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user