Branch init use of already calulated values needed

This commit is contained in:
VCB Ferreira
2026-08-04 19:05:11 +02:00
parent cab3af2004
commit ed6b4bf373
3 changed files with 87 additions and 18 deletions
+19 -1
View File
@@ -8,6 +8,24 @@
class NuFISolver;
struct RhoESnapshot {
unsigned int it = 0;
double time = 0.0;
std::vector<double> x_eval;
std::vector<double> rho;
std::vector<double> E;
double int_E_sqr = 0;
};
RhoESnapshot
compute_rho_E_snapshot(const NuFISolver &solver, unsigned int n,
std::vector<GridStructure<1>> &grid_struct,
std::vector<SolutionSnapshot<1>> &phi_history,
unsigned int Nx_out, unsigned int Nv = Parameters::NV);
void flush_rho_E_history(std::vector<RhoESnapshot> &history,
const std::string &dir);
struct DiagnosticsSnapshot {
unsigned int Nx = 0;
unsigned int Nv = 0;
@@ -27,7 +45,7 @@ compute_diagnostics(const NuFISolver &solver, unsigned int n,
void save_f(const DiagnosticsSnapshot &snap, const std::string &filepath);
void save_rho(const DiagnosticsSnapshot &snap, const std::string &filepath);
void save_Efield(const DiagnosticsSnapshot &snap, const std::string &filepath);
double compute_int_E_squared(const DiagnosticsSnapshot &snap);
double compute_int_E_squared(const std::vector<double> &E, double Lx);
void save_time_series(const std::vector<double> &t,
const std::vector<double> &values,