# PhasicFlow: src/Geometry/geometryMotion/geometryMotion.hpp Source File

geometryMotion.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 __geometryMotion_hpp__
#define __geometryMotion_hpp__
#include "geometry.hpp"
#include "VectorDuals.hpp"
namespace pFlow
{
template<typename MotionModelType>
class geometryMotion
:
public geometry
{
public:
using MotionModel = MotionModelType;
protected:
MotionModel& motionModel_;
// motion indext mapped on each surface
int32Vector_HD motionIndex_;
// motion index mapped on each triangle
int8Vector_HD triMotionIndex_;
int8Vector_HD pointMotionIndex_;
// timer for moveGeometry
Timer moveGeomTimer_;
bool findMotionIndex();
public:
// type info
TypeInfoTemplate("geometry", MotionModel);
geometryMotion(systemControl& control, const property& prop);
// construct from components
geometryMotion(
systemControl& control,
const property& prop,
const multiTriSurface& triSurface,
const wordVector& motionCompName,
const wordVector& propName,
const MotionModel& motionModel);
// - construct from components and dictionary that contains
// motionModel
geometryMotion(systemControl& control,
const property& prop,
const dictionary& dict,
const multiTriSurface& triSurface,
const wordVector& motionCompName,
const wordVector& propName);
add_vCtor
(
geometry,
geometryMotion,
systemControl
);
add_vCtor
(
geometry,
geometryMotion,
dictionary
);
auto getModel(real t)const
{
return motionModel_.getModel(t);
}
word motionModelTypeName()const override
{
return motionModel_.typeName();
}
const int8Vector_HD& triMotionIndex()const override
{
return triMotionIndex_;
}
const int8Vector_HD& pointMotionIndex()const override
{
return pointMotionIndex_;
}
// - iterate
bool beforeIteration() override {
geometry::beforeIteration();
return true;
}
bool iterate() override ;
bool afterIteration() override {
geometry::afterIteration();
return true;
}
bool moveGeometry();
};
}
#include "geometryMotion.cpp"
#ifndef BUILD_SHARED_LIBS
#include "geometryMotionsInstantiate.cpp"
#endif
#endif //__geometryMotion_hpp__
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::geometryMotion::pointMotionIndex
const int8Vector_HD & pointMotionIndex() const override
Definition: geometryMotion.hpp:122
pFlow::geometryMotion::pointMotionIndex_
int8Vector_HD pointMotionIndex_
motion index mapped on each point
Definition: geometryMotion.hpp:54
pFlow::geometryMotion::triMotionIndex
const int8Vector_HD & triMotionIndex() const override
Definition: geometryMotion.hpp:117
pFlow::demComponent::control
const auto & control() const
Definition: demComponent.hpp:57
pFlow::geometryMotion::triMotionIndex_
int8Vector_HD triMotionIndex_
Definition: geometryMotion.hpp:51
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
pFlow::geometryMotion::TypeInfoTemplate
TypeInfoTemplate("geometry", MotionModel)
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::geometryMotion::MotionModel
MotionModelType MotionModel
Definition: geometryMotion.hpp:40
pFlow::geometryMotion::motionIndex_
int32Vector_HD motionIndex_
Definition: geometryMotion.hpp:48
geometryMotion.cpp
pFlow::geometryMotion::moveGeometry
bool moveGeometry()
Definition: geometryMotion.cpp:22
pFlow
Definition: demComponent.hpp:28
pFlow::multiTriSurface
Definition: multiTriSurface.hpp:33
pFlow::geometry::afterIteration
bool afterIteration() override
Definition: geometry.hpp:226
pFlow::geometryMotion
Definition: geometryMotion.hpp:34
pFlow::geometryMotion::add_vCtor
add_vCtor(geometry, geometryMotion, systemControl)
pFlow::VectorDual< int32 >
pFlow::Timer
Definition: Timer.hpp:39
pFlow::geometryMotion::moveGeomTimer_
Timer moveGeomTimer_
Definition: geometryMotion.hpp:57
geometryMotionsInstantiate.cpp
geometry.hpp
pFlow::geometry::beforeIteration
bool beforeIteration() override
Definition: geometry.hpp:219
pFlow::geometryMotion::geometryMotion
geometryMotion(systemControl &control, const property &prop)
Definition: geometryMotion.cpp:93
pFlow::geometryMotion::iterate
bool iterate() override
Definition: geometryMotion.cpp:184
pFlow::property
property holds the pure properties of materials.
Definition: property.hpp:40
pFlow::geometryMotion::findMotionIndex
bool findMotionIndex()
Definition: geometryMotion.cpp:54
pFlow::geometry
Definition: geometry.hpp:37
pFlow::geometryMotion::getModel
auto getModel(real t) const
Definition: geometryMotion.hpp:107
pFlow::geometryMotion::afterIteration
bool afterIteration() override
Definition: geometryMotion.hpp:135
pFlow::geometryMotion::beforeIteration
bool beforeIteration() override
Definition: geometryMotion.hpp:128
pFlow::geometryMotion::motionModel_
MotionModel & motionModel_
Definition: geometryMotion.hpp:45
pFlow::triSurface
Definition: triSurface.hpp:38
pFlow::Vector< word >
VectorDuals.hpp
pFlow::geometryMotion::motionModelTypeName
word motionModelTypeName() const override
Definition: geometryMotion.hpp:112
pFlow::dictionary
Definition: dictionary.hpp:38