Question about the development of polyhedral contact laws

Asked by Xue

Hello everyone,

I would like to ask for your help with regards to building new contact laws for polyhedral particles. Specifically, I want to change the friction coefficient from a constant value to a function that varies with the contact force, like the HertzMindlinExtended function. I downloaded the source codes from the pkg in February 2023.

My questions are about the overall process of compiling the source code:

As far as I understand, I need to modify the laws2 and ip2 functions, which are both in the Polyhedra_02.cpp file. Does this mean that I only need to use the existing law2 and ip2 functions in Polyhedra_02.cpp as templates to build new functions, and then add the declaration of the new function to the hpp file? My main concern is that I am not particularly clear about the dependency relationships between functions in different files, such as the Ig2 function. My current idea is to copy the first 22 lines of Polyhedra_02.cpp into my newly written cpp file. Is this feasible?

After building the new function (law2,ip2), if I want to test the model, should I put the cpp file in the yade source file path and then recompile according to the method provided in the installation? Does this mean that I need to recompile the entire source code every time I make a modification? I saw that the programmer's manual mentioned debugging, but this is new knowledge for me, and I am not sure which part of it can provide guidance for my work.

Thank you very much for your attention, and I eagerly await your response!

xue

Question information

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

Hello,

> Does this mean that I only need to use the existing law2 and ip2 functions in Polyhedra_02.cpp as templates to build new functions, and then add the declaration of the new function to the hpp file?

Yes, it is one option.

> My main concern is that I am not particularly clear about the dependency relationships between functions in different files, such as the Ig2 function. My current idea is to copy the first 22 lines of Polyhedra_02.cpp into my newly written cpp file. Is this feasible?

Yes, it should be feasible.
You can read User's manual, Tutorial, DEM Formulation... to get basic idea about Yade design.

As I understood your description, you will modify how the force is computed based on contact geometry.
It is a task of Law2.
Probably you also would need to modify Ip2, which stores "physics" information about interaction (e.g. some friction history).
It should not be necessary to touch Ig2 (geometry part of the contact - overlaps etc.).

> After building the new function (law2,ip2), if I want to test the model, should I put the cpp file in the yade source file path and then recompile according to the method provided in the installation?

Yes

> Does this mean that I need to recompile the entire source code every time I make a modification?

Yes.
But the compiler is "clever enough" to compile only necessary part of the code (the modified files + files depending on them)

Cheers
Jan

Revision history for this message
Xue (1q12) said :
#2

Thanks Jan Stránský, that solved my question.