← Back to team overview

yade-users team mailing list archive

[Question #687484]: decreasing speed of run after some cycle

 

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

Hi everyone
I run polyhedra particles in this computer:

CPU (Cores)::  xIntel(R) Xeon(TM) E5-2680 v2
20 cores 3.1 Hz
Hard disc (HDD): 150 GB ssd
Ram: 128 GB   DDR 3
ubuntu : 18.04
yade 2018.02b

number of bodies : 1511
size of bodies' range in x and y axises: 5cm til 1 m
z length of body is constant : 10 cm

I run it with : yade -j20 filename.py

it started with 97% of CPU and high velocity of running and continue,  after 2950000 iteration I stoped it for saving simulation until this iter and then play it but now simulating has 30% of CPU  and velocity of runnig is very low, WHY?
what is the problem?please help

Thanks,
Mahdeyeh


Here is my code:

from yade import export,polyhedra_utils
import os
from yade import plot
import math
from yade import utils
import pylab
import matplotlib; matplotlib.rc('axes',grid=True)
from matplotlib import pyplot
import numpy as np
from numpy import *
from yade import export as expt


RawVer=np.genfromtxt('ring.txt',names=True,dtype=None)
Ver=()
ListVer=[]
for b in RawVer:
    if b[0]=='*LWPOLYLINE':
        ListVer.append(Ver)
        Ver=()
        continue
    Cordn=b[0]
    Cordn=np.fromstring(Cordn, sep=',')
    Cordn=tuple(Cordn.tolist())
    Cordn1=Cordn+(0.1,) # add z vertex to coordinates
    Cordn2=Cordn+(0.2,) # add z vertex to coordinates
    if not Cordn1 in Ver:
        Ver=Ver+(Cordn1,Cordn2)
ListVer.append(Ver)

RawVer1=np.genfromtxt('boundary.txt',names=True,dtype=None)
Ver1=()
ListVer1=[]
for b in RawVer1:
    if b[0]=='*LWPOLYLINE':
        ListVer1.append(Ver1)
        Ver1=()
        continue
    Cordn=b[0]
    Cordn=np.fromstring(Cordn, sep=',')
    Cordn=tuple(Cordn.tolist())
    Cordn1=Cordn+(-2,) # add z vertex to coordinates
    Cordn2=Cordn+(2,) # add z vertex to coordinates
    if not Cordn1 in Ver1:
        Ver1=Ver1+(Cordn1,Cordn2)
ListVer1.append(Ver1)

RawVer2=np.genfromtxt('waste.txt',names=True,dtype=None)
Ver2=()
ListVer2=[]
for b in RawVer2:
    if b[0]=='*LWPOLYLINE':
        ListVer2.append(Ver2)
        Ver2=()
        continue
    Cordn=b[0]
    Cordn=np.fromstring(Cordn, sep=',')
    Cordn=tuple(Cordn.tolist())
    Cordn1=Cordn+(0.1,) # add z vertex to coordinates
    Cordn2=Cordn+(0.2,) # add z vertex to coordinates
    if not Cordn1 in Ver2:
        Ver2=Ver2+(Cordn1,Cordn2)
ListVer2.append(Ver2)


Dolomite = PolyhedraMat()
Dolomite.density = 2870 #kg/m^3
Dolomite.young = 24.36e9 #Pa
Dolomite.poisson = 0.2
Dolomite.frictionAngle = radians(55.12) #rad

Shale = PolyhedraMat()
Shale.density = 2750 #kg/m^3
Shale.young = 6e9 #Pa
Shale.poisson = 0.23
Shale.frictionAngle = radians(42) #rad

for ii in ListVer:
    O.bodies.append(polyhedra_utils.polyhedra(Dolomite,v=ii,fixed=False, color=(0.1,0.5,0.2), mask=3))

for iii in ListVer1:
    O.bodies.append(polyhedra_utils.polyhedra(Dolomite,v=iii,fixed=True, color=(1,0,1), mask=4))

for iiii in ListVer2:
    O.bodies.append(polyhedra_utils.polyhedra(Shale,v=iiii,fixed=False, color=(0.9,0.81,0.45), mask=5))

O.bodies.erase(340) 


for b in O.bodies:
    if b.mask is 3:
        b.state.blockedDOFs='zXY'
for b in O.bodies:
    if b.mask is 5:
        b.state.blockedDOFs='zXY'

def calm():
    for c in O.bodies:
        c.state.vel=Vector3(0,0,0)
        c.state.angVel=Vector3(0,0,0)


def checkUnbalanced():
     iter00=O.iter
    Unbalanced=open("Unbalanced iter Unbalanced forces.txt","a")
    Unbalanced.write(repr(iter00)+' '+repr(utils.unbalancedForce())+' '+"\n")
    Unbalanced.close()

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Polyhedra_Aabb(),]), 
   InteractionLoop(
      [Ig2_Polyhedra_Polyhedra_PolyhedraGeom(),],
      [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()], 
      [Law2_PolyhedraGeom_PolyhedraPhys_Volumetric()] 
   ),
   NewtonIntegrator(gravity=(0,-9.81,0),damping=0.2),
]

