fix(build): started bringing SERiF back up to speed with 4D-STAR C++
Some checks failed
Build and Test / build-and-test-ubuntu (ubuntu-24.04) (push) Has been cancelled
Some checks failed
Build and Test / build-and-test-ubuntu (ubuntu-24.04) (push) Has been cancelled
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
gridfire_p = subproject('GridFire')
|
||||
gridfire_dep = gridfire_p.get_variable('network_dep')
|
||||
# Disabled for dev
|
||||
#gridfire_p = subproject('GridFire')
|
||||
#gridfire_dep = gridfire_p.get_variable('gridfire_dep')
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
config_p = subproject('libconfig')
|
||||
config_dep = config_p.get_variable('config_dep')
|
||||
yaml_cpp_dep = config_p.get_variable('yaml_cpp_dep')
|
||||
@@ -54,9 +54,9 @@ if get_option('build_tests')
|
||||
subdir('tests')
|
||||
endif
|
||||
|
||||
if get_option('build_python')
|
||||
subdir('build-python')
|
||||
endif
|
||||
# if get_option('build_python')
|
||||
# subdir('build-python')
|
||||
# endif
|
||||
|
||||
if get_option('build_post_run_utils')
|
||||
subdir('utils')
|
||||
|
||||
14
src/config/config.h
Normal file
14
src/config/config.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace serif::config {
|
||||
struct SERiFConfig {
|
||||
struct EOS {
|
||||
struct Helm {
|
||||
std::string logFile = "log";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
1
src/config/meson.build
Normal file
1
src/config/meson.build
Normal file
@@ -0,0 +1 @@
|
||||
include_directories('.', install_dir: )
|
||||
@@ -3,6 +3,8 @@
|
||||
#include "helm.h"
|
||||
#include <string>
|
||||
|
||||
#include <ranges>
|
||||
|
||||
namespace serif::eos {
|
||||
EOS::EOS(const EOSio& reader) : m_reader(reader) {}
|
||||
EOS::EOS(const std::string& filename, const EOSFormat format) : m_reader(EOSio(filename, format)) {}
|
||||
@@ -15,7 +17,13 @@ namespace serif::eos {
|
||||
q.rho = in.density; // Density in g/cm^3
|
||||
|
||||
q.abar = in.composition.getMeanParticleMass(); // Mean atomic mass in g
|
||||
q.zbar = in.composition.getMeanAtomicNumber(); // Mean atomic number (dimensionless)
|
||||
|
||||
//TODO: Impliment actual get Mean atomic Number Method
|
||||
q.zbar = 0;
|
||||
for (const auto& sp : in.composition | std::views::keys) {
|
||||
q.zbar += sp.z();
|
||||
}
|
||||
q.zbar /= static_cast<double>(in.composition.size());
|
||||
|
||||
helmholtz::HELMEOSOutput tempOutput;
|
||||
tempOutput = helmholtz::get_helm_EOS(q, *std::get<std::unique_ptr<helmholtz::HELMTable>>(m_reader.getTable()));
|
||||
|
||||
@@ -36,11 +36,12 @@
|
||||
|
||||
|
||||
#include "helm.h"
|
||||
#include "const.h"
|
||||
#include "config.h"
|
||||
#include "fourdst/constants/const.h"
|
||||
#include "fourdst/config/config.h"
|
||||
#include "quill/LogMacros.h"
|
||||
#include "quill/Logger.h"
|
||||
#include "logging.h"
|
||||
#include "fourdst/logging/logging.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -127,10 +128,8 @@ namespace serif::eos::helmholtz {
|
||||
|
||||
// this function reads in the HELM table and stores in the above arrays
|
||||
std::unique_ptr<HELMTable> read_helm_table(const std::string &filename) {
|
||||
fourdst::config::Config& config = fourdst::config::Config::getInstance();
|
||||
auto logFile = config.get<std::string>("EOS:Helm:LogFile", "log");
|
||||
fourdst::logging::LogManager& logManager = fourdst::logging::LogManager::getInstance();
|
||||
quill::Logger* logger = logManager.getLogger(logFile);
|
||||
quill::Logger* logger = logManager.getLogger("log");
|
||||
LOG_INFO(logger, "read_helm_table : Reading HELM table from file {}", filename);
|
||||
|
||||
// Make a unique pointer to the HELMTable
|
||||
@@ -238,10 +237,8 @@ namespace serif::eos::helmholtz {
|
||||
and returns the calculated quantities in the input
|
||||
***/
|
||||
serif::eos::helmholtz::HELMEOSOutput get_helm_EOS(serif::eos::helmholtz::HELMEOSInput &q, const serif::eos::helmholtz::HELMTable &table) {
|
||||
fourdst::config::Config& config = fourdst::config::Config::getInstance();
|
||||
auto logFile = config.get<std::string>("EOS:Helm:LogFile", "log");
|
||||
fourdst::logging::LogManager& logManager = fourdst::logging::LogManager::getInstance();
|
||||
quill::Logger* logger = logManager.getLogger(logFile);
|
||||
quill::Logger* logger = logManager.getLogger("log");
|
||||
|
||||
fourdst::constant::Constants& constants = fourdst::constant::Constants::getInstance();
|
||||
const double pi = std::numbers::pi;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "EOSio.h"
|
||||
#include "helm.h"
|
||||
#include <string>
|
||||
#include "composition.h"
|
||||
#include "fourdst/composition/composition.h"
|
||||
#include <iomanip>
|
||||
|
||||
namespace serif::eos {
|
||||
|
||||
@@ -11,8 +11,8 @@ subdir('probe')
|
||||
subdir('eos')
|
||||
subdir('meshIO')
|
||||
|
||||
# Resouce Manager Libraries
|
||||
subdir('resource')
|
||||
# Resouce Manager Libraries Disabled for dev
|
||||
#subdir('resource')
|
||||
|
||||
# Physics Libraries
|
||||
subdir('polytrope')
|
||||
|
||||
@@ -35,7 +35,7 @@ dependencies = [
|
||||
probe_dep,
|
||||
quill_dep,
|
||||
config_dep,
|
||||
resourceManager_dep,
|
||||
# resourceManager_dep,
|
||||
types_dep,
|
||||
]
|
||||
|
||||
|
||||
@@ -28,22 +28,24 @@
|
||||
#include "mfem.hpp"
|
||||
|
||||
#include "4DSTARTypes.h"
|
||||
#include "config.h"
|
||||
#include "const.h"
|
||||
#include "fourdst/config/config.h"
|
||||
// #include "fourdst/constants/const.h"
|
||||
#include "integrators.h"
|
||||
#include "mfem.hpp"
|
||||
#include "polytropeOperator.h"
|
||||
#include "polyCoeff.h"
|
||||
#include "probe.h"
|
||||
#include "resourceManager.h"
|
||||
#include "resourceManagerTypes.h"
|
||||
// #include "resourceManager.h"
|
||||
// #include "resourceManagerTypes.h"
|
||||
#include "utilities.h"
|
||||
#include "quill/LogMacros.h"
|
||||
#include "logging.h"
|
||||
#include "fourdst/logging/logging.h"
|
||||
|
||||
|
||||
namespace serif::polytrope {
|
||||
|
||||
static mesh::MeshIO loadedMesh("assets/dynamic/mesh/core_midres.msh");
|
||||
|
||||
namespace laneEmden {
|
||||
|
||||
double a (const int k, const double n) { // NOLINT(*-no-recursion)
|
||||
@@ -76,7 +78,7 @@ namespace laneEmden {
|
||||
|
||||
|
||||
PolySolver::PolySolver(mfem::Mesh& mesh, const double n, const double order)
|
||||
: m_config(fourdst::config::Config::getInstance()), // Updated
|
||||
: // m_config(fourdst::config::Config::getInstance()), // Updated
|
||||
m_logManager(fourdst::logging::LogManager::getInstance()),
|
||||
m_logger(m_logManager.getLogger("log")),
|
||||
m_polytropicIndex(n),
|
||||
@@ -104,11 +106,12 @@ mfem::Mesh& PolySolver::prepareMesh(const double n) {
|
||||
if (n > 4.99 || n < 0.0) {
|
||||
throw std::runtime_error("The polytropic index n must be less than 5.0 and greater than 0.0. Currently it is " + std::to_string(n));
|
||||
}
|
||||
const serif::resource::ResourceManager& rm = serif::resource::ResourceManager::getInstance();
|
||||
const serif::resource::types::Resource& genericResource = rm.getResource("mesh:polySphere");
|
||||
const auto &meshIO = std::get<std::unique_ptr<serif::mesh::MeshIO>>(genericResource);
|
||||
meshIO->LinearRescale(polycoeff::x1(n)); // Assumes polycoeff is now serif::polytrope::polycoeff
|
||||
return meshIO->GetMesh();
|
||||
// Disabled for dev
|
||||
// const serif::resource::ResourceManager& rm = serif::resource::ResourceManager::getInstance();
|
||||
// const serif::resource::types::Resource& genericResource = rm.getResource("mesh:polySphere");
|
||||
|
||||
|
||||
return loadedMesh.GetMesh();
|
||||
}
|
||||
|
||||
PolySolver::~PolySolver() = default;
|
||||
@@ -380,10 +383,10 @@ void PolySolver::setInitialGuess() const {
|
||||
(*m_phi)(phiCenterDofs[i]) = 0.0;
|
||||
}
|
||||
|
||||
if (m_config.get<bool>("Poly:Solver:ViewInitialGuess", false)) {
|
||||
serif::probe::glVisView(*m_theta, m_mesh, "θ init");
|
||||
serif::probe::glVisView(*m_phi, m_mesh, "φ init");
|
||||
}
|
||||
// if (m_config.get<bool>("Poly:Solver:ViewInitialGuess", false)) {
|
||||
// serif::probe::glVisView(*m_theta, m_mesh, "θ init");
|
||||
// serif::probe::glVisView(*m_phi, m_mesh, "φ init");
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -392,25 +395,25 @@ void PolySolver::saveAndViewSolution(const mfem::BlockVector& state_vector) cons
|
||||
mfem::Vector& x_theta = x_block.GetBlock(0);
|
||||
mfem::Vector& x_phi = x_block.GetBlock(1);
|
||||
|
||||
if (m_config.get<bool>("Poly:Output:View", false)) {
|
||||
serif::probe::glVisView(x_theta, *m_feTheta, "θ Solution");
|
||||
serif::probe::glVisView(x_phi, *m_fePhi, "ɸ Solution");
|
||||
}
|
||||
// if (m_config.get<bool>("Poly:Output:View", false)) {
|
||||
// serif::probe::glVisView(x_theta, *m_feTheta, "θ Solution");
|
||||
// serif::probe::glVisView(x_phi, *m_fePhi, "ɸ Solution");
|
||||
// }
|
||||
|
||||
// --- Extract the Solution ---
|
||||
if (m_config.get<bool>("Poly:Output:1D:Save", true)) {
|
||||
const auto solutionPath = m_config.get<std::string>("Poly:Output:1D:Path", "polytropeSolution_1D.csv");
|
||||
auto derivSolPath = "d" + solutionPath;
|
||||
|
||||
const auto rayCoLatitude = m_config.get<double>("Poly:Output:1D:RayCoLatitude", 0.0);
|
||||
const auto rayLongitude = m_config.get<double>("Poly:Output:1D:RayLongitude", 0.0);
|
||||
const auto raySamples = m_config.get<int>("Poly:Output:1D:RaySamples", 100);
|
||||
|
||||
const std::vector rayDirection = {rayCoLatitude, rayLongitude};
|
||||
|
||||
serif::probe::getRaySolution(x_theta, *m_feTheta, rayDirection, raySamples, solutionPath);
|
||||
// Probe::getRaySolution(x_phi, *m_fePhi, rayDirection, raySamples, derivSolPath);
|
||||
}
|
||||
// if (m_config.get<bool>("Poly:Output:1D:Save", true)) {
|
||||
// const auto solutionPath = m_config.get<std::string>("Poly:Output:1D:Path", "polytropeSolution_1D.csv");
|
||||
// auto derivSolPath = "d" + solutionPath;
|
||||
//
|
||||
// const auto rayCoLatitude = m_config.get<double>("Poly:Output:1D:RayCoLatitude", 0.0);
|
||||
// const auto rayLongitude = m_config.get<double>("Poly:Output:1D:RayLongitude", 0.0);
|
||||
// const auto raySamples = m_config.get<int>("Poly:Output:1D:RaySamples", 100);
|
||||
//
|
||||
// const std::vector rayDirection = {rayCoLatitude, rayLongitude};
|
||||
//
|
||||
// serif::probe::getRaySolution(x_theta, *m_feTheta, rayDirection, raySamples, solutionPath);
|
||||
// // Probe::getRaySolution(x_phi, *m_fePhi, rayDirection, raySamples, derivSolPath);
|
||||
// }
|
||||
}
|
||||
|
||||
void PolySolver::setOperatorEssentialTrueDofs() const {
|
||||
@@ -420,15 +423,24 @@ void PolySolver::setOperatorEssentialTrueDofs() const {
|
||||
|
||||
void PolySolver::LoadSolverUserParams(double &newtonRelTol, double &newtonAbsTol, int &newtonMaxIter, int &newtonPrintLevel,
|
||||
double &gmresRelTol, double &gmresAbsTol, int &gmresMaxIter, int &gmresPrintLevel) const {
|
||||
newtonRelTol = m_config.get<double>("Poly:Solver:Newton:RelTol", 1.e-4);
|
||||
newtonAbsTol = m_config.get<double>("Poly:Solver:Newton:AbsTol", 1.e-6);
|
||||
newtonMaxIter = m_config.get<int>("Poly:Solver:Newton:MaxIter", 10);
|
||||
newtonPrintLevel = m_config.get<int>("Poly:Solver:Newton:PrintLevel", 3);
|
||||
|
||||
gmresRelTol = m_config.get<double>("Poly:Solver:GMRES:RelTol", 1.e-12);
|
||||
gmresAbsTol = m_config.get<double>("Poly:Solver:GMRES:AbsTol", 1.e-12);
|
||||
gmresMaxIter = m_config.get<int>("Poly:Solver:GMRES:MaxIter", 200);
|
||||
gmresPrintLevel = m_config.get<int>("Poly:Solver:GMRES:PrintLevel", -1);
|
||||
// newtonAbsTol = m_config.get<double>("Poly:Solver:Newton:AbsTol", 1.e-6);
|
||||
// newtonMaxIter = m_config.get<int>("Poly:Solver:Newton:MaxIter", 10);
|
||||
// newtonPrintLevel = m_config.get<int>("Poly:Solver:Newton:PrintLevel", 3);
|
||||
//
|
||||
// gmresRelTol = m_config.get<double>("Poly:Solver:GMRES:RelTol", 1.e-12);
|
||||
// gmresAbsTol = m_config.get<double>("Poly:Solver:GMRES:AbsTol", 1.e-12);
|
||||
// gmresMaxIter = m_config.get<int>("Poly:Solver:GMRES:MaxIter", 200);
|
||||
// gmresPrintLevel = m_config.get<int>("Poly:Solver:GMRES:PrintLevel", -1);
|
||||
|
||||
// The config system has changed, for now just hard code these.
|
||||
newtonAbsTol = 1.0e-6;
|
||||
newtonMaxIter = 10;
|
||||
newtonPrintLevel = 3;
|
||||
gmresRelTol = 1.0e-12;
|
||||
gmresAbsTol = 1.0e-12;
|
||||
gmresMaxIter = 200;
|
||||
gmresPrintLevel = -1;
|
||||
|
||||
LOG_DEBUG(m_logger, "Newton Solver (relTol: {:0.2E}, absTol: {:0.2E}, maxIter: {}, printLevel: {})", newtonRelTol, newtonAbsTol, newtonMaxIter, newtonPrintLevel);
|
||||
LOG_DEBUG(m_logger, "GMRES Solver (relTol: {:0.2E}, absTol: {:0.2E}, maxIter: {}, printLevel: {})", gmresRelTol, gmresAbsTol, gmresMaxIter, gmresPrintLevel);
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
#include "integrators.h"
|
||||
#include "4DSTARTypes.h"
|
||||
#include "polytropeOperator.h"
|
||||
#include "config.h"
|
||||
#include "fourdst/config/config.h"
|
||||
#include "meshIO.h"
|
||||
#include "quill/Logger.h"
|
||||
#include "logging.h"
|
||||
#include "fourdst/logging/logging.h"
|
||||
|
||||
namespace serif {
|
||||
namespace polytrope {
|
||||
@@ -282,7 +282,7 @@ public: // Public methods
|
||||
|
||||
private: // Private Attributes
|
||||
// --- Configuration and Logging ---
|
||||
fourdst::config::Config& m_config; ///< Reference to the global configuration manager instance.
|
||||
// fourdst::config::Config& m_config; ///< Reference to the global configuration manager instance.
|
||||
fourdst::logging::LogManager& m_logManager; ///< Reference to the global log manager instance.
|
||||
quill::Logger* m_logger; ///< Pointer to the specific logger instance for this class.
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
#include <cmath>
|
||||
|
||||
#include "integrators.h"
|
||||
#include "config.h"
|
||||
#include "fourdst/config/config.h"
|
||||
#include <string>
|
||||
|
||||
namespace serif::polytrope::polyMFEMUtils {
|
||||
NonlinearPowerIntegrator::NonlinearPowerIntegrator(const double n) :
|
||||
m_polytropicIndex(n),
|
||||
m_epsilon(fourdst::config::Config::getInstance().get<double>("Poly:Solver:Epsilon", 1.0e-8)) {
|
||||
m_epsilon(1e-8) {
|
||||
|
||||
if (m_polytropicIndex < 0.0) {
|
||||
throw std::invalid_argument("Polytropic index must be non-negative.");
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "mfem_smout.h"
|
||||
#include <memory>
|
||||
|
||||
#include "config.h"
|
||||
#include "fourdst/config/config.h"
|
||||
|
||||
namespace serif {
|
||||
namespace polytrope {
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
|
||||
#include "mfem.hpp"
|
||||
#include <string>
|
||||
#include "config.h"
|
||||
#include "fourdst/config/config.h"
|
||||
#include "probe.h"
|
||||
#include "quill/Logger.h"
|
||||
#include "logging.h"
|
||||
#include "fourdst/logging/logging.h"
|
||||
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,7 @@ namespace serif::polytrope {
|
||||
*/
|
||||
virtual void AssembleElementGrad (const mfem::FiniteElement &el, mfem::ElementTransformation &Trans, const mfem::Vector &elfun, mfem::DenseMatrix &elmat) override;
|
||||
private:
|
||||
fourdst::config::Config& m_config = fourdst::config::Config::getInstance();
|
||||
// fourdst::config::Config& m_config = fourdst::config::Config::getInstance();
|
||||
fourdst::logging::LogManager& m_logManager = fourdst::logging::LogManager::getInstance();
|
||||
quill::Logger* m_logger = m_logManager.getLogger("log");
|
||||
double m_polytropicIndex;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "probe.h"
|
||||
#include "logging.h"
|
||||
#include "fourdst/logging/logging.h"
|
||||
#include "quill/Logger.h"
|
||||
|
||||
namespace serif::polytrope {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "mfem.hpp"
|
||||
|
||||
#include "config.h"
|
||||
#include "fourdst/config/config.h"
|
||||
#include "probe.h"
|
||||
|
||||
#include <thread>
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "quill/LogMacros.h"
|
||||
#include "quill/Logger.h"
|
||||
|
||||
#include "logging.h"
|
||||
#include "fourdst/logging/logging.h"
|
||||
|
||||
|
||||
namespace serif::probe {
|
||||
@@ -57,27 +57,29 @@ void wait(int seconds) {
|
||||
|
||||
void glVisView(mfem::GridFunction& u, mfem::Mesh& mesh,
|
||||
const std::string& windowTitle, const std::string& keyset) {
|
||||
fourdst::config::Config& config = fourdst::config::Config::getInstance();
|
||||
quill::Logger* logger = fourdst::logging::LogManager::getInstance().getLogger("log");
|
||||
if (config.get<bool>("Probe:GLVis:Visualization", true)) {
|
||||
// if (config.get<bool>("Probe:GLVis:Visualization", true)) {
|
||||
std::string usedKeyset;
|
||||
LOG_INFO(logger, "Visualizing solution using GLVis...");
|
||||
LOG_INFO(logger, "Window title: {}", windowTitle);
|
||||
if (keyset.empty()) {
|
||||
usedKeyset = config.get<std::string>("Probe:GLVis:DefaultKeyset", "");
|
||||
// usedKeyset = config.get<std::string>("Probe:GLVis:DefaultKeyset", "");
|
||||
usedKeyset = "";
|
||||
} else {
|
||||
usedKeyset = keyset;
|
||||
}
|
||||
LOG_INFO(logger, "Keyset: {}", usedKeyset);
|
||||
const auto vishost = config.get<std::string>("Probe:GLVis:Host", "localhost");
|
||||
const auto visport = config.get<int>("Probe:GLVis:Port", 19916);
|
||||
// const auto vishost = config.get<std::string>("Probe:GLVis:Host", "localhost");
|
||||
// const auto visport = config.get<int>("Probe:GLVis:Port", 19916);
|
||||
const std::string vishost = "localhost";
|
||||
const int visport = 19916;
|
||||
mfem::socketstream sol_sock(vishost.c_str(), visport);
|
||||
sol_sock.precision(8);
|
||||
sol_sock << "solution\n" << mesh << u
|
||||
<< "window_title '" << windowTitle <<
|
||||
"'\n" << "keys " << usedKeyset << "\n";
|
||||
sol_sock << std::flush;
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
void glVisView(mfem::Vector &vec, mfem::FiniteElementSpace &fes, const std::string &windowTitle, const std::string& keyset) {
|
||||
@@ -109,14 +111,15 @@ double getMeshRadius(mfem::Mesh& mesh) {
|
||||
std::pair<std::vector<double>, std::vector<double>> getRaySolution(mfem::GridFunction& u, mfem::Mesh& mesh,
|
||||
const std::vector<double>& rayDirection,
|
||||
int numSamples, std::string filename) {
|
||||
fourdst::config::Config& config = fourdst::config::Config::getInstance();
|
||||
// fourdst::config::Config& config = fourdst::config::Config::getInstance();
|
||||
fourdst::logging::LogManager& logManager = fourdst::logging::LogManager::getInstance();
|
||||
quill::Logger* logger = logManager.getLogger("log");
|
||||
LOG_INFO(logger, "Getting ray solution...");
|
||||
// Check if the directory to write to exists
|
||||
// If it does not exist and MakeDir is true create it
|
||||
// Otherwise throw an exception
|
||||
bool makeDir = config.get<bool>("Probe:GetRaySolution:MakeDir", true);
|
||||
// bool makeDir = config.get<bool>("Probe:GetRaySolution:MakeDir", true);
|
||||
bool makeDir = true;
|
||||
std::filesystem::path path = filename;
|
||||
|
||||
if (makeDir) {
|
||||
|
||||
@@ -5,7 +5,7 @@ bindings_headers = files('bindings.h')
|
||||
dependencies = [
|
||||
eos_dep,
|
||||
config_dep,
|
||||
resourceManager_dep,
|
||||
# resourceManager_dep,
|
||||
python3_dep,
|
||||
pybind11_dep,
|
||||
]
|
||||
|
||||
@@ -1,8 +1 @@
|
||||
subdir('composition')
|
||||
subdir('const')
|
||||
subdir('config')
|
||||
|
||||
subdir('mfem')
|
||||
subdir('eos')
|
||||
subdir('polytrope')
|
||||
subdir('network')
|
||||
message('Python bindings currently disabled for development')
|
||||
|
||||
@@ -10,7 +10,7 @@ bindings_headers = files(
|
||||
|
||||
dependencies = [
|
||||
config_dep,
|
||||
resourceManager_dep,
|
||||
# resourceManager_dep,
|
||||
python3_dep,
|
||||
pybind11_dep,
|
||||
mpi_dep,
|
||||
|
||||
@@ -5,7 +5,7 @@ bindings_headers = files('bindings.h')
|
||||
dependencies = [
|
||||
polysolver_dep,
|
||||
config_dep,
|
||||
resourceManager_dep,
|
||||
# resourceManager_dep,
|
||||
python3_dep,
|
||||
pybind11_dep,
|
||||
]
|
||||
|
||||
@@ -10,7 +10,6 @@ resourceManager_headers = files(
|
||||
)
|
||||
|
||||
dependencies = [
|
||||
yaml_cpp_dep,
|
||||
opatio_dep,
|
||||
eos_dep,
|
||||
quill_dep,
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "resourceManagerTypes.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "fourdst/config/config.h"
|
||||
|
||||
#define STRINGIFY(x) #x
|
||||
#define TOSTRING(x) STRINGIFY(x)
|
||||
@@ -37,7 +37,8 @@
|
||||
namespace serif::resource {
|
||||
ResourceManager::ResourceManager() {
|
||||
const std::string defaultDataDir = TOSTRING(DATA_DIR);
|
||||
m_dataDir = m_config.get<std::string>("Data:Dir", defaultDataDir);
|
||||
// m_dataDir = m_config.get<std::string>("Data:Dir", defaultDataDir);
|
||||
m_dataDir = defaultDataDir;
|
||||
// -- Get the index file path using filesystem to make it a system safe path
|
||||
const std::string indexFilePath = m_dataDir + "/index.yaml";
|
||||
// TODO Add checks to make sure data dir exists and index.yaml exists
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
#include <unordered_map>
|
||||
|
||||
#include "resourceManagerTypes.h"
|
||||
#include "config.h"
|
||||
#include "fourdst/config/config.h"
|
||||
#include "quill/Logger.h"
|
||||
#include "logging.h"
|
||||
#include "fourdst/logging/logging.h"
|
||||
|
||||
/**
|
||||
* @class ResourceManager
|
||||
@@ -54,11 +54,11 @@ namespace serif::resource {
|
||||
*/
|
||||
ResourceManager& operator=(const ResourceManager&) = delete;
|
||||
|
||||
fourdst::config::Config& m_config = fourdst::config::Config::getInstance();
|
||||
// fourdst::config::Config& m_config = fourdst::config::Config::getInstance();
|
||||
fourdst::logging::LogManager& m_logManager = fourdst::logging::LogManager::getInstance();
|
||||
quill::Logger* m_logger = m_logManager.getLogger("log");
|
||||
|
||||
fourdst::config::Config m_resourceConfig;
|
||||
// fourdst::config::Config m_resourceConfig;
|
||||
std::string m_dataDir;
|
||||
std::unordered_map<std::string, types::Resource> m_resources;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/4D-STAR/GridFire.git
|
||||
revision = v0.0.3a
|
||||
revision = v0.7.4rc2
|
||||
depth = 1
|
||||
@@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/4D-STAR/libcomposition.git
|
||||
revision = v1.0.1
|
||||
revision = v2.3.0
|
||||
depth = 1
|
||||
|
||||
[provide]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/4D-STAR/libconfig.git
|
||||
revision = v1.0.0
|
||||
revision = v2.0.2
|
||||
depth = 1
|
||||
|
||||
[provide]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/4D-STAR/libconstants.git
|
||||
revision = v1.1
|
||||
revision = v1.1.1
|
||||
depth = 1
|
||||
|
||||
[provide]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[wrap-git]
|
||||
url = https://github.com/4D-STAR/liblogging.git
|
||||
revision = v1.0.1
|
||||
revision = v1.1.1
|
||||
depth = 1
|
||||
|
||||
[provide]
|
||||
|
||||
@@ -4,10 +4,10 @@ gtest_main = dependency('gtest_main', required: true)
|
||||
gtest_nomain_dep = dependency('gtest', main: false, required : true)
|
||||
|
||||
# Subdirectories for unit and integration tests
|
||||
subdir('meshIO')
|
||||
subdir('probe')
|
||||
subdir('eos')
|
||||
subdir('resource')
|
||||
#subdir('meshIO')
|
||||
#subdir('probe')
|
||||
#subdir('eos')
|
||||
#subdir('resource')
|
||||
subdir('poly')
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ foreach test_file : test_sources
|
||||
test_exe = executable(
|
||||
exe_name,
|
||||
test_file,
|
||||
dependencies: [gtest_dep, polysolver_dep, probe_dep, quill_dep, config_dep, gtest_main, resourceManager_dep],
|
||||
dependencies: [gtest_dep, polysolver_dep, probe_dep, quill_dep, config_dep, gtest_main],
|
||||
install_rpath: '@loader_path/../../src' # Ensure runtime library path resolves correctly
|
||||
)
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
#include "quill/LogMacros.h"
|
||||
#include "mfem.hpp"
|
||||
#include "polySolver.h"
|
||||
#include "logging.h"
|
||||
#include "config.h"
|
||||
#include "fourdst/logging/logging.h"
|
||||
#include "fourdst/config/config.h"
|
||||
|
||||
std::string CONFIG_FILENAME = std::string(getenv("MESON_SOURCE_ROOT")) + "/tests/testsConfig.yaml";
|
||||
|
||||
@@ -35,20 +35,16 @@ class polyTest : public ::testing::Test {};
|
||||
TEST_F(polyTest, Solve) {
|
||||
using namespace serif::polytrope;
|
||||
|
||||
fourdst::config::Config& config = fourdst::config::Config::getInstance();
|
||||
config.loadConfig(CONFIG_FILENAME);
|
||||
fourdst::logging::LogManager& logManager = fourdst::logging::LogManager::getInstance();
|
||||
quill::Logger* logger = logManager.getLogger("log");
|
||||
|
||||
|
||||
LOG_INFO(logger, "Starting polytrope solve test 1...");
|
||||
config.loadConfig(CONFIG_FILENAME);
|
||||
|
||||
double polytropicIndex = config.get<double>("Tests:Poly:Index", 1);
|
||||
LOG_INFO(logger, "Solving polytrope with n = {:0.2f}", polytropicIndex);
|
||||
// LOG_INFO(logger, "Solving polytrope with n = {:0.2f}", 1);
|
||||
|
||||
|
||||
PolySolver polytrope(polytropicIndex, 1);
|
||||
PolySolver polytrope(1, 1);
|
||||
LOG_INFO(logger, "Solving polytrope...");
|
||||
EXPECT_NO_THROW(polytrope.solve());
|
||||
LOG_INFO(logger, "Polytrope solved.");
|
||||
|
||||
@@ -1 +1 @@
|
||||
subdir('meshView')
|
||||
#subdir('meshView')
|
||||
Reference in New Issue
Block a user