[Yade-dev] material -- state couples

2009-11-24 Thread Václav Šmilauer
Material CpmMat requires that the body has CpmState (deriving from State), e.g. to record per-body damaged contacts etc. I can imagine some other materials might have similar requirements. What would be a clean way to assure that? Obviously checking that in the constitutive law at every step

Re: [Yade-dev] material -- state couples

2009-11-24 Thread Bruno Chareyre
Complex stuff! Are you just trying to make the code foolproof or is there another reason? Fixing the state type is perhaps not necessary : it would make something not desired by the user anyway, for good or bad. Wouldn't displaying you picked a wrong mat/state combination be enough? In that

Re: [Yade-dev] material -- state couples

2009-11-24 Thread Václav Šmilauer
For now, I solved that in python only: most/all python code calls utils.sphere to create sphere etc. Material::newAssocState returns instance of required State (sub)class. Are you just trying to make the code foolproof or is there another reason? Yes, that's it. In that case, it could be tested