How to Add a New Variable

From KratosWiki
(Difference between revisions)
Jump to: navigation, search
Line 2: Line 2:
  
 
'''IN KRATOS'''
 
'''IN KRATOS'''
 +
 
1. '''define''' the variable
 
1. '''define''' the variable
 
it is done in '''.../kratos/includes/variables.h'''
 
it is done in '''.../kratos/includes/variables.h'''
Line 16: Line 17:
  
 
'''IN FAVORITE APPLICATION'''
 
'''IN FAVORITE APPLICATION'''
 +
 
3.If you want to use it in ''python'' file, it is also necessery to introduse it to python in favorite application  
 
3.If you want to use it in ''python'' file, it is also necessery to introduse it to python in favorite application  
 
for example :
 
for example :
 
''../kratosR1/applications/incompressible_fluid_applications/kratos_incompressible_fluid_python_applications.cpp''  
 
''../kratosR1/applications/incompressible_fluid_applications/kratos_incompressible_fluid_python_applications.cpp''  
 
  KRATOS_REGISTER_IN_PYTHON_VARIABLE( DIVPROJ)
 
  KRATOS_REGISTER_IN_PYTHON_VARIABLE( DIVPROJ)

Revision as of 13:56, 5 December 2008

If you need to add a new variable to Kratos which doesn`t exist 3 passes are needed

IN KRATOS

1. define the variable it is done in .../kratos/includes/variables.h

KRATOS_DEFINE_VARIABLE(double, DIVPROJ)

2. Create & Register it is done in '.../kratos/sources/variables.cpp

KRATOS_CREATE_VARIABLE(double, DIVPROJ)
KRATOS_REGISTER_VARIABLE(double, DIVPROJ)


IN FAVORITE APPLICATION

3.If you want to use it in python file, it is also necessery to introduse it to python in favorite application for example : ../kratosR1/applications/incompressible_fluid_applications/kratos_incompressible_fluid_python_applications.cpp

KRATOS_REGISTER_IN_PYTHON_VARIABLE( DIVPROJ)
Personal tools
Categories