#include <density.h>
A class for time-efficient (time-memory trade-off) calculation of density on the lattice.
It holds six FourVectors - positive and negative summands of 4-current, and the time and spatial derivatives of the compound current. These four-vectors are additive by particles. It is efficient to calculate additive \(j^\mu\) and \(\partial_\nu j^\mu \) in one loop over particles and then calculate the Eckart density, the gradient of the density, the curl, the time derivative of the current, and derivatives of the rest frame density accordingly. Splitting into positive and negative parts of \(j^\mu\) is necessary to avoid problems with the definition of Eckart rest frame.
Intended usage of the class:
Public Member Functions | |
DensityOnLattice () | |
Default constructor. More... | |
void | add_particle (const ParticleData &part, double FactorTimesSf) |
Adds particle to 4-current: \(j^{\mu} += p^{\mu}/p^0 \cdot factor \). More... | |
void | add_particle_for_derivatives (const ParticleData &part, double factor, ThreeVector sf_grad) |
Adds particle to the time and spatial derivatives of the 4-current. More... | |
double | rho (const double norm_factor=1.0) |
Compute the net Eckart density on the local lattice. More... | |
ThreeVector | curl_vecj (const double norm_factor=1.0) |
Compute curl of the current on the local lattice. More... | |
ThreeVector | grad_j0 (const double norm_factor=1.0) |
Compute gradient of the the zeroth component of the four-current j^mu (that is of the computational frame density) on the local lattice. More... | |
ThreeVector | dvecj_dt (const double norm_factor=1.0) |
Compute time derivative of the current density on the local lattice. More... | |
FourVector | jmu_net () const |
void | add_to_jmu_pos (FourVector additional_jmu_B) |
Add to the positive density current. More... | |
void | add_to_jmu_neg (FourVector additional_jmu_B) |
Add to the negative density current. More... | |
FourVector | drho_dxnu () const |
Return the FourGradient of the rest frame density \(\partial_{\nu}\rho\). More... | |
std::array< FourVector, 4 > | djmu_dxnu () const |
Return the FourGradient of the net baryon current \(\partial_{\nu} j^\mu\). More... | |
ThreeVector | grad_rho_cross_vecj () const |
Compute the cross product of \(\boldsymbol{\nabla}\rho\) and \(j^\mu\). More... | |
void | overwrite_djmu_dt_to_zero () |
Overwrite the time derivative of the current to zero. More... | |
void | overwrite_drho_dt_to_zero () |
Overwrite the time derivative of the rest frame density to zero. More... | |
void | overwrite_drho_dxnu (FourVector computed_drho_dxnu) |
Overwrite the rest frame density derivatives to provided values. More... | |
void | overwrite_djmu_dxnu (FourVector djmu_dt, FourVector djmu_dx, FourVector djmu_dy, FourVector djmu_dz) |
Overwrite all density current derivatives to provided values. More... | |
Private Attributes | |
FourVector | jmu_pos_ |
Four-current density of the positively charged particle. More... | |
FourVector | jmu_neg_ |
Four-current density of the negatively charged particle. More... | |
std::array< FourVector, 4 > | djmu_dxnu_ |
Four-gradient of the four-current density, \(\partial_\nu j^\mu \). More... | |
FourVector | drho_dxnu_ |
Four-gradient of the rest frame density, \(\partial_\nu \rho \). More... | |
|
inline |
Default constructor.
Definition at line 318 of file density.h.
|
inline |
Adds particle to 4-current: \(j^{\mu} += p^{\mu}/p^0 \cdot factor \).
Two private class members jmu_pos_ and jmu_neg_ indicating the 4-current of the positively and negatively charged particles are updated by this function.
[in] | part | Particle would be added to the current density on the lattice. |
[in] | FactorTimesSf | particle contribution to given density type (e.g. anti-proton contributes with factor -1 to baryon density, proton - with factor 1) times the smearing factor. |
|
inline |
Adds particle to the time and spatial derivatives of the 4-current.
An array of four private 4-vectors djmu_dxnu_ indicating the derivatives of the compound current are updated by this function.
[in] | part | Particle would be added to the current density on the lattice. |
[in] | factor | particle contribution to given density type (e.g. anti-proton contributes with factor -1 to baryon density, proton - with factor 1). |
[in] | sf_grad | Smearing factor of the gradients |
Definition at line 357 of file density.h.
|
inline |
Compute the net Eckart density on the local lattice.
Note that the net Eckart density is calculated by taking the difference between the Eckart density of the positively charged particles and that of the negatively charged particles, which are, in general, defined in different frames. So the net Eckart density is not the net density in the Eckart local rest frame. However, this is the only way we can think of to be applied to the case where the density current is space-like. And fortunately, the net eckart densities are only used for calculating the potentials which are valid only in the low-energy collisions where the amount of the negatively charged particles are negligible. May be in the future, the net Eckart density can be calculated in a smarter way.
[in] | norm_factor | Normalization factor |
Definition at line 384 of file density.h.
|
inline |
|
inline |
|
inline |
Compute time derivative of the current density on the local lattice.
[in] | norm_factor | Normalization factor |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Compute the cross product of \(\boldsymbol{\nabla}\rho\) and \(j^\mu\).
Definition at line 472 of file density.h.
|
inline |
Overwrite the time derivative of the current to zero.
|
inline |
|
inline |
Overwrite the rest frame density derivatives to provided values.
[in] | computed_drho_dxnu | a FourGradient of the rest frame density rho |
|
inline |
Overwrite all density current derivatives to provided values.
[in] | djmu_dt | time derivative of the current FourVector jmu |
[in] | djmu_dx | x derivative of the current FourVector jmu |
[in] | djmu_dy | y derivative of the current FourVector jmu |
[in] | djmu_dz | z derivative of the current FourVector jmu |
Definition at line 507 of file density.h.
|
private |
|
private |
|
private |
|
private |