← Back to team overview

yade-users team mailing list archive

[Question #698760]: error shared_ptr.hpp:734: typename boost

 

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

Hello dear

I use yadedaily:
Yade 20210909-5909~5b11526~focal1 
Using python version: 3.8.10 (default, Jun  2 2021, 10:49:15) 
[GCC 9.4.0]

Ubuntu 20.04

when I define a function ("extrction()") in the 'live' Yade console, this error show:

python3.8: /usr/include/boost/smart_ptr/shared_ptr.hpp:734: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = yade::Body; typename boost::detail::sp_member_access<T>::type = yade::Body*]: Assertion `px != 0' failed.
Aborted (core dumped)

I write this function: "extrction()"    in the 'live' Yade console.

And the function is:

def extrction():              # run when a bucket has wanted to remove
        clrOre=[0.1,0.5,0.2]
        clrWaste=[0.8,0.9,0.9]
        M_o1=0                # total ore of model befor deleting volume of bucket
        M_w1=0                # total waste of model befor deleting volume of bucket
        for b in O.bodies:
            if b.shape.color==clrOre:
                M_o1 +=b.state.mass
            if b.shape.color==clrWaste:
                M_w1 +=b.state.mass

            if b.state.pos[0]>(-11.5) and b.state.pos[0]<1.58 and b.state.pos[1]>0 and b.state.pos[1]<3.8:
                if O.bodies[b.id].isClump or O.bodies[b.id].isClumpMember:
                    iter1=O.iter
                    ids=open("iter removedids.txt","a")
                    ids.write(repr(iter1)+'	'+repr(b.id)+'	'"\n")
                    ids.close()
                O.bodies.erase(b.id,True)
        M_o2=0               # total ore of model after deleting volume of bucket
        M_w2=0               # total waste of model after deleting volume of bucket
        for b in O.bodies:
            if b.shape.color==clrOre:
                M_o2 +=b.state.mass
            if b.shape.color==clrWaste:
                M_w2 +=b.state.mass

        m_o = M_o1 - M_o2
        m_w = M_w1 - M_w2
   #     print M_o1 , M_o2 , m_o , m_w
        iter1=O.iter
        Mass=open("Mass iter massore masswaste.txt","a")
        Mass.write(repr(iter1)+'	'+repr(m_o)+'	'+repr(m_w)+'	'"\n")
        Mass.close() 

 My script has 2 files as input data .The below link shows my scrip and clump data files:
https://www.filemail.com/d/xrqjjzwakjinvib

Please help me about this error.
Best regards,


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.