build(libcomposition): brought working build system into libcomposition
This commit is contained in:
@@ -8,10 +8,10 @@ composition_headers = files(
|
||||
)
|
||||
|
||||
dependencies = [
|
||||
probe_dep,
|
||||
quill_dep,
|
||||
species_weight_dep,
|
||||
const_dep,
|
||||
config_dep,
|
||||
log_dep
|
||||
]
|
||||
|
||||
# Define the libcomposition library so it can be linked against by other parts of the build system
|
||||
@@ -30,4 +30,4 @@ composition_dep = declare_dependency(
|
||||
)
|
||||
|
||||
# Make headers accessible
|
||||
install_headers(composition_headers, subdir : 'SERiF/composition')
|
||||
install_headers(composition_headers, subdir : 'libcomposition/composition')
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
#include "atomicSpecies.h"
|
||||
#include "species.h"
|
||||
|
||||
namespace serif::composition {
|
||||
namespace fourdst::composition {
|
||||
|
||||
CompositionEntry::CompositionEntry() : m_symbol("H-1"), m_isotope(serif::atomic::species.at("H-1")),
|
||||
CompositionEntry::CompositionEntry() : m_symbol("H-1"), m_isotope(fourdst::atomic::species.at("H-1")),
|
||||
m_initialized(false) {
|
||||
}
|
||||
|
||||
CompositionEntry::CompositionEntry(const std::string& symbol, const bool massFracMode) : m_symbol(symbol), m_isotope(serif::atomic::species.at(symbol)), m_massFracMode(massFracMode) {
|
||||
CompositionEntry::CompositionEntry(const std::string& symbol, const bool massFracMode) : m_symbol(symbol), m_isotope(fourdst::atomic::species.at(symbol)), m_massFracMode(massFracMode) {
|
||||
setSpecies(symbol);
|
||||
}
|
||||
|
||||
@@ -56,11 +56,11 @@ namespace serif::composition {
|
||||
if (m_initialized) {
|
||||
throw std::runtime_error("Composition entry is already initialized.");
|
||||
}
|
||||
if (serif::atomic::species.count(symbol) == 0) {
|
||||
if (fourdst::atomic::species.count(symbol) == 0) {
|
||||
throw std::runtime_error("Invalid symbol.");
|
||||
}
|
||||
m_symbol = symbol;
|
||||
m_isotope = serif::atomic::species.at(symbol);
|
||||
m_isotope = fourdst::atomic::species.at(symbol);
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace serif::composition {
|
||||
return m_relAbundance;
|
||||
}
|
||||
|
||||
serif::atomic::Species CompositionEntry::isotope() const {
|
||||
fourdst::atomic::Species CompositionEntry::isotope() const {
|
||||
return m_isotope;
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace serif::composition {
|
||||
}
|
||||
|
||||
bool Composition::isValidSymbol(const std::string& symbol) {
|
||||
return serif::atomic::species.contains(symbol);
|
||||
return fourdst::atomic::species.contains(symbol);
|
||||
}
|
||||
|
||||
double Composition::setMassFraction(const std::string& symbol, const double& mass_fraction) {
|
||||
@@ -652,7 +652,7 @@ namespace serif::composition {
|
||||
return m_compositions.count(symbol) > 0;
|
||||
}
|
||||
|
||||
bool Composition::contains(const serif::atomic::Species &isotope) const {
|
||||
bool Composition::contains(const fourdst::atomic::Species &isotope) const {
|
||||
// Check if the isotope's symbol is in the composition
|
||||
if (!m_finalized) {
|
||||
LOG_ERROR(m_logger, "Composition has not been finalized.");
|
||||
@@ -696,4 +696,4 @@ namespace serif::composition {
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace serif::composition
|
||||
} // namespace fourdst::composition
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "probe.h"
|
||||
#include "config.h"
|
||||
#include "logging.h"
|
||||
|
||||
#include "atomicSpecies.h"
|
||||
|
||||
namespace serif::composition {
|
||||
namespace fourdst::composition {
|
||||
struct CanonicalComposition {
|
||||
double X = 0.0; ///< Mass fraction of Hydrogen.
|
||||
double Y = 0.0; ///< Mass fraction of Helium.
|
||||
@@ -63,7 +63,7 @@ namespace serif::composition {
|
||||
*/
|
||||
struct CompositionEntry {
|
||||
std::string m_symbol; ///< The chemical symbol of the species.
|
||||
serif::atomic::Species m_isotope; ///< The isotope of the species.
|
||||
fourdst::atomic::Species m_isotope; ///< The isotope of the species.
|
||||
bool m_massFracMode = true; ///< The mode of the composition entry. True if mass fraction, false if number fraction.
|
||||
|
||||
double m_massFraction = 0.0; ///< The mass fraction of the species.
|
||||
@@ -142,7 +142,7 @@ namespace serif::composition {
|
||||
* @brief Gets the isotope of the species.
|
||||
* @return The isotope of the species.
|
||||
*/
|
||||
serif::atomic::Species isotope() const;
|
||||
fourdst::atomic::Species isotope() const;
|
||||
|
||||
/**
|
||||
* @brief Gets the mode of the composition entry.
|
||||
@@ -215,8 +215,8 @@ namespace serif::composition {
|
||||
*/
|
||||
class Composition {
|
||||
private:
|
||||
serif::config::Config& m_config = serif::config::Config::getInstance();
|
||||
serif::probe::LogManager& m_logManager = serif::probe::LogManager::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");
|
||||
|
||||
bool m_finalized = false; ///< True if the composition is finalized.
|
||||
@@ -473,7 +473,7 @@ namespace serif::composition {
|
||||
*/
|
||||
bool hasSymbol(const std::string& symbol) const;
|
||||
|
||||
bool contains(const serif::atomic::Species& isotope) const;
|
||||
bool contains(const fourdst::atomic::Species& isotope) const;
|
||||
|
||||
/**
|
||||
* @brief Sets the composition mode.
|
||||
@@ -508,4 +508,4 @@ namespace serif::composition {
|
||||
Composition operator+(const Composition& other) const;
|
||||
|
||||
};
|
||||
}; // namespace serif::composition
|
||||
}; // namespace fourdst::composition
|
||||
|
||||
1
src/meson.build
Normal file
1
src/meson.build
Normal file
@@ -0,0 +1 @@
|
||||
subdir('composition')
|
||||
Reference in New Issue
Block a user