Skip to content

Commit

Permalink
Read top level CAMP JSON if config.json file exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwfncar committed Sep 19, 2023
1 parent ce81070 commit 00550c2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/micm/configure/solver_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ namespace micm
// Constants
// find names from config.json
// Configure files
static const inline std::string CAMP_CONFIG = "config.json";
static const inline std::string SPECIES_CONFIG = "species.json";
static const inline std::string MECHANISM_CONFIG = "mechanism.json";
static const inline std::string REACTIONS_CONFIG = "reactions.json";
Expand All @@ -120,14 +121,19 @@ namespace micm
/// @return True for successful parsing
ConfigParseStatus Parse(const std::filesystem::path& config_dir)
{
// Look for CAMP_FILES here

// Create configure paths
std::filesystem::path species_config(config_dir / SPECIES_CONFIG);
std::filesystem::path mechanism_config(config_dir / MECHANISM_CONFIG);
std::filesystem::path reactions_config(config_dir / REACTIONS_CONFIG);
std::filesystem::path tolerance_config(config_dir / TOLERANCE_CONFIG);

// Look for CAMP config file
std::filesystem::path camp_config(config_dir / CAMP_CONFIG);
if (std::filesystem::exists(camp_config))
{
json camp_config = json::parse(std::ifstream(camp_config));
}

// Current reaction configs should be either mechanism_config or reactions config
std::filesystem::path cur_reactions_config;

Expand Down

0 comments on commit 00550c2

Please sign in to comment.