aboutsummaryrefslogtreecommitdiff
path: root/Source/Diagnostics/ReducedDiags/FieldMaximum.cpp
diff options
context:
space:
mode:
authorGravatar NeilZaim <49716072+NeilZaim@users.noreply.github.com> 2021-01-11 22:16:22 +0100
committerGravatar GitHub <noreply@github.com> 2021-01-11 13:16:22 -0800
commit8613231709ef6d77aaa8826b59489573f76531cd (patch)
tree47be643e47b60d69180f41bed1f71fb1e6d8a327 /Source/Diagnostics/ReducedDiags/FieldMaximum.cpp
parentfb287f548c40aebadb789761d04f4aff0acf9db2 (diff)
downloadWarpX-8613231709ef6d77aaa8826b59489573f76531cd.tar.gz
WarpX-8613231709ef6d77aaa8826b59489573f76531cd.tar.zst
WarpX-8613231709ef6d77aaa8826b59489573f76531cd.zip
New reduced diag: maximum charge densities (#1535)
* New reduced diag: maximum charge densities * Apply suggestions from code review Co-authored-by: Luca Fedeli <luca.fedeli.88@gmail.com> * Update benchmark and apply suggestions from review Co-authored-by: Luca Fedeli <luca.fedeli.88@gmail.com>
Diffstat (limited to 'Source/Diagnostics/ReducedDiags/FieldMaximum.cpp')
-rw-r--r--Source/Diagnostics/ReducedDiags/FieldMaximum.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/Diagnostics/ReducedDiags/FieldMaximum.cpp b/Source/Diagnostics/ReducedDiags/FieldMaximum.cpp
index a7250c5aa..ad2ee1a05 100644
--- a/Source/Diagnostics/ReducedDiags/FieldMaximum.cpp
+++ b/Source/Diagnostics/ReducedDiags/FieldMaximum.cpp
@@ -30,15 +30,14 @@ FieldMaximum::FieldMaximum (std::string rd_name)
constexpr int noutputs = 8; // total energy, E-field energy and B-field energy
// resize data array
- m_data.resize(noutputs*nLevel,0.0); // max of Ex,Ey,Ez,|E|,Bx,By,Bz and |B|
+ m_data.resize(noutputs*nLevel, 0.0_rt); // max of Ex,Ey,Ez,|E|,Bx,By,Bz and |B|
if (ParallelDescriptor::IOProcessor())
{
if ( m_IsNotRestart )
{
// open file
- std::ofstream ofs{m_path + m_rd_name + "." + m_extension,
- std::ofstream::out | std::ofstream::app};
+ std::ofstream ofs{m_path + m_rd_name + "." + m_extension, std::ofstream::out};
// write header row
ofs << "#";
ofs << "[1]step()";
@@ -94,7 +93,7 @@ void FieldMaximum::ComputeDiags (int step)
// Judge if the diags should be done
if (!m_intervals.contains(step+1)) { return; }
- // get WarpX class object
+ // get a reference to WarpX instance
auto & warpx = WarpX::GetInstance();
// get number of level