# Electrostatic Application Global Files

(Difference between revisions)
 Revision as of 09:05, 4 November 2009 (view source)JMora (Talk | contribs) (→The files' structure for the Electrostatic Kratos application)← Older edit Revision as of 14:31, 5 December 2009 (view source)Jmarti (Talk | contribs) Newer edit → Line 17: Line 17: − == Electrostatic Kratos Variables == + == Convection diffusion Kratos Variables ==

## Basic Kratos Directory Tree

After installing successfully Kratos, you should have a directory's tree like this (minor changes are allowed, such as the location of the python files, etc):

/kratos
/.svn
/applications
/benchmarking
/Debug
/external_libraries
/kratos
/libs
/problemtype_generator
/Release


Our main working directory will be our specific application's directory (to be created), in the applications subdirectory. Nevertheless, the rest of the structure is presented to indicate where are located other important files to work with Kratos.

## Convection diffusion Kratos Variables

The Kratos name for the variables of interest in our Electrostatic application are:

 ELECTRICAL_PERMITTIVITY $\mathbf{\varepsilon} \,$ ELECTROSTATIC_POTENTIAL the unknowns, $\mathbf{a} \qquad \left ( \hat V (x,y,z) = \mathbf{N} \mathbf{a}^{(e)} \right )$ ELECTROSTATIC_POINT_CHARGE $Q = \int_{\Omega} \rho_v \partial \Omega$ ELECTROSTATIC_SURFACE_CHARGE $\rho_s \,$ ELECTRIC_FIELD $\mathbf{E}$ ELECTRIC_DISPLACEMENT_FIELD $\mathbf{D}=\mathbf{\varepsilon} \mathbf{E}$ INFINIT_COEFFICIENT indicates if the infinit condition is applied

The variables must be defined, created and registered in the variables.h file in the kratos\kratos\includes directory and in the variables.cpp file in the kratos\kratos\sources directory (see How_to_Add_a_variable).

In variables.h, check if the following lines are included (if not, please include them):

	// for electromagnetic applications
// for kElectrostatic application

KRATOS_DEFINE_3D_VARIABLE_WITH_COMPONENTS(ELECTRICAL_PERMITTIVITY)
KRATOS_DEFINE_VARIABLE(double, ELECTROSTATIC_POTENTIAL)
KRATOS_DEFINE_VARIABLE(double, ELECTROSTATIC_POINT_CHARGE)
KRATOS_DEFINE_VARIABLE(double, ELECTROSTATIC_SURFACE_CHARGE)
KRATOS_DEFINE_3D_VARIABLE_WITH_COMPONENTS(ELECTRIC_FIELD)
KRATOS_DEFINE_3D_VARIABLE_WITH_COMPONENTS(ELECTRIC_DISPLACEMENT_FIELD)
KRATOS_DEFINE_VARIABLE(double, INFINIT_COEFFICIENT)



In variables.cpp, check if the following lines are included (if not, please include them):

	// for electromagnetic applications
// for kElectrostatic application

KRATOS_CREATE_3D_VARIABLE_WITH_COMPONENTS(ELECTRICAL_PERMITTIVITY)
KRATOS_CREATE_VARIABLE(double, ELECTROSTATIC_POTENTIAL)
KRATOS_CREATE_VARIABLE(double, ELECTROSTATIC_POINT_CHARGE)
KRATOS_CREATE_VARIABLE(double, ELECTROSTATIC_SURFACE_CHARGE)
KRATOS_CREATE_3D_VARIABLE_WITH_COMPONENTS(ELECTRIC_FIELD)
KRATOS_CREATE_3D_VARIABLE_WITH_COMPONENTS(ELECTRIC_DISPLACEMENT_FIELD)
KRATOS_CREATE_VARIABLE(double, INFINIT_COEFFICIENT)


and:

	// for electromagnetic applications
// for kElectrostatic application

KRATOS_REGISTER_3D_VARIABLE_WITH_COMPONENTS(ELECTRICAL_PERMITTIVITY)
KRATOS_REGISTER_VARIABLE(ELECTROSTATIC_POTENTIAL)
KRATOS_REGISTER_VARIABLE(ELECTROSTATIC_POINT_CHARGE)
KRATOS_REGISTER_VARIABLE(ELECTROSTATIC_SURFACE_CHARGE)
KRATOS_REGISTER_3D_VARIABLE_WITH_COMPONENTS(ELECTRIC_FIELD)
KRATOS_REGISTER_3D_VARIABLE_WITH_COMPONENTS(ELECTRIC_DISPLACEMENT_FIELD)
KRATOS_REGISTER_VARIABLE(INFINIT_COEFFICIENT)


## The files' structure for the Electrostatic Kratos application

In the /Kratos/applications directory you have to create a new directory (called "kElectrostatic"). You have to create a set of custom directories for your application (basically /custom_conditions, /custom_elements, /custom_python, /python_scripts and /test_examples):

/Kratos
/applications
/kElectrostatic
/custom_conditions
/custom_elements
/custom_python
/python_scripts
/test_examples


Each of these subdirectories will contain the specific C++ or python code needed for our application. We will focus our attention in using our customised element, therefore, the other needed code will be, simply, copied from other already existing applications.

Note that if you want to use a new strategy or solver, then you have to create other typical customisation directories or files such as /custom_strategies, etc...