Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jderouillat committed Dec 13, 2018
2 parents c894776 + 3fe0185 commit 0fb818c
Show file tree
Hide file tree
Showing 20 changed files with 438 additions and 435 deletions.
22 changes: 11 additions & 11 deletions doc/Sphinx/namelist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ The block ``Main`` is **mandatory** and has the following syntax::
.. py:data:: patch_arrangement
:default: ``"hilbertian"``

Determines the ordering of patches and the way they are separated into the
various MPI processes. Options are:

* ``"hilbertian"``: following the Hilbert curve (see :ref:`this explanation<LoadBalancingExplanation>`).
* ``"linearized_XY"`` in 2D or ``"linearized_XYZ"`` in 3D: following the
row-major (C-style) ordering.
Expand Down Expand Up @@ -1731,13 +1731,13 @@ tables.
:default: 128

Discretization of the *chimin* and *xip* tables in the *chipa* direction.
Discretization of the *chimin* and *xip* tables in the *particle_chi* direction.

.. py:data:: xip_chiph_dim
:default: 128

Discretization of the *xip* tables in the *chiph* direction.
Discretization of the *xip* tables in the *photon_chi* direction.

.. py:data:: output_format
Expand All @@ -1749,15 +1749,15 @@ tables.
:default: 1e-3

Threshold on the particle quantum parameter *chipa*. When a particle has a
Threshold on the particle quantum parameter *particle_chi*. When a particle has a
quantum parameter below this threshold, radiation reaction is not taken
into account.

.. py:data:: chipa_disc_min_threshold
:default: 1e-2

Threshold on the particle quantum parameter *chipa* between the continuous
Threshold on the particle quantum parameter *particle_chi* between the continuous
and the discontinuous radiation model.

.. py:data:: table_path
Expand Down Expand Up @@ -1871,13 +1871,13 @@ There are two tables used for the multiphoton Breit-Wheeler refers to as the
:default: 128

Discretization of the *chimin* and *xip* tables in the *chiph* direction.
Discretization of the *chimin* and *xip* tables in the *photon_chi* direction.

.. py:data:: xip_chipa_dim
:default: 128

Discretization of the *xip* tables in the *chipa* direction.
Discretization of the *xip* tables in the *particle_chi* direction.

--------------------------------------------------------------------------------

Expand Down Expand Up @@ -2173,16 +2173,16 @@ To add one probe diagnostic, include the block ``DiagProbe``::
.. py:data:: fields
:default: ``[]``, which means ``["Ex", "Ey", "Ez", "Bx", "By", "Bz", "Jx", "Jy", "Jz", "Rho"]``

A list of fields among ``"Ex"``, ``"Ey"``, ``"Ez"``,
``"Bx"``, ``"By"``, ``"Bz"``, ``"Jx"``, ``"Jy"``, ``"Jz"`` and ``"Rho"``.
Only listed fields will be saved although they are all calculated.

The contributions of each species to the currents and the density are also available,
although they are not included by default. They may be added to the list as
``"Jx_abc"``, ``"Jy_abc"``, ``"Jz_abc"`` or ``"Rho_abc"``, where ``abc`` is the
species name.

In the case of an envelope model for the laser (see :doc:`laser_envelope`),
the following fields are also available: ``"Env_A_abs"``, ``"Env_Chi"``, ``"Env_E_abs"``.

