Cylinder-Pfacet contact

Asked by Cong Xu

Hi,

I'm very interested in the pfacet element in the following paper:

Effeindzourou, A., Chareyre, B., Thoeni, K., Giacomini, A., and Kneib, F. 2016. Modelling of deformable structures in the general framework of the discrete element method. Geotextiles and Geomembranes 44(2): 143-156.

I met a problem when I tested the Cylinder-Pfacet contact. The error message is Segmentation fault. I want to know whether this function is built in Yadedaily? The following is my script:

# -*- coding: utf-8
from yade import qt,plot
from yade.gridpfacet import *

##################
### PARAMETERS ###
##################
phi=20.
E=3.*1e8
color=[255./255.,102./255.,0./255.]
r=0.005
r2=0.01

################
### ENGINES ###
################
O.engines=[
 ForceResetter(),
 InsertionSortCollider([
  Bo1_GridConnection_Aabb(),
  Bo1_PFacet_Aabb(),
 ]),
 InteractionLoop([
  Ig2_GridNode_GridNode_GridNodeGeom6D(),
  Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
  Ig2_GridConnection_PFacet_ScGeom(),
    ],
    [
        Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=True),
  Ip2_FrictMat_FrictMat_FrictPhys()
 ],
 [
        Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
  Law2_ScGeom_FrictPhys_CundallStrack(),
  Law2_GridCoGridCoGeom_FrictPhys_CundallStrack()
 ]
 ),
 NewtonIntegrator(gravity=(0,-9.81,0),damping=0.0,label='newton'),
]

################
### MATERIAL ###
################
O.materials.append( CohFrictMat( young=E,poisson=0.3,density=2650,frictionAngle=radians(phi),normalCohesion=3e100,shearCohesion=3e100,momentRotationLaw=True,label='gridNodeMat' ) ) # material to create the gridConnections
O.materials.append( FrictMat( young=E,poisson=0.3,density=2650,frictionAngle=radians(phi),label='pFacetMat' ) ) # material for general interactions

########################################
### GENERATE THE WALL AND THE cylinder ###
########################################

