Module: Tools
Helpers for post-processing simulation data: slices through 1D/2D/3D arrays, centre of mass, particle number, condensation and flow energies.
Module: tools
List of functions
- libnest.tools.threeSlice(variable)[source]
Returns 1, 2 or 3 dimensional numpy array with slices through given variable.
It works for 1D, 2D, 3D.
By default it cuts through the center.
- Parameters:
variable (numpy.ndarray) – 1D, 2D or 3D array
- Returns:
slices through the centre along each axis
- Return type:
- libnest.tools.centerOfMass(density)[source]
Returns numpy array of center of masses coordinates.
It works for 1D, 2D, 3D.
Note
The center of mass unit here is unitless (units of grid)
- Parameters:
density (numpy.ndarray) – \(\rho_n\) [fm -3] at subsequent time steps, shape (nt, nx, ny, nz)
- Returns:
2 dimensional numpy array of center of mass coordinates at subsequent time steps [[x0,y0,z0], [x1,y1,z1],…]
- libnest.tools.condensationEnergy(density, delta, dV=1.0)[source]
Calculates the condensation energy by calculating proper function of system density \(\rho\), and pairing field \(\Delta\). The Fermi energy \(\epsilon^*_{F}\) is calculated under the assumption that the effective mass is taken into account. It works for 1D, 2D, 3D. Returns numpy array of values of condensation energy. 1 dimensional numpy array of condensation energy
\[E_{\mathrm{cond}} = \int_V \frac{3}{8} \frac{|\Delta(\bm r)|^2}{\epsilon^*_{F}(\bm r)}\rho(\bm r)d{\bm r}\]
- libnest.tools.flowEnergy(j, density_n, density_p)[source]
Returns numpy array of values of flow energy.
It works for 1D, 2D, 3D.
Formula: integral hbar*c*j^2/(2mc^2 density) dr
- Parameters:
j (numpy.ndarray) – current, shape (nt, 3, nx, ny, nz)
density_n (numpy.ndarray) – neutron density [fm -3], shape (nt, nx, ny, nz)
density_p (numpy.ndarray) – proton density [fm -3], shape (nt, nx, ny, nz)
- Returns:
1 dimensional numpy array of flow energy at subsequent time steps [e0, e1,…]
- libnest.tools.particleN(density)[source]
Returns number of particles.
It works for 1D, 2D, 3D. For static nucleus it is constant, however there are some system scenarios where the number of particles might change.
- Parameters:
density (numpy.ndarray) – density [fm -3], shape (nt, nx, ny, nz)
- Returns:
1 dimensional numpy array of number of particles at subsequent time steps [N0, N1,…]