SERiF 0.0.1a
3+1D Stellar Structure and Evolution
Loading...
Searching...
No Matches
EOSio.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 20, 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 <string>
22#include <utility>
23
24#include "EOSio.h"
25#include "helm.h"
26#include "debug.h"
27
28#include <string>
29
30namespace serif::eos {
31 EOSio::EOSio(const std::string &filename, const EOSFormat format) : m_filename(filename), m_format(format){
32 load();
33 }
34
35 EOSio::EOSio(const EOSio &other) {
36 m_filename = other.m_filename;
37 m_format = other.m_format;
38 load();
39 }
40
42 return m_format;
43 }
44
45
46 std::string EOSio::getFormatName() const {
48 }
49
50
52 return m_table;
53 }
54
55 void EOSio::load() {
57 loadHelm();
58 }
59 }
60
62 // Load the HELM table from the file
64 m_table = std::move(helmTabptr);
65 m_loaded = true;
66 }
67}
std::string m_filename
The filename of the EOS table.
Definition EOSio.h:59
void loadHelm()
Loads the HELM format EOS table.
Definition EOSio.cpp:61
void load()
Loads the EOS table from the file.
Definition EOSio.cpp:55
EOSTable m_table
The EOS table data.
Definition EOSio.h:62
bool m_loaded
Flag indicating if the table is loaded.
Definition EOSio.h:60
EOSio(const std::string &filename, EOSFormat format=EOSFormat::HELM)
Constructs an EosIO object with the given filename.
Definition EOSio.cpp:31
std::string getFormatName() const
Gets the format name (as a string) of the EOS table.
Definition EOSio.cpp:46
EOSFormat m_format
Definition EOSio.h:61
EOSFormat getFormat() const
Definition EOSio.cpp:41
EOSTable & getTable()
Gets the EOS table.
Definition EOSio.cpp:51
Defines a macro for triggering a breakpoint in different compilers and platforms.
std::unique_ptr< HELMTable > read_helm_table(const std::string &filename)
Read the Helmholtz EOS table from a file.
Definition helm.cpp:132
@ HELM
Helmholtz EOS format.
Definition EOSio.h:30
std::variant< std::unique_ptr< serif::eos::helmholtz::HELMTable > > EOSTable
Definition EOSio.h:38
static std::unordered_map< EOSFormat, std::string > FormatStringLookup
Definition EOSio.h:33