Help for delete beam between two SetOfs.

Posted by LE Ba Danh on
URL: http://granoo.326.s1.nabble.com/Help-for-delete-beam-between-two-SetOfs-tp142.html

Hello,

I have a small function in PlugIn of Granoo 0.0, it run well. But, it does not work with Granoo 2.0.
Can you help me make an update this function with Granoo2.0?

void
CreateDomains::DeleteBeamsBetweenFiberAndMatrix()
{    
  SetOfDE & demFiber        =  SetOfDE::Get("Fiber");
  SetOfDE & demMatrix       =  SetOfDE::Get("Matrix");
  SetOfBO * beamToBeDeleted =  new SetOfBO("BeamToBeDeleted");
 
  for (unsigned int i=0; i < demFiber.GetTotItemNumber(); ++i)
    {
      DEM::SetOfBase<DEM::Bond<_3D> > & bondSet = demFiber[i]->GetBondSet();
      for (unsigned int j=0; j < bondSet.GetTotItemNumber(); ++j)
        {
          DE & de1 = bondSet[j]->GetDiscreteElement1();
          DE & de2 = bondSet[j]->GetDiscreteElement2();
          // choose the discrete element at the other end of the beam:
          DE * de = &de1;
          if (&de1 == demFiber[i] )
            {
              de = & de2;
            }
          // look if de is in fiber or matrix... iy yes, append the beam to BeamToBeDeleted:
          if (demMatrix.Contain(de))
            {
              beamToBeDeleted->AddItem(bondSet[j]);
            }
        }
    }
    // destroy all the beams in beamToBeDeleted:
    beamToBeDeleted->ClearAndDelete();
}


Thank for your help.

Danh