fix(headers): moved all headers to fourdst/
This commit is contained in:
108
src/composition/include/fourdst/composition/atomicSpecies.h
Normal file
108
src/composition/include/fourdst/composition/atomicSpecies.h
Normal file
@@ -0,0 +1,108 @@
|
||||
#pragma once
|
||||
#include <unordered_map>
|
||||
#include <string_view>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
namespace fourdst::atomic {
|
||||
struct Species {
|
||||
std::string m_name; //< Name of the species
|
||||
std::string m_el; //< Element symbol
|
||||
int m_nz; //< NZ
|
||||
int m_n; //< N
|
||||
int m_z; //< Z
|
||||
int m_a; //< A
|
||||
double m_bindingEnergy; //< Binding energy
|
||||
std::string m_betaCode; //< Beta decay code
|
||||
double m_betaDecayEnergy; //< Beta decay energy
|
||||
double m_atomicMass; //< Atomic mass
|
||||
double m_atomicMassUnc; //< Atomic mass uncertainty
|
||||
|
||||
Species(const std::string_view name, const std::string_view el, const int nz, const int n, const int z, const int a, const double bindingEnergy, const std::string_view betaCode, const double betaDecayEnergy, const double atomicMass, const double atomicMassUnc)
|
||||
: m_name(name), m_el(el), m_nz(nz), m_n(n), m_z(z), m_a(a), m_bindingEnergy(bindingEnergy), m_betaCode(betaCode), m_betaDecayEnergy(betaDecayEnergy), m_atomicMass(atomicMass), m_atomicMassUnc(atomicMassUnc) {};
|
||||
|
||||
//Copy constructor
|
||||
Species(const Species& species) {
|
||||
m_name = species.m_name;
|
||||
m_el = species.m_el;
|
||||
m_nz = species.m_nz;
|
||||
m_n = species.m_n;
|
||||
m_z = species.m_z;
|
||||
m_a = species.m_a;
|
||||
m_bindingEnergy = species.m_bindingEnergy;
|
||||
m_betaCode = species.m_betaCode;
|
||||
m_betaDecayEnergy = species.m_betaDecayEnergy;
|
||||
m_atomicMass = species.m_atomicMass;
|
||||
m_atomicMassUnc = species.m_atomicMassUnc;
|
||||
}
|
||||
|
||||
|
||||
double mass() const {
|
||||
return m_atomicMass;
|
||||
}
|
||||
|
||||
double massUnc() const {
|
||||
return m_atomicMassUnc;
|
||||
}
|
||||
|
||||
double bindingEnergy() const {
|
||||
return m_bindingEnergy;
|
||||
}
|
||||
|
||||
double betaDecayEnergy() const {
|
||||
return m_betaDecayEnergy;
|
||||
}
|
||||
|
||||
std::string_view betaCode() const {
|
||||
return m_betaCode;
|
||||
}
|
||||
|
||||
std::string_view name() const {
|
||||
return m_name;
|
||||
}
|
||||
|
||||
std::string_view el() const {
|
||||
return m_el;
|
||||
}
|
||||
|
||||
int nz() const {
|
||||
return m_nz;
|
||||
}
|
||||
|
||||
int n() const {
|
||||
return m_n;
|
||||
}
|
||||
|
||||
int z() const {
|
||||
return m_z;
|
||||
}
|
||||
|
||||
int a() const {
|
||||
return m_a;
|
||||
}
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& os, const Species& species) {
|
||||
os << species.m_name << " (" << species.m_atomicMass << " u)";
|
||||
return os;
|
||||
}
|
||||
|
||||
friend bool operator==(const Species& lhs, const Species& rhs);
|
||||
friend bool operator!=(const Species& lhs, const Species& rhs);
|
||||
};
|
||||
inline bool operator==(const Species& lhs, const Species& rhs) {
|
||||
return (lhs.m_name == rhs.m_name);
|
||||
}
|
||||
inline bool operator!=(const Species& lhs, const Species& rhs) {
|
||||
return (lhs.m_name != rhs.m_name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
namespace std {
|
||||
template<>
|
||||
struct hash<fourdst::atomic::Species> {
|
||||
size_t operator()(const fourdst::atomic::Species& s) const noexcept {
|
||||
return std::hash<std::string>()(s.m_name);
|
||||
}
|
||||
};
|
||||
} // namespace std
|
||||
@@ -27,10 +27,9 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "config.h"
|
||||
#include "logging.h"
|
||||
|
||||
#include "atomicSpecies.h"
|
||||
#include "fourdst/config/config.h"
|
||||
#include "fourdst/logging/logging.h"
|
||||
#include "fourdst/composition/atomicSpecies.h"
|
||||
|
||||
namespace fourdst::composition {
|
||||
struct CanonicalComposition {
|
||||
17802
src/composition/include/fourdst/composition/species.h
Normal file
17802
src/composition/include/fourdst/composition/species.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -18,8 +18,6 @@
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// *********************************************************************** */
|
||||
#include "composition.h"
|
||||
#include "const.h"
|
||||
#include "quill/LogMacros.h"
|
||||
|
||||
#include <stdexcept>
|
||||
@@ -30,8 +28,10 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "atomicSpecies.h"
|
||||
#include "species.h"
|
||||
#include "fourdst/composition/atomicSpecies.h"
|
||||
#include "fourdst/composition/species.h"
|
||||
#include "fourdst/composition/composition.h"
|
||||
#include "fourdst/constants/const.h"
|
||||
|
||||
namespace fourdst::composition {
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
# Define the library
|
||||
composition_sources = files(
|
||||
'private/composition.cpp',
|
||||
required_headers = [
|
||||
'fourdst/composition/atomicSpecies.h',
|
||||
'fourdst/composition/species.h',
|
||||
'fourdst/composition/composition.h'
|
||||
]
|
||||
|
||||
foreach h : required_headers
|
||||
if not cpp.has_header(h, include_directories: include_directories('include'))
|
||||
error('libcomposition requires the header file ' + h + ' to be present in the fourdst/composition directory.')
|
||||
endif
|
||||
endforeach
|
||||
|
||||
species_weight_dep = declare_dependency(
|
||||
include_directories: include_directories('include'),
|
||||
)
|
||||
|
||||
composition_headers = files(
|
||||
'public/composition.h'
|
||||
message('✅ libcomposition species_weight dependency declared')
|
||||
|
||||
composition_sources = files(
|
||||
'lib/composition.cpp',
|
||||
)
|
||||
|
||||
|
||||
dependencies = [
|
||||
species_weight_dep,
|
||||
const_dep,
|
||||
@@ -17,17 +31,20 @@ dependencies = [
|
||||
# Define the libcomposition library so it can be linked against by other parts of the build system
|
||||
libcomposition = library('composition',
|
||||
composition_sources,
|
||||
include_directories: include_directories('public'),
|
||||
cpp_args: ['-fvisibility=default'],
|
||||
dependencies: dependencies,
|
||||
install : true)
|
||||
|
||||
composition_dep = declare_dependency(
|
||||
include_directories: include_directories('public'),
|
||||
link_with: libcomposition,
|
||||
dependencies: dependencies,
|
||||
sources: composition_sources,
|
||||
)
|
||||
|
||||
# Make headers accessible
|
||||
composition_headers = files(
|
||||
'include/fourdst/composition/composition.h',
|
||||
'include/fourdst/composition/atomicSpecies.h',
|
||||
'include/fourdst/composition/species.h'
|
||||
)
|
||||
install_headers(composition_headers, subdir : 'fourdst/fourdst/composition')
|
||||
|
||||
Reference in New Issue
Block a user