erdc / proteus

A computational methods and simulation toolkit
http://proteustoolkit.org
MIT License
87 stars 55 forks source link

Error of mooring line attach material #1273

Closed whtsao closed 1 year ago

whtsao commented 1 year ago

When I run the moored_body.py in proteus_tutorial/2D/, I got the following error from ‘seabed.SetMaterialSurface(material)’: AttributeError: 'ChBodyEasyBox' object has no attribute 'SetMaterialSurface' I found someone has the same problem before (https://github.com/projectchrono/chrono/issues/428), it seems the new chrono has changed something. Do @cekees know how to rewrite this part for chrono? Thank you.

cekees commented 1 year ago

The issue you point to on the chrono issue tracker is saying the API has changed. Now you need to set call that function on the collision object, which is distinct from the body. You may want to see if ChBodyEasyBox has a pointer to its collision object.

whtsao commented 1 year ago

Contact materials are now associated with collision shapes (so that you can have multiple different materials in the collision material of any given body). Please see point 5 in this link: https://github.com/projectchrono/chrono/blob/main/CHANGELOG.md#changed-collision-shapes-and-contact-materials

The old code use: mybox = pychrono.ChBodyEasyBox(x size, y size, z size, density, collision?) mybox.SetMaterialSurface(material)

The new code use: mboxBody = chrono.ChBodyEasyBox(x size, y size, z size, density, visualization?, collision?, material)