motion model docs are added

This commit is contained in:
Hamidreza Norouzi 2023-04-02 09:17:16 -07:00
parent 8faa1a5e53
commit 9105a503ce
8 changed files with 579 additions and 364 deletions

View File

@ -1554,7 +1554,7 @@ FORMULA_MACROFILE =
# The default value is: NO. # The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES. # This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO USE_MATHJAX = YES
# When MathJax is enabled you can set the default output format to be used for # When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see: # the MathJax output. See the MathJax site (see:

View File

@ -32,38 +32,88 @@ namespace pFlow
class dictionary; class dictionary;
class multiRotatingAxisMotion; class multiRotatingAxisMotion;
/**
* Defines an axis of rotation that rotates around itself and rotates around
* another axis.
*
* This axis rotates around itself and can have one axis of rotation, and that
* axis of rotation can have another axis of rotatoin and so on.
*
*
\verbatim
// This creates an axis around x-axis. This axis rotates round itself at
// 1.57 rad/s and at the same time rotates around rotating axis axisName.
// axisName is separatly defined in the same dictionray.
axis1
{
p1 (0 0 0);
p2 (1 0 0);
omega 1.57;
rotationAxis axisName;
startTime 1;
endTime 5;
}
axisName
{
p1 (0 0 0);
p2 (0 1 1);
omega 3.14;
} \endverbatim
*
*
* | Parameter | Type | Description | Optional [default value] |
* |----| :---: | ---- | :---: |
* | p1 | realx3 | begin point of axis | No |
* | p2 | realx3 | end point of axis | No |
* | omega | real | rotation speed (rad/s) | No |
* | rotationAxis | word | the axis rotates around this axis | Yes [none] |
* | startTime | real | start time of rotation (s) | Yes [0] |
* | endTime | real | end time of rotation (s) | Yes [infinity] |
*
*/
class multiRotatingAxis class multiRotatingAxis
: :
public rotatingAxis public rotatingAxis
{ {
protected: protected:
// this is either host/device pointer /// This is either host/device pointer to all axes
multiRotatingAxis* axisList_; multiRotatingAxis* axisList_;
/// Index of parent axis
int32 parentAxisIndex_ = -1; int32 parentAxisIndex_ = -1;
public: public:
// - Constructors
/// Empty Constructor
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
multiRotatingAxis(){} multiRotatingAxis(){}
/// Empty with list of axes
FUNCTION_H FUNCTION_H
multiRotatingAxis(multiRotatingAxisMotion* axisMotion); multiRotatingAxis(multiRotatingAxisMotion* axisMotion);
/// Construct from dictionary and list of axes
FUNCTION_H FUNCTION_H
multiRotatingAxis(multiRotatingAxisMotion* axisMotion, const dictionary& dict); multiRotatingAxis(multiRotatingAxisMotion* axisMotion, const dictionary& dict);
/*FUNCTION_HD /// Copy constructor
multiRotatingAxis(const realx3& p1, const realx3& p2, real omega = 0.0);*/
FUNCTION_HD FUNCTION_HD
multiRotatingAxis(const multiRotatingAxis&) = default; multiRotatingAxis(const multiRotatingAxis&) = default;
/// Copy assignment
FUNCTION_HD FUNCTION_HD
multiRotatingAxis& operator=(const multiRotatingAxis&) = default; multiRotatingAxis& operator=(const multiRotatingAxis&) = default;
/// Destructor
~multiRotatingAxis() = default;
/// - Methods
/// Tangential velocity at point p
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
realx3 pointTangentialVel(const realx3& p)const realx3 pointTangentialVel(const realx3& p)const
{ {
@ -80,8 +130,7 @@ public:
return parentVel + rotatingAxis::linTangentialVelocityPoint(p); return parentVel + rotatingAxis::linTangentialVelocityPoint(p);
} }
/// Translate point p for dt seconds based on the axis information
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
realx3 transferPoint(const realx3& p, real dt)const realx3 transferPoint(const realx3& p, real dt)const
{ {
@ -104,31 +153,39 @@ public:
return newP; return newP;
} }
/// Does this axis have a parent
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
bool hasParrent()const bool hasParent()const
{ {
return parentAxisIndex_ > -1; return parentAxisIndex_ > -1;
} }
/// Return the index of parent axis
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
int32 parentAxisIndex()const int32 parentAxisIndex()const
{ {
return parentAxisIndex_; return parentAxisIndex_;
} }
// this pointer is device pointer /// Set the pointer to the list of all axes.
/// This pointer is device pointer
INLINE_FUNCTION_H INLINE_FUNCTION_H
void setAxisList(multiRotatingAxis* axisList) void setAxisList(multiRotatingAxis* axisList)
{ {
axisList_ = axisList; axisList_ = axisList;
} }
// it is assumed that the axis with deepest level
// (with more parrents) is moved first and then /**
// the axis with lower levels * Move the end points of the axis
*
* This function moves the end points of this axis, if it has any parrents.
* It is assumed that the axis with deepest level (with more parrents) is
* moved first and then the axis with lower levels.
*/
void move(real dt) void move(real dt)
{ {
if( !hasParrent() ) return; if( !hasParent() ) return;
auto lp1 = point1(); auto lp1 = point1();
auto lp2 = point2(); auto lp2 = point2();
@ -140,39 +197,18 @@ public:
} }
// - IO operation // - IO operation
/// Read from dictionary
FUNCTION_H FUNCTION_H
bool read(multiRotatingAxisMotion* axisMotion, const dictionary& dict); bool read(multiRotatingAxisMotion* axisMotion, const dictionary& dict);
/// Write to dictionary
FUNCTION_H FUNCTION_H
bool write(const multiRotatingAxisMotion* axisMotion, dictionary& dict) const; bool write(const multiRotatingAxisMotion* axisMotion, dictionary& dict) const;
/*FUNCTION_H
bool read(iIstream& is);
FUNCTION_H
bool write(iOstream& os)const;*/
}; };
/*inline iOstream& operator <<(iOstream& os, const multiRotatingAxis& ax)
{
if(!ax.write(os))
{
fatalExit;
}
return os;
}
inline iIstream& operator >>(iIstream& is, multiRotatingAxis& ax)
{
if( !ax.read(is) )
{
fatalExit;
}
return is;
}*/
} }

