#include #include #include "quill/LogMacros.h" #include "mfem.hpp" #include "polySolver.h" #include "probe.h" #include "config.h" #include "meshIO.h" std::string CONFIG_FILENAME = std::string(getenv("MESON_SOURCE_ROOT")) + "/tests/testsConfig.yaml"; std::string SPHERICAL_MESH = std::string(getenv("MESON_SOURCE_ROOT")) + "/src/resources/mesh/core.msh"; class polyTest : public ::testing::Test {}; TEST_F(polyTest, Solve) { Config& config = Config::getInstance(); config.loadConfig(CONFIG_FILENAME); Probe::LogManager& logManager = Probe::LogManager::getInstance(); quill::Logger* logger = logManager.getLogger("log"); LOG_INFO(logger, "Starting polytrope solve test 1..."); config.loadConfig(CONFIG_FILENAME); double polyRadius = config.get("Tests:Poly:Radius", std::numbers::pi); MeshIO meshIO(SPHERICAL_MESH, polyRadius); mfem::Mesh& mesh = meshIO.GetMesh(); double radius = Probe::getMeshRadius(mesh); LOG_INFO(logger, "Mesh radius: {}", radius); double polytropicIndex = config.get("Tests:Poly:Index", 1); LOG_INFO(logger, "Solving polytrope with n = {:0.2f}", polytropicIndex); PolySolver polytrope(polytropicIndex, 1, mesh); LOG_INFO(logger, "Solving polytrope..."); EXPECT_NO_THROW(polytrope.solve()); LOG_INFO(logger, "Polytrope solved."); }