Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/M2ulPhyS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,6 @@ class M2ulPhyS : public TPS::PlasmaSolver {
// for use if we want to write a serial file
Mesh *serial_mesh;

// I/O organizer
IODataOrganizer ioData;

std::list<mfem::DenseMatrix> tableHost_;

#ifdef HAVE_MASA
Expand Down Expand Up @@ -470,6 +467,8 @@ class M2ulPhyS : public TPS::PlasmaSolver {
int getMaximumIterations() const { return MaxIters; }
int getCurrentIterations() const { return iter; }
void setMaximumIterations(int value) { MaxIters = value; }

double getCurrentTime() const { return time; }
};

#endif // M2ULPHYS_HPP_
10 changes: 10 additions & 0 deletions src/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ class IOFamily {
* @param read_order Polynomial order of function in HDF5 file
*/
void readChangeOrder(hid_t file, int read_order);

/** @brief Returns pointer to ParGridFunction for this IOFamily */
mfem::ParGridFunction *getParGridFunction() { return pfunc_; }
};

/**
Expand Down Expand Up @@ -312,6 +315,13 @@ class IODataOrganizer {
* @param read_order Polynomial order for data in file (optional, only required for variable order read)
*/
void read(hid_t file, bool serial, int read_order = -1);

/**
* @brief Get reference to vector of IOFamily objects
*
* This supports operations on all IO fields (e.g., interpolation between grids)
*/
std::vector<IOFamily> &getIOFamilies() { return families_; }
};

/**
Expand Down
3 changes: 1 addition & 2 deletions src/loMach.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,8 @@ class LoMachSolver : public TPS::PlasmaSolver {
StopWatch sw_setup_, sw_step_, sw_turb_, sw_thermChem_, sw_flow_, sw_press_;
double tlast_;

// I/O helpers
// Viz helper
ParaViewDataCollection *pvdc_ = nullptr; // visualization
IODataOrganizer ioData; // restart

/// Update the EXTk/BDF time integration coefficient.
void SetTimeIntegrationCoefficients(int step);
Expand Down
22 changes: 21 additions & 1 deletion src/lte_thermo_chem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ LteThermoChem::LteThermoChem(mfem::ParMesh *pmesh, LoMachOptions *loMach_opts, t

LteThermoChem::~LteThermoChem() {
// allocated in initializeOperators
delete rad_kap_gradT_coeff_;
delete rad_radiation_sink_coeff_;
delete rad_jh_coeff_;
delete rad_un_next_coeff_;
Expand All @@ -183,29 +184,40 @@ LteThermoChem::~LteThermoChem() {

delete sfes_filter_;
delete sfec_filter_;
delete MqInv_;
delete MqInvPC_;
delete HtInv_;
delete HtInvPC_;
delete MsInv_;
delete MsInvPC_;
delete MrhoInv_;
delete MrhoInvPC_;
delete jh_form_;
delete Mq_form_;
delete Ht_form_;
delete M_rho_form_;
delete M_rho_Cp_form_;
delete Ms_form_;
delete A_rho_form_;
delete At_form_;
delete LQ_form_;
delete LQ_bdry_;
delete rho_Cp_u_coeff_;
delete un_next_coeff_;
delete kap_gradT_coeff_;
delete gradT_coeff_;
delete mut_coeff_;
delete kapt_coeff_;
delete mult_coeff_;
delete thermal_diff_coeff_;
delete thermal_diff_sum_coeff_;
delete thermal_diff_total_coeff_;
delete rho_Cp_over_dt_coeff_;
delete rho_Cp_coeff_;
delete Cp_coeff_;
delete rho_coeff_;
delete jh_coeff_;
delete radiation_sink_coeff_;

delete umag_coeff_;
delete gscale_coeff_;
Expand All @@ -224,6 +236,14 @@ LteThermoChem::~LteThermoChem() {
// allocated in initializeSelf
delete sfes_;
delete sfec_;

delete radiation_;

delete mu_table_;
delete kappa_table_;
delete sigma_table_;
delete Rgas_table_;
delete Cp_table_;
}

void LteThermoChem::initializeSelf() {
Expand Down Expand Up @@ -550,7 +570,7 @@ void LteThermoChem::initializeOperators() {
kap_gradT_coeff_ = new ScalarVectorProductCoefficient(*thermal_diff_total_coeff_, *gradT_coeff_);

un_next_coeff_ = new VectorGridFunctionCoefficient(flow_interface_->velocity);
rhon_next_coeff_ = new GridFunctionCoefficient(&rn_gf_);
// rhon_next_coeff_ = new GridFunctionCoefficient(&rn_gf_);

rho_Cp_u_coeff_ = new ScalarVectorProductCoefficient(*rho_Cp_coeff_, *un_next_coeff_);

Expand Down
12 changes: 12 additions & 0 deletions src/solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#ifndef SOLVER_HPP_
#define SOLVER_HPP_

#include "io.hpp"
#include "tps_mfem_wrap.hpp"
#include "utils.hpp"

Expand Down Expand Up @@ -119,6 +120,9 @@ class Solver {

// Base class for flow solver implementations
class PlasmaSolver : public Solver {
protected:
IODataOrganizer ioData;

public:
virtual ~PlasmaSolver() {}

Expand All @@ -141,6 +145,14 @@ class PlasmaSolver : public Solver {
exit(1);
return nullptr;
}

virtual void restart_files_hdf5(string mode, string inputFileName = std::string()) {
cout << "ERROR: " << __func__ << " remains unimplemented" << endl;
exit(1);
}

/// Fetch reference to IODataOrganizer object
IODataOrganizer &getIODataOrganizer() { return ioData; }
};

} // end namespace TPS
Expand Down
Loading
Loading