| 1 |
/************************************************************************* |
| 2 |
* Copyright (C) 2009-2012 by Franck Lominé * |
| 3 |
* [email protected] * |
| 4 |
* * |
| 5 |
* This program is free software; it is licensed under the terms of the * |
| 6 |
* GNU General Public License v2 or later. See file LICENSE for details. * |
| 7 |
* * |
| 8 |
*************************************************************************/ |
| 9 |
#ifdef LBM_ENGINE |
| 10 |
|
| 11 |
#pragma once |
| 12 |
#include <lib/multimethods/Indexable.hpp> |
| 13 |
#include <lib/serialization/Serializable.hpp> |
| 14 |
|
| 15 |
namespace yade { // Cannot have #include directive inside. |
| 16 |
|
| 17 |
class LBMbody : public Serializable { |
| 18 |
public: |
| 19 |
virtual ~LBMbody() {}; |
| 20 |
//Real radius(){return ext[0];} |
| 21 |
bool isBox() |
| 22 |
{ |
| 23 |
if (type == 1) return true; |
| 24 |
else |
| 25 |
return false; |
| 26 |
} |
| 27 |
bool isPtc() |
| 28 |
{ |
| 29 |
if (type == 2) return true; |
| 30 |
else |
| 31 |
return false; |
| 32 |
} |
| 33 |
void setAsPtc() { type = 2; } |
| 34 |
void setAsBox() { type = 1; } |
| 35 |
|
| 36 |
// clang-format off |
| 37 |
YADE_CLASS_BASE_DOC_ATTRS_CTOR(LBMbody,Serializable, |
| 38 |
"Body class for Lattice Boltzmann Method ", |
| 39 |
((Vector3r,force,Vector3r::Zero(),,"Hydrodynamic force, need to be reinitialized (LB unit)")) |
| 40 |
((Vector3r,fm,Vector3r::Zero(),,"Hydrodynamic force (LB unit) at t-0.5dt")) |
| 41 |
((Vector3r,fp,Vector3r::Zero(),,"Hydrodynamic force (LB unit) at t+0.5dt")) |
| 42 |
((Vector3r,momentum,Vector3r::Zero(),,"Hydrodynamic momentum,need to be reinitialized (LB unit)")) |
| 43 |
((Vector3r,mm,Vector3r::Zero(),,"Hydrodynamic momentum (LB unit) at t-0.5dt")) |
| 44 |
((Vector3r,mp,Vector3r::Zero(),,"Hydrodynamic momentum (LB unit) at t+0.5dt")) |
| 45 |
((Vector3r,pos,Vector3r::Zero(),,"Position of body")) |
| 46 |
((Vector3r,vel,Vector3r::Zero(),,"Velocity of body")) |
| 47 |
((Vector3r,AVel,Vector3r::Zero(),,"Angular velocity of body")) |
| 48 |
((Vector3r,Fh,Vector3r::Zero(),,"Hydrodynamical force on body")) |
| 49 |
((Vector3r,Mh,Vector3r::Zero(),,"Hydrodynamical momentum on body")) |
| 50 |
((Real,radius,-1000.,,"Radius of body (for sphere)")) |
| 51 |
((bool,isEroded,false,,"Hydrodynamical force on body")) |
| 52 |
((bool,saveProperties,false,,"To save properties of the body")) |
| 53 |
((short int,type,-1,," ")) |
| 54 |
, |
| 55 |
); |
| 56 |
// clang-format on |
| 57 |
}; |
| 58 |
REGISTER_SERIALIZABLE(LBMbody); |
| 59 |
|
| 60 |
} // namespace yade |
| 61 |
|
| 62 |
#endif //LBM_ENGINE |