Skip to content

Commit

Permalink
Report parameter values in DriftReducedSystem and HWSystem.
Browse files Browse the repository at this point in the history
  • Loading branch information
oparry-ukaea committed Feb 21, 2024
1 parent d7c46dc commit acba2d9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
20 changes: 20 additions & 0 deletions solvers/H3LAPD/EquationSystems/DriftReducedSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,26 @@ void DriftReducedSystem::validate_fields() {
}
}

void DriftReducedSystem::v_GenerateSummary(SU::SummaryList &s) {
UnsteadySystem::v_GenerateSummary(s);

std::stringstream tmpss;
tmpss << "[" << m_d00 << "," << m_d11 << "," << m_d22 << "]";
SU::AddSummaryItem(s, "Helmsolve coeffs.", tmpss.str());

SU::AddSummaryItem(s, "Reference density", m_n_ref);
SU::AddSummaryItem(s, "Density floor", m_n_floor_fac);

SU::AddSummaryItem(s, "Riemann solver", m_riemann_solver_type);
// Particle stuff
SU::AddSummaryItem(s, "Num. part. substeps", m_num_part_substeps);
SU::AddSummaryItem(s, "Part. output freq", m_num_write_particle_steps);
tmpss = std::stringstream();
tmpss << "[" << m_B[0] << "," << m_B[1] << "," << m_B[2] << "]";
SU::AddSummaryItem(s, "B", tmpss.str());
SU::AddSummaryItem(s, "|B|", m_Bmag);
}

/**
* @brief Post-construction class initialisation.
*
Expand Down
2 changes: 2 additions & 0 deletions solvers/H3LAPD/EquationSystems/DriftReducedSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <LibUtilities/Memory/NekMemoryManager.hpp>
#include <SolverUtils/AdvectionSystem.h>
#include <SolverUtils/Core/Misc.h>
#include <SolverUtils/EquationSystem.h>
#include <SolverUtils/Forcing/Forcing.h>
#include <SolverUtils/RiemannSolvers/RiemannSolver.h>
Expand Down Expand Up @@ -110,6 +111,7 @@ class DriftReducedSystem : virtual public SU::AdvectionSystem {
virtual void load_params();
void solve_phi(const Array<OneD, const Array<OneD, NekDouble>> &in_arr);

virtual void v_GenerateSummary(SU::SummaryList &s) override;
virtual void v_InitObject(bool DeclareField) override;
virtual bool v_PostIntegrate(int step) override;
virtual bool v_PreIntegrate(int step) override;
Expand Down
13 changes: 4 additions & 9 deletions solvers/H3LAPD/EquationSystems/HWSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,10 @@ void HWSystem::get_phi_solve_rhs(
Vmath::Vcopy(npts, in_arr[w_idx], 1, rhs, 1);
}

/**
* @brief Read base class params then extra params required for 2D-in-3D and 3D
* HW.
*/
void HWSystem::load_params() {
DriftReducedSystem::load_params();

// kappa (required)
m_session->LoadParameter("HW_kappa", m_kappa);
void HWSystem::v_GenerateSummary(SU::SummaryList &s) {
DriftReducedSystem::v_GenerateSummary(s);
SU::AddSummaryItem(s, "HW alpha", m_alpha);
SU::AddSummaryItem(s, "HW kappa", m_kappa);
}

/**
Expand Down
1 change: 1 addition & 0 deletions solvers/H3LAPD/EquationSystems/HWSystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class HWSystem : virtual public DriftReducedSystem {
get_phi_solve_rhs(const Array<OneD, const Array<OneD, NekDouble>> &inarray,
Array<OneD, NekDouble> &rhs) override final;

void v_GenerateSummary(SU::SummaryList &s);
virtual void v_InitObject(bool DeclareField) override;

virtual bool v_PostIntegrate(int step) override final;
Expand Down

0 comments on commit acba2d9

Please sign in to comment.