CPM model "omega threshold" parameter in source code

Asked by chanaka Udaya

Dear all,

My problem is regarding the concrete particle model and its source code. In the .hpp file in source code, line 284 (https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/ConcretePM.hpp)
following code block can be found,

((Real,omegaThreshold,((void)">=1. to deactivate, i.e. never delete any contacts",1.),,"damage after which the contact disappears (<1), since omega reaches 1 only for strain →+∞"))

I would like to know what it means by

(void)">=1.

this part.

In addition, If I want to delete a cohesive contact when the omega Threshold reaching to 0.8,
should the code block be modified to the following format,

(Real,omegaThreshold,((void)">=0.8 to deactivate, i.e. never delete any contacts",0.8),,"damage after which the contact disappears (<0.8), since omega reaches 1 only for strain →+∞"))

Thanks
Chanaka

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,

> I would like to know what it means by
> (void)">=1.

concerning line [1], have a look at documentation [2] how it looks "rendered".
">=1. ... is a part of a docstring (note the starting quotation mark)
(void) ... this is C++ way to cast (change) types, here a "string" to void (for some internal reasons). Have a look at [3] and search "(void)" (there are 2 occurrences and explanation for almost this case).

> In addition, If I want to delete a cohesive contact when the omega Threshold reaching to 0.8, should the code block be modified to the following format,
> (Real,omegaThreshold,((void)">=0.8 to deactivate, i.e. never delete any contacts",0.8),,"damage after which the contact disappears (<0.8), since omega reaches 1 only for strain →+∞"))

NO!
It is possible to do it this way, but it is very discouraged approach for various reasons (one is the need to recompilation, other is divergence from git source code)
The first and third 0.8 is inside quotation marks and appear only in docstrings (have absolutely no effect on computation itself).
The second 0.8 is default value. But I think 1.0 is more reasonable.

The way to change the value for simulation is:
###
O.engines = [
    ...
        Law2_ScGeom_CpmPhys_Cpm(omegaThreshold=0.8),
    ...
]
###

Cheers
Jan

[1] https://gitlab.com/yade-dev/trunk/-/blob/master/pkg/dem/ConcretePM.hpp#L284
[2] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.Law2_ScGeom_CpmPhys_Cpm.omegaThreshold
[3] https://yade-dem.org/doc/prog.html

Revision history for this message
chanaka Udaya (chanaka-udaya) said :
#2

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