utils.calm()
O.engines=O.engines+[PyRunner(iterPeriod=20,command='calm()',label="calmRunner")] 
O.engines=O.engines+[PyRunner(command='checkUnbalanced()',iterPeriod=10000,label="checker")] 

O.dt=10e-6
O.run(50000,True)


clrOre=[0.1,0.5,0.2]
clrWaste=[0.9,0.81,0.45]

def positions():
    for b in O.bodies:
        if b.shape.color==clrOre:
            time1=O.time
            Positions=open("Positions time x y z.txt","a")
            Positions.write(repr(time1)+' '+repr(b.state.pos[0])+' '+repr(b.state.pos[1])+' '+repr(b.state.pos[2])+' '"\n")
            Positions.close()

def oreAmount():
    clrOre=[0.1,0.5,0.2]
    M_o=0
    for b in O.bodies:
        if b.shape.color==clrOre:
                M_o+=b.state.mass
    return M_o

os.mkdir(O.tags['id']) 
O.engines=O.engines+[PyRunner(iterPeriod=200000,command='VTKview()',label="VTKview")] 
PolVtkData = expt.VTKExporter(O.tags['id']+'/'+'polData') 
def VTKview():
    PolVtkData.exportPolyhedra()

m_o = 0.00005
m_w = 0.00005
R = 0
D = 0
D_m = 0
E = 0 
M_o = oreAmount()
totalEMass = 1.25 * M_o 

def excavation():
        m_o = 0.00005
        m_w = 0.00005
        for b in O.bodies:
            if b.state.pos[0]>(-2.4) and b.state.pos[0]<1 and b.state.pos[1]>0 and b.state.pos[1]<1:

                if b.shape.color==clrOre:
                    m_o += b.state.mass 
                if b.shape.color==clrWaste:
                    m_w += b.state.mass

        iter1=O.iter
        Mass=open("Mass iter massore masswaste.txt","a")
        Mass.write(repr(iter1)+' '+repr(m_o)+' '+repr(m_w)+' '"\n")
        Mass.close()

        E = ( m_o + m_w) / M_o * 100 
        D = (m_w / (m_w + m_o)) * 100 
        D_m = (1- ( m_o / (m_w + m_o))) * 100 
        R = (m_o / M_o) * 100 ## Total ore recovery
        iter2=O.iter
        DataAnalysis=open("DataAnalysis iter E D DM R.txt","a")
        DataAnalysis.write(repr(iter2)+' '+repr(E)+' '+repr(D)+' '+repr(D_m)+ ' '+repr(R)+"\n")
        DataAnalysis.close()


O.engines=O.engines+[PyRunner(command='positions()',realPeriod=20000,label="flow")] 
O.engines=O.engines+[PyRunner(iterPeriod=200000,command='excavation()',label="excavate")]

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