sjtuWangDing / MSP-CFDEMcoupling

GNU General Public License v3.0
11 stars 1 forks source link

颗粒数量变化之后,计算会报错 #6

Closed 3ys closed 8 months ago

3ys commented 8 months ago

我是用insert/stream持续生成颗粒。但是,每次颗粒数量更新之后,就会报错。用piso、semi、mix和IB都试了,报错大概是下面这样:

Total # of neighbors = 1
Ave neighs/atom = 0.125
Neighbor list builds = 1
Dangerous builds = 0
Run LIGGGHTS - done
number of particles: 8
cfdemCloud: Reset Us fields - done
cfdemCloud: Reset Us weight fields - done
Reset voidFraction fields - done
cfdemCloud: Reset voidFraction fields - done
Reset volumeFraction fields - done
cfdemCloud: Reset volumeFraction fields - done
cfdemCloud: Reset implicit force fields - done
cfdemCloud: Reset Explicit force fields - done
cfdemCloud: Reset Ksl fields - done
free(): invalid pointer
free(): invalid pointer
[yin-virtual-machine:96401] *** Process received signal ***
[yin-virtual-machine:96401] Signal: Aborted (6)
[yin-virtual-machine:96401] Signal code:  (-6)

定位到代码里面,是在cfdem_cloudsemi里面,用parCloud.impForces() 和parCloud_.expForces() 的时候出的问题:

//! \brief 重新分配内存
void cfdemCloudMix::reallocate() {
  int number = numberOfParticles();
  // allocate memory of data exchanged with liggghts
  dataExchangeM().realloc(parCloud_.radii(), base::makeShape1(number), parCloud_.radiiPtr(), 0.0);
  dataExchangeM().realloc(parCloud_.positions(), base::makeShape2(number, 3), parCloud_.positionsPtr(), 0.0);
  dataExchangeM().realloc(parCloud_.velocities(), base::makeShape2(number, 3), parCloud_.velocitiesPtr(), 0.0);
  dataExchangeM().realloc(parCloud_.DEMForces(), base::makeShape2(number, 3), parCloud_.DEMForcesPtr(), 0.0);
  dataExchangeM().realloc(parCloud_.DEMTorques(), base::makeShape2(number, 3), parCloud_.DEMTorquesPtr(), 0.0);
  dataExchangeM().realloc(parCloud_.cds(), base::makeShape1(number), parCloud_.cdsPtr(), 0.0);
  dataExchangeM().realloc(parCloud_.fluidVel(), base::makeShape2(number, 3), parCloud_.fluidVelPtr(), 0.0);
  dataExchangeM().realloc(parCloud_.angularVelocities(), base::makeShape2(number, 3), parCloud_.angularVelocitiesPtr(),
                          0.0);
  // allocate memory of data not exchanged with liggghts
  parCloud_.particleOverMeshNumber() = std::move(base::CITensor1(base::makeShape1(number), 0));
  parCloud_.dimensionRatios() = std::move(base::CDTensor1(base::makeShape1(number), -1.0));
  parCloud_.impForces() = std::move(base::CDTensor2(base::makeShape2(number, 3), 0.0));
  parCloud_.expForces() = std::move(base::CDTensor2(base::makeShape2(number, 3), 0.0));
  parCloud_.particleRootProcIDs() = std::move(base::CITensor1(base::makeShape1(number), -1));
  parCloud_.findCellIDs() = std::move(base::CITensor1(base::makeShape1(number), -1));
  parCloud_.findMpiCellIDs() = std::move(base::CITensor1(base::makeShape1(number), -1));
  parCloud_.findExpandedCellIDs() = std::move(base::CITensor1(base::makeShape1(number), -1));
}

请问下,这是不支持颗粒数量变化吗,还是说哪里设置有问题呢

sjtuWangDing commented 8 months ago

代码细节不太记得了,毕业后就没动过了,可能需要你自己 debug 看看哈

3ys commented 8 months ago

哈哈,好嘞,师兄是不是跨到cs去了

---原始邮件--- 发件人: "Wang @.> 发送时间: 2024年3月14日(周四) 凌晨1:28 收件人: @.>; 抄送: @.**@.>; 主题: Re: [sjtuWangDing/MSP-CFDEMcoupling] 颗粒数量变化之后,计算会报错 (Issue #6)

代码细节不太记得了,毕业后就没动过了,可能需要你自己 debug 看看哈

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

sjtuWangDing commented 8 months ago

哈哈,是的