105 _storeForce(p._storeForce)
149 setAddedMass(masAdd);
232 for (
int i = 0; i < 3; i++) {
233 _force[i] += force[i];
245 for (
int i = 0; i < 3; i++) {
254 for (
int i = 0; i < 3; i++) {
255 _storeForce[i] = storeForce[i];
262 for (
int i = 0; i < 3; i++) {
263 _storeForce[i] = T(0);
349 for (
int i = 0; i < 3; i++) {
351 serial[i + 3] = _vel[i];
352 serial[i + 6] = _force[i];
355 serial[10] = _masAdd;
356 serial[11] = _effectiveMas;
358 serial[13] = _cuboid;
359 serial[14] = _active;
362 for (
int i = 0; i < 3; i++) {
363 serial[i + 16] = _storeForce[i];
374 for (
int i = 0; i < 3; i++) {
376 _vel[i] = data[i + 3];
377 _force[i] = data[i + 6];
381 _effectiveMas = data[11];
383 _cuboid = int(data[13]);
386 _invMasAdd = 1. / _masAdd;
387 _invEffectiveMas = 1. / _effectiveMas;
390 for (
int i = 0; i < 3; i++) {
391 _storeForce[i] = data[i + 16];
398 std::cout <<
"Pos=(" << _pos[0] <<
", " << _pos[1] <<
", " << _pos[2] <<
") "
399 <<
"Vel=(" << _vel[0] <<
", " << _vel[1] <<
", " << _vel[2] <<
") "
408 <<
" ID=" << this->getID()
443 return _invEffectiveMas;
449 return _effectiveMas;
467 return _effectiveMas;
474 throw std::invalid_argument(
"Exception called in particle3D::setMass(T). Input value must be > 0, but instead was " + std::to_string(m));
478 _effectiveMas = _mas + _masAdd;
479 _invEffectiveMas = 1. / _effectiveMas;
486 throw std::invalid_argument(
"Exception called in particle3D::setAddedMass(T). Input value must be >= 0, but instead was " + std::to_string(m));
489 _effectiveMas = _mas + _masAdd;
490 _invEffectiveMas = 1. / _effectiveMas;
549 template<
typename T,
template<
typename U>
class PARTICLETYPE>
554 template<
typename T,
template<
typename U>
class PARTICLETYPE>
557 _pSys->computeForce();
558 _pSys->explicitEuler(dT, scale);
562 template<
typename T,
template<
typename U>
class PARTICLETYPE>
568 template<
typename T,
template<
typename U>
class PARTICLETYPE>
572 int material,
int subSteps,
bool scale )
574 for (
int iSubStep=1; iSubStep<=subSteps; iSubStep++) {
575 if (! _pSys->executeForwardCoupling(forwardCoupling) ) {
576 std::cout <<
" on substep " << iSubStep << std::endl;
579 _pSys->computeForce();
580 _pSys->explicitEuler(dT/(T)(subSteps), scale);
583 _pSys->executeBackwardCoupling(backCoupling, material);
586 template<
typename T,
template<
typename U>
class PARTICLETYPE>
590 int material,
int subSteps,
bool scale )
592 for (
int iSubStep=1; iSubStep<=subSteps; iSubStep++) {
593 if (! _pSys->executeForwardCoupling(forwardCoupling) ) {
594 std::cout <<
" on substep " << iSubStep << std::endl;
597 _pSys->executeBackwardCoupling(backCoupling, material, subSteps);
598 _pSys->computeForce();
599 _pSys->explicitEuler(dT/(T)(subSteps), scale);
Abstact base class for BaseBackCouplingModel.
Abstact base class for all the forward-coupling models Its raison d'etre consists of not being temple...
std::vector< T > & getVel()
const T & getInvEffectiveMass()
void setStoreForce(std::vector< T > &storeForce)
std::vector< T > & getForce()
void addForce(std::vector< T > &frc)
std::vector< T > & getPos()
std::vector< T > & getStoredPos()
std::vector< T > & getStoreForce()
void setStoredVel(std::vector< T > vel)
void setVel(std::vector< T > vel)
void printDeep(std::string message)
void serialize(T serial[])
void setPos(std::vector< T > pos)
std::vector< T > & getStoredVel()
void setStoredPos(std::vector< T > pos)
void setForce(std::vector< T > &frc)
const T & getEffectiveMass()
void simulateWithTwoWayCoupling_Mathias(T dT, ForwardCouplingModel< T, PARTICLETYPE > &forwardCoupling, BackCouplingModel< T, PARTICLETYPE > &backCoupling, int material, int subSteps=1, bool scale=false)
SimulateParticles(ParticleSystem3D< T, PARTICLETYPE > *ps)
void simulateWithTwoWayCoupling_Davide(T dT, ForwardCouplingModel< T, PARTICLETYPE > &forwardCoupling, BackCouplingModel< T, PARTICLETYPE > &backCoupling, int material, int subSteps=1, bool scale=false)
void simulate(T dT, bool scale=false)
Top level namespace for all of OpenLB.