diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d40148da..c8921c7d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,3 +100,9 @@ if(PROJECT_IS_TOP_LEVEL) endif() ################################################################################ + +# on ubuntu with clang, an incorrect version of the c++ standard library was being linked +if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux" AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # If the compiler is Clang, use libc++ + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +endif() diff --git a/include/micm/configure/solver_config.hpp b/include/micm/configure/solver_config.hpp index 15f547eca..e6dfcb538 100644 --- a/include/micm/configure/solver_config.hpp +++ b/include/micm/configure/solver_config.hpp @@ -8,20 +8,20 @@ #include #include #include -#include -#include +#include #include -#include -#include -#include -#include -#include +#include #include #include -#include #include -#include -#include + +#include +#include +#include +#include +#include +#include +#include namespace micm { @@ -29,14 +29,13 @@ namespace micm { Success, None, - InvalidSpeciesFilePath, - InvalidReactionsFilePath, InvalidKey, UnknownKey, - InvalidSpecies, + InvalidCAMPFilePath, + NoConfigFilesFound, CAMPFilesSectionNotFound, - InvalidCAMPFileCount, CAMPDataSectionNotFound, + InvalidSpecies, InvalidMechanism, ObjectTypeNotFound, RequiredKeyNotFound, @@ -50,14 +49,13 @@ namespace micm { case ConfigParseStatus::Success: return "Success"; case ConfigParseStatus::None: return "None"; - case ConfigParseStatus::InvalidSpeciesFilePath: return "InvalidSpeciesFilePath"; - case ConfigParseStatus::InvalidReactionsFilePath: return "InvalidReactionsFilePath"; case ConfigParseStatus::InvalidKey: return "InvalidKey"; case ConfigParseStatus::UnknownKey: return "UnknownKey"; - case ConfigParseStatus::InvalidSpecies: return "InvalidSpecies"; + case ConfigParseStatus::InvalidCAMPFilePath: return "InvalidCAMPFilePath"; + case ConfigParseStatus::NoConfigFilesFound: return "NoConfigFilesFound"; case ConfigParseStatus::CAMPFilesSectionNotFound: return "CAMPFilesSectionNotFound"; - case ConfigParseStatus::InvalidCAMPFileCount: return "InvalidCAMPFileCount"; case ConfigParseStatus::CAMPDataSectionNotFound: return "CAMPDataSectionNotFound"; + case ConfigParseStatus::InvalidSpecies: return "InvalidSpecies"; case ConfigParseStatus::InvalidMechanism: return "InvalidMechanism"; case ConfigParseStatus::ObjectTypeNotFound: return "ObjectTypeNotFound"; case ConfigParseStatus::RequiredKeyNotFound: return "RequiredKeyNotFound"; @@ -86,808 +84,849 @@ namespace micm } }; - // JSON Configure paser class JsonReaderPolicy { using json = nlohmann::json; - public: - // Read from species configure - std::vector species_arr_; - - // Read from reaction configure - std::vector user_defined_rate_arr_; - std::vector arrhenius_rate_arr_; - std::vector branched_rate_arr_; - std::vector surface_rate_arr_; - std::vector troe_rate_arr_; - std::vector ternary_rate_arr_; - std::vector tunneling_rate_arr_; - - // Specific for solver parameters - Phase gas_phase_; - std::unordered_map phases_; - std::vector processes_; + public: + std::vector species_arr_; - // Constants - // 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"; - static const inline std::string TOLERANCE_CONFIG = "tolerance.json"; + std::vector user_defined_rate_arr_; + std::vector arrhenius_rate_arr_; + std::vector troe_rate_arr_; + std::vector ternary_rate_arr_; + std::vector branched_rate_arr_; + std::vector tunneling_rate_arr_; + std::vector surface_rate_arr_; - // Common JSON - static const inline std::string CAMP_DATA = "camp-data"; - static const inline std::string CAMP_FILES = "camp-files"; - static const inline std::string TYPE = "type"; + // Specific for solver parameters + Phase gas_phase_; + std::unordered_map phases_; + std::vector processes_; - // Functions + // Common JSON + static const inline std::string DEFAULT_CONFIG_FILE = "config.json"; + static const inline std::string CAMP_FILES = "camp-files"; + static const inline std::string CAMP_DATA = "camp-data"; + static const inline std::string TYPE = "type"; - /// @brief Parse configures - /// @return True for successful parsing - ConfigParseStatus Parse(const std::filesystem::path& config_dir) - { - // 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); - // Note tolerance_config is defined here but not used - 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)) + // Functions + + /// @brief Parse configures + /// @param config_path Path to a the CAMP configuration directory or file + /// @return True for successful parsing + ConfigParseStatus Parse(const std::filesystem::path& config_path) { - json camp_data = json::parse(std::ifstream(camp_config)); + // Parse status + ConfigParseStatus status; + + // Look for CAMP config path + if (!std::filesystem::exists(config_path)) + { + status = ConfigParseStatus::InvalidCAMPFilePath; + std::string msg = configParseStatusToString(status); + std::cerr << msg << std::endl; + return status; + } + + std::filesystem::path config_dir; + std::filesystem::path config_file; + + if (std::filesystem::is_directory(config_path)) + { + // If config path is a directory, use default config file name + config_dir = config_path; + config_file = config_dir / DEFAULT_CONFIG_FILE; + } + else + { + // Extract configuration dir from configuration file path + config_dir = config_path.parent_path(); + config_file = config_path; + } + + // std::cout << "config_file " << config_file << std::endl; + + // Load the CAMP file list JSON + json camp_data = json::parse(std::ifstream(config_file)); if (!camp_data.contains(CAMP_FILES)) - return ConfigParseStatus::CAMPFilesSectionNotFound; + { + status = ConfigParseStatus::CAMPFilesSectionNotFound; + std::string msg = configParseStatusToString(status); + std::cerr << msg << std::endl; + return status; + } - std::vector camp_files; + // Build a list of individual CAMP config files + std::vector camp_files; for (const auto& element : camp_data[CAMP_FILES]) { - camp_files.push_back(element.get()); + std::filesystem::path camp_file = config_dir / element.get(); + if (std::filesystem::exists(camp_file)) + { + camp_files.push_back(camp_file); + } + // Error return here if CAMP files list has a missing file? } - if (camp_files.size() != 2) + + // No config files found + if (camp_files.size() < 1) { - std::string err_msg = "CAMP file list should contain two files [species.json, mechanism.json]"; - std::cerr << err_msg << std::endl; - return ConfigParseStatus::InvalidCAMPFileCount; + status = ConfigParseStatus::NoConfigFilesFound; + std::string msg = configParseStatusToString(status); + std::cerr << msg << std::endl; + return status; } - // As a temporary implementation, assume camp files are ordered - species_config = config_dir / camp_files[0]; - mechanism_config = config_dir / camp_files[1]; - } - // Current reaction configs should be either mechanism_config or reactions_config - std::filesystem::path cur_reactions_config; + std::vector species_objects; + std::vector mechanism_objects; - // Check if species config exists - if (!std::filesystem::exists(species_config)) - { - std::string err_msg = "Species configuration file at path " + species_config.string() + " does not exist\n"; - std::cerr << err_msg << std::endl; - return ConfigParseStatus::InvalidSpeciesFilePath; - } + // Iterate CAMP file list and form CAMP data object arrays + for (const auto& camp_file : camp_files) + { + json config_subset = json::parse(std::ifstream(camp_file)); + + if (config_subset.contains(CAMP_DATA)) + { + // Iterate JSON objects from CAMP data entry + for (const auto& object : config_subset[CAMP_DATA]) + { + if (!object.is_null()) + { + // Require object to have a type entry + if (!ValidateJsonWithKey(object, TYPE)) + { + status = ConfigParseStatus::ObjectTypeNotFound; + std::string msg = configParseStatusToString(status); + std::cerr << msg << std::endl; + return status; + } + // Sort into object arrays by type + std::string type = object[TYPE].get(); + // CHEM_SPEC and RELATIVE_TOLERANCE parsed first by ParseSpeciesArray + if ((type == "CHEM_SPEC") || (type == "RELATIVE_TOLERANCE")) + { + species_objects.push_back(object); + } + // All other objects will be parsed by ParseMechanismArray + else + { + mechanism_objects.push_back(object); + } + } + } + } + else + { + return ConfigParseStatus::CAMPDataSectionNotFound; + } + } - // Check if a reaction configure exists and decide which one - if (std::filesystem::exists(mechanism_config)) - { - cur_reactions_config = mechanism_config; - } - else if (std::filesystem::exists(reactions_config)) - { - cur_reactions_config = reactions_config; - } - else - { - std::string err_msg = "Reaction configuration file at path " + mechanism_config.string() + " or " + - reactions_config.string() + " does not exist\n"; - std::cerr << err_msg << std::endl; - return ConfigParseStatus::InvalidReactionsFilePath; - } + // Clear vectors and maps + species_arr_.clear(); + user_defined_rate_arr_.clear(); + arrhenius_rate_arr_.clear(); + troe_rate_arr_.clear(); + ternary_rate_arr_.clear(); + branched_rate_arr_.clear(); + tunneling_rate_arr_.clear(); + surface_rate_arr_.clear(); + phases_.clear(); + processes_.clear(); - // Read species file to create Species and Phase that needs to be known to System and Process + // Parse species object array + status = ParseSpeciesArray(species_objects); - auto species_status = ConfigureSpecies(species_config); - if (species_status != ConfigParseStatus::Success) - return species_status; + // Assign the parsed 'Species' to 'Phase' + gas_phase_ = Phase(species_arr_); - // Assign the parsed 'Species' to 'Phase' - gas_phase_ = Phase(species_arr_); + // Parse mechanism object array + status = ParseMechanismArray(mechanism_objects); - // Read reactions file - json reaction_data = json::parse(std::ifstream(cur_reactions_config)); + return status; + } - if (!reaction_data.contains(CAMP_DATA)) - return ConfigParseStatus::CAMPDataSectionNotFound; + private: - std::vector reaction_objects; - for (const auto& element : reaction_data[CAMP_DATA]) + ConfigParseStatus ParseSpeciesArray(const std::vector& objects) { - reaction_objects.push_back(element); - } + ConfigParseStatus status = ConfigParseStatus::None; - return ParseObjectArray(reaction_objects); - } + for (const auto& object : objects) + { + std::string type = object[TYPE].get(); + + // debug statements + // std::cout << type << std::endl; + // std::cout << "ParseSpeciesArray object " << object.dump(4) << std::endl; + + if (type == "CHEM_SPEC") + { + status = ParseChemicalSpecies(object); + } + else if (type == "RELATIVE_TOLERANCE") + { + status = ParseRelativeTolerance(object); + } + + if (status != ConfigParseStatus::Success) + break; + } - private: - /// @brief Create 'Species' and 'Phase' - /// @param path to 'Species' file - /// @return True at success - ConfigParseStatus ConfigureSpecies(const std::filesystem::path& file) - { - ConfigParseStatus status = ConfigParseStatus::None; - json file_data = json::parse(std::ifstream(file)); + return status; + } + + ConfigParseStatus ParseMechanismArray(const std::vector& objects) + { + ConfigParseStatus status = ConfigParseStatus::None; - if (!file_data.contains(CAMP_DATA)) - return ConfigParseStatus::CAMPDataSectionNotFound; + for (const auto& object : objects) + { + std::string type = object[TYPE].get(); + + // debug statements + // std::cout << type << std::endl; + // std::cout << "ParseMechanismArray object " << object.dump(4) << std::endl; + + if (type == "MECHANISM") + { + status = ParseMechanism(object); + } + else if (type == "PHOTOLYSIS") + { + status = ParsePhotolysis(object); + } + else if (type == "EMISSION") + { + status = ParseEmission(object); + } + else if (type == "FIRST_ORDER_LOSS") + { + status = ParseFirstOrderLoss(object); + } + else if (type == "ARRHENIUS") + { + status = ParseArrhenius(object); + } + else if (type == "TROE") + { + status = ParseTroe(object); + } + else if (type == "TERNARY_CHEMICAL_ACTIVATION") + { + status = ParseTernaryChemicalActivation(object); + } + else if (type == "BRANCHED" || type == "WENNBERG_NO_RO2") + { + status = ParseBranched(object); + } + else if (type == "TUNNELING" || type == "WENNBERG_TUNNELING") + { + status = ParseTunneling(object); + } + else if (type == "SURFACE") + { + status = ParseSurface(object); + } + else + { + status = ConfigParseStatus::UnknownKey; + } + + if (status != ConfigParseStatus::Success) + break; + } - std::vector objects; - for (const auto& element : file_data[CAMP_DATA]) - objects.push_back(element); + return status; + } - for (const auto& object : objects) + bool ValidateJsonWithKey(const json& object, const std::string& key) { - if (!ValidateJsonWithKey(object, TYPE)) + if (!object.contains(key)) { - status = ConfigParseStatus::ObjectTypeNotFound; - break; + std::string msg = "Key " + key + " was not found in the config file"; + std::cerr << msg << std::endl; + return false; } + return true; + } - std::string type = object[TYPE].get(); + ConfigParseStatus ParseChemicalSpecies(const json& object) + { + // required keys + const std::string NAME = "name"; - if (type == "CHEM_SPEC") + auto status = ValidateSchema( + object, + { NAME, "type" }, + { "tracer type", "absolute tolerance", "diffusion coefficient [m2 s-1]", "molecular weight [kg mol-1]" }); + if (status != ConfigParseStatus::Success) { - status = ParseChemicalSpecies(object); + return status; } - else if (type == "RELATIVE_TOLERANCE") + + std::string name = object[NAME].get(); + + // Load remaining keys as properties + std::map properties{}; + for (auto& [key, value] : object.items()) { - status = ParseRelativeTolerance(object); + if (value.is_number_float()) + properties[key] = value; } + species_arr_.push_back(Species(name, properties)); - if (status != ConfigParseStatus::Success) - break; + return ConfigParseStatus::Success; } - return status; - } - - bool ValidateJsonWithKey(const json& object, const std::string& key) - { - if (!object.contains(key)) + ConfigParseStatus ParseRelativeTolerance(const json& object) { - std::string msg = "Key " + key + " was not found in the config file"; - std::cerr << msg << std::endl; - return false; + return ConfigParseStatus::Success; } - return true; - } - ConfigParseStatus ParseObjectArray(const std::vector& objects) - { - ConfigParseStatus status = ConfigParseStatus::None; - - for (const auto& object : objects) + ConfigParseStatus ParseMechanism(const json& object) { - if (!ValidateJsonWithKey(object, TYPE)) + auto status = ValidateSchema(object, { "name", "reactions", "type" }, {}); + if (status != ConfigParseStatus::Success) { - status = ConfigParseStatus::ObjectTypeNotFound; - break; + return status; } - std::string type = object[TYPE].get(); - - if (type == "MECHANISM") - { - status = ParseMechanism(object); - } - else if (type == "PHOTOLYSIS") - { - status = ParsePhotolysis(object); - } - else if (type == "ARRHENIUS") - { - status = ParseArrhenius(object); - } - else if (type == "BRANCHED" || type == "WENNBERG_NO_RO2") + std::vector objects; + for (const auto& element : object["reactions"]) { - status = ParseBranched(object); + objects.push_back(element); } - else if (type == "TERNARY_CHEMICAL_ACTIVATION") - { - status = ParseTernaryChemicalActivation(object); - } - else if (type == "TROE") - { - status = ParseTroe(object); - } - else if (type == "TUNNELING" || type == "WENNBERG_TUNNELING") - { - status = ParseTunneling(object); - } - else if (type == "EMISSION") - { - status = ParseEmission(object); - } - else if (type == "FIRST_ORDER_LOSS") - { - status = ParseFirstOrderLoss(object); - } - else if (type == "SURFACE") - { - status = ParseSurface(object); - } - else - { - status = ConfigParseStatus::UnknownKey; - } - if (status != ConfigParseStatus::Success) - break; - } - return status; - } - - ConfigParseStatus ParseChemicalSpecies(const json& object) - { - // required keys - const std::string NAME = "name"; + return ParseMechanismArray(objects); + } - auto status = ValidateSchema( - object, - { NAME, "type" }, - { "tracer type", "absolute tolerance", "diffusion coefficient [m2 s-1]", "molecular weight [kg mol-1]" }); - if (status != ConfigParseStatus::Success) + std::pair> ParseReactants(const json& object) { - return status; - } + const std::string QTY = "qty"; + std::vector reactants; - std::string name = object[NAME].get(); + ConfigParseStatus status = ConfigParseStatus::Success; - // Load remaining keys as properties - std::map properties{}; - for (auto& [key, value] : object.items()) - { - if (value.is_number_float()) - properties[key] = value; + for (auto& [key, value] : object.items()) + { + std::size_t qty = 1; + auto new_status = ValidateSchema(value, {}, { "qty" }); + if (new_status != ConfigParseStatus::Success) + { + status = new_status; + } + if (value.contains(QTY)) + qty = value[QTY]; + for (std::size_t i = 0; i < qty; ++i) + reactants.push_back(Species(key)); + } + return std::make_pair(status, reactants); } - species_arr_.push_back(Species(name, properties)); - return ConfigParseStatus::Success; - } + std::pair>> ParseProducts(const json& object) + { + const std::string YIELD = "yield"; - ConfigParseStatus ParseRelativeTolerance(const json& object) - { - return ConfigParseStatus::Success; - } + ConfigParseStatus status = ConfigParseStatus::Success; - ConfigParseStatus ParseMechanism(const json& object) - { - auto status = ValidateSchema(object, { "name", "reactions", "type" }, {}); - if (status != ConfigParseStatus::Success) - { - return status; + constexpr double DEFAULT_YIELD = 1.0; + std::vector> products; + for (auto& [key, value] : object.items()) + { + auto new_status = ValidateSchema(value, {}, { "yield" }); + if (new_status != ConfigParseStatus::Success) + { + status = new_status; + } + if (value.contains(YIELD)) + { + products.push_back(std::make_pair(Species(key), value[YIELD])); + } + else + { + products.push_back(std::make_pair(Species(key), DEFAULT_YIELD)); + } + } + return std::make_pair(status, products); } - std::vector objects; - for (const auto& element : object["reactions"]) + ConfigParseStatus ParsePhotolysis(const json& object) { - objects.push_back(element); - } + const std::string REACTANTS = "reactants"; + const std::string PRODUCTS = "products"; + const std::string MUSICA_NAME = "MUSICA name"; - return ParseObjectArray(objects); - } + auto status = ValidateSchema(object, { "type", REACTANTS, PRODUCTS, MUSICA_NAME }, {}); + if (status != ConfigParseStatus::Success) + { + return status; + } - std::pair> ParseReactants(const json& object) - { - const std::string QTY = "qty"; - std::vector reactants; + auto reactants = ParseReactants(object[REACTANTS]); + auto products = ParseProducts(object[PRODUCTS]); - ConfigParseStatus status = ConfigParseStatus::Success; + if (reactants.first != ConfigParseStatus::Success) + { + return reactants.first; + } - for (auto& [key, value] : object.items()) - { - std::size_t qty = 1; - auto new_status = ValidateSchema(value, {}, { "qty" }); - if (new_status != ConfigParseStatus::Success) + if (products.first != ConfigParseStatus::Success) { - status = new_status; + return products.first; } - if (value.contains(QTY)) - qty = value[QTY]; - for (std::size_t i = 0; i < qty; ++i) - reactants.push_back(Species(key)); - } - return std::make_pair(status, reactants); - } - std::pair>> ParseProducts(const json& object) - { - const std::string YIELD = "yield"; + std::string name = "PHOTO." + object[MUSICA_NAME].get(); - ConfigParseStatus status = ConfigParseStatus::Success; + user_defined_rate_arr_.push_back(UserDefinedRateConstant({ .label_ = name })); - constexpr double DEFAULT_YEILD = 1.0; - std::vector> products; - for (auto& [key, value] : object.items()) + std::unique_ptr rate_ptr = + std::make_unique(UserDefinedRateConstantParameters{ .label_ = name }); + processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); + + return ConfigParseStatus::Success; + } + + ConfigParseStatus ParseEmission(const json& object) { - auto new_status = ValidateSchema(value, {}, { "yield" }); - if (new_status != ConfigParseStatus::Success) + const std::string SPECIES = "species"; + const std::string MUSICA_NAME = "MUSICA name"; + + auto status = ValidateSchema(object, { "type", SPECIES, MUSICA_NAME }, {}); + if (status != ConfigParseStatus::Success) { - status = new_status; + return status; } - if (value.contains(YIELD)) + + std::string species = object["species"].get(); + json reactants_object{}; + json products_object{}; + products_object[species] = { { "yield", 1.0 } }; + + auto reactants = ParseReactants(reactants_object); + auto products = ParseProducts(products_object); + + if (reactants.first != ConfigParseStatus::Success) { - products.push_back(std::make_pair(Species(key), value[YIELD])); + return reactants.first; } - else + + if (products.first != ConfigParseStatus::Success) { - products.push_back(std::make_pair(Species(key), DEFAULT_YEILD)); + return products.first; } - } - return std::make_pair(status, products); - } - ConfigParseStatus ParsePhotolysis(const json& object) - { - const std::string REACTANTS = "reactants"; - const std::string PRODUCTS = "products"; - const std::string MUSICA_NAME = "MUSICA name"; + std::string name = "EMIS." + object[MUSICA_NAME].get(); - auto status = ValidateSchema(object, { "type", REACTANTS, PRODUCTS, MUSICA_NAME }, {}); - if (status != ConfigParseStatus::Success) - { - return status; - } + user_defined_rate_arr_.push_back(UserDefinedRateConstant({ .label_ = name })); - auto reactants = ParseReactants(object[REACTANTS]); - auto products = ParseProducts(object[PRODUCTS]); + std::unique_ptr rate_ptr = + std::make_unique(UserDefinedRateConstantParameters{ .label_ = name }); + processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); - if (reactants.first != ConfigParseStatus::Success) - { - return reactants.first; + return ConfigParseStatus::Success; } - if (products.first != ConfigParseStatus::Success) + ConfigParseStatus ParseFirstOrderLoss(const json& object) { - return products.first; - } + const std::string SPECIES = "species"; + const std::string MUSICA_NAME = "MUSICA name"; - std::string name = "PHOTO." + object[MUSICA_NAME].get(); + auto status = ValidateSchema(object, { "type", SPECIES, MUSICA_NAME }, {}); + if (status != ConfigParseStatus::Success) + { + return status; + } - user_defined_rate_arr_.push_back(UserDefinedRateConstant({ .label_ = name })); + std::string species = object["species"].get(); + json reactants_object{}; + json products_object{}; + reactants_object[species] = { {} }; - std::unique_ptr rate_ptr = - std::make_unique(UserDefinedRateConstantParameters{ .label_ = name }); - processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); + auto reactants = ParseReactants(reactants_object); + auto products = ParseProducts(products_object); - return ConfigParseStatus::Success; - } + if (reactants.first != ConfigParseStatus::Success) + { + return reactants.first; + } - ConfigParseStatus ParseArrhenius(const json& object) - { - const std::string REACTANTS = "reactants"; - const std::string PRODUCTS = "products"; + if (products.first != ConfigParseStatus::Success) + { + return products.first; + } - auto status = - ValidateSchema(object, { "type", REACTANTS, PRODUCTS }, { "A", "B", "C", "D", "E", "Ea", "MUSICA name" }); - if (status != ConfigParseStatus::Success) - { - return status; - } + std::string name = "LOSS." + object[MUSICA_NAME].get(); - auto reactants = ParseReactants(object[REACTANTS]); - auto products = ParseProducts(object[PRODUCTS]); + user_defined_rate_arr_.push_back(UserDefinedRateConstant({ .label_ = name })); - if (reactants.first != ConfigParseStatus::Success) - { - return reactants.first; - } + std::unique_ptr rate_ptr = + std::make_unique(UserDefinedRateConstantParameters{ .label_ = name }); + processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); - if (products.first != ConfigParseStatus::Success) - { - return products.first; + return ConfigParseStatus::Success; } - ArrheniusRateConstantParameters parameters; - if (object.contains("A")) - { - parameters.A_ = object["A"].get(); - } - if (object.contains("B")) - { - parameters.B_ = object["B"].get(); - } - if (object.contains("C")) - { - parameters.C_ = object["C"].get(); - } - if (object.contains("D")) - { - parameters.D_ = object["D"].get(); - } - if (object.contains("E")) - { - parameters.E_ = object["E"].get(); - } - if (object.contains("Ea")) + ConfigParseStatus ParseArrhenius(const json& object) { + const std::string REACTANTS = "reactants"; + const std::string PRODUCTS = "products"; + + auto status = + ValidateSchema(object, { "type", REACTANTS, PRODUCTS }, { "A", "B", "C", "D", "E", "Ea", "MUSICA name" }); + if (status != ConfigParseStatus::Success) + { + return status; + } + + auto reactants = ParseReactants(object[REACTANTS]); + auto products = ParseProducts(object[PRODUCTS]); + + if (reactants.first != ConfigParseStatus::Success) + { + return reactants.first; + } + + if (products.first != ConfigParseStatus::Success) + { + return products.first; + } + + ArrheniusRateConstantParameters parameters; + if (object.contains("A")) + { + parameters.A_ = object["A"].get(); + } + if (object.contains("B")) + { + parameters.B_ = object["B"].get(); + } + if (object.contains("C")) + { + parameters.C_ = object["C"].get(); + } + if (object.contains("D")) + { + parameters.D_ = object["D"].get(); + } + if (object.contains("E")) + { + parameters.E_ = object["E"].get(); + } + if (object.contains("Ea")) + { if (parameters.C_ != 0) { std::cerr << "Ea is specified when C is also specified for an Arrhenius reaction. Pick one." << std::endl; return ConfigParseStatus::MutuallyExclusiveOption; } - // Calculate 'C' using 'Ea' - parameters.C_ = -1 * object["Ea"].get() / BOLTZMANN_CONSTANT; - } - - arrhenius_rate_arr_.push_back(ArrheniusRateConstant(parameters)); + // Calculate 'C' using 'Ea' + parameters.C_ = -1 * object["Ea"].get() / BOLTZMANN_CONSTANT; + } - std::unique_ptr rate_ptr = std::make_unique(parameters); + arrhenius_rate_arr_.push_back(ArrheniusRateConstant(parameters)); + + std::unique_ptr rate_ptr = std::make_unique(parameters); - processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); + processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); - return ConfigParseStatus::Success; - } + return ConfigParseStatus::Success; + } - ConfigParseStatus ParseBranched(const json& object) - { - const std::string REACTANTS = "reactants"; - const std::string ALKOXY_PRODUCTS = "alkoxy products"; - const std::string NITRATE_PRODUCTS = "nitrate products"; - const std::string X = "X"; - const std::string Y = "Y"; - const std::string A0 = "a0"; - const std::string N = "n"; - - auto status = ValidateSchema(object, { "type", REACTANTS, ALKOXY_PRODUCTS, NITRATE_PRODUCTS, X, Y, A0, N }, {}); - if (status != ConfigParseStatus::Success) + ConfigParseStatus ParseTroe(const json& object) { - return status; - } + const std::string REACTANTS = "reactants"; + const std::string PRODUCTS = "products"; - auto reactants = ParseReactants(object[REACTANTS]); - auto alkoxy_products = ParseProducts(object[ALKOXY_PRODUCTS]); - auto nitrate_products = ParseProducts(object[NITRATE_PRODUCTS]); + auto status = ValidateSchema( + object, { "type", REACTANTS, PRODUCTS }, { "k0_A", "k0_B", "k0_C", "kinf_A", "kinf_B", "kinf_C", "Fc", "N" }); + if (status != ConfigParseStatus::Success) + { + return status; + } - if (reactants.first != ConfigParseStatus::Success) - { - return reactants.first; - } - if (alkoxy_products.first != ConfigParseStatus::Success) - { - return alkoxy_products.first; - } - if (nitrate_products.first != ConfigParseStatus::Success) - { - return nitrate_products.first; - } + auto reactants = ParseReactants(object[REACTANTS]); + auto products = ParseProducts(object[PRODUCTS]); - BranchedRateConstantParameters parameters; - parameters.X_ = object[X].get(); - parameters.Y_ = object[Y].get(); - parameters.a0_ = object[A0].get(); - parameters.n_ = object[N].get(); + if (reactants.first != ConfigParseStatus::Success) + { + return reactants.first; + } - // Alkoxy branch - parameters.branch_ = BranchedRateConstantParameters::Branch::Alkoxy; - branched_rate_arr_.push_back(BranchedRateConstant(parameters)); - std::unique_ptr rate_ptr = std::make_unique(parameters); - processes_.push_back(Process(reactants.second, alkoxy_products.second, std::move(rate_ptr), gas_phase_)); + if (products.first != ConfigParseStatus::Success) + { + return products.first; + } - // Nitrate branch - parameters.branch_ = BranchedRateConstantParameters::Branch::Nitrate; - branched_rate_arr_.push_back(BranchedRateConstant(parameters)); - rate_ptr = std::make_unique(parameters); - processes_.push_back(Process(reactants.second, nitrate_products.second, std::move(rate_ptr), gas_phase_)); + TroeRateConstantParameters parameters; + if (object.contains("k0_A")) + { + parameters.k0_A_ = object["k0_A"].get(); + } + if (object.contains("k0_B")) + { + parameters.k0_B_ = object["k0_B"].get(); + } + if (object.contains("k0_C")) + { + parameters.k0_C_ = object["k0_C"].get(); + } + if (object.contains("kinf_A")) + { + parameters.kinf_A_ = object["kinf_A"].get(); + } + if (object.contains("kinf_B")) + { + parameters.kinf_B_ = object["kinf_B"].get(); + } + if (object.contains("kinf_C")) + { + parameters.kinf_C_ = object["kinf_C"].get(); + } + if (object.contains("Fc")) + { + parameters.Fc_ = object["Fc"].get(); + } + if (object.contains("N")) + { + parameters.N_ = object["N"].get(); + } - return ConfigParseStatus::Success; - } + troe_rate_arr_.push_back(TroeRateConstant(parameters)); - ConfigParseStatus ParseTroe(const json& object) - { - const std::string REACTANTS = "reactants"; - const std::string PRODUCTS = "products"; + std::unique_ptr rate_ptr = std::make_unique(parameters); - auto status = ValidateSchema( - object, { "type", REACTANTS, PRODUCTS }, { "k0_A", "k0_B", "k0_C", "kinf_A", "kinf_B", "kinf_C", "Fc", "N" }); - if (status != ConfigParseStatus::Success) - { - return status; - } + processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); - auto reactants = ParseReactants(object[REACTANTS]); - auto products = ParseProducts(object[PRODUCTS]); - if (reactants.first != ConfigParseStatus::Success) - { - return reactants.first; - } - if (products.first != ConfigParseStatus::Success) - { - return products.first; + return ConfigParseStatus::Success; } - TroeRateConstantParameters parameters; - if (object.contains("k0_A")) - { - parameters.k0_A_ = object["k0_A"].get(); - } - if (object.contains("k0_B")) - { - parameters.k0_B_ = object["k0_B"].get(); - } - if (object.contains("k0_C")) - { - parameters.k0_C_ = object["k0_C"].get(); - } - if (object.contains("kinf_A")) - { - parameters.kinf_A_ = object["kinf_A"].get(); - } - if (object.contains("kinf_B")) + ConfigParseStatus ParseTernaryChemicalActivation(const json& object) { - parameters.kinf_B_ = object["kinf_B"].get(); - } - if (object.contains("kinf_C")) - { - parameters.kinf_C_ = object["kinf_C"].get(); - } - if (object.contains("Fc")) - { - parameters.Fc_ = object["Fc"].get(); - } - if (object.contains("N")) - { - parameters.N_ = object["N"].get(); - } - - troe_rate_arr_.push_back(TroeRateConstant(parameters)); - - std::unique_ptr rate_ptr = std::make_unique(parameters); - - processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); - - return ConfigParseStatus::Success; - } - - ConfigParseStatus ParseTernaryChemicalActivation(const json& object) - { - const std::string REACTANTS = "reactants"; - const std::string PRODUCTS = "products"; + const std::string REACTANTS = "reactants"; + const std::string PRODUCTS = "products"; - auto status = ValidateSchema( + auto status = ValidateSchema( object, { "type", REACTANTS, PRODUCTS }, { "k0_A", "k0_B", "k0_C", "kinf_A", "kinf_B", "kinf_C", "Fc", "N" }); - if (status != ConfigParseStatus::Success) - { - return status; - } + if (status != ConfigParseStatus::Success) + { + return status; + } - auto reactants = ParseReactants(object[REACTANTS]); - auto products = ParseProducts(object[PRODUCTS]); - if (reactants.first != ConfigParseStatus::Success) - { - return reactants.first; - } - if (products.first != ConfigParseStatus::Success) - { - return products.first; - } + auto reactants = ParseReactants(object[REACTANTS]); + auto products = ParseProducts(object[PRODUCTS]); - TernaryChemicalActivationRateConstantParameters parameters; - if (object.contains("k0_A")) - { - parameters.k0_A_ = object["k0_A"].get(); - } - if (object.contains("k0_B")) - { - parameters.k0_B_ = object["k0_B"].get(); - } - if (object.contains("k0_C")) - { - parameters.k0_C_ = object["k0_C"].get(); - } - if (object.contains("kinf_A")) - { - parameters.kinf_A_ = object["kinf_A"].get(); - } - if (object.contains("kinf_B")) - { - parameters.kinf_B_ = object["kinf_B"].get(); - } - if (object.contains("kinf_C")) - { - parameters.kinf_C_ = object["kinf_C"].get(); - } - if (object.contains("Fc")) - { - parameters.Fc_ = object["Fc"].get(); - } - if (object.contains("N")) - { - parameters.N_ = object["N"].get(); - } + if (reactants.first != ConfigParseStatus::Success) + { + return reactants.first; + } - ternary_rate_arr_.push_back(TernaryChemicalActivationRateConstant(parameters)); + if (products.first != ConfigParseStatus::Success) + { + return products.first; + } - std::unique_ptr rate_ptr = - std::make_unique(parameters); + TernaryChemicalActivationRateConstantParameters parameters; + if (object.contains("k0_A")) + { + parameters.k0_A_ = object["k0_A"].get(); + } + if (object.contains("k0_B")) + { + parameters.k0_B_ = object["k0_B"].get(); + } + if (object.contains("k0_C")) + { + parameters.k0_C_ = object["k0_C"].get(); + } + if (object.contains("kinf_A")) + { + parameters.kinf_A_ = object["kinf_A"].get(); + } + if (object.contains("kinf_B")) + { + parameters.kinf_B_ = object["kinf_B"].get(); + } + if (object.contains("kinf_C")) + { + parameters.kinf_C_ = object["kinf_C"].get(); + } + if (object.contains("Fc")) + { + parameters.Fc_ = object["Fc"].get(); + } + if (object.contains("N")) + { + parameters.N_ = object["N"].get(); + } - processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); + ternary_rate_arr_.push_back(TernaryChemicalActivationRateConstant(parameters)); - return ConfigParseStatus::Success; - } + std::unique_ptr rate_ptr = + std::make_unique(parameters); - ConfigParseStatus ParseTunneling(const json& object) - { - const std::string REACTANTS = "reactants"; - const std::string PRODUCTS = "products"; + processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); - auto status = ValidateSchema(object, { "type", REACTANTS, PRODUCTS }, { "A", "B", "C" }); - if (status != ConfigParseStatus::Success) - { - return status; + return ConfigParseStatus::Success; } - auto reactants = ParseReactants(object[REACTANTS]); - auto products = ParseProducts(object[PRODUCTS]); - if (reactants.first != ConfigParseStatus::Success) - { - return reactants.first; - } - if (products.first != ConfigParseStatus::Success) + ConfigParseStatus ParseBranched(const json& object) { - return products.first; - } + const std::string REACTANTS = "reactants"; + const std::string ALKOXY_PRODUCTS = "alkoxy products"; + const std::string NITRATE_PRODUCTS = "nitrate products"; + const std::string X = "X"; + const std::string Y = "Y"; + const std::string A0 = "a0"; + const std::string N = "n"; - TunnelingRateConstantParameters parameters; - if (object.contains("A")) - { - parameters.A_ = object["A"].get(); - } - if (object.contains("B")) - { - parameters.B_ = object["B"].get(); - } - if (object.contains("C")) - { - parameters.C_ = object["C"].get(); - } + auto status = ValidateSchema(object, { "type", REACTANTS, ALKOXY_PRODUCTS, NITRATE_PRODUCTS, X, Y, A0, N }, {}); + if (status != ConfigParseStatus::Success) + { + return status; + } - tunneling_rate_arr_.push_back(TunnelingRateConstant(parameters)); + auto reactants = ParseReactants(object[REACTANTS]); + auto alkoxy_products = ParseProducts(object[ALKOXY_PRODUCTS]); + auto nitrate_products = ParseProducts(object[NITRATE_PRODUCTS]); - std::unique_ptr rate_ptr = std::make_unique(parameters); + if (reactants.first != ConfigParseStatus::Success) + { + return reactants.first; + } - processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); + if (alkoxy_products.first != ConfigParseStatus::Success) + { + return alkoxy_products.first; + } - return ConfigParseStatus::Success; - } + if (nitrate_products.first != ConfigParseStatus::Success) + { + return nitrate_products.first; + } - ConfigParseStatus ParseEmission(const json& object) - { - const std::string SPECIES = "species"; - const std::string MUSICA_NAME = "MUSICA name"; + BranchedRateConstantParameters parameters; + parameters.X_ = object[X].get(); + parameters.Y_ = object[Y].get(); + parameters.a0_ = object[A0].get(); + parameters.n_ = object[N].get(); - auto status = ValidateSchema(object, { "type", SPECIES, MUSICA_NAME }, {}); - if (status != ConfigParseStatus::Success) - { - return status; - } + // Alkoxy branch + parameters.branch_ = BranchedRateConstantParameters::Branch::Alkoxy; + branched_rate_arr_.push_back(BranchedRateConstant(parameters)); + std::unique_ptr rate_ptr = std::make_unique(parameters); + processes_.push_back(Process(reactants.second, alkoxy_products.second, std::move(rate_ptr), gas_phase_)); - std::string species = object["species"].get(); - json reactants_object{}; - json products_object{}; - products_object[species] = { { "yield", 1.0 } }; - auto reactants = ParseReactants(reactants_object); - auto products = ParseProducts(products_object); - if (reactants.first != ConfigParseStatus::Success) - { - return reactants.first; + // Nitrate branch + parameters.branch_ = BranchedRateConstantParameters::Branch::Nitrate; + branched_rate_arr_.push_back(BranchedRateConstant(parameters)); + rate_ptr = std::make_unique(parameters); + processes_.push_back(Process(reactants.second, nitrate_products.second, std::move(rate_ptr), gas_phase_)); + + return ConfigParseStatus::Success; } - if (products.first != ConfigParseStatus::Success) + + ConfigParseStatus ParseTunneling(const json& object) { - return products.first; - } + const std::string REACTANTS = "reactants"; + const std::string PRODUCTS = "products"; - std::string name = "EMIS." + object[MUSICA_NAME].get(); + auto status = ValidateSchema(object, { "type", REACTANTS, PRODUCTS }, { "A", "B", "C" }); + if (status != ConfigParseStatus::Success) + { + return status; + } - user_defined_rate_arr_.push_back(UserDefinedRateConstant({ .label_ = name })); + auto reactants = ParseReactants(object[REACTANTS]); + auto products = ParseProducts(object[PRODUCTS]); - std::unique_ptr rate_ptr = - std::make_unique(UserDefinedRateConstantParameters{ .label_ = name }); - processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); + if (reactants.first != ConfigParseStatus::Success) + { + return reactants.first; + } - return ConfigParseStatus::Success; - } + if (products.first != ConfigParseStatus::Success) + { + return products.first; + } - ConfigParseStatus ParseFirstOrderLoss(const json& object) - { - const std::string SPECIES = "species"; - const std::string MUSICA_NAME = "MUSICA name"; + TunnelingRateConstantParameters parameters; + if (object.contains("A")) + { + parameters.A_ = object["A"].get(); + } + if (object.contains("B")) + { + parameters.B_ = object["B"].get(); + } + if (object.contains("C")) + { + parameters.C_ = object["C"].get(); + } - auto status = ValidateSchema(object, { "type", SPECIES, MUSICA_NAME }, {}); - if (status != ConfigParseStatus::Success) - { - return status; - } + tunneling_rate_arr_.push_back(TunnelingRateConstant(parameters)); - std::string species = object["species"].get(); - json reactants_object{}; - json products_object{}; - reactants_object[species] = {}; - auto reactants = ParseReactants(reactants_object); - auto products = ParseProducts(products_object); - if (reactants.first != ConfigParseStatus::Success) - { - return reactants.first; - } - if (products.first != ConfigParseStatus::Success) - { - return products.first; - } + std::unique_ptr rate_ptr = std::make_unique(parameters); - std::string name = "LOSS." + object[MUSICA_NAME].get(); + processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); - user_defined_rate_arr_.push_back(UserDefinedRateConstant({ .label_ = name })); + return ConfigParseStatus::Success; + } - std::unique_ptr rate_ptr = - std::make_unique(UserDefinedRateConstantParameters{ .label_ = name }); - processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); + ConfigParseStatus ParseSurface(const json& object) + { + const std::string REACTANTS = "gas-phase reactant"; + const std::string PRODUCTS = "gas-phase products"; + const std::string MUSICA_NAME = "MUSICA name"; + const std::string PROBABILITY = "reaction probability"; - return ConfigParseStatus::Success; - } + auto status = ValidateSchema(object, { "type", REACTANTS, PRODUCTS, MUSICA_NAME }, { PROBABILITY }); + if (status != ConfigParseStatus::Success) + { + return status; + } - ConfigParseStatus ParseSurface(const json& object) - { - const std::string REACTANTS = "gas-phase reactant"; - const std::string PRODUCTS = "gas-phase products"; - const std::string MUSICA_NAME = "MUSICA name"; - const std::string PROBABILITY = "reaction probability"; + std::string species_name = object[REACTANTS].get(); + json reactants_object{}; + reactants_object[species_name] = { {} }; - auto status = ValidateSchema(object, { "type", REACTANTS, PRODUCTS, MUSICA_NAME }, { PROBABILITY }); - if (status != ConfigParseStatus::Success) - { - return status; - } + auto reactants = ParseReactants(reactants_object); + auto products = ParseProducts(object[PRODUCTS]); - std::string species_name = object[REACTANTS].get(); - json reactants_object{}; - reactants_object[species_name] = {}; - auto reactants = ParseReactants(reactants_object); - auto products = ParseProducts(object[PRODUCTS]); - if (reactants.first != ConfigParseStatus::Success) - { - return reactants.first; - } - if (products.first != ConfigParseStatus::Success) - { - return products.first; - } + if (reactants.first != ConfigParseStatus::Success) + { + return reactants.first; + } - Species reactant_species = Species(""); - for (auto& species : species_arr_) - { - if (species.name_ == species_name) + if (products.first != ConfigParseStatus::Success) { - reactant_species = species; - break; + return products.first; } - } - SurfaceRateConstantParameters parameters{ .label_ = "SURF." + object[MUSICA_NAME].get(), - .species_ = reactant_species }; - if (object.contains(PROBABILITY)) - { - parameters.reaction_probability_ = object[PROBABILITY].get(); - } + Species reactant_species = Species(""); + for (auto& species : species_arr_) + { + if (species.name_ == species_name) + { + reactant_species = species; + break; + } + } + SurfaceRateConstantParameters parameters{ .label_ = "SURF." + object[MUSICA_NAME].get(), + .species_ = reactant_species }; - surface_rate_arr_.push_back(SurfaceRateConstant(parameters)); + if (object.contains(PROBABILITY)) + { + parameters.reaction_probability_ = object[PROBABILITY].get(); + } - std::unique_ptr rate_ptr = std::make_unique(parameters); - processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); + surface_rate_arr_.push_back(SurfaceRateConstant(parameters)); - return ConfigParseStatus::Success; - } + std::unique_ptr rate_ptr = std::make_unique(parameters); + processes_.push_back(Process(reactants.second, products.second, std::move(rate_ptr), gas_phase_)); + + return ConfigParseStatus::Success; + } /// @brief Search for nonstandard keys. Only nonstandard keys starting with __ are allowed. Others are considered typos /// @param object the object whose keys need to be validated @@ -905,6 +944,14 @@ namespace micm // starting with __ // anything else is reported as an error so that typos are caught, specifically for optional keys + // debug statement + // std::cout << "ValidateSchema object " << object.dump(4) << std::endl; + + if (!object.empty() && object.begin().value().is_null()) + { + return ConfigParseStatus::Success; + } + std::vector sorted_object_keys; for (auto& [key, value] : object.items()) sorted_object_keys.push_back(key); @@ -944,6 +991,7 @@ namespace micm { if (!key.starts_with("__")) { + std::cerr << "non-standard key " << key << std::endl; return ConfigParseStatus::ContainsNonStandardKey; } } @@ -955,33 +1003,32 @@ namespace micm template class SolverConfig : public ConfigTypePolicy { - private: - ConfigParseStatus last_parse_status_ = ConfigParseStatus::None; - - public: - /// @brief Reads and parses configures - /// @param config_dir A path to a configuration file - /// @return an enum indicating the success or failure of the parse - [[nodiscard]] ConfigParseStatus ReadAndParse(const std::filesystem::path& config_dir) - { - last_parse_status_ = this->Parse(config_dir); - return last_parse_status_; - } + private: + ConfigParseStatus last_parse_status_ = ConfigParseStatus::None; - /// @brief Creates and returns SolverParameters - /// @return SolverParameters that contains 'System' and a collection of 'Process' - SolverParameters GetSolverParams() - { - if (last_parse_status_ != ConfigParseStatus::Success) + public: + /// @brief Reads and parses configures + /// @param config_dir Path to a the configuration directory + /// @return an enum indicating the success or failure of the parse + [[nodiscard]] ConfigParseStatus ReadAndParse(const std::filesystem::path& config_dir) { - std::string msg = "Parsing configuration files failed. The parsing failed with error: " + - configParseStatusToString(last_parse_status_); - throw std::runtime_error(msg); + last_parse_status_ = this->Parse(config_dir); + return last_parse_status_; } - return SolverParameters( + /// @brief Creates and returns SolverParameters + /// @return SolverParameters that contains 'System' and a collection of 'Process' + SolverParameters GetSolverParams() + { + if (last_parse_status_ != ConfigParseStatus::Success) + { + std::string msg = "Parsing configuration files failed. The parsing failed with error: " + + configParseStatusToString(last_parse_status_); + throw std::runtime_error(msg); + } + + return SolverParameters( std::move(System(std::move(this->gas_phase_), std::move(this->phases_))), std::move(this->processes_)); - } + } }; - } // namespace micm diff --git a/test/kpp/configs/kpp_chapman/config.json b/test/kpp/configs/kpp_chapman/config.json new file mode 100644 index 000000000..61165b00d --- /dev/null +++ b/test/kpp/configs/kpp_chapman/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json"]} diff --git a/test/tutorial/configs/rate_constants_no_user_defined/config.json b/test/tutorial/configs/rate_constants_no_user_defined/config.json new file mode 100644 index 000000000..61165b00d --- /dev/null +++ b/test/tutorial/configs/rate_constants_no_user_defined/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json"]} diff --git a/test/tutorial/configs/rate_constants_user_defined/config.json b/test/tutorial/configs/rate_constants_user_defined/config.json new file mode 100644 index 000000000..61165b00d --- /dev/null +++ b/test/tutorial/configs/rate_constants_user_defined/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json"]} diff --git a/test/tutorial/configs/robertson/config.json b/test/tutorial/configs/robertson/config.json new file mode 100644 index 000000000..61165b00d --- /dev/null +++ b/test/tutorial/configs/robertson/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json"]} diff --git a/test/unit/configure/CMakeLists.txt b/test/unit/configure/CMakeLists.txt index a76f870af..0ff3e452e 100644 --- a/test/unit/configure/CMakeLists.txt +++ b/test/unit/configure/CMakeLists.txt @@ -11,4 +11,4 @@ create_standard_test(NAME solver_config SOURCES test_solver_config.cpp) ################################################################################ # Tests -add_subdirectory(process) \ No newline at end of file +add_subdirectory(process) diff --git a/test/unit/configure/process/CMakeLists.txt b/test/unit/configure/process/CMakeLists.txt index ffbdb9239..437d7f4ac 100644 --- a/test/unit/configure/process/CMakeLists.txt +++ b/test/unit/configure/process/CMakeLists.txt @@ -14,4 +14,5 @@ create_standard_test(NAME photolysis_config SOURCES test_photolysis_config.cpp) create_standard_test(NAME surface_config SOURCES test_surface_config.cpp) create_standard_test(NAME ternary_chemical_activation_config SOURCES test_ternary_chemical_activation_config.cpp) create_standard_test(NAME troe_config SOURCES test_troe_config.cpp) -create_standard_test(NAME tunneling_config SOURCES test_tunneling_config.cpp) \ No newline at end of file +create_standard_test(NAME tunneling_config SOURCES test_tunneling_config.cpp) + diff --git a/test/unit/configure/process/test_arrhenius_config.cpp b/test/unit/configure/process/test_arrhenius_config.cpp index d2ab313eb..65837f22e 100644 --- a/test/unit/configure/process/test_arrhenius_config.cpp +++ b/test/unit/configure/process/test_arrhenius_config.cpp @@ -110,4 +110,4 @@ TEST(ArrheniusConfig, DetectsNonstandardReactantCoefficient) micm::ConfigParseStatus status = solver_config.ReadAndParse("./unit_configs/process/arrhenius/nonstandard_reactant_coef"); EXPECT_EQ(micm::ConfigParseStatus::ContainsNonStandardKey, status); -} \ No newline at end of file +} diff --git a/test/unit/configure/test_solver_config.cpp b/test/unit/configure/test_solver_config.cpp index 55c7fe82c..cf229a0b7 100644 --- a/test/unit/configure/test_solver_config.cpp +++ b/test/unit/configure/test_solver_config.cpp @@ -5,8 +5,15 @@ TEST(SolverConfig, DetectsInvalidConfigFile) { micm::SolverConfig solverConfig{}; - auto status = solverConfig.ReadAndParse("not_a_config_file_directory"); - EXPECT_EQ(micm::ConfigParseStatus::InvalidSpeciesFilePath, status); + auto status = solverConfig.ReadAndParse("not_a_config_file"); + EXPECT_EQ(micm::ConfigParseStatus::InvalidCAMPFilePath, status); +} + +TEST(SolverConfig, NoConfigFilesFound) +{ + micm::SolverConfig solverConfig{}; + auto status = solverConfig.ReadAndParse("./unit_configs/CAMP/camp_invalid/config.json"); + EXPECT_EQ(micm::ConfigParseStatus::NoConfigFilesFound, status); } TEST(SolverConfig, ReadAndParseCAMPFiles) @@ -14,21 +21,17 @@ TEST(SolverConfig, ReadAndParseCAMPFiles) micm::SolverConfig solverConfig{}; // Read and parse the CAMP configure file - micm::ConfigParseStatus status = solverConfig.ReadAndParse("./unit_configs/CAMP/camp_valid"); + micm::ConfigParseStatus status = solverConfig.ReadAndParse("./unit_configs/CAMP/camp_valid/config.json"); EXPECT_EQ(micm::ConfigParseStatus::Success, status); } -TEST(SolverConfig, DetectsInvalidCAMPConfigFile) +TEST(SolverConfig, ReadAndParseCAMPFilesFromDir) { micm::SolverConfig solverConfig{}; // Read and parse the CAMP configure file - micm::ConfigParseStatus status; - status = solverConfig.ReadAndParse("./unit_configs/CAMP/camp_invalid"); - EXPECT_EQ(micm::ConfigParseStatus::InvalidCAMPFileCount, status); - - status = solverConfig.ReadAndParse("./unit_configs/CAMP/camp_no_files_key"); - EXPECT_EQ(micm::ConfigParseStatus::CAMPFilesSectionNotFound, status); + micm::ConfigParseStatus status = solverConfig.ReadAndParse("./unit_configs/CAMP/camp_valid"); + EXPECT_EQ(micm::ConfigParseStatus::Success, status); } TEST(SolverConfig, ReadAndParseSystemObject) @@ -36,7 +39,7 @@ TEST(SolverConfig, ReadAndParseSystemObject) micm::SolverConfig solverConfig; // Read and parse the configure files - micm::ConfigParseStatus status = solverConfig.ReadAndParse("./unit_configs/chapman"); + micm::ConfigParseStatus status = solverConfig.ReadAndParse("./unit_configs/chapman/config.json"); EXPECT_EQ(micm::ConfigParseStatus::Success, status); // Get solver parameters ('System', the collection of 'Process') @@ -69,7 +72,7 @@ TEST(SolverConfig, ReadAndParseProcessObjects) micm::SolverConfig solverConfig; // Read and parse the configure files - micm::ConfigParseStatus status = solverConfig.ReadAndParse("./unit_configs/chapman"); + micm::ConfigParseStatus status = solverConfig.ReadAndParse("./unit_configs/chapman/config.json"); EXPECT_EQ(micm::ConfigParseStatus::Success, status); // Get solver parameters ('System', the collection of 'Process') @@ -146,11 +149,3 @@ TEST(SolverConfig, ReadAndParseProcessObjects) EXPECT_EQ(it->rate_constant_->CustomParameters()[i], custom_rate_labels[idx][i]); } } - -TEST(SolverConfig, GettingSolverParamsThrowsExceptionWithFailedParsing) -{ - micm::SolverConfig solverConfig; - micm::ConfigParseStatus status = solverConfig.ReadAndParse("not_a_config_file_directory"); - EXPECT_NE(micm::ConfigParseStatus::Success, status); - EXPECT_ANY_THROW(solverConfig.GetSolverParams()); -} diff --git a/test/unit/unit_configs/CAMP/camp_invalid/config.json b/test/unit/unit_configs/CAMP/camp_invalid/config.json index d8250971c..201b3ff4d 100644 --- a/test/unit/unit_configs/CAMP/camp_invalid/config.json +++ b/test/unit/unit_configs/CAMP/camp_invalid/config.json @@ -1 +1 @@ -{"camp-files": ["camp_species.json", "camp_mechanism.json", "other.json"]} +{"camp-files": ["other.json"]} diff --git a/test/unit/unit_configs/chapman/config.json b/test/unit/unit_configs/chapman/config.json new file mode 100644 index 000000000..045297e2b --- /dev/null +++ b/test/unit/unit_configs/chapman/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "mechanism.json"]} diff --git a/test/unit/unit_configs/process/arrhenius/contains_nonstandard_key/config.json b/test/unit/unit_configs/process/arrhenius/contains_nonstandard_key/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/arrhenius/contains_nonstandard_key/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/arrhenius/missing_products/config.json b/test/unit/unit_configs/process/arrhenius/missing_products/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/arrhenius/missing_products/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/arrhenius/missing_reactants/config.json b/test/unit/unit_configs/process/arrhenius/missing_reactants/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/arrhenius/missing_reactants/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/arrhenius/mutually_exclusive/config.json b/test/unit/unit_configs/process/arrhenius/mutually_exclusive/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/arrhenius/mutually_exclusive/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/arrhenius/nonstandard_product_coef/config.json b/test/unit/unit_configs/process/arrhenius/nonstandard_product_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/arrhenius/nonstandard_product_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/arrhenius/nonstandard_reactant_coef/config.json b/test/unit/unit_configs/process/arrhenius/nonstandard_reactant_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/arrhenius/nonstandard_reactant_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/arrhenius/valid/config.json b/test/unit/unit_configs/process/arrhenius/valid/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/arrhenius/valid/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/branched/contains_nonstandard_key/config.json b/test/unit/unit_configs/process/branched/contains_nonstandard_key/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/branched/contains_nonstandard_key/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/branched/missing_alkoxy_products/config.json b/test/unit/unit_configs/process/branched/missing_alkoxy_products/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/branched/missing_alkoxy_products/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/branched/missing_nitrate_products/config.json b/test/unit/unit_configs/process/branched/missing_nitrate_products/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/branched/missing_nitrate_products/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/branched/missing_reactants/config.json b/test/unit/unit_configs/process/branched/missing_reactants/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/branched/missing_reactants/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/branched/nonstandard_alkoxy_product_coef/config.json b/test/unit/unit_configs/process/branched/nonstandard_alkoxy_product_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/branched/nonstandard_alkoxy_product_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/branched/nonstandard_nitrate_product_coef/config.json b/test/unit/unit_configs/process/branched/nonstandard_nitrate_product_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/branched/nonstandard_nitrate_product_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/branched/nonstandard_reactant_coef/config.json b/test/unit/unit_configs/process/branched/nonstandard_reactant_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/branched/nonstandard_reactant_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/branched/valid/config.json b/test/unit/unit_configs/process/branched/valid/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/branched/valid/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/emission/contains_nonstandard_key/config.json b/test/unit/unit_configs/process/emission/contains_nonstandard_key/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/emission/contains_nonstandard_key/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/emission/missing_MUSICA_name/config.json b/test/unit/unit_configs/process/emission/missing_MUSICA_name/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/emission/missing_MUSICA_name/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/emission/missing_products/config.json b/test/unit/unit_configs/process/emission/missing_products/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/emission/missing_products/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/emission/valid/config.json b/test/unit/unit_configs/process/emission/valid/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/emission/valid/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/first_order_loss/contains_nonstandard_key/config.json b/test/unit/unit_configs/process/first_order_loss/contains_nonstandard_key/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/first_order_loss/contains_nonstandard_key/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/first_order_loss/missing_MUSICA_name/config.json b/test/unit/unit_configs/process/first_order_loss/missing_MUSICA_name/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/first_order_loss/missing_MUSICA_name/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/first_order_loss/missing_reactants/config.json b/test/unit/unit_configs/process/first_order_loss/missing_reactants/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/first_order_loss/missing_reactants/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/first_order_loss/valid/config.json b/test/unit/unit_configs/process/first_order_loss/valid/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/first_order_loss/valid/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/photolysis/contains_nonstandard_key/config.json b/test/unit/unit_configs/process/photolysis/contains_nonstandard_key/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/photolysis/contains_nonstandard_key/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/photolysis/missing_MUSICA_name/config.json b/test/unit/unit_configs/process/photolysis/missing_MUSICA_name/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/photolysis/missing_MUSICA_name/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/photolysis/missing_products/config.json b/test/unit/unit_configs/process/photolysis/missing_products/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/photolysis/missing_products/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/photolysis/missing_reactants/config.json b/test/unit/unit_configs/process/photolysis/missing_reactants/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/photolysis/missing_reactants/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/photolysis/nonstandard_product_coef/config.json b/test/unit/unit_configs/process/photolysis/nonstandard_product_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/photolysis/nonstandard_product_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/photolysis/nonstandard_reactant_coef/config.json b/test/unit/unit_configs/process/photolysis/nonstandard_reactant_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/photolysis/nonstandard_reactant_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/photolysis/valid/config.json b/test/unit/unit_configs/process/photolysis/valid/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/photolysis/valid/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/surface/contains_nonstandard_key/config.json b/test/unit/unit_configs/process/surface/contains_nonstandard_key/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/surface/contains_nonstandard_key/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/surface/missing_MUSICA_name/config.json b/test/unit/unit_configs/process/surface/missing_MUSICA_name/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/surface/missing_MUSICA_name/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/surface/missing_products/config.json b/test/unit/unit_configs/process/surface/missing_products/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/surface/missing_products/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/surface/missing_reactants/config.json b/test/unit/unit_configs/process/surface/missing_reactants/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/surface/missing_reactants/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/surface/nonstandard_product_coef/config.json b/test/unit/unit_configs/process/surface/nonstandard_product_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/surface/nonstandard_product_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/surface/valid/config.json b/test/unit/unit_configs/process/surface/valid/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/surface/valid/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/ternary_chemical_activation/contains_nonstandard_key/config.json b/test/unit/unit_configs/process/ternary_chemical_activation/contains_nonstandard_key/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/ternary_chemical_activation/contains_nonstandard_key/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/ternary_chemical_activation/missing_products/config.json b/test/unit/unit_configs/process/ternary_chemical_activation/missing_products/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/ternary_chemical_activation/missing_products/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/ternary_chemical_activation/missing_reactants/config.json b/test/unit/unit_configs/process/ternary_chemical_activation/missing_reactants/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/ternary_chemical_activation/missing_reactants/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/ternary_chemical_activation/nonstandard_product_coef/config.json b/test/unit/unit_configs/process/ternary_chemical_activation/nonstandard_product_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/ternary_chemical_activation/nonstandard_product_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/ternary_chemical_activation/nonstandard_reactant_coef/config.json b/test/unit/unit_configs/process/ternary_chemical_activation/nonstandard_reactant_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/ternary_chemical_activation/nonstandard_reactant_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/ternary_chemical_activation/valid/config.json b/test/unit/unit_configs/process/ternary_chemical_activation/valid/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/ternary_chemical_activation/valid/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/troe/contains_nonstandard_key/config.json b/test/unit/unit_configs/process/troe/contains_nonstandard_key/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/troe/contains_nonstandard_key/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/troe/missing_products/config.json b/test/unit/unit_configs/process/troe/missing_products/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/troe/missing_products/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/troe/missing_reactants/config.json b/test/unit/unit_configs/process/troe/missing_reactants/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/troe/missing_reactants/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/troe/nonstandard_product_coef/config.json b/test/unit/unit_configs/process/troe/nonstandard_product_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/troe/nonstandard_product_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/troe/nonstandard_reactant_coef/config.json b/test/unit/unit_configs/process/troe/nonstandard_reactant_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/troe/nonstandard_reactant_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/troe/valid/config.json b/test/unit/unit_configs/process/troe/valid/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/troe/valid/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/tunneling/contains_nonstandard_key/config.json b/test/unit/unit_configs/process/tunneling/contains_nonstandard_key/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/tunneling/contains_nonstandard_key/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/tunneling/missing_products/config.json b/test/unit/unit_configs/process/tunneling/missing_products/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/tunneling/missing_products/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/tunneling/missing_reactants/config.json b/test/unit/unit_configs/process/tunneling/missing_reactants/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/tunneling/missing_reactants/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/tunneling/nonstandard_product_coef/config.json b/test/unit/unit_configs/process/tunneling/nonstandard_product_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/tunneling/nonstandard_product_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/tunneling/nonstandard_reactant_coef/config.json b/test/unit/unit_configs/process/tunneling/nonstandard_reactant_coef/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/tunneling/nonstandard_reactant_coef/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/process/tunneling/valid/config.json b/test/unit/unit_configs/process/tunneling/valid/config.json new file mode 100644 index 000000000..38307636f --- /dev/null +++ b/test/unit/unit_configs/process/tunneling/valid/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json", "tolerance.json"]} diff --git a/test/unit/unit_configs/robertson/config.json b/test/unit/unit_configs/robertson/config.json new file mode 100644 index 000000000..61165b00d --- /dev/null +++ b/test/unit/unit_configs/robertson/config.json @@ -0,0 +1 @@ +{"camp-files": ["species.json", "reactions.json"]}