fix(resource-manager): fixed old style calls to opat-core
tboudreaux:feature/mixedPolytrope implimented a fix to bring old style opat-core calls to the more up to date style. This change has been fast forwarded into main
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -74,3 +74,5 @@ output/
|
||||
.boost_installed
|
||||
4DSSE_logs/
|
||||
.last_build_flags
|
||||
|
||||
.idea/
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
yaml_cpp_cmake_options = cmake.subproject_options()
|
||||
yaml_cpp_cmake_options.add_cmake_defines({
|
||||
'CMAKE_POLICY_VERSION_MINIMUM': '3.5'
|
||||
})
|
||||
yaml_cpp_sp = cmake.subproject(
|
||||
'yaml-cpp'
|
||||
'yaml-cpp',
|
||||
options: yaml_cpp_cmake_options,
|
||||
)
|
||||
yaml_cpp_dep = yaml_cpp_sp.dependency('yaml-cpp')
|
||||
add_project_arguments('-I' + meson.current_build_dir() + '/subprojects/yaml-cpp/__CMake_build', language: 'cpp')
|
||||
@@ -1,3 +1,23 @@
|
||||
/* ***********************************************************************
|
||||
//
|
||||
// Copyright (C) 2025 -- The 4D-STAR Collaboration
|
||||
// File Author: Emily Boudreaux
|
||||
// Last Modified: March 20, 2025
|
||||
//
|
||||
// 4DSSE is free software; you can use it and/or modify
|
||||
// it under the terms and restrictions the GNU General Library Public
|
||||
// License version 3 (GPLv3) as published by the Free Software Foundation.
|
||||
//
|
||||
// 4DSSE is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Library General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Library General Public License
|
||||
// along with this software; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// *********************************************************************** */
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
/* ***********************************************************************
|
||||
//
|
||||
// Copyright (C) 2025 -- The 4D-STAR Collaboration
|
||||
// File Author: Emily Boudreaux
|
||||
// Last Modified: April 09, 2025
|
||||
//
|
||||
// 4DSSE is free software; you can use it and/or modify
|
||||
// it under the terms and restrictions the GNU General Library Public
|
||||
// License version 3 (GPLv3) as published by the Free Software Foundation.
|
||||
//
|
||||
// 4DSSE is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Library General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Library General Public License
|
||||
// along with this software; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// *********************************************************************** */
|
||||
#include <string>
|
||||
|
||||
#include "resourceManagerTypes.h"
|
||||
@@ -22,7 +42,7 @@ std::string getFirstSegment(const std::string& input) {
|
||||
Resource createResource(const std::string& type, const std::string& path) {
|
||||
static const std::unordered_map<std::string, std::function<Resource(const std::string&)>> factoryMap = {
|
||||
{"opac", [](const std::string& p) { return Resource(
|
||||
std::make_unique<OpatIO>(p));
|
||||
std::make_unique<opat::OPAT>(opat::readOPAT(p)));
|
||||
}},
|
||||
{"mesh", [](const std::string& p) { return Resource(
|
||||
std::make_unique<MeshIO>(p));
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
/* ***********************************************************************
|
||||
//
|
||||
// Copyright (C) 2025 -- The 4D-STAR Collaboration
|
||||
// File Author: Emily Boudreaux
|
||||
// Last Modified: March 20, 2025
|
||||
//
|
||||
// 4DSSE is free software; you can use it and/or modify
|
||||
// it under the terms and restrictions the GNU General Library Public
|
||||
// License version 3 (GPLv3) as published by the Free Software Foundation.
|
||||
//
|
||||
// 4DSSE is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Library General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Library General Public License
|
||||
// along with this software; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// *********************************************************************** */
|
||||
#ifndef RESOURCE_MANAGER_H
|
||||
#define RESOURCE_MANAGER_H
|
||||
|
||||
|
||||
@@ -1,3 +1,23 @@
|
||||
/* ***********************************************************************
|
||||
//
|
||||
// Copyright (C) 2025 -- The 4D-STAR Collaboration
|
||||
// File Author: Emily Boudreaux
|
||||
// Last Modified: April 09, 2025
|
||||
//
|
||||
// 4DSSE is free software; you can use it and/or modify
|
||||
// it under the terms and restrictions the GNU General Library Public
|
||||
// License version 3 (GPLv3) as published by the Free Software Foundation.
|
||||
//
|
||||
// 4DSSE is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
// See the GNU Library General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Library General Public License
|
||||
// along with this software; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
// *********************************************************************** */
|
||||
#ifndef RESOURCE_MANAGER_TYPES_H
|
||||
#define RESOURCE_MANAGER_TYPES_H
|
||||
|
||||
@@ -30,7 +50,7 @@
|
||||
* @endcode
|
||||
*/
|
||||
using Resource = std::variant<
|
||||
std::unique_ptr<OpatIO>,
|
||||
std::unique_ptr<opat::OPAT>,
|
||||
std::unique_ptr<MeshIO>,
|
||||
std::unique_ptr<EosIO>>;
|
||||
|
||||
|
||||
@@ -16,6 +16,5 @@ subdir('composition')
|
||||
|
||||
# Subdirectories for sandbox tests
|
||||
subdir('dobj_sandbox')
|
||||
subdir('opatIO_sandbox')
|
||||
subdir('composition_sandbox')
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
executable('tryGS98', 'opacity.cpp', dependencies: [opatio_dep])
|
||||
@@ -1,28 +0,0 @@
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
//#include <string>
|
||||
#include "opatIO.h"
|
||||
|
||||
|
||||
int main() {
|
||||
|
||||
std::string FILENAME = "GS98hz.opat";
|
||||
OpatIO opatIO(FILENAME);
|
||||
Header header = opatIO.getHeader();
|
||||
std::cout << header.version << std::endl;
|
||||
std::cout << header.comment << std::endl;
|
||||
std::cout << header.numTables << std::endl;
|
||||
|
||||
std::vector<TableIndex> tableIndex = opatIO.getTableIndex();
|
||||
|
||||
//print out the X,Z pairs in the table
|
||||
for (size_t i=0; i< tableIndex.size()-1; i++){
|
||||
std::cout << "Table [" << i << "]: {" << tableIndex[i].index.at(0) << ", "
|
||||
<< tableIndex[i].index.at(1) << "}" << std::endl;
|
||||
}
|
||||
|
||||
//find the table index corresponding to X=0.1, Z=0.001
|
||||
std::vector<double> index = {0.1, 0.001};
|
||||
OPATTable tab = opatIO.getTable(index);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user