Here we give some hints on how to extend potfit. In particular, we list some common pitfalls that are to be avoided.
potfit source code is indented according to the default emacs indentation. The same effect can be achieved with the 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
- read into potfit (routine getparamfile() in file
- possibly checked for nonsense values (routine
- broadcast to the other CPUs (routine
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.