[Kratos] variables.h

Hoang Giang Bui hgbk2008 en gmail.com
Mie Mayo 22 12:31:34 CEST 2013


Hi Janosch

Including header of other application causes a lot of compilation errors.
We should not do that. The way works for me is to declare

extern Variable<DataType> VARIABLE_IN_OTHER_APPLICATION;

in where you want to use this variable in your application (i.e. elements,
conditions). Of course you have to link your application with other
application containing that variable in CMakeLists.txt. And in the python
script you should import other application first to align the destructor
call of the smart pointer.



Hi Pooyan

I tried to create a variable as the same in the kernel but it caused
linking error:

../../kratos/libKratosCore.a(variables.cpp.o):(.bss+0x2648): multiple
definition of `Kratos::SUCTION'



Ciao
Bui





On Wed, May 22, 2013 at 11:58 AM, Pablo Becker <pbecker at cimne.upc.edu>wrote:

> I think some people still modify the kernel to avoid declaring variables
> more than once. For example, if you are using two applications and both
> need a variable. But otherwise i agree with you.
> Pablo
>
>
> On Wed, May 22, 2013 at 10:48 AM, Pooyan <pooyan at cimne.upc.edu> wrote:
>
>> Hi everybody,****
>>
>> ** **
>>
>> I agree completely and  the best way is to add the variables to each
>> applications and not to the main variables.h and cpp. (These are for
>> generic variables) This habit comes from the time in which the kernel could
>> not handle the variables in applications in the same way as the core ones.
>> I have fixed this bug and as much as I know the kernel take them in the
>> same manner. (if it is not like this please report a bug)****
>>
>> ** **
>>
>> Bests,****
>>
>> ** **
>>
>> Pooyan.****
>>
>> ** **
>>
>> *From:* kratos-bounces at listas.cimne.upc.edu [mailto:
>> kratos-bounces at listas.cimne.upc.edu] *On Behalf Of *Hoang Giang Bui
>> *Sent:* 18 May 2013 23:39
>> *To:* kratos
>> *Subject:* [Kratos] variables.h****
>>
>> ** **
>>
>>
>> Hello****
>>
>> Is there a way to stop changing the variables.h file? My kratos keeping
>> recompile when I update. I think you can introduce new variables in your
>> application or link with other application if you want to use variables
>> from other application. How do you think ?
>> ****
>>
>> ** **
>>
>> This is what I did (in header file):
>>
>> extern Variable<Vector> PRESTRESS;
>> extern Variable<Vector> STRESSES;
>> extern Variable<double> PRESTRESS_FACTOR;
>>
>> Ciao
>> Bui****
>>
>> _______________________________________________
>> Kratos mailing list
>> Kratos at listas.cimne.upc.edu
>> http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/kratos
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/kratos/attachments/20130522/015cb1d5/attachment.htm 


Más información sobre la lista de distribución Kratos