Question #247006 on Yade changed: https://answers.launchpad.net/yade/+question/247006
Jan Stránský proposed the following answer: Hi Behzad, > Jan; > this can be any developer :-) > To start writing and compiling a new constitutive law, perhaps it's not a > bad idea if I first have a look on the simple already implemented laws. > yes :-) > for example where I can find the C++ files of a simple law of > frictMat=frictMat contact? > the answer to your question is not so easy.. have a look at [1,2] chapters in user's manual. For the standard basic case: - when two bodies newly interct: - Firstly Ig2 (e.g. Ig2_Sphere_Sphere_ScGeom) functor is called creating geometric properties of the interaction from bodies' Shapes. - these properties are stored in IGeom instace, belonging to interaction (in this case ScGeom) - then Ip2 functor is called, in this case Ip2_FrictMat_FrictMat_FrictPhys. It take the two bodies' Materials and create new IPhys (specifically FrictPhys) instance. - IPhys stores variables specific for the interaction physics (could be e.g. material parameter like internal friction angle - same for all interactions - but also internal variables like plastic strain - different for every interaction -etc.) - for forces evaluation, you need Law2 functor (in this case Law2_ScGeom_FrictPhys_CundallStrack) combining IGeom and IPhys of the interaction and computing forces, that are then used by NewtonIntegrator Files related to the example: pkg/common/Sphere.xpp pkg/dem/Ig2_Sphere_Sphere_ScGeom.xpp pkg/dem/ScGeom.xpp pkg/common/ElastMat.xpp pkg/dem/Ip2_FrictMat_FrictMat_FrictPhys.xpp pkg/dem/FrictPhys.xpp pkg/dem/ElasticContactLaw.xpp Let's say I modify this, then how do I compile it? > See [3]. After a modification, recompile yade by 'make' and 'make install' commands in case of any problem, write us, we will try to help cheers Jan [1] https://yade-dem.org/doc/user.html#creating-interactions [2] https://yade-dem.org/doc/user.html#base-engines [3] https://yade-dem.org/doc/installation.html#source-code -- You received this question notification because you are a member of yade-users, which is an answer contact for Yade. _______________________________________________ Mailing list: https://launchpad.net/~yade-users Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp

