Go to the documentation of this file.
21 #ifndef __MotionModel_hpp__
22 #define __MotionModel_hpp__
38 template<
typename Model,
typename Component>
139 return static_cast<const ModelType&
>(*this);
146 return ModelType::noneComponent();
165 getModel().impl_setTime(iter, t, dt);
167 return ModelInterface(
205 return getModel().impl_nameToIndex(name, idx);
211 return getModel().impl_indexToName(idx, name);
218 return getModel().impl_componentNames();
230 return getModel().impl_move(iter, t, dt);
236 return getModel().impl_getModelInterface(iter, t, dt);
246 #endif //__MotionModel_hpp__
bool indexToName(uint32 idx, word &name) const
Component index to motion component name.
bool move(uint32 iter, real t, real dt)
Move the component itself.
INLINE_FUNCTION_HD ModelInterface & operator=(const ModelInterface &)=default
MotionModel & operator=(const MotionModel &)=default
Copy assignment.
wordList componentNames_
Names of compoenents.
INLINE_FUNCTION_HD ModelInterface(deviceViewType1D< ModelComponent > Comps, uint32 numComp)
auto getModelInterface(uint32 iter, real t, real dt) const
Obtain an object to model interface.
Rotating axis motion model for walls.
~MotionModel()=default
Destructor.
Motion model class to be passed to computational units/kernels for transfing points and returning vel...
INLINE_FUNCTION_HD uint32 size() const
bool impl_writeDictionary(dictionary &dict) const
Write to dictionary.
INLINE_FUNCTION_HD realx3 operator()(uint32 n, const realx3 &p) const
auto impl_noneComponent() const
Return a none object for the motion model.
INLINE_FUNCTION_HD realx3 pointVelocity(uint32 n, const realx3 &p) const
ComponentVector_D motionComponents_
Vector to store motion components.
bool nameToIndex(const word &name, uint32 &idx) const
name of the compoenent to index of the component
auto impl_getModelInterface(uint32 iter, real t, real dt) const
Return model interface.
bool impl_readDictionary(const dictionary &dict)
Read from dictionary.
Kokkos::View< T * > deviceViewType1D
1D array (vector) with default device (memory space and execution space)
deviceViewType1D< ModelComponent > components_
INLINE_FUNCTION_HD realx3 transferPoint(uint32 n, const realx3 p, real dt) const
An axis which rotates around itself at specified speed.
const wordList & componentNames() const
Return a const reference to the list of compoenent names.
bool impl_indexToName(uint32 i, word &name) const
Component index to motion component name.
auto & getModel()
obtain a reference to the actual motion model
INLINE_FUNCTION_H auto & deviceViewAll()
Device view range [0,capcity)
uint32 numComponents_
Number of axes components.
Motion model abstract class (CRTP) for all the motion models.
#define INLINE_FUNCTION_HD
bool impl_nameToIndex(const word &name, uint32 &idx) const
Name of the compoenent to index of the component.
const auto & getModel() const
Obtain a const reference to the actual motion model.
bool isMoving() const
Is the wall assocciated to this motion component moving?
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
const wordList & impl_componentNames() const
const reference to the list of component names