~~NOTOC~~
====== Dev's Corner ======
----
Here we give some hints on how to extend //potfit//. In particular, we list some common pitfalls that are to be avoided.
==== Indentation ====
//potfit// source code is indented according to the default emacs indentation. The same effect can be achieved with the [[http://www.gnu.org/software/indent/|GNU indent command]], version >=2.2.10, using the following command:
indent -gnu -cdw -cli4 -npsl -npcs -di6 -ncs -ce -br -brs -nlp -hnl -l110 -bbo
-T real -T apot_table_t -T pot_table_t -T vector -T sym_tens -T neigh_t -T atom_t -T FILE -T Param_T -T Interaction_T *.[[ch]]
Sections that are NOT to be indented in this way have to be marked with
/* *INDENT-OFF* */
at their beginning and
/* *INDENT-ON* */
at their end, each control comment on a line of its own.
==== Introducing new parameters ====
Before a new parameter can be used, it must be
* declared and initialized to default value (in file ''potfit.h'')
* read into potfit (routine getparamfile() in file ''param.c'')
* possibly checked for nonsense values (routine ''check_parameters_complete()'' in file ''param.c'')
* broadcast to the other CPUs (routine ''broadcast_params()'' in file ''mpi_utils.c'')
==== Naming conventions for files ====
* Source files are all named with lower case letters
* Non-source files in the source directory begin with a capital letter (e.g. Makefile, README, INSTALL)
* Documentation should be written, in English and in HTML or Wiki-Markup.