Electrostatic Application Global Files

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...
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 7, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.30720070004463196, "perplexity": 8125.956942750492}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-21/segments/1652662538646.33/warc/CC-MAIN-20220521045616-20220521075616-00090.warc.gz"}