# PhasicFlow: MotionModel< Model, Component > Class Template Reference
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

MotionModel< Model, Component > Class Template Reference

Motion model abstract class (CRTP) for all the motion models. More...

Inheritance diagram for MotionModel< Model, Component >:
[legend]
Collaboration diagram for MotionModel< Model, Component >:
[legend]

## Classes

class | ModelInterface
| Motion model class to be passed to computational units/kernels for transfing points and returning velocities at various positions. More...

## Public Types

using | ModelType = Model
using | ModelComponent = Component
using | ComponentVector_D = VectorSingle< ModelComponent >

## Public Member Functions

| MotionModel ()
| Empty. More...
| MotionModel (const MotionModel &)=default
| Copy constructor. More...
| MotionModel (MotionModel &&)=default
| Move constructor. More...
MotionModel & | operator= (const MotionModel &)=default
| Copy assignment. More...
MotionModel & | operator= (MotionModel &&)=default
| No move assignment. More...
| ~MotionModel ()=default
| Destructor. More...
bool | nameToIndex (const word &name, uint32 &idx) const
| name of the compoenent to index of the component More...
bool | indexToName (uint32 idx, word &name) const
| Component index to motion component name. More...
const wordList & | componentNames () const
| Return a const reference to the list of compoenent names. More...
bool | isMoving () const
| Is the wall assocciated to this motion component moving? More...
bool | move (uint32 iter, real t, real dt)
| Move the component itself. More...
auto | getModelInterface (uint32 iter, real t, real dt) const
| Obtain an object to model interface. More...

## Protected Member Functions

auto & | getModel ()
| obtain a reference to the actual motion model More...
const auto & | getModel () const
| Obtain a const reference to the actual motion model. More...
auto | impl_noneComponent () const
| Return a none object for the motion model. More...
bool | impl_nameToIndex (const word &name, uint32 &idx) const
| Name of the compoenent to index of the component. More...
bool | impl_indexToName (uint32 i, word &name) const
| Component index to motion component name. More...
const wordList & | impl_componentNames () const
| const reference to the list of component names More...
auto | impl_getModelInterface (uint32 iter, real t, real dt) const
| Return model interface. More...
bool | impl_readDictionary (const dictionary &dict)
| Read from dictionary. More...
bool | impl_writeDictionary (dictionary &dict) const
| Write to dictionary. More...

## Private Attributes

friend | ModelType
uint32 | numComponents_ = 0
| Number of axes components. More...
ComponentVector_D | motionComponents_
| Vector to store motion components. More...
wordList | componentNames_
| Names of compoenents. More...

## Detailed Description

### template<typename Model, typename Component>
class pFlow::MotionModel< Model, Component >

Motion model abstract class (CRTP) for all the motion models.

Definition at line 39 of file MotionModel.hpp.

## Member Typedef Documentation

## ModelType

using ModelType = Model

Definition at line 43 of file MotionModel.hpp.

## ModelComponent

using ModelComponent = Component

Definition at line 45 of file MotionModel.hpp.

## ComponentVector_D

using ComponentVector_D = VectorSingle<ModelComponent>

Definition at line 47 of file MotionModel.hpp.

## Constructor & Destructor Documentation

## MotionModel() [1/3]

MotionModel

Empty.

Definition at line 144 of file MotionModel.cpp.

## MotionModel() [2/3]

MotionModel | ( | const MotionModel< Model, Component > & |  | ) |

default

Copy constructor.

## MotionModel() [3/3]

MotionModel | ( | MotionModel< Model, Component > && |  | ) |

default

Move constructor.

## ~MotionModel()

~MotionModel | ( |  | ) |

default

Destructor.

## Member Function Documentation

## getModel() [1/2]

auto& getModel | ( |  | ) |

inlineprotected

obtain a reference to the actual motion model

Definition at line 130 of file MotionModel.hpp.

Referenced by MotionModel< rotatingAxisMotion, rotatingAxis >::componentNames(), MotionModel< rotatingAxisMotion, rotatingAxis >::getModelInterface(), MotionModel< rotatingAxisMotion, rotatingAxis >::impl_getModelInterface(), MotionModel< rotatingAxisMotion, rotatingAxis >::indexToName(), MotionModel< rotatingAxisMotion, rotatingAxis >::isMoving(), MotionModel< rotatingAxisMotion, rotatingAxis >::move(), and MotionModel< rotatingAxisMotion, rotatingAxis >::nameToIndex().

