Electrostatic Application Global Files

From KratosWiki
Revision as of 11:36, 4 February 2010 by JMora (Talk | contribs)
Jump to: navigation, search

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.


Electrostatic Application 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 \frac{}{}
ELECTROSTATIC_VOLUME_CHARGE \rho_V \frac{}{}
ELECTRIC_FIELD \mathbf{E} \frac{}{}
ELECTRIC_DISPLACEMENT_FIELD \mathbf{D}=\mathbf{\varepsilon} \mathbf{E} \frac{}{}
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_VARIABLE(double, ELECTROSTATIC_VOLUME_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_VARIABLE(double, ELECTROSTATIC_VOLUME_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_VARIABLE(ELECTROSTATIC_VOLUME_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...

Personal tools
Categories