| 1 | /** |
|---|
| 2 | * @mainpage Instructions for the developers of Libpspio |
|---|
| 3 | * |
|---|
| 4 | * @section intro Introduction |
|---|
| 5 | * |
|---|
| 6 | * One important aspect to pay attention to is to always distinguish clearly |
|---|
| 7 | * the difference between what a developer of the library needs and what a |
|---|
| 8 | * user of the library developing some other code will have to access. This |
|---|
| 9 | * is not always easy to achieve, because of the confusion generated by the |
|---|
| 10 | * users of the library being actually developers themselves. The related |
|---|
| 11 | * concepts are explained practically in the following sections. |
|---|
| 12 | * |
|---|
| 13 | * |
|---|
| 14 | * @section c_headers C headers |
|---|
| 15 | * |
|---|
| 16 | * All headers containing data that will be accessed by the users of the |
|---|
| 17 | * library should be clearly identified and preserved from name clashes. |
|---|
| 18 | * They are thus always prefixed by "pspio_". They also have to include the |
|---|
| 19 | * minimum amount of data possible, i.e. the C headers required by the |
|---|
| 20 | * exported routines (e.g. stdio.h) are included in the C files only. These |
|---|
| 21 | * "pspio_*.h" headers are listed in the makefile in the "pio_core_hdrs" |
|---|
| 22 | * variable. |
|---|
| 23 | * |
|---|
| 24 | * Headers which are strictly internal to Libpspio do not have a priori to |
|---|
| 25 | * follow strict naming conventions, but it is always a good idea to name |
|---|
| 26 | * them cleverly, so that their purpose is known from reading their name. |
|---|
| 27 | * These headers are listed in the makefile in the "pio_hidden_hdrs" |
|---|
| 28 | * variable. |
|---|
| 29 | * |
|---|
| 30 | * The headers belonging to Libpspio are included using double quotes, |
|---|
| 31 | * while those coming from other libraries are included using the <toto.h> |
|---|
| 32 | * convention. The config.h file is included in the C files only and is |
|---|
| 33 | * always the last to be included, as it may fine-tune some already-defined |
|---|
| 34 | * parameters and work around some issues. One noticeable exception is |
|---|
| 35 | * the conditional including of headers, which should of course be |
|---|
| 36 | * placed after including config.h. |
|---|
| 37 | * |
|---|
| 38 | * |
|---|
| 39 | * @section libext Private extensions of external libraries |
|---|
| 40 | * |
|---|
| 41 | * Extending privately the capabilities of an external library is not a good |
|---|
| 42 | * idea on the long run, since its developers may decide at some point to |
|---|
| 43 | * extend the capabilities in an incompatible way. Always prefer to discuss |
|---|
| 44 | * of such extensions directly with them. You might get them earlier than |
|---|
| 45 | * you expect. |
|---|
| 46 | * |
|---|
| 47 | * |
|---|
| 48 | * @section indexes Indexes of states, pseudopotentials, and projectors |
|---|
| 49 | * |
|---|
| 50 | * To each pseudopotential corresponds a specific pair of l and j |
|---|
| 51 | * quantum numbers. If we assume that in a set of pseudopotentials all |
|---|
| 52 | * the l values up to lmax are present, and that j = 0 when the |
|---|
| 53 | * pseudopotentials are non-relativistic, then we can uniquely identify |
|---|
| 54 | * an l, j pair by the index i = l + int(j). Thus the pseudopotentials |
|---|
| 55 | * in psp_data should be have a size of lmax*2+1 or lmax+1, depending if |
|---|
| 56 | * the atom is treated relativistically or not, and |
|---|
| 57 | * psp_data->pseudopotentials[l+int(j)] is the pseudopotential with |
|---|
| 58 | * quantum numbers l, j. |
|---|
| 59 | * |
|---|
| 60 | * As for the states, they will also have a n quantum number associated. |
|---|
| 61 | * In that case we create a matrix qn_to_i[n-1][l+int(j)], where i is |
|---|
| 62 | * define as in the previous paragraph, such that |
|---|
| 63 | * psp_data->states[qn_to_istates[n][l+int(j)]] is the state with |
|---|
| 64 | * quantum numbers n, l, j. The size of the first dimention of the |
|---|
| 65 | * psp_data->qn_to_i matrix will be maximum value of n, while the size |
|---|
| 66 | * of the second dimention will be lmax*2+1 or lmax+1, depending if the |
|---|
| 67 | * atom is treated relativistically or not. |
|---|
| 68 | * |
|---|
| 69 | * One of these two schemes can be used for the projectors, depending if |
|---|
| 70 | * there is more than a projector for each l, j pair. For now only |
|---|
| 71 | * norm-conserving pseudopotentials are supported, so the projectors will |
|---|
| 72 | * be stored like for the pseudopotentials. |
|---|
| 73 | * |
|---|
| 74 | **/ |
|---|