setting new parameter

Submitted by Masayuki on Mon, 01/23/2012 - 21:18

Hi,

I want to introduce new parameter to the LIGGGHTS code. I have tried to define the parameter but I couldn't that. So, first, I should understand, for example, how Young's modulus is got from LIGGGHTS code such as "in.cohesion" to inside of the LIGGGTHS code such as "pair_gran_hooke_history.cpp". Please tell me how to get parameters from LIGGGHTS code to inside or please tell me the flow of the variable from "in.cohesion" to "pair_gran_hooke_history".

Regards,

Masa

ckloss's picture

ckloss | Tue, 01/24/2012 - 09:26

Hi Masa,

the easiest way to understand how properties from the input script get into the code is to look at fix_heat_gran.cpp. E.g. the line Y = static_cast(modify->find_fix_property("youngsModulus","property/global","peratomtype",max_type,0))->get_values();

Cheers, Christoph

Masayuki | Tue, 01/24/2012 - 16:05

Thanks for answering.

I have still question.
How do you follow parameter?

I write down what I tried.
In the file of "fix_heat_gran.cpp",
I could find the line of "fix_temp = static_cast(modify->fix[modify->find_fix_property("Temp","property/peratom","scalar",0,0)]);".
In this line, I think I can ignore the " static_cast()" because of merely conversion.
And, "modify->fix[]" is important.
But, I couldn't find "*fix" or "fix[]" .

On the other hand, I could find "const double* get_values() {return values;}" in the file of "fix_propertyGlobal.h", but I can't follow the "values".

So, please tell me the flow of Youngs modulus from input script to inside of the code again.
Youngs modulus is used as a "Yeff" in the file "pair_gran_hooke_history.cpp", and in that file, there is a definition "Yeff = memory->create_2d_double_array(size+1,size+1,"Yeff");" in a function of "PairGranHookeHistory::allocate_properties(int size)"

I could find the function of "create_2d_double_array" in the file of "memory.cpp", and in that file, there are lines of "return array" and "array[i] = &data[n];". However, I can't follow the "data".

ckloss's picture

ckloss | Tue, 01/24/2012 - 16:21

Dear Masa,

answering all this in detail in the forum would be a bit tedious. I suggest you either get yourself C++ basics and get into that a bit deeper on your own and ask the remaining questions in the forums or take the next course we hold in Linz (probably in June)

Christoph

Masayuki | Wed, 01/25/2012 - 02:06

To Christoph,

Thanks for quick replying.
I'll use your previous information.

Regards,

Masa