[Kratos] variables.h

Pooyan pooyan en cimne.upc.edu
Mie Mayo 22 13:06:15 CEST 2013


Hi,

 

But the variable Should NOT be in the variables.cpp. It has to be in your_application.cpp like the others.

 

Pooyan.

 

From: kratos-bounces en listas.cimne.upc.edu [mailto:kratos-bounces en listas.cimne.upc.edu] On Behalf Of Hoang Giang Bui
Sent: 22 May 2013 12:32
To: kratos
Subject: Re: [Kratos] variables.h

 

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 en 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 en 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 en listas.cimne.upc.edu [mailto:kratos-bounces en 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 en listas.cimne.upc.edu
http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/kratos

 





------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://listas.cimne.upc.edu/pipermail/kratos/attachments/20130522/ee03819a/attachment.htm 


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