aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/ReducedDiags/ParticleEnergy.H
blob: b143cc93f0483ad15845d9b657df1bb2a80002e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* Copyright 2019-2020 Yinjian Zhao
 *
 * This file is part of WarpX.
 *
 * License: BSD-3-Clause-LBNL
 */

#ifndef WARPX_DIAGNOSTICS_REDUCEDDIAGS_PARTICLEENERGY_H_
#define WARPX_DIAGNOSTICS_REDUCEDDIAGS_PARTICLEENERGY_H_

#include "ReducedDiags.H"

#include <string>

/**
 *  This class mainly contains a function that
 *  computes the particle relativistic kinetic energy
 *  of each species.
 */
class ParticleEnergy : public ReducedDiags
{
public:

    /**
     * constructor
     * @param[in] rd_name reduced diags names
     */
    ParticleEnergy(std::string rd_name);

    /**
     * This function computes the particle relativistic kinetic energy (EP).
     * EP = sqrt( p^2 c^2 + m^2 c^4 ) - m c^2,
     * where p is the relativistic momentum,
     * m is the particle rest mass.
     *
     * @param[in] step current time step
     */
    virtual void ComputeDiags(int step) override final;

};

#endif