Files
phasicFlow/src/Geometry/geometryMotion/geometryMotion.hpp

156 lines
3.1 KiB
C++
Raw Normal View History

2022-09-05 01:56:29 +04:30
/*------------------------------- 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.
-----------------------------------------------------------------------------*/
2022-12-10 01:32:54 +03:30
#ifndef __geometryMotion_hpp__
#define __geometryMotion_hpp__
2022-09-05 01:56:29 +04:30
2022-12-10 01:32:54 +03:30
#include "geometry.hpp"
#include "VectorDuals.hpp"
2022-09-05 01:56:29 +04:30
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_;
/// motion index mapped on each point
int8Vector_HD pointMotionIndex_;
// timer for moveGeometry
Timer moveGeomTimer_;
bool findMotionIndex();
public:
// type info
2022-12-10 01:32:54 +03:30
TypeInfoTemplate("geometry", MotionModel);
2022-09-05 01:56:29 +04:30
//// - Constructors
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
);
//// - Methods
auto getModel(real t)const
2022-09-05 01:56:29 +04:30
{
return motionModel_.getModel(t);
2022-09-05 01:56:29 +04:30
}
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();
};
}
2022-12-10 01:32:54 +03:30
#include "geometryMotion.cpp"
2022-09-05 01:56:29 +04:30
#ifndef BUILD_SHARED_LIBS
2022-12-10 01:32:54 +03:30
#include "geometryMotionsInstantiate.cpp"
2022-09-05 01:56:29 +04:30
#endif
2022-12-10 01:32:54 +03:30
#endif //__geometryMotion_hpp__