Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • wslda wslda
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wtools
  • wsldawslda
  • Wiki
  • Reference scales

Reference scales · Changes

Page history
Update Reference scales authored Dec 15, 2021 by Gabriel Wlazłowski's avatar Gabriel Wlazłowski
Hide whitespace changes
Inline Side-by-side
Reference-scales.md
View page @ e0c1503d
[[_TOC_]]
# General info
During the computation process W-SLDA codes exploit information about typical scales present in the problem. Precisely, *reference scales* define typical orders of magnitude for computed quantities. The most important reference scale is:
* $`k_F=(3\pi^2 n)^{1/3}`$ - Fermi momentum.
......@@ -11,8 +12,8 @@ Finally, chemical potentials also serve as reference scales for static problems:
* $`\mu_{\downarrow}`$ - chemical potential is spin-down particles (particles of type `b`).
# Defining reference scales for static calculation
### Fermi momentum
There are following methods of defining the $`k_F`$ reference scale:
## Fermi momentum
There are the following methods of defining the $`k_F`$ reference scale:
* *automatic*: in each iteration code checks what is maximal density $`n=\max[n_{\uparrow}(\bm{r})+n_{\downarrow}(\bm{r})]`$ and next Fermi momentum is computed as $`k_F=(3\pi^2 n)^{1/3}`$,
* *via input file*: $`k_F`$ is provided by user in input file. To activate this mode you need to **uncomment** tag `referencekF`:
```bash
......@@ -27,8 +28,52 @@ void process_params(double *params, double *kF, double *mu, size_t extra_data_si
// ...
}
```
### Chemical potentials
## Chemical potentials
Chemical potentials are adjusted automatically when mode with fixed particle number is executed. For mode with fixed chemical potential see [here](Chemical potentials control).
## Examples
### Fermi momentum is fixed by density in the box center
```c
// Set kF via process_params function
void process_params(double *params, double *kF, double *mu, size_t extra_data_size, void *extra_data)
{
// set kF
double *dens=(double *)extra_data;
if(dens[0]>0.0) // do it only if central density has been computed
{
(*kF) = pow(3.0*M_PI*M_PI*dens[0],1./3.);
if(wsldapid==0) wprintf("# UPDATE OF kF=%f\n", (*kF)); // print to stdout
}
}
// here you can extract needed data, like central density
void modify_potentials(int it, wslda_density h_densities, wslda_potential h_potentials, double *params, size_t extra_data_size, void *extra_data)
{
// DETERMINE LOCAL SIZES OF ARRAYS (CODE DIMENSIONALITY DEPENDENT)
int lNX=h_densities.nx, lNY=h_densities.ny, lNZ=h_densities.nz; // local sizes
int ixyz;
// take value of density in box center and save it to extra_data
ixyz = lNZ/2 + lNZ*lNY/2 + lNZ*lNY*lNX/2;
double *dens=(double *)extra_data;
dens[0] = h_densities.rho_a[ixyz]+h_densities.rho_b[ixyz];
}
// since you want to pass data between functions, use extra_data buffer
size_t get_extra_data_size(double *params)
{
return sizeof(double); // I need buffer for density
}
// here you initialize the buffer
int load_extra_data(size_t size, void *extra_data, double *params)
{
double *dens=(double *)extra_data;
dens[0]=0.0; // set initial value to zero
return 0;
}
```
# Defining reference scales for time dependent calculations
All reference scales are provided together with an initial state, i.e. binary files produced by static codes contain this information. Presently there is no option of changing values for reference scales.
\ No newline at end of file
Clone repository
  • API version
  • Automatic interpolations
  • Auxiliary tools
  • Browsing the code
  • Broyden algorithm
  • C and CUDA
  • Campaign of calculations
  • Checking correctness of settings
  • Chemical potentials control
  • Code & Results quality
  • Common failures of static codes
  • Common failures of time dependent codes
  • Computation domain
  • Configuring GPU machine
  • Constraining densities and potentials
View All Pages