how creat a new law between particle

Asked by lip

hello
i am going to define a new contact geometry and a new contact law, the new geometry is serve for the new law. i want to know which file in yade is relavent to my work, is there any examples to guide me how todo that?
i woule appreciate if you can help me

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello,

there is no really example, but the existing code should be instructive and inspirative enough.

In the most general case:
Shape - describes a geometry of a **Body**, e.g. Sphere, Polyhedra
Material - describes material properties of a **Body**, e.g. FrictMat, PolyhedraMat
IGeom - describes a geometry of an **Interaction**, e.g. ScGeom, PolyhedraGeom
IPhys - describes physics/material properties/physical history of an **Interaction**, e.g. FrictPhys, PolyhedraPhys
Ig2 - takes two Shapes and creates/updates IGeom
Ip2 - takes two Materials and creates/updates IPhys
Law2 - takes IGeom and IPhys and calculates forces, possibly updates IPhys

For new staff (in most general case):
- new law needs new Law2 functor
- new IGeom needs new IGeom subclass and new Ig2 functor(s)
- new Shape needs new Bo1 functor, new Ig2 functor(s) and possibly new IGeom
- new IPhys needs new IPhys subclass and new Ip2 functor(s)
- new Material would need new Ip2 functor(s), possibly new IPhys

Look at the most basic/used existing cases:
IGeom: ScGeom [1,2]
Ig2: Ig2_Sphere_Sphere_ScGeom [3,4], Ig2_Wall_Sphere_ScGeom [5,6]
Law2: Law2_ScGeom_FrictPhys_CundallStrack [7,8]

cheers
Jan

[1] https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/ScGeom.hpp#L18
[2] https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/ScGeom.cpp
[3] https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/Ig2_Sphere_Sphere_ScGeom.hpp#L10
[4] https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/Ig2_Sphere_Sphere_ScGeom.cpp
[5] https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/Ig2_Facet_Sphere_ScGeom.hpp#L67
[6] https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/Ig2_Facet_Sphere_ScGeom.cpp
[7] https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/ElasticContactLaw.hpp#L16
[8] https://gitlab.com/yade-dev/trunk/blob/master/pkg/dem/ElasticContactLaw.cpp

Revision history for this message
Robert Caulk (rcaulk) said :
#2

Thank you for the thoughtful response, Jan.