View File

@ -50,13 +50,13 @@ class rotatingAxis;
endTime 5; endTime 5;
} \endverbatim } \endverbatim
* *
* | parameter | value type | discription | optional (default) | * | Parameter | Type | Description | Optional [default value] |
* |----| ---- | ---- | ---- | * |----| :---: | ---- | ---- |
* | p1 | realx3 | begin point of axis | No | * | p1 | realx3 | begin point of axis | No |
* | p2 | realx3 | end point of axis | No | * | p2 | realx3 | end point of axis | No |
* | omega | real | rotation speed (rad/s) | No | * | omega | real | rotation speed (rad/s) | No |
* | startTime | real | start time of rotation (s) | Yes (0) | * | startTime | real | start time of rotation (s) | Yes [0] |
* | endTime | real | end time of rotation (s) | Yes (infinity) | * | endTime | real | end time of rotation (s) | Yes [infinity] |
* *
*/ */
class rotatingAxis class rotatingAxis

View File

@ -29,10 +29,39 @@ Licence:
namespace pFlow namespace pFlow
{ {
// forward
class dictionary; class dictionary;
class vibrating;
/**
* Vibrating model for a wall
*
* Creates a sinoidal virating model for a wall. The viration is defined by
* frequency, amplitude and phase angle.
* \f[
\vec{v}(t) = \vec{A} sin(\vec{\omega}(t-startTime)+\vec{\phi})
\f]
\verbatim
// This creates sinoidal vibration on the wall in x-direction. The viration
// starts at t = 0 s and ends at t = 10 s.
{
angularFreq (10 0 0);
amplitude ( 1 0 0);
phaseAngle ( 0 0 0);
startTime 0;
endTime 10;
} \endverbatim
*
* *
* | Parameter | Type | Description | Optional [default value] |
* |----| :---: | ---- | :---: |
* | angularFreq | realx3 | angular frequency of vibration (rad/s) | No |
* | amplitude | realx3 | rotation speed (m/s) | No |
* | phaseAngle | realx3 | phase angle (rad) | Yes [(0 0 0)] |
* | startTime | real | start time of rotation (s) | Yes [0] |
* | endTime | real | end time of rotation (s) | Yes [infinity] |
*
*/
class vibrating class vibrating
: :
public timeInterval public timeInterval

View File

@ -34,12 +34,26 @@ namespace pFlow
class dictionary; class dictionary;
/**
* Fixed wall motion model for walls
*
* This class is used for geometries that are fixed during simulation.
*
*
\verbatim
// In geometryDict file, this will defines fixed walls during simulation
...
motionModel fixedWall;
...
\endverbatim
*/
class fixedWall class fixedWall
{ {
public: public:
// - this class shuold be decleared in every motion model with /** Motion model class to be passed to computational units/kernels for
// exact methods * transfing points and returning velocities at various positions
*/
class Model class Model
{ {
@ -81,48 +95,66 @@ public:
protected: protected:
/// Name
const word name_ = "none"; const word name_ = "none";
/// Read from a dictionary
bool readDictionary(const dictionary& dict); bool readDictionary(const dictionary& dict);
/// write to a dictionary
bool writeDictionary(dictionary& dict)const; bool writeDictionary(dictionary& dict)const;
public: public:
/// Type info
TypeInfoNV("fixedWall"); TypeInfoNV("fixedWall");
// empty // - Constructors
/// Empty
fixedWall(); fixedWall();
// construct with dictionary /// Constructor with dictionary
fixedWall(const dictionary& dict); fixedWall(const dictionary& dict);
/// Copy constructor
fixedWall(const fixedWall&) = default; fixedWall(const fixedWall&) = default;
/// Move constructor
fixedWall(fixedWall&&) = default; fixedWall(fixedWall&&) = default;
/// Copy assignment
fixedWall& operator=(const fixedWall&) = default; fixedWall& operator=(const fixedWall&) = default;
/// Move assignment
fixedWall& operator=(fixedWall&&) = default; fixedWall& operator=(fixedWall&&) = default;
/// Destructor
~fixedWall() = default; ~fixedWall() = default;
// - Methods
/// Return motion model
/// t is the current simulation time
Model getModel(real t)const Model getModel(real t)const
{ {
return Model(); return Model();
} }
/// Name of the motion component to index
int32 nameToIndex(const word& name)const int32 nameToIndex(const word& name)const
{ {
return 0; return 0;
} }
/// Index of motion component to name
word indexToName(label i)const word indexToName(label i)const
{ {
return name_; return name_;
} }
/// Velocity at point p
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
realx3 pointVelocity(label n, const realx3& p)const realx3 pointVelocity(label n, const realx3& p)const
{ {
@ -130,39 +162,43 @@ public:
} }
/// Transfer point p for dt seconds according to motion component n
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
realx3 transferPoint(label n, const realx3 p, real dt)const realx3 transferPoint(label n, const realx3 p, real dt)const
{ {
return p; return p;
} }
/// Transfer a vector of point pVec for dt seconds according to motion
/// component n
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
bool transferPoint(label n, realx3* pVec, size_t numP, real dt) bool transferPoint(label n, realx3* pVec, size_t numP, real dt)
{ {
return true; return true;
} }
/// Are walls moving
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
bool isMoving()const bool isMoving()const
{ {
return false; return false;
} }
/// Move points
bool move(real t, real dt) bool move(real t, real dt)
{ {
return true; return true;
} }
// - IO operations
/// Read from input stream is
FUNCTION_H FUNCTION_H
bool read(iIstream& is); bool read(iIstream& is);
/// Write to output stream os
FUNCTION_H FUNCTION_H
bool write(iOstream& os)const; bool write(iOstream& os)const;
}; };
} // pFlow } // pFlow

View File

@ -32,14 +32,43 @@ Licence:
namespace pFlow namespace pFlow
{ {
// forward
class dictionary; class dictionary;
/**
* Rotating axis motion model for walls
*
* This class is used for simulaiton that at least one wall components
* is moving according to multiRotatingAxis motion mode. One or more than one
* motion components can be defined in multiRotatingAxisMotionInfo dictionary
*
\verbatim
// In geometryDict file, this will defines multi-rotating walls during simulation
...
motionModel multiRotatingAxisMotion;
multiRotatingAxisMotionInfo
{
rotationAxis1
{
// the definition based on class multiRotatingAxis
}
rotatoinAxis2
{
// the definition based on calss multiRotatingAxis
}
}
...
\endverbatim
*
*/
class multiRotatingAxisMotion class multiRotatingAxisMotion
{ {
public: public:
// - this class shuold be decleared in every motion model with /** Motion model class to be passed to computational units/kernels for
// exact methods * transfing points and returning velocities at various positions
*/
class Model class Model
{ {
protected: protected:
@ -91,47 +120,60 @@ protected:
using axisVector_HD = VectorDual<multiRotatingAxis>; using axisVector_HD = VectorDual<multiRotatingAxis>;
/// Vector of multiRotaingAxis axes
axisVector_HD axis_; axisVector_HD axis_;
/// Sorted index based on number of parrents each axis ha
VectorDual<int32> sortedIndex_; VectorDual<int32> sortedIndex_;
/// List of axes names
wordList axisName_; wordList axisName_;
/// Number of axes
label numAxis_= 0; label numAxis_= 0;
/// Read from a dictionary
bool readDictionary(const dictionary& dict); bool readDictionary(const dictionary& dict);
/// Write to a dictionary
bool writeDictionary(dictionary& dict)const; bool writeDictionary(dictionary& dict)const;
public: public:
/// Type info
TypeInfoNV("multiRotatingAxisMotion"); TypeInfoNV("multiRotatingAxisMotion");
// empty // - Constructor
/// Empty constructor
FUNCTION_H FUNCTION_H
multiRotatingAxisMotion(); multiRotatingAxisMotion();
// construct with dictionary /// Construct with dictionary
FUNCTION_H FUNCTION_H
multiRotatingAxisMotion(const dictionary& dict); multiRotatingAxisMotion(const dictionary& dict);
// copy /// Copy constructor
FUNCTION_H FUNCTION_H
multiRotatingAxisMotion(const multiRotatingAxisMotion&) = default; multiRotatingAxisMotion(const multiRotatingAxisMotion&) = default;
/// No Move
multiRotatingAxisMotion(multiRotatingAxisMotion&&) = delete; multiRotatingAxisMotion(multiRotatingAxisMotion&&) = delete;
/// Copy assignment
FUNCTION_H FUNCTION_H
multiRotatingAxisMotion& operator=(const multiRotatingAxisMotion&) = default; multiRotatingAxisMotion& operator=(const multiRotatingAxisMotion&) = default;
/// No move assignment
multiRotatingAxisMotion& operator=(multiRotatingAxisMotion&&) = delete; multiRotatingAxisMotion& operator=(multiRotatingAxisMotion&&) = delete;
/// Destructor
FUNCTION_H FUNCTION_H
~multiRotatingAxisMotion() = default; ~multiRotatingAxisMotion() = default;
// - Methods
/// Retrun motion model at time t
Model getModel(real t) Model getModel(real t)
{ {
for(int32 i= 0; i<numAxis_; i++ ) for(int32 i= 0; i<numAxis_; i++ )
@ -145,19 +187,21 @@ public:
return Model(axis_.deviceVector(), numAxis_); return Model(axis_.deviceVector(), numAxis_);
} }
/// Pointer to axis list on host side
INLINE_FUNCTION_H INLINE_FUNCTION_H
multiRotatingAxis* getAxisListPtrHost() multiRotatingAxis* getAxisListPtrHost()
{ {
return axis_.hostVectorAll().data(); return axis_.hostVectorAll().data();
} }
/// Pointer to axis list on device
INLINE_FUNCTION_H INLINE_FUNCTION_H
multiRotatingAxis* getAxisListPtrDevice() multiRotatingAxis* getAxisListPtrDevice()
{ {
return axis_.deviceVectorAll().data(); return axis_.deviceVectorAll().data();
} }
/// Name of motion component to index
INLINE_FUNCTION_H INLINE_FUNCTION_H
int32 nameToIndex(const word& name)const int32 nameToIndex(const word& name)const
{ {
@ -175,6 +219,7 @@ public:
} }
/// Index of motion component to component name
INLINE_FUNCTION_H INLINE_FUNCTION_H
word indexToName(label i)const word indexToName(label i)const
{ {
@ -190,20 +235,24 @@ public:
} }
} }
/// Is moving
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
bool isMoving()const bool isMoving()const
{ {
return true; return true;
} }
/// Move points
FUNCTION_H FUNCTION_H
bool move(real t, real dt); bool move(real t, real dt);
// - IO operation
/// Read from input stream is
FUNCTION_H FUNCTION_H
bool read(iIstream& is); bool read(iIstream& is);
/// Write to output stream os
FUNCTION_H FUNCTION_H
bool write(iOstream& os)const; bool write(iOstream& os)const;

View File

@ -35,12 +35,40 @@ namespace pFlow
class dictionary; class dictionary;
/**
* Rotating axis motion model for walls
*
* This class is used for simulaiton that at least one wall components
* is moving according to rotatingAxis motion mode. One or more than one
* motion components can be defined in rotatingAxisMotionInfo dictionary
*
\verbatim
// In geometryDict file, this will defines rotating walls during simulation
...
motionModel rotatingAxisMotion;
rotatingAxisMotionInfo
{
rotationAxis1
{
// the definition based on class rotatingAxis
}
rotatoinAxis2
{
// the definition based on calss rotatingAxis
}
}
...
\endverbatim
*
*/
class rotatingAxisMotion class rotatingAxisMotion
{ {
public: public:
// - this class shuold be decleared in every motion model with /** Motion model class to be passed to computational units/kernels for
// exact methods * transfing points and returning velocities at various positions
*/
class Model class Model
{ {
protected: protected:
@ -92,43 +120,56 @@ protected:
using axisVector_HD = VectorDual<rotatingAxis>; using axisVector_HD = VectorDual<rotatingAxis>;
/// Vector to store axes
axisVector_HD axis_; axisVector_HD axis_;
/// Names of axes
wordList axisName_; wordList axisName_;
/// Number of axes components
label numAxis_= 0; label numAxis_= 0;
/// Read from dictionary
bool readDictionary(const dictionary& dict); bool readDictionary(const dictionary& dict);
/// Write to dictionary
bool writeDictionary(dictionary& dict)const; bool writeDictionary(dictionary& dict)const;
public: public:
/// Type info
TypeInfoNV("rotatingAxisMotion"); TypeInfoNV("rotatingAxisMotion");
// empty // - Constructors
/// Empty
FUNCTION_H FUNCTION_H
rotatingAxisMotion(); rotatingAxisMotion();
// construct with dictionary /// Construct with dictionary
FUNCTION_H FUNCTION_H
rotatingAxisMotion(const dictionary& dict); rotatingAxisMotion(const dictionary& dict);
// copy /// Copy constructor
FUNCTION_H FUNCTION_H
rotatingAxisMotion(const rotatingAxisMotion&) = default; rotatingAxisMotion(const rotatingAxisMotion&) = default;
/// No move constructor
rotatingAxisMotion(rotatingAxisMotion&&) = delete; rotatingAxisMotion(rotatingAxisMotion&&) = delete;
/// Copy assignment
FUNCTION_H FUNCTION_H
rotatingAxisMotion& operator=(const rotatingAxisMotion&) = default; rotatingAxisMotion& operator=(const rotatingAxisMotion&) = default;
/// No move assignment
rotatingAxisMotion& operator=(rotatingAxisMotion&&) = delete; rotatingAxisMotion& operator=(rotatingAxisMotion&&) = delete;
/// Destructor
FUNCTION_H FUNCTION_H
~rotatingAxisMotion() = default; ~rotatingAxisMotion() = default;
// - Methods
/// Return the motion model at time t
Model getModel(real t) Model getModel(real t)
{ {
for(int32 i= 0; i<numAxis_; i++ ) for(int32 i= 0; i<numAxis_; i++ )
@ -141,6 +182,7 @@ public:
return Model(axis_.deviceVector(), numAxis_); return Model(axis_.deviceVector(), numAxis_);
} }
/// Motion component name to index
INLINE_FUNCTION_H INLINE_FUNCTION_H
int32 nameToIndex(const word& name)const int32 nameToIndex(const word& name)const
{ {
@ -158,6 +200,7 @@ public:
} }
/// Motion index to motion component name
INLINE_FUNCTION_H INLINE_FUNCTION_H
word indexToName(label i)const word indexToName(label i)const
{ {
@ -174,50 +217,29 @@ public:
} }
/*INLINE_FUNCTION_D /// Are walls moving
realx3 pointVelocity(label n, const realx3& p)const
{
return axis_.deviceVectorAll()[n].linTangentialVelocityPoint(p);
}*/
/*INLINE_FUNCTION_D
realx3 transferPoint(label n, const realx3 p, real dt)const
{
return rotate(p, axis_.deviceVectorAll()[n], dt);
}
INLINE_FUNCTION_D
bool transferPoint(label n, realx3* pVec, size_t numP, real dt)
{
if( n>=numAxis_)return false;
rotate( pVec, numP, axis_.deviceVectorAll()[n], dt);
return true;
}*/
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
bool isMoving()const bool isMoving()const
{ {
return true; return true;
} }
/// Move
INLINE_FUNCTION_H INLINE_FUNCTION_H
bool move(real t, real dt) bool move(real t, real dt)
{ {
return true; return true;
} }
// - IO operation
/// Read from input stream is
FUNCTION_H FUNCTION_H
bool read(iIstream& is); bool read(iIstream& is);
/// Write to output stream os
FUNCTION_H FUNCTION_H
bool write(iOstream& os)const; bool write(iOstream& os)const;
}; };
} // pFlow } // pFlow

View File

@ -34,14 +34,44 @@ Licence:
namespace pFlow namespace pFlow
{ {
// forward
class dictionary; class dictionary;
/**
* Vibrating motion model for walls
*
* This class is used for simulaiton that at least one wall components
* are moving according to a sinoidal viration defined in class vibrating.
* One or more than one motion components can be defined in
* vibratingMotionInfo dictionary
*
\verbatim
// In geometryDict file, this will defines vibrating walls during simulation
...
motionModel vibratingMotion;
vibratingMotionInfo
{
vibComponent1
{
// the definition based on class vibrating
}
vibComponent2
{
// the definition based on calss vibrating
}
}
...
\endverbatim
*
*/
class vibratingMotion class vibratingMotion
{ {
public: public:
// - this class shuold be decleared in every motion model with /** Motion model class to be passed to computational units/kernels for
// exact methods * transfing points and returning velocities at various positions
*/
class Model class Model
{ {
protected: protected:
@ -93,43 +123,53 @@ protected:
using axisVector_HD = VectorDual<vibrating>; using axisVector_HD = VectorDual<vibrating>;
/// Vibrating motion components
axisVector_HD components_; axisVector_HD components_;
/// Names of components
wordList componentName_; wordList componentName_;
/// Number of components
label numComponents_= 0; label numComponents_= 0;
/// Read from a dictionary
bool readDictionary(const dictionary& dict); bool readDictionary(const dictionary& dict);
/// Write to a dictionary
bool writeDictionary(dictionary& dict)const; bool writeDictionary(dictionary& dict)const;
public: public:
/// Type info
TypeInfoNV("vibratingMotion"); TypeInfoNV("vibratingMotion");
// empty /// Empty
FUNCTION_H FUNCTION_H
vibratingMotion(); vibratingMotion();
// construct with dictionary /// Construct with dictionary
FUNCTION_H FUNCTION_H
vibratingMotion(const dictionary& dict); vibratingMotion(const dictionary& dict);
// copy /// Copy constructor
FUNCTION_H FUNCTION_H
vibratingMotion(const vibratingMotion&) = default; vibratingMotion(const vibratingMotion&) = default;
/// No move
vibratingMotion(vibratingMotion&&) = delete; vibratingMotion(vibratingMotion&&) = delete;
/// Copy assignment
FUNCTION_H FUNCTION_H
vibratingMotion& operator=(const vibratingMotion&) = default; vibratingMotion& operator=(const vibratingMotion&) = default;
/// No Move assignment
vibratingMotion& operator=(vibratingMotion&&) = delete; vibratingMotion& operator=(vibratingMotion&&) = delete;
/// Destructor
FUNCTION_H FUNCTION_H
~vibratingMotion() = default; ~vibratingMotion() = default;
/// Return motion model at time t
Model getModel(real t) Model getModel(real t)
{ {
for(int32 i= 0; i<numComponents_; i++ ) for(int32 i= 0; i<numComponents_; i++ )
@ -142,6 +182,7 @@ public:
return Model(components_.deviceVectorAll(), numComponents_); return Model(components_.deviceVectorAll(), numComponents_);
} }
/// Name to component index
INLINE_FUNCTION_H INLINE_FUNCTION_H
int32 nameToIndex(const word& name)const int32 nameToIndex(const word& name)const
{ {
@ -159,6 +200,7 @@ public:
} }
/// Index to name
INLINE_FUNCTION_H INLINE_FUNCTION_H
word indexToName(label i)const word indexToName(label i)const
{ {
@ -174,41 +216,42 @@ public:
} }
} }
/// velocity at point p according to motion component n
INLINE_FUNCTION_H INLINE_FUNCTION_H
realx3 pointVelocity(label n, const realx3& p)const realx3 pointVelocity(label n, const realx3& p)const
{ {
return components_.hostVectorAll()[n].linTangentialVelocityPoint(p); return components_.hostVectorAll()[n].linTangentialVelocityPoint(p);
} }
/// Transfer point p for dt seconds based on motion component n
INLINE_FUNCTION_H INLINE_FUNCTION_H
realx3 transferPoint(label n, const realx3 p, real dt)const realx3 transferPoint(label n, const realx3 p, real dt)const
{ {
return components_.hostVectorAll()[n].transferPoint(p, dt); return components_.hostVectorAll()[n].transferPoint(p, dt);
} }
/// Is moving
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
bool isMoving()const bool isMoving()const
{ {
return true; return true;
} }
/// Move ponits at time t for dt seconds
INLINE_FUNCTION_H INLINE_FUNCTION_H
bool move(real t, real dt) bool move(real t, real dt)
{ {
return true; return true;
} }
/// Read from input stream is
FUNCTION_H FUNCTION_H
bool read(iIstream& is); bool read(iIstream& is);
/// Write to output stream os
FUNCTION_H FUNCTION_H
bool write(iOstream& os)const; bool write(iOstream& os)const;
}; };
} // pFlow } // pFlow