feat(loading): robust error reporting and mutation
cfg now reports which fields are missing when loading. Further, the mutate method has been added for easier mutation of the underlying configuration struct
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
|
||||
struct PhysicsConfigOptions {
|
||||
bool diffusion;
|
||||
bool convection;
|
||||
bool radiation;
|
||||
std::optional<bool> convection;
|
||||
std::optional<bool> radiation;
|
||||
std::array<int, 3> flags;
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ struct SimulationConfigOptions {
|
||||
struct OutputConfigOptions {
|
||||
std::string directory = "./output";
|
||||
std::string format = "hdf5";
|
||||
bool save_plots = false;
|
||||
std::optional<bool> save_plots = false;
|
||||
};
|
||||
|
||||
struct TestConfigSchema {
|
||||
@@ -28,4 +28,4 @@ struct TestConfigSchema {
|
||||
PhysicsConfigOptions physics;
|
||||
SimulationConfigOptions simulation;
|
||||
OutputConfigOptions output;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user