documentation for rotatingAxis

This commit is contained in:
Hamidreza Norouzi 2023-03-31 10:48:23 -07:00
parent c3a729e2d3
commit 8faa1a5e53
1 changed files with 45 additions and 2 deletions

View File

@ -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;