mimesis-inria / caribou

Multi-physics computation library
GNU Lesser General Public License v3.0
29 stars 17 forks source link

Add hyperelastic FF trampoline class for python bindings #127

Open jnbrunet opened 2 years ago

jnbrunet commented 2 years ago

This PR will allow one to do something like

import SofaCaribou

class MyFF (SofaCaribou.SofaCaribou.HyperelasticForcefield_Hexahedron):
    def addForce(self, mp, f, x, v):
       print(x)
        SofaCaribou.SofaCaribou.HyperelasticForcefield_Hexahedron.addForce(self, mp, f, x, v)

def createScene(root):
    # (...)
    root.addObject(MyFF(printLog=True))