sixDoFRigidBodyMotion::axialAngularSpring: Function1 based replacement for tabulatedAxialAngularSpring
axialAngularSpring uses a Function1 for the angular spring moment and linear damping. Tabulated data is supported using the 'table' Function1.
This commit is contained in:
@ -10,7 +10,7 @@ $(restraints)/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C
|
||||
$(restraints)/linearAxialAngularSpring/linearAxialAngularSpring.C
|
||||
$(restraints)/linearSpring/linearSpring.C
|
||||
$(restraints)/sphericalAngularSpring/sphericalAngularSpring.C
|
||||
$(restraints)/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C
|
||||
$(restraints)/axialAngularSpring/axialAngularSpring.C
|
||||
$(restraints)/linearDamper/linearDamper.C
|
||||
$(restraints)/sphericalAngularDamper/sphericalAngularDamper.C
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "tabulatedAxialAngularSpring.H"
|
||||
#include "axialAngularSpring.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "sixDoFRigidBodyMotion.H"
|
||||
#include "transform.H"
|
||||
@ -35,12 +35,12 @@ namespace Foam
|
||||
{
|
||||
namespace sixDoFRigidBodyMotionRestraints
|
||||
{
|
||||
defineTypeNameAndDebug(tabulatedAxialAngularSpring, 0);
|
||||
defineTypeNameAndDebug(axialAngularSpring, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
sixDoFRigidBodyMotionRestraint,
|
||||
tabulatedAxialAngularSpring,
|
||||
axialAngularSpring,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
@ -49,8 +49,8 @@ namespace sixDoFRigidBodyMotionRestraints
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::
|
||||
tabulatedAxialAngularSpring
|
||||
Foam::sixDoFRigidBodyMotionRestraints::axialAngularSpring::
|
||||
axialAngularSpring
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& sDoFRBMRDict
|
||||
@ -69,15 +69,15 @@ tabulatedAxialAngularSpring
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::
|
||||
~tabulatedAxialAngularSpring()
|
||||
Foam::sixDoFRigidBodyMotionRestraints::axialAngularSpring::
|
||||
~axialAngularSpring()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void
|
||||
Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::restrain
|
||||
Foam::sixDoFRigidBodyMotionRestraints::axialAngularSpring::restrain
|
||||
(
|
||||
const sixDoFRigidBodyMotion& motion,
|
||||
vector& restraintPosition,
|
||||
@ -142,7 +142,7 @@ Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::restrain
|
||||
}
|
||||
|
||||
|
||||
bool Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::read
|
||||
bool Foam::sixDoFRigidBodyMotionRestraints::axialAngularSpring::read
|
||||
(
|
||||
const dictionary& sDoFRBMRDict
|
||||
)
|
||||
@ -175,10 +175,7 @@ bool Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::read
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
moment_.reset
|
||||
(
|
||||
new Function1s::Table<scalar>("moment", sDoFRBMRCoeffs_)
|
||||
);
|
||||
moment_ = Function1<scalar>::New("moment", sDoFRBMRCoeffs_);
|
||||
|
||||
const word angleFormat = sDoFRBMRCoeffs_.lookup("angleFormat");
|
||||
|
||||
@ -203,7 +200,7 @@ bool Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::read
|
||||
}
|
||||
|
||||
|
||||
void Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::write
|
||||
void Foam::sixDoFRigidBodyMotionRestraints::axialAngularSpring::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
@ -22,19 +22,19 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring
|
||||
Foam::sixDoFRigidBodyMotionRestraints::axialAngularSpring
|
||||
|
||||
Description
|
||||
sixDoFRigidBodyMotionRestraints model. Axial angular spring with moment
|
||||
values drawn from an interpolation table. Linear damping.
|
||||
Axial angular spring with moment values obtained from a Function1 and
|
||||
linear damping.
|
||||
|
||||
SourceFiles
|
||||
tabulatedAxialAngularSpring.C
|
||||
axialAngularSpring.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef tabulatedAxialAngularSpring_H
|
||||
#define tabulatedAxialAngularSpring_H
|
||||
#ifndef axialAngularSpring_H
|
||||
#define axialAngularSpring_H
|
||||
|
||||
#include "sixDoFRigidBodyMotionRestraint.H"
|
||||
#include "point.H"
|
||||
@ -50,10 +50,10 @@ namespace sixDoFRigidBodyMotionRestraints
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class tabulatedAxialAngularSpring Declaration
|
||||
Class axialAngularSpring Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class tabulatedAxialAngularSpring
|
||||
class axialAngularSpring
|
||||
:
|
||||
public sixDoFRigidBodyMotionRestraint
|
||||
{
|
||||
@ -66,7 +66,7 @@ class tabulatedAxialAngularSpring
|
||||
vector axis_;
|
||||
|
||||
//- Spring moment as a function of angle
|
||||
autoPtr<Function1s::Table<scalar>> moment_;
|
||||
autoPtr<Function1<scalar>> moment_;
|
||||
|
||||
//- Boolean stating whether the angle around the axis needs to
|
||||
// be converted to degrees before evaluating the moment function
|
||||
@ -79,13 +79,13 @@ class tabulatedAxialAngularSpring
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("tabulatedAxialAngularSpring");
|
||||
TypeName("axialAngularSpring");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
tabulatedAxialAngularSpring
|
||||
axialAngularSpring
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& sDoFRBMRDict
|
||||
@ -96,13 +96,13 @@ public:
|
||||
{
|
||||
return autoPtr<sixDoFRigidBodyMotionRestraint>
|
||||
(
|
||||
new tabulatedAxialAngularSpring(*this)
|
||||
new axialAngularSpring(*this)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~tabulatedAxialAngularSpring();
|
||||
virtual ~axialAngularSpring();
|
||||
|
||||
|
||||
// Member Functions
|
||||
Reference in New Issue
Block a user