face material

Asked by Wang Haijiang

Hello all

I am trying to simulate a landslide. I will generate spheres and materials between the balls, but I do not know how to generate materials between spheres and face.The last line of code error, I don't know how to write.Please help me.

This is the code

################################
from yade import pack
import gts, os.path, locale

#-----------------------Creat materials----------------------
O.materials.append( CohFrictMat( young=1E8,poisson=0.35,density=2100,frictionAngle=radians(30),normalCohesion=2e4,shearCohesion=2e4,momentRotationLaw=True,label='cMat' ) ) # material to create the gridConnections
O.materials.append( FrictMat( young=9E8,poisson=0.38,density=2100,frictionAngle=radians(22),label='fMat' ) ) # material for general interactions

#------------------Create spheres and facet-----------------
surf=gts.read(open('2222.gts'))
surf1=gts.read(open('1111.gts'))
if surf.is_closed():
 pred=pack.inGtsSurface(surf)
 aabb=pred.aabb()
 dim0=aabb[1][0]-aabb[0][0]; radius=dim0/100. # get some characteristic dimension, use it for radius
 O.bodies.append(pack.regularHexa(pred,radius=radius,gap=0,material='cMat'))
 for b in O.bodies:
     b.shape.color = (0,191/255.,1)
O.bodies.append(pack.gtsSurface2Facets(surf1),wire=False,material='fMat')

##########################################

 File "/usr/bin/yade", line 336, in runScript
    execfile(script,globals())
  File "/usr/lib/python3/dist-packages/past/builtins/misc.py", line 87, in execfile
    exec_(code, myglobals, mylocals)
  File "MLS.py", line 24, in <module>
    O.bodies.append(pack.gtsSurface2Facets(surf1),wire=False)
Boost.Python.ArgumentError: Python argument types in
    BodyContainer.append(BodyContainer, list)
did not match C++ signature:
    append(yade::pyBodyContainer {lvalue}, std::vector<boost::shared_ptr<yade::Body>, std::allocator<boost::shared_ptr<yade::Body> > >)
    append(yade::pyBodyContainer {lvalue}, boost::shared_ptr<yade::Body>)

Looking forward to your answers
Appreciate

Wang

Question information

Language:
English Edit question
Status:
Expired
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello,

please provide a MWE [1].
I.e. we can try it ourselves.
In this case, without *.gts files.
To illustrate the problem, one / a few spheres and facets should be sufficient.
If GTS surface is needed, you can "manually" construct it.

> I do not know how to generate materials between spheres and face.
> The last line of code error, I don't know how to write

Please open separate question for separate problem ([1], point 5)

Concerning the error, you can focus on the error line
O.bodies.append(pack.gtsSurface2Facets(surf1),wire=False,material='fMat')
O.bodies.append does not have "wire" and "material" keywords.
Maybe
O.bodies.append(pack.gtsSurface2Facets(surf1,wire=False,material='fMat'))
?

Cheers
Jan

[1] https://www.yade-dem.org/wiki/Howtoask

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.