test(tests/poly): started working on tests for ray cast 1D solution
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "quill/LogMacros.h"
|
||||
#include "mfem.hpp"
|
||||
|
||||
#include "polySolver.h"
|
||||
#include "probe.h"
|
||||
|
||||
class polyTest : public ::testing::Test {};
|
||||
|
||||
@@ -11,4 +15,18 @@ TEST_F(polyTest, DefaultConstructor) {
|
||||
TEST_F(polyTest, Solve) {
|
||||
PolySolver polytrope(1.5, 1);
|
||||
EXPECT_NO_THROW(polytrope.solve());
|
||||
Probe::LogManager& logManager = Probe::LogManager::getInstance();
|
||||
quill::Logger* logger = logManager.newFileLogger("polyTest.log", "polyTest");
|
||||
LOG_INFO(logger, "Solving polytrope with n = 1.5, gamma = 1");
|
||||
mfem::Mesh& mesh = polytrope.getMesh();
|
||||
mfem::GridFunction& solution = polytrope.getSolution();
|
||||
|
||||
// Get the mesh radius
|
||||
double radius = Probe::getMeshRadius(mesh);
|
||||
LOG_INFO(logger, "Mesh radius: {}", radius);
|
||||
|
||||
// Get the ray solution
|
||||
const std::vector<double> rayDirection = {0, 0};
|
||||
int numSamples = 10;
|
||||
std::vector<double> samples = Probe::getRaySolution(solution, mesh, rayDirection, numSamples);
|
||||
}
|
||||
Reference in New Issue
Block a user