mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-06-22 16:28:30 +00:00
adapt the multiRotatingAxisMotion to v-1.0
This commit is contained in:
@ -22,6 +22,18 @@ Licence:
|
||||
#include "multiRotatingAxisMotion.hpp"
|
||||
#include "dictionary.hpp"
|
||||
|
||||
/// Construct from dictionary
|
||||
FUNCTION_H
|
||||
pFlow::multiRotatingAxis::multiRotatingAxis(const dictionary& dict)
|
||||
{
|
||||
if(!read(nullptr, dict))
|
||||
{
|
||||
fatalErrorInFunction<<
|
||||
" error in reading multiRotatingAxis from dictionary "<< dict.globalName()<<endl;
|
||||
fatalExit;
|
||||
}
|
||||
}
|
||||
|
||||
FUNCTION_H
|
||||
pFlow::multiRotatingAxis::multiRotatingAxis
|
||||
(
|
||||
@ -69,7 +81,7 @@ bool pFlow::multiRotatingAxis::read
|
||||
}
|
||||
else
|
||||
{
|
||||
parentAxisIndex_ = axisMotion-> nameToIndex(rotAxis);
|
||||
bool result = axisMotion-> nameToIndex(rotAxis, parentAxisIndex_);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -90,10 +102,33 @@ bool pFlow::multiRotatingAxis::write
|
||||
}
|
||||
else
|
||||
{
|
||||
auto rotAxis = axisMotion->indexToName(parentAxisIndex_);
|
||||
word rotAxis;
|
||||
bool result = axisMotion->indexToName(parentAxisIndex_, rotAxis);
|
||||
dict.add("rotationAxis", rotAxis);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
FUNCTION_H
|
||||
bool pFlow::multiRotatingAxis::write
|
||||
(
|
||||
dictionary& dict
|
||||
) const
|
||||
{
|
||||
if( !rotatingAxis::write(dict) ) return false;
|
||||
|
||||
if(parentAxisIndex_ == 0)
|
||||
{
|
||||
dict.add("rotationAxis", "none");
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// word rotAxis;
|
||||
// bool result = axisMotion->indexToName(parentAxisIndex_, rotAxis);
|
||||
// dict.add("rotationAxis", rotAxis);
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -82,16 +82,22 @@ protected:
|
||||
multiRotatingAxis* axisList_;
|
||||
|
||||
/// Index of parent axis
|
||||
int32 parentAxisIndex_ = -1;
|
||||
uint32 parentAxisIndex_ = static_cast<uint32>(-1);
|
||||
|
||||
public:
|
||||
|
||||
TypeInfoNV("multiRotatingAxis");
|
||||
|
||||
// - Constructors
|
||||
|
||||
/// Empty Constructor
|
||||
INLINE_FUNCTION_HD
|
||||
multiRotatingAxis(){}
|
||||
|
||||
/// Construct from dictionary
|
||||
FUNCTION_H
|
||||
explicit multiRotatingAxis(const dictionary& dict);
|
||||
|
||||
/// Empty with list of axes
|
||||
FUNCTION_H
|
||||
multiRotatingAxis(multiRotatingAxisMotion* axisMotion);
|
||||
@ -123,11 +129,11 @@ public:
|
||||
while(parIndex != -1)
|
||||
{
|
||||
auto& ax = axisList_[parIndex];
|
||||
parentVel += ax.linTangentialVelocityPoint(p);
|
||||
parentVel += ax.linVelocityPoint(p);
|
||||
parIndex = ax.parentAxisIndex();
|
||||
}
|
||||
|
||||
return parentVel + rotatingAxis::linTangentialVelocityPoint(p);
|
||||
return parentVel + rotatingAxis::linVelocityPoint(p);
|
||||
}
|
||||
|
||||
/// Translate point p for dt seconds based on the axis information
|
||||
@ -207,6 +213,10 @@ public:
|
||||
FUNCTION_H
|
||||
bool write(const multiRotatingAxisMotion* axisMotion, dictionary& dict) const;
|
||||
|
||||
/// Write to dictionary
|
||||
FUNCTION_H
|
||||
bool write(dictionary& dict) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user