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

Hello,

I use Yadedaily on ubuntu 18 and 20. I want to simulate a triaxial test. When I 
use clump instead of spherical particles, I received this error:
Segmentation fault (core dumped)
I  don't know how to fix it. I was wondering if you could help me. An example 
of my script is:


from yade import utils, plot
from yade import pack, qt
from datetime import datetime
import math
import pylab
import sys
from numpy import *


qtr=qt.Renderer()
qtr.bgColor=(1,1,1)


#==============================================================
#================= define the materials =======================
#==============================================================

O.materials.append(CohFrictMat(normalCohesion= 1e20, shearCohesion= 1e20, 
isCohesive= True, young=6.81e8, density=1377.5, poisson=0.3, frictionAngle= 
0.31, fragile=False, label='aggregate-48'))

O.materials.append(CohFrictMat(normalCohesion= 1e20, shearCohesion= 1e20, 
isCohesive= False, young=2e11, 
density=0, poisson=0.3, frictionAngle= 0, fragile=False, 
label='wall-frictionless'))


#===============================================================
#=================== define walls ============================
#===============================================================

walls=aabbWalls([(0,0,0),(4e-2,4e-2,4e-2)],thickness=0.001,oversizeFactor=1.5,material='wall-frictionless')
wallIds=O.bodies.append(walls)


#===============================================================
#===================clump shape=================================
#===============================================================

        
radz1=[0.355155e-3,0.505113e-3,0.397713e-3,0.465286e-3,0.484395e-3,0.394534e-3,0.493151e-3,0.487328e-3,0.613619e-3,0.413455e-3]
poz1= 
[[1.13418e-3,-0.703895e-3,-1.20338e-3],[-0.390408e-3,0.476061e-3,-0.150612e-3],[-0.556545e-3,0.451341e-3,1.1495e-3],[-0.633942e-3,0.498253e-3,0.348231e-3],[0.0256934e-3,0.388855e-3,-0.733445e-3],[-0.218563e-3,0.504478e-3,1.54117e-3],[-0.319601e-3,0.104778e-3,0.742895e-3],[0.650678e-3,-0.76675e-3,-0.289908e-3],[0.0113115e-3,-0.207684e-3,0.00255944e-3],[0.594902e-3,-0.301473e-3,-0.878654e-3]]
          
template1= []
template1.append(clumpTemplate(relRadii=radz1,relPositions=poz1))


#===============================================================
#=================== define packing ============================
#===============================================================

coke=((1.875e-3,100),(1.875e-3,100),(1.875e-3,100))

nums=['t','t','t']


temps=[template1,template1,template1]


mats=['aggregate-48','aggregate-48','aggregate-48']

tolerance=[(0.4752e-3),(0.4752e-3),(0.4752e-3)]

for i in range(len(nums)):
    nums[i]=pack.SpherePack()
    
nums[i].makeCloud((0.005,0.005,0.005),(0.035,0.035,0.035),rMean=coke[i][0],rRelFuzz=tolerance[i],num=coke[i][1])
    O.bodies.append([utils.sphere(c,r,material=mats[i]) for c,r in nums[i]])
    O.bodies.replaceByClumps(temps[i],[1.0],discretization=5)

#===============================================================
#=================== define Engine =============================
#===============================================================

O.engines=[
        ForceResetter(),
        
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Facet_Aabb()]),
        
InteractionLoop([Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
        [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
        
[Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
        ),
        TriaxialStateRecorder(iterPeriod=10000,file='WallStresses'),
        NewtonIntegrator(damping=0.4,gravity=[0,0,-9.81]),
        PyRunner(iterPeriod=10000,command='addPlotData()'),
]

O.dt=5e-7


def addPlotData():
        plot.addData(exx=-triax.strain[0], eyy=-triax.strain[1], 
ezz=-triax.strain[2], ev=(triax.strain[0]+triax.strain[1]+triax.strain[2]), 
sxx=-triax.stress(triax.wall_right_id)[0], 
syy=-triax.stress(triax.wall_top_id)[1], 
szz=-triax.stress(triax.wall_front_id)[2], 
q=-(triax.stress(triax.wall_front_id)[2]-triax.stress(triax.wall_right_id)[0]), 
p=triax.meanStress, R=triax.stress(triax.wall_front_id)[2]/sigmaIso, 
por=triax.porosity, i=O.iter,**O.energy,total=O.energy.total()),


#=================================================================
#=================  APPLYING CONFINING PRESSURE   ================
#=================================================================
sigmaIso=-1e5
triax=TriaxialStressController(
        maxMultiplier=1.000,  
        finalMaxMultiplier=1.000,  
        thickness = 0,
        stressMask = 7,
        internalCompaction=False,
        max_vel=1,
)


O.engines=O.engines+[triax]

triax.goal1=sigmaIso
triax.goal2=sigmaIso
triax.goal3=sigmaIso
triax.wall_back_activated=True


while 1:
        O.run(100, True)
        unb=unbalancedForce()
        
meanS=(triax.stress(triax.wall_right_id)[0]+triax.stress(triax.wall_top_id)[1]+triax.stress(triax.wall_front_id)[2])/3
        print('mean Stress:',triax.meanStress,'porosity:', 
triax.porosity,'Unbalancing:',unb)
        if  triax.porosity<0.63 and 
abs(sigmaIso-triax.meanStress)/abs(sigmaIso)<0.01:
                print('Isotropic strain1:',-triax.strain[0], 'Isotropic strain 
2:',-triax.strain[1], 'Isotropic strain 3:', -triax.strain[2])
                break
                print('###      Isotropic state saved      ###')


triax.depth0 = triax.depth
triax.height0 = triax.height
triax.width0 = triax.width
O.save('RVE3000-sizeDis3-solid-Iso5e4-Rate005-Isopart.yade')



#====================================================================
#=====================   DEVIATORIC LOADING   =======================
#====================================================================

triax.stressMask = 3
triax.goal1 = sigmaIso
triax.goal2 = sigmaIso
triax.goal3 = -0.05
triax.max_vel = 0.05


O.trackEnergy=True
O.saveTmp()


#====================================================================
#====================     Micro Strain    ===========================
#====================================================================


TW=TesselationWrapper()
TW.triangulate()
TW.computeVolumes()
TW.volume(10)
TW.setState(0)
step=0
while 1:
        step +=1
        O.run(10000,True)
        print('Dev strain1:',-triax.strain[0], 'Dev strain 
2:',-triax.strain[1], 'Dev strain 3:', -triax.strain[2])
        TW.setState(1)
        TW.defToVtk("strain_"+str(step)+".vtk")
        if abs(triax.strain[2]) > 0.5:
                print(O.iter)
                print('time is ', O.time)
                print('porosity:',triax.porosity)
                print('strain 1:',-triax.strain[0], 'strain 
2:',-triax.strain[1], 'strain 3:',-triax.strain[2])
                O.save('RVE3000-sizeDis3-solid-Iso5e4-Rate005-Devpart.yade')
                
plot.saveDataTxt('RVE3000-sizeDis3-solid-Iso5e4-Rate005-Devpart.txt')
                break
                O.pause()


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

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to