← Back to team overview

yade-users team mailing list archive

[Question #693817]: The error about defining a CohFrictPhys bond between two different materials?

 

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

Hi, everyone

Here is Jingchi Yu, and i have this code, and i want to simulate the brazilian experiment of  a concrete sample, which is made of rock and mortar. For the purpose of defining the tensile strength between rock and mortar, I used the "matchmaker", but I got the error information:

Traceback (most recent call last):
  File "/usr/bin/yade", line 342, in runScript
    execfile(script,globals())
  File "uniCom_2d.py", line 98, in <module>
    normalCohesion=MatchMaker(matches=((rockId,mortarId,6.0e6))),
TypeError: No registered converter was able to produce a C++ rvalue of type Eigen::Matrix<double, 3, 1, 0, 3, 1> from this Python object of type int

Hope your apply!

My code is here:


from __future__ import division
from yade import bodiesHandling
from numpy import arange
from yade import ymport
from yade import export
from yade import utils
from yade import pack
from yade import plot
from yade import qt
import xlsxwriter
import math
import numpy

###########################
# DEFINE MATERIALS
###########################
# input parameters
porosity = 0.05
Young = 1.0e11 # 100Gpa
FrictAng = radians(18)
Density = 2240/(1-porosity)
Poisson = 1/3.0
Cohesion = 4.5e7 # pa
TensileStr = 10*4.5e6 # pa


#for Mat in (rock,mortar,steel):
#	O.materials.append(Mat)
rockId = O.materials.append(CohFrictMat(young=4.8e10,poisson=.2,density=Density,frictionAngle=radians(38),normalCohesion=4.2e7,shearCohesion=8.4e7,label='mat1'))
mortarId = O.materials.append(CohFrictMat(young=3.2e10,poisson=.2,density=Density,frictionAngle=radians(38),normalCohesion=1.5e7,shearCohesion=3e7,label='mat2'))
steelId = O.materials.append(CohFrictMat(young=2.06e11,poisson=.3,density=7800,frictionAngle=radians(30),normalCohesion=0,shearCohesion=0))
	
######################################
# IMPORT PACKING & UNIAXIAL TENSION
######################################

OutputName = 'uniCom_rdp_2d'

# import packing
#assembly = O.bodies.append(ymport.text('sim1.txt',color=(1,0,1),material=rock))

f = open('sim1.txt','r')
ls = f.readlines()
f.close()

for i in range(8434):
	l = ls[i].split()
	if i<1000:
		x0,y0,z0,r0 = float(l[0]),float(l[1]),float(l[2]),float(l[3])
		assembly = O.bodies.append(sphere(center=(x0,y0,z0),radius=r0,color=(0,0,1),material=rockId))
	else:
		x1,y1,z1,r1 = float(l[0]),float(l[1]),float(l[2]),float(l[3])
		assembly = O.bodies.append(sphere(center=(x1,y1,z1),radius=r1,color=(1,0,1),material=mortarId))


# define a 2d simulation
#for i in assembly:
#	O.bodies[i].state.blockedDOFs = 'zXY'

# aabbWalls
wall = O.bodies.append(utils.aabbWalls(material=steelId,thickness=0.001,color=(1,1,1)))

# delete other walls only save walls in y axis
O.bodies.erase(wall[0])
O.bodies.erase(wall[1])
O.bodies.erase(wall[4])
O.bodies.erase(wall[5])

# set velocity for upper wall
upper_wall = O.bodies[wall[3]]
upper_wall.state.blockedDOFs = 'xyzXYZ'
upper_wall.state.vel = (0,-0.01,0) # 10 mm/s

# fixed the bottom wall
bottom_wall = O.bodies[wall[2]]
bottom_wall.state.blockedDOFs = 'xyzXYZ'

###########################
# ENGINES
###########################

O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1.25,label='Aabb'),Bo1_Box_Aabb()]),
	InteractionLoop(
		[Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor=1.25,label='IntFactor'),Ig2_Box_Sphere_ScGeom6D()],
		[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(
										normalCohesion=MatchMaker(matches=((rockId,mortarId,6.0e6))),
										shearCohesion=MatchMaker(matches=((rockId,mortarId,12e6))))],
		[Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
	),
	VTKRecorder(fileName='post/uniCom-',recorders=['all'],iterPeriod=1000),
	GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=5,timestepSafetyCoefficient=0.8,defaultDt=PWaveTimeStep()),
	NewtonIntegrator(damping=0.3,gravity=(0,-9.81,0)),
	PyRunner(command='addPlotData()',iterPeriod=500),
	PyRunner(command='damageRatio()',iterPeriod=500),
	PyRunner(command='writeData()',iterPeriod=500),
	PyRunner(command='stopSimu()',iterPeriod=500),
#	inter

]
O.trackEnergy=True
O.step()

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