// We assume a distribution of friction and cohesion // Arrays frictionArray and cohesionArray are given for triangles
// tract is the traction before convertion to displacement // id is the id of the triangle for the considered surface c.setFunction( (tract, id) => { constμ = frictionArray[id] constC = cohesionArray[id] constσ = tract[0] constτ = μ*σ + C constt = Math.sqrt(tract[1]**2 + tract[2]**2)
Represent a user-defined constraint on traction. The implementation is provided by a callback.
Another example for coulomb friction
UserDic