SERiF 0.0.1a
3+1D Stellar Structure and Evolution
Loading...
Searching...
No Matches
polyTest.cpp
Go to the documentation of this file.
1/* ***********************************************************************
2//
3// Copyright (C) 2025 -- The 4D-STAR Collaboration
4// File Author: Emily Boudreaux
5// Last Modified: March 18, 2025
6//
7// 4DSSE is free software; you can use it and/or modify
8// it under the terms and restrictions the GNU General Library Public
9// License version 3 (GPLv3) as published by the Free Software Foundation.
10//
11// 4DSSE is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14// See the GNU Library General Public License for more details.
15//
16// You should have received a copy of the GNU Library General Public License
17// along with this software; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19//
20// *********************************************************************** */
21#include <gtest/gtest.h>
22
23
24#include "quill/LogMacros.h"
25#include "mfem.hpp"
26#include "polySolver.h"
27#include "probe.h"
28#include "config.h"
29
30std::string CONFIG_FILENAME = std::string(getenv("MESON_SOURCE_ROOT")) + "/tests/testsConfig.yaml";
31
32
33class polyTest : public ::testing::Test {};
34
36 using namespace serif::polytrope;
37
38 serif::config::Config& config = serif::config::Config::getInstance();
39 config.loadConfig(CONFIG_FILENAME);
41 quill::Logger* logger = logManager.getLogger("log");
42
43
44 LOG_INFO(logger, "Starting polytrope solve test 1...");
45 config.loadConfig(CONFIG_FILENAME);
46
47 double polytropicIndex = config.get<double>("Tests:Poly:Index", 1);
48 LOG_INFO(logger, "Solving polytrope with n = {:0.2f}", polytropicIndex);
49
50
51 PolySolver polytrope(polytropicIndex, 1);
52 LOG_INFO(logger, "Solving polytrope...");
53 EXPECT_NO_THROW(polytrope.solve());
54 LOG_INFO(logger, "Polytrope solved.");
55}
Solves the Lane-Emden equation for a polytropic star using a mixed finite element method.
Definition polySolver.h:203
Class to manage logging operations.
Definition probe.h:79
quill::Logger * getLogger(const std::string &loggerName)
Get a logger by name.
Definition probe.cpp:219
static LogManager & getInstance()
Get the singleton instance of LogManager.
Definition probe.h:103
std::string CONFIG_FILENAME
Definition polyTest.cpp:30
TEST_F(polyTest, Solve)
Definition polyTest.cpp:35