From 8faa1a5e531257240e6b98e11726d03c3ec9758d Mon Sep 17 00:00:00 2001 From: Hamidreza Norouzi Date: Fri, 31 Mar 2023 10:48:23 -0700 Subject: [PATCH] documentation for rotatingAxis --- .../entities/rotatingAxis/rotatingAxis.hpp | 47 ++++++++++++++++++- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/src/MotionModel/entities/rotatingAxis/rotatingAxis.hpp b/src/MotionModel/entities/rotatingAxis/rotatingAxis.hpp index 07e8de5d..0fa38bc7 100644 --- a/src/MotionModel/entities/rotatingAxis/rotatingAxis.hpp +++ b/src/MotionModel/entities/rotatingAxis/rotatingAxis.hpp @@ -32,6 +32,33 @@ class rotatingAxis; #include "rotatingAxisFwd.hpp" +/** + * An axis which rotates around itself at specified speed + * + * This defines an axis with two end points that rotates around + * itself at specified speed (rad/s). + * + * + \verbatim + // This creates an axis of rotation around x-axis, rotation starts at t = 1 s + // and ends at t = 5 s. + { + p1 (0 0 0); + p2 (1 0 0); + omega 1.57; + startTime 1; + endTime 5; + } \endverbatim + * + * | parameter | value type | discription | optional (default) | + * |----| ---- | ---- | ---- | + * | p1 | realx3 | begin point of axis | No | + * | p2 | realx3 | end point of axis | No | + * | omega | real | rotation speed (rad/s) | No | + * | startTime | real | start time of rotation (s) | Yes (0) | + * | endTime | real | end time of rotation (s) | Yes (infinity) | + * + */ class rotatingAxis : public timeInterval, @@ -39,56 +66,72 @@ class rotatingAxis { protected: - // rotation speed + /// rotation speed real omega_ = 0; + /// is rotating bool rotating_ = false; public: + // - Constructor + + /// Empty constructor FUNCTION_HD rotatingAxis(){} + /// Construct from dictionary FUNCTION_H rotatingAxis(const dictionary& dict); + /// Construct from components FUNCTION_HD rotatingAxis(const realx3& p1, const realx3& p2, real omega = 0.0); + /// Copy constructor FUNCTION_HD rotatingAxis(const rotatingAxis&) = default; + /// Copy asssignment rotatingAxis& operator=(const rotatingAxis&) = default; + /// Set omega FUNCTION_HD real setOmega(real omega); - + /// Return omega INLINE_FUNCTION_HD real omega()const { return omega_; } + /// Is rotating INLINE_FUNCTION_HD bool isRotating()const { return rotating_; } + /// Linear tangential velocity at point p INLINE_FUNCTION_HD realx3 linTangentialVelocityPoint(const realx3 &p)const; // - IO operation + + /// Read from dictionary FUNCTION_H bool read(const dictionary& dict); + /// Write to dictionary FUNCTION_H bool write(dictionary& dict) const; + /// Read from input stream is FUNCTION_H bool read(iIstream& is); + /// Write to output stream os FUNCTION_H bool write(iOstream& os)const;