... | @@ -3,20 +3,21 @@ |
... | @@ -3,20 +3,21 @@ |
|
The W-SLDA toolkit provides a framework for creating flexible parametrization of formulas. The list of numbers (of double type) that can be passed from an input file to the code is called *custom parameters*. In the input file they start with the tag:
|
|
The W-SLDA toolkit provides a framework for creating flexible parametrization of formulas. The list of numbers (of double type) that can be passed from an input file to the code is called *custom parameters*. In the input file they start with the tag:
|
|
```bash
|
|
```bash
|
|
# Custom parameters
|
|
# Custom parameters
|
|
params0 0.0 # value of the parameter
|
|
params0 0.0 # value of the params[0], simple syntax
|
|
params1 1.0 # value of the parameter
|
|
params[1] 1.0 # value of the params[1], alternative syntax
|
|
params2 2.0 # value of the parameter
|
|
params[2] = 2.0; # value of the params[2] in C style
|
|
# ... and so on ...
|
|
# ... and so on ...
|
|
# ... if you need pass string parameter...
|
|
# ... if you need pass string parameter...
|
|
strings0 aaa
|
|
strings0 aaa # accessible via (global) variable strings[0]
|
|
strings1 bbb
|
|
strings[1] aaa # accessible via (global) variable strings[1]
|
|
|
|
strings[2] = "ccc"; # (global) variable strings[2], C style
|
|
```
|
|
```
|
|
Maximal number of parameters is specified in `predefines.h` by macro-variable:
|
|
The maximal number of parameters is specified in `predefines.h` by macro-variable:
|
|
```c
|
|
```c
|
|
// Maximal number of parameters in params array
|
|
// Maximal number of parameters in params array
|
|
#define MAX_USER_PARAMS 32
|
|
#define MAX_USER_PARAMS 32
|
|
```
|
|
```
|
|
When the program reads the input file custom parameters are uploaded into `params` array in a such way that *paramsk* is assigned to `params[k]`. Pointer to the array is passed to each user-defined function, for example:
|
|
When the program reads the input file, custom parameters are uploaded into `params` array in a such way that *paramsk* is assigned to `params[k]`. The pointer to the array is passed to each user-defined function, for example:
|
|
```c
|
|
```c
|
|
double v_ext(int ix, int iy, int iz, int it, int spin, double *params, size_t extra_data_size, void *extra_data)
|
|
double v_ext(int ix, int iy, int iz, int it, int spin, double *params, size_t extra_data_size, void *extra_data)
|
|
{
|
|
{
|
... | @@ -27,12 +28,12 @@ double v_ext(int ix, int iy, int iz, int it, int spin, double *params, size_t ex |
... | @@ -27,12 +28,12 @@ double v_ext(int ix, int iy, int iz, int it, int spin, double *params, size_t ex |
|
}
|
|
}
|
|
```
|
|
```
|
|
|
|
|
|
During the self-iteration process, before `params` array is passed to user-defined functions the array can be processed by function:
|
|
During the self-iteration process, before `params` array is passed to user-defined functions the array can be processed by the function:
|
|
```c
|
|
```c
|
|
/**
|
|
/**
|
|
* THIS FUNCTION IS CALLED DURING THE SELF-CONSISTENT PROCESS.
|
|
* THIS FUNCTION IS CALLED DURING THE SELF-CONSISTENT PROCESS.
|
|
* After loading params array from input file, the parameters are processed by this routine.
|
|
* After loading params array from input file, the parameters are processed by this routine.
|
|
* The routine is executed at beginning of each iteration.
|
|
* The routine is executed at the beginning of each iteration.
|
|
* @param params array of size MAX_USER_PARAMS with parameters from input file.
|
|
* @param params array of size MAX_USER_PARAMS with parameters from input file.
|
|
* @param kF typical Fermi momentum scale of the problem.
|
|
* @param kF typical Fermi momentum scale of the problem.
|
|
* kF=referencekF if the referencekF tag is indicated in the input file,
|
|
* kF=referencekF if the referencekF tag is indicated in the input file,
|
... | | ... | |