Electrostatic Application Global Files

From KratosWiki
(Difference between revisions)
Jump to: navigation, search
(Electrostatic Application Kratos Variables)
(Electrostatic Application Kratos Variables)
 
(10 intermediate revisions by one user not shown)
Line 22: Line 22:
 
The Kratos name for the variables of interest in our Electrostatic application are:
 
The Kratos name for the variables of interest in our Electrostatic application are:
  
::{|
+
::{| cellpadding="10" cellspacing="0" border="1"
|-
+
|-style="height:50px"
 
| ELECTRICAL_PERMITTIVITY  
 
| ELECTRICAL_PERMITTIVITY  
 
| <math>\mathbf{\varepsilon} \,</math>
 
| <math>\mathbf{\varepsilon} \,</math>
|-
+
|-style="height:50px"
 
| ELECTROSTATIC_POTENTIAL  
 
| ELECTROSTATIC_POTENTIAL  
 
| the unknowns, <math>\mathbf{a} \qquad \left ( \hat V (x,y,z) = \mathbf{N} \mathbf{a}^{(e)} \right )</math>
 
| the unknowns, <math>\mathbf{a} \qquad \left ( \hat V (x,y,z) = \mathbf{N} \mathbf{a}^{(e)} \right )</math>
|-
+
|-style="height:50px"
 
| ELECTROSTATIC_POINT_CHARGE  
 
| ELECTROSTATIC_POINT_CHARGE  
 
| <math>Q = \int_{\Omega} \rho_V \partial \Omega</math>
 
| <math>Q = \int_{\Omega} \rho_V \partial \Omega</math>
|-
+
|-style="height:50px"
 
| ELECTROSTATIC_SURFACE_CHARGE  
 
| ELECTROSTATIC_SURFACE_CHARGE  
 
| <math>\rho_S \frac{}{}</math>
 
| <math>\rho_S \frac{}{}</math>
|-
+
|-style="height:50px"
 
| ELECTROSTATIC_VOLUME_CHARGE  
 
| ELECTROSTATIC_VOLUME_CHARGE  
 
| <math>\rho_V \frac{}{}</math>
 
| <math>\rho_V \frac{}{}</math>
|-
+
|-style="height:50px"
 
| ELECTRIC_FIELD  
 
| ELECTRIC_FIELD  
 
| <math>\mathbf{E} \frac{}{}</math>
 
| <math>\mathbf{E} \frac{}{}</math>
|-
+
|-style="height:50px"
 
| ELECTRIC_DISPLACEMENT_FIELD  
 
| ELECTRIC_DISPLACEMENT_FIELD  
 
| <math>\mathbf{D}=\mathbf{\varepsilon} \mathbf{E} \frac{}{}</math>
 
| <math>\mathbf{D}=\mathbf{\varepsilon} \mathbf{E} \frac{}{}</math>
|-
+
|-style="height:50px"
 
| INFINIT_COEFFICIENT  
 
| INFINIT_COEFFICIENT  
 
| indicates if the infinit condition is applied
 
| indicates if the infinit condition is applied

Latest revision as of 11:45, 4 February 2010

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