Here is the caller graph for this function:

## getModel() [2/2]

const auto& getModel | ( |  | ) | const

inlineprotected

Obtain a const reference to the actual motion model.

Definition at line 137 of file MotionModel.hpp.

## impl_noneComponent()

auto impl_noneComponent | ( |  | ) | const

inlineprotected

Return a none object for the motion model.

Definition at line 144 of file MotionModel.hpp.

## impl_nameToIndex()

bool impl_nameToIndex | ( | const word & | name,
|  | uint32 & | idx
| ) |  | const

inlineprotected

Name of the compoenent to index of the component.

Definition at line 24 of file MotionModel.cpp.

## impl_indexToName()

bool impl_indexToName | ( | uint32 | i,
|  | word & | name
| ) |  | const

inlineprotected

Component index to motion component name.

Definition at line 40 of file MotionModel.cpp.

## impl_componentNames()

const wordList& impl_componentNames | ( |  | ) | const

inlineprotected

const reference to the list of component names

Definition at line 157 of file MotionModel.hpp.

## impl_getModelInterface()

auto impl_getModelInterface | ( | uint32 | iter,
|  | real | t,
|  | real | dt
| ) |  | const

inlineprotected

Return model interface.

Definition at line 163 of file MotionModel.hpp.

## impl_readDictionary()

bool impl_readDictionary | ( | const dictionary & | dict | ) |

inlineprotected

Read from dictionary.

Definition at line 56 of file MotionModel.cpp.

## impl_writeDictionary()

bool impl_writeDictionary | ( | dictionary & | dict | ) | const

inlineprotected

Write to dictionary.

Definition at line 113 of file MotionModel.cpp.

## operator=() [1/2]

MotionModel& operator= | ( | const MotionModel< Model, Component > & |  | ) |

default

Copy assignment.

## operator=() [2/2]

MotionModel& operator= | ( | MotionModel< Model, Component > && |  | ) |

default

No move assignment.

## nameToIndex()

bool nameToIndex | ( | const word & | name,
|  | uint32 & | idx
| ) |  | const

inline

name of the compoenent to index of the component

Definition at line 203 of file MotionModel.hpp.

## indexToName()

bool indexToName | ( | uint32 | idx,
|  | word & | name
| ) |  | const

inline

Component index to motion component name.

Definition at line 209 of file MotionModel.hpp.

## componentNames()

const wordList& componentNames | ( |  | ) | const

inline

Return a const reference to the list of compoenent names.

Returns

Definition at line 216 of file MotionModel.hpp.

## isMoving()

bool isMoving | ( |  | ) | const

inline

Is the wall assocciated to this motion component moving?

Definition at line 222 of file MotionModel.hpp.

## move()

bool move | ( | uint32 | iter,
|  | real | t,
|  | real | dt
| ) |  |

inline

Move the component itself.

Definition at line 228 of file MotionModel.hpp.

## getModelInterface()

auto getModelInterface | ( | uint32 | iter,
|  | real | t,
|  | real | dt
| ) |  | const

inline

Obtain an object to model interface.

Definition at line 234 of file MotionModel.hpp.

## Member Data Documentation

## ModelType

friend ModelType

private

Definition at line 115 of file MotionModel.hpp.

## numComponents_

uint32 numComponents_ = 0

private

Number of axes components.

Definition at line 118 of file MotionModel.hpp.

Referenced by MotionModel< rotatingAxisMotion, rotatingAxis >::impl_getModelInterface().

## motionComponents_

ComponentVector_D motionComponents_

private

Vector to store motion components.

Definition at line 121 of file MotionModel.hpp.

Referenced by MotionModel< rotatingAxisMotion, rotatingAxis >::impl_getModelInterface().

## componentNames_

wordList componentNames_

private

Names of compoenents.

Definition at line 124 of file MotionModel.hpp.

Referenced by MotionModel< rotatingAxisMotion, rotatingAxis >::impl_componentNames().

The documentation for this class was generated from the following files:

- src/MotionModel/MotionModel/MotionModel.hpp
- src/MotionModel/MotionModel/MotionModel.cpp