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

164 lines
3.9 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
#include "vocabs.hpp"
2022-12-10 01:32:54 +03:30
#include "geometry.hpp"
2022-09-05 01:56:29 +04:30
namespace pFlow
{
2023-04-13 11:42:41 -07:00
/**
* A class that represent surfaces in the simulation and moves surfaces
* based on the MotionModelType. MotionModelType can be any motion model.
*
*/
2022-09-05 01:56:29 +04:30
template<typename MotionModelType>
class geometryMotion
:
public geometry
{
public:
using ModelComponent = typename MotionModelType::ModelComponent;
private:
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// Ref to motion model
MotionModelType motionModel_;
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// motion indext mapped on each surface
uint32Field_D surfMotionIndex_{"triMotionIndex"};
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// motion index mapped on each triangle
uint32Field_D triMotionIndex_ {"surfMotionIndex"};
2022-09-05 01:56:29 +04:30
/// motion index mapped on each point
uint32Field_D pointMotionIndex_{"pointMotionIndex"};
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// timer for moveGeometry
2022-09-05 01:56:29 +04:30
Timer moveGeomTimer_;
2023-04-13 11:42:41 -07:00
/// determine the motion index of each triangle
2022-09-05 01:56:29 +04:30
bool findMotionIndex();
public:
2023-04-13 11:42:41 -07:00
/// Type info
TypeInfoTemplate11("geometry", ModelComponent);
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
// - Constructors
2022-09-05 01:56:29 +04:30
geometryMotion(systemControl& control, const property& prop);
geometryMotion(
systemControl& control,
const property& prop,
multiTriSurface& surf,
const wordVector& motionCompName,
const wordVector& materialName,
const dictionary& motionDict);
/*geometryMotion(
2022-09-05 01:56:29 +04:30
systemControl& control,
const property& prop,
const multiTriSurface& triSurface,
const wordVector& motionCompName,
const wordVector& propName,
const MotionModel& motionModel);*/
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// Construct from components and dictionary that contains
/// motionModel
/*geometryMotion(systemControl& control,
2022-09-05 01:56:29 +04:30
const property& prop,
const dictionary& dict,
const multiTriSurface& triSurface,
const wordVector& motionCompName,
const wordVector& propName);*/
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// Add virtual constructor
/*add_vCtor
2022-09-05 01:56:29 +04:30
(
geometry,
geometryMotion,
systemControl
);*/
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// Add virtual constructor
2022-09-05 01:56:29 +04:30
add_vCtor
(
geometry,
geometryMotion,
dictionary
);
2023-04-13 11:42:41 -07:00
// - Methods
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// Obtain motion model at time t
/*auto getModel(real t)const
2023-04-13 11:42:41 -07:00
{
return motionModel_.getModel(t);
}*/
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// TypeName / TypeInfo of motion model
/*word motionModelTypeName()const override
2023-04-13 11:42:41 -07:00
{
return motionModel_.typeName();
}*/
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// Access to motion model index of triangles
/*const auto& triMotionIndex()const override
2023-04-13 11:42:41 -07:00
{
return triMotionIndex_;
}
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// Access to motion model index of points
const int8Vector_HD& pointMotionIndex()const override
{
return pointMotionIndex_;
}*/
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// Operations before each iteration
/*bool beforeIteration() override;
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// Iterate geometry one time step
bool iterate() override ;
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// Operations after each iteration
bool afterIteration() override;*/
2022-09-05 01:56:29 +04:30
2023-04-13 11:42:41 -07:00
/// Move geometry
//bool moveGeometry();
2022-09-05 01:56:29 +04:30
};
2023-04-13 11:42:41 -07:00
} // pFlow
2022-09-05 01:56:29 +04:30
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__