how to add a new field in controller GUI in order to pass a parameter to a specific law

Asked by mansour talhaoui

Hi There,

I just started using Yade.

Presently I use those commands to launch the controller view (GUI)

1- I run the command yade then Ipress F12

I would like to add a new field (Real value) in Generate Panel, especially when choosing "CohesiveTriaxialTest" in order to pass this new value to cohesiveFrictionalRelationships of type Ip2_CohFrictMat_CohFrictMat_CohFrictPhys in class CohesiveTriaxialTest when creating actors.

Could please help me to resolve this problem?

Kind regards,
Mansour

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

Hi Mansour,
What you ask is not difficult to do, however I'm not sure it is a good
thing for you to follow this line. Nowadays the preprocessors are only
usefull for showing yade to someone in less than 5 seconds. Other than
that they really lack the flexibility of python scripts (and they force
you to recompile the code each time you change the simulation setup).
I suggest you check example scripts (namely examples/triax-tutorial),
where similar things are achieved without the graphical interface.

Bruno

Revision history for this message
mansour talhaoui (talhaouimansour) said :
#2

Hi Bruno,

Thank you very much. much appreciated.

I have checked your example but really it is not clear enough because I don't know how to use python.

I totally agree with you that changing c++ code will always lead to recompile the code for each modification but it is not a big deal for me (at least in this step of prove of concept) as I would like to do a tweak modification ( adding a constant to formula of calculation of normal adhesion) in C++ code and I think there is no impact or regression that's why I prefer to follow this line to avoid having a wrong results.

I already tried to adapt the scripts to meet my requirements but it does not work. honestly it is so difficult for me to use python.

cheers!

Revision history for this message
Anton Gladky (gladky-anton) said :
#3

Hi,

2013/11/27 mansour talhaoui <email address hidden>:
> I already tried to adapt the scripts to meet my requirements but it does
> not work. honestly it is so difficult for me to use python.

you do not need to know "the whole" Python to write simulation
scripts for Yade. Just basic commands.

Anton

Revision history for this message
Christian Jakob (jakob-ifgt) said :
#4

> honestly it is so difficult for me to use python.

It is not difficult!

Change the script, like bruno suggested and run it in your console, like:

yade scriptname.py

Revision history for this message
Best Jérôme Duriez (jduriez) said :
#5

If you really want achieve your goal through c++, I guess you have to add a line in YADE_CLASS_BASE_DOC_ATTRS_INIT_CTOR_PY block in the source file (pkg/dem/CohesiveTriaxialTest.hpp). Look at other lines from this block, or to https://www.yade-dem.org/doc/prog.html#yade-class-base-doc-macro-family, for the syntax.

But actually, this way is also the one to access and modify variables through Python. And (if you need another point of view different than yours ;-) ) I confirm it's probably worth for you to learn to deal with "python use" of yade

Jerome

Revision history for this message
mansour talhaoui (talhaouimansour) said :
#6

Hi,

Thank you for you support. the problem is solved now.

Revision history for this message
mansour talhaoui (talhaouimansour) said :
#7

Thanks jduriez, that solved my question.