8 #include <wmtk/components/utils/Paths.hpp>
14 #include <components_include.hpp>
21 const std::filesystem::path wmtk_spec_file = WMTK_APP_INPUT_SPEC;
24 std::ifstream f(wmtk_spec_file);
27 "Could not open wmtk specification file: {}",
28 wmtk_spec_file.string());
30 rules_json = nlohmann::json::parse(f);
34 spec_engine.strict = strict;
37 #include <spec_include.hpp>
38 rules_json = spec_engine.inject_include(rules_json);
42 bool r = spec_engine.verify_json(json_input_file, rules_json);
46 spec_json = spec_engine.inject_defaults(json_input_file, rules_json);
57 wmtk::logger().set_level(spec_json[
"settings"][
"log_level"]);
61 const std::string root_path = spec_json[
"root_path"];
63 const std::string output_dir =
65 if (!output_dir.empty()) {
66 std::filesystem::create_directories(output_dir);
76 #include <components_map.hpp>
79 paths.root_path = root_path;
80 paths.output_dir = output_dir;
82 logger().info(
"Root path: {}, output dir: {}", root_path, output_dir);
88 for (
const nlohmann::json& component_json : spec_json[
"components"]) {
89 for (
auto& el : component_json.items()) {
92 components[el.key()](paths, el.value(), cache);
void flush_multimeshes()
Unsets the mesh held by each cached mm - useful for debugging whether cache loading works.
fs::path resolve_path(const fs::path &root, const fs::path &path)
wmtk::io::Cache run_components(const nlohmann::json &json_input_file, bool strict)
bool has_user_overloaded_logger_level()
void log_and_throw_error(const std::string &msg)
spdlog::logger & logger()
Retrieves the current logger.
spdlog::logger & opt_logger()
Retrieves the logger for the optimization.