← Back to team overview

yade-users team mailing list archive

YADE crash when spheres generated during simulation

 

Hi all,

I am trying to generate spheres during the simulation, when the old group of shpere is stable, a new group of spheres is generated and the stability check is perfrom similarly to the function computeunbalancedforce in TRIAXIAL TEST. YADE however crash whenever the physicalAction class accessed through a pointer. The thread is begin at the operator get() in the share_ptr in boost library. I tried to figured it out in several days but all the attempts failed.

The code is attached hereunder:


Real MeanUnbalanced=0;
	long nBodies = 0;
        BodyContainer::iterator bi    = bodies->begin();
        BodyContainer::iterator biEnd = bodies->end();
        Real f;
        for(  ; bi!=biEnd ; ++bi ) 
	{
        	if ((*bi)->isDynamic) 
		{
            CRASH HERE --------->f= (static_cast<Force*>   ( ncb->physicalActions->find( (*bi)->getId() , ForceClassIndex).get() )->force).Length();
                	MeanUnbalanced += f;
                	if (f!=0) ++nBodies;
                }
	}
        if (nBodies != 0 && MeanForce != 0) 
	{
		MeanUnbalanced = MeanUnbalanced/nBodies/MeanForce;
	}
        return  MeanUnbalanced;



Could anyone give me some hints about the problems? If you need a whole class please let me know.

Thanks in advance,

Kien Dang
_______________________________________________
Yade-users mailing list
Yade-users@xxxxxxxxxxxxxxxx
https://lists.berlios.de/mailman/listinfo/yade-users



Follow ups