# PhasicFlow: src/MotionModel/fixedWall/fixedWall.hpp Source File

fixedWall.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 __fixedWall_hpp__
#define __fixedWall_hpp__
#include "types.hpp"
#include "typeInfo.hpp"
#include "Vectors.hpp"
#include "uniquePtr.hpp"
namespace pFlow
{
class dictionary;
class fixedWall
{
public:
class Model
{
public:
INLINE_FUNCTION_HD
Model(){}
INLINE_FUNCTION_HD
Model(const Model&) = default;
INLINE_FUNCTION_HD
Model& operator=(const Model&) = default;
INLINE_FUNCTION_HD
realx3 pointVelocity(int32 n, const realx3 p)const
{
return 0.0;
}
INLINE_FUNCTION_HD
realx3 operator()(int32 n, const realx3& p)const
{
return 0.0;
}
INLINE_FUNCTION_HD
realx3 transferPoint(int32 n, const realx3 p, real dt)const
{
return p;
}
INLINE_FUNCTION_HD int32 numComponents()const
{
return 0;
}
};
protected:
const word name_ = "none";
bool readDictionary(const dictionary& dict);
bool writeDictionary(dictionary& dict)const;
public:
TypeInfoNV("fixedWall");
// - Constructors
fixedWall();
fixedWall(const dictionary& dict);
fixedWall(const fixedWall&) = default;
fixedWall(fixedWall&&) = default;
fixedWall& operator=(const fixedWall&) = default;
fixedWall& operator=(fixedWall&&) = default;
~fixedWall() = default;
// - Methods
Model getModel(real t)const
{
return Model();
}
int32 nameToIndex(const word& name)const
{
return 0;
}
word indexToName(label i)const
{
return name_;
}
INLINE_FUNCTION_HD
realx3 pointVelocity(label n, const realx3& p)const
{
return zero3;
}
INLINE_FUNCTION_HD
realx3 transferPoint(label n, const realx3 p, real dt)const
{
return p;
}
INLINE_FUNCTION_HD
bool transferPoint(label n, realx3* pVec, size_t numP, real dt)
{
return true;
}
INLINE_FUNCTION_HD
bool isMoving()const
{
return false;
}
bool move(real t, real dt)
{
return true;
}
// - IO operations
FUNCTION_H
bool read(iIstream& is);
FUNCTION_H
bool write(iOstream& os)const;
};
} // pFlow
#endif //__fixed_hpp__
pFlow::fixedWall::read
FUNCTION_H bool read(iIstream &is)
Read from input stream is.
Definition: fixedWall.cpp:70
pFlow::fixedWall::pointVelocity
INLINE_FUNCTION_HD realx3 pointVelocity(label n, const realx3 &p) const
Velocity at point p.
Definition: fixedWall.hpp:159
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::fixedWall::transferPoint
INLINE_FUNCTION_HD realx3 transferPoint(label n, const realx3 p, real dt) const
Transfer point p for dt seconds according to motion component n.
Definition: fixedWall.hpp:167
pFlow::fixedWall::isMoving
INLINE_FUNCTION_HD bool isMoving() const
Are walls moving.
Definition: fixedWall.hpp:182
pFlow::fixedWall::writeDictionary
bool writeDictionary(dictionary &dict) const
write to a dictionary
Definition: fixedWall.cpp:44
pFlow::fixedWall::Model::Model
INLINE_FUNCTION_HD Model()
Definition: fixedWall.hpp:63
types.hpp
pFlow::fixedWall::indexToName
word indexToName(label i) const
Index of motion component to name.
Definition: fixedWall.hpp:152
pFlow::fixedWall::name_
const word name_
Name.
Definition: fixedWall.hpp:99
pFlow::fixedWall::move
bool move(real t, real dt)
Move points.
Definition: fixedWall.hpp:188
pFlow::fixedWall::Model::pointVelocity
INLINE_FUNCTION_HD realx3 pointVelocity(int32 n, const realx3 p) const
Definition: fixedWall.hpp:73
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::zero3
const realx3 zero3(0.0)
Definition: types.hpp:97
Vectors.hpp
pFlow::fixedWall::transferPoint
INLINE_FUNCTION_HD bool transferPoint(label n, realx3 *pVec, size_t numP, real dt)
Transfer a vector of point pVec for dt seconds according to motion component n.
Definition: fixedWall.hpp:175
pFlow::fixedWall::write
FUNCTION_H bool write(iOstream &os) const
Write to output stream os.
Definition: fixedWall.cpp:91
pFlow
Definition: demComponent.hpp:28
FUNCTION_H
#define FUNCTION_H
Definition: pFlowMacros.hpp:58
uniquePtr.hpp
n
int32 n
Definition: NBSCrossLoop.hpp:24
pFlow::iIstream
Definition: iIstream.hpp:33
pFlow::int32
int int32
Definition: builtinTypes.hpp:53
pFlow::fixedWall
Fixed wall motion model for walls.
Definition: fixedWall.hpp:50
pFlow::fixedWall::fixedWall
fixedWall()
Empty.
Definition: fixedWall.cpp:55
pFlow::fixedWall::Model::operator=
INLINE_FUNCTION_HD Model & operator=(const Model &)=default
pFlow::fixedWall::Model::transferPoint
INLINE_FUNCTION_HD realx3 transferPoint(int32 n, const realx3 p, real dt) const
Definition: fixedWall.hpp:85
pFlow::fixedWall::nameToIndex
int32 nameToIndex(const word &name) const
Name of the motion component to index.
Definition: fixedWall.hpp:146
pFlow::fixedWall::operator=
fixedWall & operator=(const fixedWall &)=default
Copy assignment.
pFlow::fixedWall::getModel
Model getModel(real t) const
Return motion model t is the current simulation time
Definition: fixedWall.hpp:140
pFlow::fixedWall::Model::numComponents
INLINE_FUNCTION_HD int32 numComponents() const
Definition: fixedWall.hpp:90
pFlow::fixedWall::~fixedWall
~fixedWall()=default
Destructor.
pFlow::fixedWall::readDictionary
bool readDictionary(const dictionary &dict)
Read from a dictionary.
Definition: fixedWall.cpp:26
typeInfo.hpp
pFlow::label
std::size_t label
Definition: builtinTypes.hpp:61
pFlow::fixedWall::TypeInfoNV
TypeInfoNV("fixedWall")
Type info.
pFlow::fixedWall::Model
Motion model class to be passed to computational units/kernels for transfing points and returning vel...
Definition: fixedWall.hpp:57
INLINE_FUNCTION_HD
#define INLINE_FUNCTION_HD
Definition: pFlowMacros.hpp:51
pFlow::triple< real >
pFlow::iOstream
Definition: iOstream.hpp:53
pFlow::dictionary
Definition: dictionary.hpp:38
pFlow::fixedWall::Model::operator()
INLINE_FUNCTION_HD realx3 operator()(int32 n, const realx3 &p) const
Definition: fixedWall.hpp:79