|
WarpX
|
#include <FieldEnergy.H>
Public Member Functions | |
| FieldEnergy (const std::string &rd_name) | |
| void | ComputeDiags (int step) final |
| amrex::Real | ComputeNorm2 (const amrex::MultiFab &field, int lev) |
| Calculate the integral of the field squared, taking into account the fraction of the cell volume within the domain. | |
Public Member Functions inherited from ReducedDiags | |
| ReducedDiags (const std::string &rd_name) | |
| virtual | ~ReducedDiags ()=default |
| ReducedDiags (const ReducedDiags &)=default | |
| ReducedDiags & | operator= (const ReducedDiags &)=default |
| ReducedDiags (ReducedDiags &&)=default | |
| ReducedDiags & | operator= (ReducedDiags &&)=default |
| virtual void | InitData () |
| virtual void | LoadBalance () |
| virtual void | ComputeDiagsMidStep (int step) |
| virtual void | WriteToFile (int step) const |
| bool | DoDiags (int step) const |
| virtual void | WriteCheckpointData (std::string const &dir) |
| Write out checkpoint related data. | |
| virtual void | ReadCheckpointData (std::string const &dir) |
| Read in checkpoint related data. | |
| void | BackwardCompatibility () const |
Additional Inherited Members | |
Public Attributes inherited from ReducedDiags | |
| std::string | m_path = "./diags/reducedfiles/" |
| output path (default) | |
| std::string | m_extension = "txt" |
| output extension (default) | |
| std::string | m_rd_name |
| diags name | |
| utils::parser::IntervalsParser | m_intervals |
| output intervals | |
| bool | m_write_header = false |
| check if header should be written | |
| std::string | m_sep = " " |
| separator in the output file | |
| int | m_precision = 14 |
| precision for data in the output file | |
| std::vector< amrex::Real > | m_data |
| output data | |
This class mainly contains a function that computes the field energy.
| FieldEnergy::FieldEnergy | ( | const std::string & | rd_name | ) |
constructor
| [in] | rd_name | reduced diags names |
|
finalvirtual |
This function computes the field energy (EF): EF = sum( 1/2 * (|E|^2 * eps0 + |B|^2 / mu0) * dV ), where E is the electric field, B is the magnetic field, eps0 is the vacuum permittivity, mu0 is the vacuum permeability, dV is the cell volume (area, in 2D) and the sum is over all cells.
| [in] | step | current time step |
Implements ReducedDiags.
| amrex::Real FieldEnergy::ComputeNorm2 | ( | const amrex::MultiFab & | field, |
| int | lev ) |
Calculate the integral of the field squared, taking into account the fraction of the cell volume within the domain.
| field | The MultiFab to be integrated |
| lev | The refinement level |