← Back to team overview

yade-users team mailing list archive

[Question #269315]: swap failure in InteractionLoop

 

New question #269315 on Yade:
https://answers.launchpad.net/yade/+question/269315

Hey guys,

I have an Ip like:

Ip2_CohFrictMat_CohBurgersMat_CohBurgersPhys

which makes a CohBurgersPhy (viscoelastic Burgers model) from an interaction of CohFrictMat and CohBurgersMat.

Since two types of material are in contact we need to determine the order of bodies with iffrent materials in contact and swap the order, if necessary.  I was using the following:

#=================

void Ip2_CohFrictMat_CohBurgersMat_CohBurgersPhys::go(const shared_ptr<Material>& b1, const shared_ptr<Material>& b2, const shared_ptr<Interaction>& interaction) 
{

  if(interaction->phys) return;
  shared_ptr<CohBurgersPhys> phys (new CohBurgersPhys());
 

  int i1 = b1->getClassIndex(); // get actual material index of b1
  int i2 = b2->getClassIndex(); // get actual material index of b2
  int cbmi = CohBurgersMat::getClassIndexStatic(); // get index of CohBurgersMat
  CohFrictMat* mat1;
  CohBurgersMat* mat2;
  if (i2 == cbmi) { // b2 is CohburgersMat and b1 is CohFrictMat
  mat1 = dynamic_cast<CohFrictMat*>(b1.get());
  mat2 = dynamic_cast<CohBurgersMat*>(b2.get());
  } else if (i1 == cbmi) { // b1 is CohburgersMat and b2 is CohFrictMat
  mat1 = dynamic_cast<CohFrictMat*>(b2.get());
  mat2 = dynamic_cast<CohBurgersMat*>(b1.get());
  } else { // should not happen, but to be sure..
  LOG_FATAL("TODO");
  }

  ScGeom6D* geom= YADE_CAST<ScGeom6D*>(interaction->geom.get());
.
.
.
#=============

This was working well with any order of materials in contact. However, I upgraded from Ubuntu 12.04 to Ubuntu 14.04 yesterday and I got an updated Yade trunk. Compilation of my Burger's model files went through. But, swapping function is not working now!

I'm getting the following error now:


python: /home/bemaj3/yade-trunk/trunk/pkg/common/InteractionLoop.cpp:116: virtual void InteractionLoop::action(): Assertion `!swap' failed.
Aborted (core dumped)



Is there any new change in InteractionLoop which causes this problem? 
Thanks

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.