mirror of
https://github.com/PhasicFlow/phasicFlow.git
synced 2025-07-08 03:07:03 +00:00
global damping is added to the code
This commit is contained in:
@ -21,6 +21,7 @@ Licence:
|
||||
#include "dynamicPointStructure.hpp"
|
||||
#include "systemControl.hpp"
|
||||
|
||||
|
||||
pFlow::dynamicPointStructure::dynamicPointStructure
|
||||
(
|
||||
systemControl& control
|
||||
@ -77,6 +78,9 @@ pFlow::dynamicPointStructure::dynamicPointStructure
|
||||
fatalExit;
|
||||
}
|
||||
|
||||
REPORT(1)<<"Reading globalDamping dictionary ..."<<END_REPORT;
|
||||
velDamping_ = makeUnique<globalDamping>(control);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -101,6 +105,16 @@ bool pFlow::dynamicPointStructure::iterate()
|
||||
return correct(dt, acc);*/
|
||||
}
|
||||
|
||||
bool pFlow::dynamicPointStructure::afterIteration()
|
||||
{
|
||||
//const auto ti = TimeInfo();
|
||||
|
||||
auto succs = pointStructure::afterIteration();
|
||||
//velDamping_().applyDamping(ti, velocity_);
|
||||
|
||||
return succs;
|
||||
}
|
||||
|
||||
bool pFlow::dynamicPointStructure::predict(
|
||||
real dt,
|
||||
realx3PointField_D &acceleration)
|
||||
@ -119,10 +133,11 @@ bool pFlow::dynamicPointStructure::correct
|
||||
)
|
||||
{
|
||||
//auto& pos = pStruct().pointPosition();
|
||||
const auto ti = TimeInfo();
|
||||
|
||||
if(!integrationPos_().correctPStruct(dt, *this, velocity_) )return false;
|
||||
|
||||
if(!integrationVel_().correct(dt, velocity_, acceleration))return false;
|
||||
if(!integrationVel_().correct(dt, velocity_, acceleration, velDamping_().dampingFactor(ti)))return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -26,11 +26,13 @@ Licence:
|
||||
#include "pointFields.hpp"
|
||||
#include "integration.hpp"
|
||||
#include "uniquePtr.hpp"
|
||||
#include "globalDamping.hpp"
|
||||
|
||||
namespace pFlow
|
||||
{
|
||||
|
||||
class systemControl;
|
||||
//class globalDamping;
|
||||
|
||||
class dynamicPointStructure
|
||||
:
|
||||
@ -44,6 +46,8 @@ private:
|
||||
|
||||
uniquePtr<integration> integrationVel_ = nullptr;
|
||||
|
||||
uniquePtr<globalDamping> velDamping_ = nullptr;
|
||||
|
||||
Timer velocityUpdateTimer_;
|
||||
|
||||
/// @brief integration method for velocity and position
|
||||
@ -88,6 +92,8 @@ public:
|
||||
/// @brief This is called in time loop. Perform the main calculations
|
||||
/// when the component should evolve along time.
|
||||
bool iterate() override;
|
||||
|
||||
bool afterIteration()override;
|
||||
|
||||
/// prediction step (if any), is called in beforeIteration
|
||||
bool predict(real dt, realx3PointField_D& acceleration);
|
||||
|
Reference in New Issue
Block a user