How to Add a New Variable

From KratosWiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
If you need to add a new variable to Kratos which doesn`t exist 3 passes are needed
 
If you need to add a new variable to Kratos which doesn`t exist 3 passes are needed
  
 +
'''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 12: Line 13:
  
 
  KRATOS_REGISTER_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)

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