For reporting basic quantities (like particle number, energy, etc) W-SLDA code used wlog
file. It is txt file produced by function int logger( )
from logger.h file. This file can be modified by the user depending on a specifics of a given problem.
Example
In addition to defined by default variables, the user needs to print out variable:
\Delta_{\textrm{avg}}(t) = \dfrac{\int |\Delta(\bm{r},t)|(n_a(\bm{r},t)+n_b(\bm{r},t))\,d\bm{r}}{\int (n_a(\bm{r},t)+n_b(\bm{r},t))\,d\bm{r}}
which is (weighted) average value of delta. This can be done by adding to logger(..)
:
int ixyz;
int lNXYZ = h_potentials.blocklength;
double delta_avg=0.0, Ntot = 0.0;
for(ixyz=0; ixyz<lNXYZ; ixyz++) delta_avg+=cabs(h_potentials.delta[ixyz])*(h_densities.rho_a[ixyz]+h_densities.rho_b[ixyz]);
for(ixyz=0; ixyz<lNXYZ; ixyz++) Ntot+=h_densities.rho_a[ixyz]+h_densities.rho_b[ixyz];
delta_avg /= Ntot;
and supplementing printf
statement appropriate entry, like:
// add entry
fprintf(log, "%6d %18.10g %18.10g
%18.10g %18.10g %18.10g
%18.10g %18.10g %18.10g
%18.10g %18.10g %18.10g
%18.10g %18.10g %18.10g
%18.10g %18.10g %18.10g %10.2f %20s\n",
<-- HERE
it, // 1
npart[SPINA], // 2
npart[SPINB], // 3
npart[SPINA]+npart[SPINB], // 4
E_tot/Effg, // 5
energy[EKIN]/Effg, // 6
energy[EPOT]/Effg, // 7
energy[EPAIR]/Effg, // 8
energy[ECURRENT]/Effg, // 9
energy[EPOTEXT]/Effg, //10
energy[EPAIREXT]/Effg, //11
energy[EVELEXT]/Effg, //12
mu[SPINA]/eF, //13
mu[SPINB]/eF, //14
kF, // 15
eF, // 16
Effg, // 17
delta_avg, // 18 <-- HERE
logger_get_time_from_last_entry(), //19
buffer
);