Expand Down
40 changes: 20 additions & 20 deletions src/MultiphotonBreitWheeler/MultiphotonBreitWheeler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
MultiphotonBreitWheeler::MultiphotonBreitWheeler(Params& params, Species * species)
{
// Dimension position
nDim_ = params.nDim_particle;
n_dimensions_ = params.nDim_particle;

// Time step
dt = params.timestep;

// Normalized Schwinger Electric Field
norm_E_Schwinger = params.electron_mass*params.c_vacuum*params.c_vacuum
norm_E_Schwinger_ = params.electron_mass*params.c_vacuum*params.c_vacuum
/ (params.red_planck_cst*params.reference_angular_frequency_SI);

// Inverse of norm_E_Schwinger
inv_norm_E_Schwinger = 1./norm_E_Schwinger;
// Inverse of norm_E_Schwinger_
inv_norm_E_Schwinger_ = 1./norm_E_Schwinger_;

// Number of positrons and electrons generated per event
this->mBW_pair_creation_sampling[0] = species->mBW_pair_creation_sampling[0];
Expand Down Expand Up @@ -161,7 +161,7 @@ void MultiphotonBreitWheeler::operator() (Particles &particles,
// for now particles could be created outside of the local domain
// without been subject do boundary conditions (including domain exchange)
//double* position[3];
//for ( int i = 0 ; i<nDim_ ; i++ )
//for ( int i = 0 ; i<n_dimensions_ ; i++ )
// position[i] = &( particles.position(i,0) );

// Weight shortcut
Expand All @@ -171,7 +171,7 @@ void MultiphotonBreitWheeler::operator() (Particles &particles,
double* tau = &( particles.tau(0));

// Quantum parameter
double * chiph = &( particles.chi(0));
double * photon_chi = &( particles.chi(0));

// Photon id
// uint64_t * id = &( particles.id(0));
Expand All @@ -193,7 +193,7 @@ void MultiphotonBreitWheeler::operator() (Particles &particles,
+ momentum[2][ipart]*momentum[2][ipart]);

// Computation of the Lorentz invariant quantum parameter
chiph[ipart] = MultiphotonBreitWheeler::compute_chiph(
photon_chi[ipart] = MultiphotonBreitWheeler::compute_chiph(
momentum[0][ipart],momentum[1][ipart],momentum[2][ipart],
(*gamma)[ipart],
(*(Ex+ipart-ipart_ref)),(*(Ey+ipart-ipart_ref)),(*(Ez+ipart-ipart_ref)),
Expand All @@ -206,29 +206,29 @@ void MultiphotonBreitWheeler::operator() (Particles &particles,
{

// If the photon has enough energy
// We also check that chiph > chiph_threshold,
// else chiph is too low to induce a decay
if (((*gamma)[ipart] > 2.) && (chiph[ipart] > chiph_threashold))
// We also check that photon_chi > chiph_threshold,
// else photon_chi is too low to induce a decay
if (((*gamma)[ipart] > 2.) && (photon_chi[ipart] > chiph_threashold))
{
// Init local variables
event_time = 0;

// New even
// If tau[ipart] <= 0, this is a new process
if (tau[ipart] <= epsilon_tau)
if (tau[ipart] <= epsilon_tau_)
{
// New final optical depth to reach for emision
while (tau[ipart] <= epsilon_tau)
while (tau[ipart] <= epsilon_tau_)
tau[ipart] = -log(1.-Rand::uniform());

}

// Photon decay: emission under progress
// If epsilon_tau > 0
else if (tau[ipart] > epsilon_tau)
// If epsilon_tau_ > 0
else if (tau[ipart] > epsilon_tau_)
{
// from the cross section
temp = MultiphotonBreitWheelerTables.compute_dNBWdt(chiph[ipart],(*gamma)[ipart]);
temp = MultiphotonBreitWheelerTables.compute_dNBWdt(photon_chi[ipart],(*gamma)[ipart]);

// Time to decay
// If this time is above the remaining iteration time,
Expand All @@ -241,17 +241,17 @@ void MultiphotonBreitWheeler::operator() (Particles &particles,

// If the final optical depth is reached
// The photon decays into pairs
if (tau[ipart] <= epsilon_tau)
if (tau[ipart] <= epsilon_tau_)
{

// Update of the position
// Move the photons

//#ifdef __DEBUG
// for ( int i = 0 ; i<nDim_ ; i++ )
// for ( int i = 0 ; i<n_dimensions_ ; i++ )
// particles.position_old(i,ipart) = position[i][ipart];
//#endif
// for ( int i = 0 ; i<nDim_ ; i++ )
// for ( int i = 0 ; i<n_dimensions_ ; i++ )
// position[i][ipart] += event_time*momentum[i][ipart]/(*gamma)[ipart];


Expand Down Expand Up @@ -343,14 +343,14 @@ void MultiphotonBreitWheeler::pair_emission(int ipart,
//inv_gamma = 1./sqrt(1.+p*p);

// Positions
for (i=0; i<nDim_; i++) {
for (i=0; i<n_dimensions_; i++) {
new_pair[k].position(i,idNew)=particles.position(i,ipart);
// + new_pair[k].momentum(i,idNew)*remaining_dt*inv_gamma;
}

// Old positions
#ifdef __DEBUG
for (i=0; i<nDim_; i++) {
for (i=0; i<n_dimensions_; i++) {
new_pair[k].position_old(i,idNew)=particles.position(i,ipart) ;
}
#endif
Expand Down
10 changes: 5 additions & 5 deletions src/MultiphotonBreitWheeler/MultiphotonBreitWheeler.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class MultiphotonBreitWheeler
double & Bx, double & By, double & Bz)
{

return inv_norm_E_Schwinger
return inv_norm_E_Schwinger_
* sqrt( fabs( pow(Ex*kx + Ey*ky + Ez*kz,2)
- pow(gamma*Ex - By*kz + Bz*ky,2)
- pow(gamma*Ey - Bz*kx + Bx*kz,2)
Expand Down Expand Up @@ -125,7 +125,7 @@ class MultiphotonBreitWheeler
// General parameters

//! Dimension of position
int nDim_;
int n_dimensions_;

//! Time step
double dt;
Expand All @@ -146,13 +146,13 @@ class MultiphotonBreitWheeler
// Factors

//! Normalized Schwinger Electric field
double norm_E_Schwinger;
double norm_E_Schwinger_;

//! Inverse Normalized Schwinger Electric field
double inv_norm_E_Schwinger;
double inv_norm_E_Schwinger_;

//! Espilon to check when tau is near 0
const double epsilon_tau = 1e-100;
const double epsilon_tau_ = 1e-100;

};

Expand Down
Loading

0 comments on commit 0fb818c

Please sign in to comment.