# PhasicFlow: src/MotionModel/entities/rotatingAxis/rotatingAxis.hpp Source File
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.

rotatingAxis.hpp
Go to the documentation of this file.
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#ifndef __rotatingAxis_hpp__
#define __rotatingAxis_hpp__
#include "timeInterval.hpp"
#include "line.hpp"
#include "rotatingAxisFwd.hpp"
namespace pFlow
{
class dictionary;
class rotatingAxis
:
public timeInterval,
public line
{
private:
real omega_ = 0;
bool rotating_ = false;
public:
// - Constructor
TypeInfoNV("rotatingAxis");
FUNCTION_HD
rotatingAxis()=default;
FUNCTION_H
explicit rotatingAxis(const dictionary& dict);
FUNCTION_HD
rotatingAxis(const realx3& p1, const realx3& p2, real omega = 0.0);
FUNCTION_HD
rotatingAxis(const rotatingAxis&) = default;
FUNCTION_HD
rotatingAxis(rotatingAxis&&) = default;
rotatingAxis& operator=(const rotatingAxis&) = default;
rotatingAxis& operator=(rotatingAxis&&) = default;
~rotatingAxis()=default;
FUNCTION_HD
real setOmega(real omega);
INLINE_FUNCTION_HD
real omega()const
{
return omega_;
}
INLINE_FUNCTION_HD
bool isRotating()const
{
return rotating_;
}
INLINE_FUNCTION_HD
realx3 linVelocityPoint(const realx3 &p)const;
INLINE_FUNCTION_HD
realx3 transferPoint(const realx3 p, real dt)const;
// - IO operation
FUNCTION_H
bool read(const dictionary& dict);
FUNCTION_H
bool write(dictionary& dict) const;
FUNCTION_H
bool read(iIstream& is);
FUNCTION_H
bool write(iOstream& os)const;
};
inline iOstream& operator <<(iOstream& os, const rotatingAxis& ax)
{
if(!ax.write(os))
{
fatalExit;
}
return os;
}
inline iIstream& operator >>(iIstream& is, rotatingAxis& ax)
{
if( !ax.read(is) )
{
fatalExit;
}
return is;
}
}
#include "rotatingAxisI.hpp"
#endif
timeInterval.hpp
pFlow::rotatingAxis::setOmega
FUNCTION_HD real setOmega(real omega)
Set omega.
Definition: rotatingAxis.cpp:57
pFlow::real
float real
Definition: builtinTypes.hpp:45
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::line
Definition: line.hpp:36
pFlow::rotatingAxis::write
FUNCTION_H bool write(dictionary &dict) const
Write to dictionary.
Definition: rotatingAxis.cpp:83
pFlow::rotatingAxis::rotating_
bool rotating_
is rotating
Definition: rotatingAxis.hpp:72
pFlow::rotatingAxis::isRotating
INLINE_FUNCTION_HD bool isRotating() const
Is rotating.
Definition: rotatingAxis.hpp:122
rotatingAxisI.hpp
pFlow
Definition: demGeometry.hpp:27
pFlow::rotatingAxis::rotatingAxis
FUNCTION_HD rotatingAxis()=default
Empty constructor.
FUNCTION_H
#define FUNCTION_H
Definition: pFlowMacros.hpp:62
pFlow::iIstream
Interface class for any input stream
Definition: iIstream.hpp:37
pFlow::rotatingAxis::omega_
real omega_
rotation speed
Definition: rotatingAxis.hpp:69
pFlow::rotatingAxis
An axis which rotates around itself at specified speed.
Definition: rotatingAxis.hpp:61
pFlow::rotatingAxis::linVelocityPoint
INLINE_FUNCTION_HD realx3 linVelocityPoint(const realx3 &p) const
Linear tangential velocity at point p.
Definition: rotatingAxisI.hpp:23
pFlow::rotatingAxis::transferPoint
INLINE_FUNCTION_HD realx3 transferPoint(const realx3 p, real dt) const
Definition: rotatingAxisI.hpp:33
pFlow::operator>>
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
Definition: AdamsBashforth3.hpp:41
pFlow::rotatingAxis::omega
INLINE_FUNCTION_HD real omega() const
Return omega.
Definition: rotatingAxis.hpp:115
pFlow::timeInterval
Definition: timeInterval.hpp:16
pFlow::operator<<
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
Definition: AdamsBashforth3.hpp:57
FUNCTION_HD
#define FUNCTION_HD
Definition: pFlowMacros.hpp:61
pFlow::rotatingAxis::read
FUNCTION_H bool read(const dictionary &dict)
Read from dictionary.
Definition: rotatingAxis.cpp:67
pFlow::rotatingAxis::~rotatingAxis
~rotatingAxis()=default
destructor
pFlow::rotatingAxis::TypeInfoNV
TypeInfoNV("rotatingAxis")
rotatingAxisFwd.hpp
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:55
pFlow::triple< real >
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
pFlow::rotatingAxis::operator=
rotatingAxis & operator=(const rotatingAxis &)=default
Copy asssignment.
line.hpp
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67