# FIXED WALL
O.bodies.append( gridNode([-0.25,-0.22,-.25],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([.5,0.,-.25],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([-.25,-0.22,.25],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([.5,0.,.25],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridConnection(0,1,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(2,3,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(2,1,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(2,0,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(3,1,r,color=color,material='gridNodeMat') )
O.bodies.append( pfacet(2,1,0,wire=False,material='pFacetMat',color=color) )
O.bodies.append( pfacet(2,3,1,wire=False,material='pFacetMat',color=color) )

# cylinder

O.bodies.append( gridNode([0,0,-0.25],r2,wire=False,fixed=False,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([0,0,0.25],r2,wire=False,fixed=False,material='gridNodeMat',color=color) )
O.bodies.append( gridConnection(11,12,r2,color=color,material='gridNodeMat') )

O.dt=1e-6
O.saveTmp()

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Klaus Thoeni
Solved:
Last query:
Last reply:
Revision history for this message
anna effeindzourou (anna-effeindzourou) said :
#1

Hi,

Looking at your script, CohFrictMat type is used for GridConnections and I
think you should instead use a FrictMat type of material. In your script,
think that once the cylinder is in contact with the PFacet structure and
the setCohesionOnNewContacts flag is True you are trying to create a
cohesive interaction between the cylinder and the Pfacet structure
therefore you get the segmentation fault.

HTH,
 Anna

2016-03-05 12:08 GMT+11:00 Cong Xu <email address hidden>:

> New question #287915 on Yade:
> https://answers.launchpad.net/yade/+question/287915
>
> Hi,
>
> I'm very interested in the pfacet element in the following paper:
>
> Effeindzourou, A., Chareyre, B., Thoeni, K., Giacomini, A., and Kneib, F.
> 2016. Modelling of deformable structures in the general framework of the
> discrete element method. Geotextiles and Geomembranes 44(2): 143-156.
>
> I met a problem when I tested the Cylinder-Pfacet contact. The error
> message is Segmentation fault. I want to know whether this function is
> built in Yadedaily? The following is my script:
>
> # -*- coding: utf-8
> from yade import qt,plot
> from yade.gridpfacet import *
>
> ##################
> ### PARAMETERS ###
> ##################
> phi=20.
> E=3.*1e8
> color=[255./255.,102./255.,0./255.]
> r=0.005
> r2=0.01
>
>
> ################
> ### ENGINES ###
> ################
> O.engines=[
> ForceResetter(),
> InsertionSortCollider([
> Bo1_GridConnection_Aabb(),
> Bo1_PFacet_Aabb(),
> ]),
> InteractionLoop([
> Ig2_GridNode_GridNode_GridNodeGeom6D(),
> Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
> Ig2_GridConnection_PFacet_ScGeom(),
> ],
> [
>
> Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=True),
> Ip2_FrictMat_FrictMat_FrictPhys()
> ],
> [
> Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
> Law2_ScGeom_FrictPhys_CundallStrack(),
> Law2_GridCoGridCoGeom_FrictPhys_CundallStrack()
> ]
> ),
> NewtonIntegrator(gravity=(0,-9.81,0),damping=0.0,label='newton'),
> ]
>
>
> ################
> ### MATERIAL ###
> ################
> O.materials.append( CohFrictMat(
> young=E,poisson=0.3,density=2650,frictionAngle=radians(phi),normalCohesion=3e100,shearCohesion=3e100,momentRotationLaw=True,label='gridNodeMat'
> ) ) # material to create the gridConnections
> O.materials.append( FrictMat(
> young=E,poisson=0.3,density=2650,frictionAngle=radians(phi),label='pFacetMat'
> ) ) # material for general interactions
>
>
> ########################################
> ### GENERATE THE WALL AND THE cylinder ###
> ########################################
>
> # FIXED WALL
> O.bodies.append(
> gridNode([-0.25,-0.22,-.25],r,wire=False,fixed=True,material='gridNodeMat',color=color)
> )
> O.bodies.append(
> gridNode([.5,0.,-.25],r,wire=False,fixed=True,material='gridNodeMat',color=color)
> )
> O.bodies.append(
> gridNode([-.25,-0.22,.25],r,wire=False,fixed=True,material='gridNodeMat',color=color)
> )
> O.bodies.append(
> gridNode([.5,0.,.25],r,wire=False,fixed=True,material='gridNodeMat',color=color)
> )
> O.bodies.append( gridConnection(0,1,r,color=color,material='gridNodeMat') )
> O.bodies.append( gridConnection(2,3,r,color=color,material='gridNodeMat') )
> O.bodies.append( gridConnection(2,1,r,color=color,material='gridNodeMat') )
> O.bodies.append( gridConnection(2,0,r,color=color,material='gridNodeMat') )
> O.bodies.append( gridConnection(3,1,r,color=color,material='gridNodeMat') )
> O.bodies.append( pfacet(2,1,0,wire=False,material='pFacetMat',color=color)
> )
> O.bodies.append( pfacet(2,3,1,wire=False,material='pFacetMat',color=color)
> )
>
> # cylinder
>
> O.bodies.append(
> gridNode([0,0,-0.25],r2,wire=False,fixed=False,material='gridNodeMat',color=color)
> )
> O.bodies.append(
> gridNode([0,0,0.25],r2,wire=False,fixed=False,material='gridNodeMat',color=color)
> )
> O.bodies.append(
> gridConnection(11,12,r2,color=color,material='gridNodeMat') )
>
> O.dt=1e-6
> O.saveTmp()
>
>
> --
> 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 address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#2

Hi,

the material for your GridConnection should be pFacetMat and not gridNodeMat as the latter is cohesive. As Anna mentioned, in your case the cylinder is trying to create a cohesive connection with the pFacet.

Klaus

Revision history for this message
Cong Xu (congxu) said :
#3

Thank you, Klaus and Anna.

Like you said, I change the GridConnection material to PfacetMat, and set the setCohesionOnNewContacts flag to False. But the error 'Segmentation fault' still occurs.

This is the script,

# -*- coding: utf-8
from yade import qt,plot
from yade.gridpfacet import *

##################
### PARAMETERS ###
##################
phi=20.
E=3.*1e8
color=[255./255.,102./255.,0./255.]
r=0.005
r2=0.01

################
### ENGINES ###
################
O.engines=[
 ForceResetter(),
 InsertionSortCollider([
  Bo1_GridConnection_Aabb(),
  Bo1_PFacet_Aabb(),
 ]),
 InteractionLoop([
  Ig2_GridNode_GridNode_GridNodeGeom6D(),
  Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
  Ig2_GridConnection_PFacet_ScGeom(),
    ],
    [
        Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
  Ip2_FrictMat_FrictMat_FrictPhys()
 ],
 [
        Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
  Law2_ScGeom_FrictPhys_CundallStrack(),
  Law2_GridCoGridCoGeom_FrictPhys_CundallStrack()
 ]
 ),
 NewtonIntegrator(gravity=(0,-9.81,0),damping=0.0,label='newton'),
]

################
### MATERIAL ###
################
O.materials.append( CohFrictMat( young=E,poisson=0.3,density=2650,frictionAngle=radians(phi),normalCohesion=3e100,shearCohesion=3e100,momentRotationLaw=True,label='gridNodeMat' ) ) # material to create the gridConnections
O.materials.append( FrictMat( young=E,poisson=0.3,density=2650,frictionAngle=radians(phi),label='pFacetMat' ) ) # material for general interactions

########################################
### GENERATE THE WALL AND THE cylinder ###
########################################

# FIXED WALL
O.bodies.append( gridNode([-0.25,-0.22,-.25],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([.5,0.,-.25],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([-.25,-0.22,.25],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([.5,0.,.25],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridConnection(0,1,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(2,3,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(2,1,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(2,0,r,color=color,material='gridNodeMat') )
O.bodies.append( gridConnection(3,1,r,color=color,material='gridNodeMat') )
O.bodies.append( pfacet(2,1,0,wire=False,material='pFacetMat',color=color) )
O.bodies.append( pfacet(2,3,1,wire=False,material='pFacetMat',color=color) )

# cylinder

O.bodies.append( gridNode([0,0,-0.25],r2,wire=False,fixed=False,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([0,0,0.25],r2,wire=False,fixed=False,material='gridNodeMat',color=color) )
O.bodies.append( gridConnection(11,12,r2,color=color,material='pFacetMat') )

O.dt=1e-6
O.saveTmp()

Best regards,

Cong

Revision history for this message
anna effeindzourou (anna-effeindzourou) said :
#4

Hi,
Looking at your script, seems like you did not change the material for the
first gridConnections you have.

HTH,
Anna

2016-03-10 8:07 GMT+11:00 Cong Xu <email address hidden>:

> Question #287915 on Yade changed:
> https://answers.launchpad.net/yade/+question/287915
>
> Status: Answered => Open
>
> Cong Xu is still having a problem:
> Thank you, Klaus and Anna.
>
> Like you said, I change the GridConnection material to PfacetMat, and
> set the setCohesionOnNewContacts flag to False. But the error
> 'Segmentation fault' still occurs.
>
> This is the script,
>
> # -*- coding: utf-8
> from yade import qt,plot
> from yade.gridpfacet import *
>
> ##################
> ### PARAMETERS ###
> ##################
> phi=20.
> E=3.*1e8
> color=[255./255.,102./255.,0./255.]
> r=0.005
> r2=0.01
>
>
> ################
> ### ENGINES ###
> ################
> O.engines=[
> ForceResetter(),
> InsertionSortCollider([
> Bo1_GridConnection_Aabb(),
> Bo1_PFacet_Aabb(),
> ]),
> InteractionLoop([
> Ig2_GridNode_GridNode_GridNodeGeom6D(),
> Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
> Ig2_GridConnection_PFacet_ScGeom(),
> ],
> [
>
> Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
> Ip2_FrictMat_FrictMat_FrictPhys()
> ],
> [
> Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
> Law2_ScGeom_FrictPhys_CundallStrack(),
> Law2_GridCoGridCoGeom_FrictPhys_CundallStrack()
> ]
> ),
> NewtonIntegrator(gravity=(0,-9.81,0),damping=0.0,label='newton'),
> ]
>
>
> ################
> ### MATERIAL ###
> ################
> O.materials.append( CohFrictMat(
> young=E,poisson=0.3,density=2650,frictionAngle=radians(phi),normalCohesion=3e100,shearCohesion=3e100,momentRotationLaw=True,label='gridNodeMat'
> ) ) # material to create the gridConnections
> O.materials.append( FrictMat(
> young=E,poisson=0.3,density=2650,frictionAngle=radians(phi),label='pFacetMat'
> ) ) # material for general interactions
>
>
> ########################################
> ### GENERATE THE WALL AND THE cylinder ###
> ########################################
>
> # FIXED WALL
> O.bodies.append(
> gridNode([-0.25,-0.22,-.25],r,wire=False,fixed=True,material='gridNodeMat',color=color)
> )
> O.bodies.append(
> gridNode([.5,0.,-.25],r,wire=False,fixed=True,material='gridNodeMat',color=color)
> )
> O.bodies.append(
> gridNode([-.25,-0.22,.25],r,wire=False,fixed=True,material='gridNodeMat',color=color)
> )
> O.bodies.append(
> gridNode([.5,0.,.25],r,wire=False,fixed=True,material='gridNodeMat',color=color)
> )
> O.bodies.append( gridConnection(0,1,r,color=color,material='gridNodeMat') )
> O.bodies.append( gridConnection(2,3,r,color=color,material='gridNodeMat') )
> O.bodies.append( gridConnection(2,1,r,color=color,material='gridNodeMat') )
> O.bodies.append( gridConnection(2,0,r,color=color,material='gridNodeMat') )
> O.bodies.append( gridConnection(3,1,r,color=color,material='gridNodeMat') )
> O.bodies.append( pfacet(2,1,0,wire=False,material='pFacetMat',color=color)
> )
> O.bodies.append( pfacet(2,3,1,wire=False,material='pFacetMat',color=color)
> )
>
> # cylinder
>
> O.bodies.append(
> gridNode([0,0,-0.25],r2,wire=False,fixed=False,material='gridNodeMat',color=color)
> )
> O.bodies.append(
> gridNode([0,0,0.25],r2,wire=False,fixed=False,material='gridNodeMat',color=color)
> )
> O.bodies.append( gridConnection(11,12,r2,color=color,material='pFacetMat')
> )
>
> O.dt=1e-6
> O.saveTmp()
>
> Best regards,
>
> Cong
>
> --
> 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 address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Cong Xu (congxu) said :
#5

Hi Anna,

Did you mean to change the gridconnection material in the wall? I tried that, it still didn't work...
BTW, my Yade version is 1.20.0-72-bbff50f~trusty.

Thank you.

Cong

Here is the new one:

# -*- coding: utf-8
from yade import qt,plot
from yade.gridpfacet import *

##################
### PARAMETERS ###
##################
phi=20.
E=3.*1e8
color=[255./255.,102./255.,0./255.]
r=0.005
r2=0.01

################
### ENGINES ###
################
O.engines=[
 ForceResetter(),
 InsertionSortCollider([
  Bo1_GridConnection_Aabb(),
  Bo1_PFacet_Aabb(),
 ]),
 InteractionLoop([
  Ig2_GridNode_GridNode_GridNodeGeom6D(),
  Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
  Ig2_GridConnection_PFacet_ScGeom(),
    ],
    [
        Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False),
  Ip2_FrictMat_FrictMat_FrictPhys()
 ],
 [
        Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
  Law2_ScGeom_FrictPhys_CundallStrack(),
  Law2_GridCoGridCoGeom_FrictPhys_CundallStrack()
 ]
 ),
 NewtonIntegrator(gravity=(0,-9.81,0),damping=0.0,label='newton'),
]

################
### MATERIAL ###
################
O.materials.append( CohFrictMat( young=E,poisson=0.3,density=2650,frictionAngle=radians(phi),normalCohesion=3e100,shearCohesion=3e100,momentRotationLaw=True,label='gridNodeMat' ) ) # material to create the gridConnections
O.materials.append( FrictMat( young=E,poisson=0.3,density=2650,frictionAngle=radians(phi),label='pFacetMat' ) ) # material for general interactions

########################################
### GENERATE THE WALL AND THE cylinder ###
########################################

# FIXED WALL
O.bodies.append( gridNode([-0.25,-0.22,-.25],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([.5,0.,-.25],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([-.25,-0.22,.25],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([.5,0.,.25],r,wire=False,fixed=True,material='gridNodeMat',color=color) )
O.bodies.append( gridConnection(0,1,r,color=color,material='pFacetMat') )
O.bodies.append( gridConnection(2,3,r,color=color,material='pFacetMat') )
O.bodies.append( gridConnection(2,1,r,color=color,material='pFacetMat') )
O.bodies.append( gridConnection(2,0,r,color=color,material='pFacetMat') )
O.bodies.append( gridConnection(3,1,r,color=color,material='pFacetMat') )
O.bodies.append( pfacet(2,1,0,wire=False,material='pFacetMat',color=color) )
O.bodies.append( pfacet(2,3,1,wire=False,material='pFacetMat',color=color) )

# cylinder

O.bodies.append( gridNode([0,0,-0.25],r2,wire=False,fixed=False,material='gridNodeMat',color=color) )
O.bodies.append( gridNode([0,0,0.25],r2,wire=False,fixed=False,material='gridNodeMat',color=color) )
O.bodies.append( gridConnection(11,12,r2,color=color,material='pFacetMat') )

O.dt=1e-6
O.saveTmp()

Revision history for this message
Best Klaus Thoeni (klaus.thoeni) said :
#6

You where right, there was as well a problem in the code. Should be fixed in the latest trunk version [1].

K

[1] https://github.com/yade/trunk/commit/32aca90dd5d6e7ccb077139d9e1ac6d8fc6cc03a

Revision history for this message
Cong Xu (congxu) said :
#7

Thanks Klaus Thoeni, that solved my question.