Began porting the mapping system

This commit is contained in:
2026-09-20 14:37:11 -04:00
parent f69fac8f1e
commit 08a8f231d2
46 changed files with 1336 additions and 115 deletions

View File

@@ -4,10 +4,19 @@ if get_option('build_tests')
# test_include_dir = include_directories('include')
#
# catch2_dep = dependency('Catch2', required:true)
stroid_dep = dependency('stroid', required:true)
# Stroid exchanges MFEM and standard-library objects with the sandboxes.
# Always build it against the parent's MFEM and C++ ABI, never an unrelated
# installed archive (even when pkg-config reports one).
stroid_project = subproject('stroid', default_options: [
'build_tests=false',
'build_tools=false',
'build_python=false',
'pkg_config=false',
])
stroid_dep = stroid_project.get_variable('stroid_dep')
#
# test_sources = discretization_test_sources
# executable('serif_tests', test_sources, dependencies: [serif_dep, catch2_dep, stroid_dep], include_directories: test_include_dir)
subdir('sandbox')
endif
endif

View File

@@ -10,17 +10,15 @@
#include "serif/eos/runtime/concepts.hpp"
#include "serif/eos/runtime/views.hpp"
int main() {
const serif::eos::models::Polytrope polytrope(1, 0.6);
std::println("Density: {}", serif::eos::evaluate<serif::dimensions::Density>(polytrope, serif::dimensions::SpecificEnthalpyValue{1.0}).value());
const serif::eos::runtime::EOSView view(polytrope);
const auto result = view.try_evaluate<serif::dimensions::Density>(serif::dimensions::SpecificEnthalpyValue{1.0});
if (result.has_value()) {
std::println("From runtime view: Density: {}", result->value());
} else {
std::println("From runtime view: EOS view is unavailable.");
}
std::println("{}", serif::discretization::blocks::gravity::name);
const serif::eos::models::Polytrope polytrope(-1, 0.6);
// std::println("Density: {}", serif::eos::evaluate<serif::dimensions::Density>(polytrope, serif::dimensions::SpecificEnthalpyValue{1.0}).value());
// const serif::eos::runtime::EOSView view(polytrope);
// const auto result = view.try_evaluate<serif::dimensions::Density>(serif::dimensions::SpecificEnthalpyValue{1.0});
// if (result.has_value()) {
// std::println("From runtime view: Density: {}", result->value());
// } else {
// std::println("From runtime view: EOS view is unavailable.");
// }
//
// std::println("{}", serif::discretization::blocks::gravity::name);
}

View File

@@ -0,0 +1,12 @@
#include <print>
#include "serif/mapping/context.hpp"
#include "serif/mapping/variation.hpp"
#include "serif/mapping/compactification/compactification.hpp"
#include "serif/mapping/status.hpp"
#include "serif/mapping/compactification/kelvin.hpp"
#include "serif/utils/user_options/mapping/compactification/kelvin.hpp"
int main() {
std::println("Hello, World!");
}

View File

@@ -5,13 +5,33 @@ sandboxes = [
'dimensions_sandbox',
'quadrature_sandbox',
'meta_sandbox',
'mapping_sandbox'
]
expected_errors = {}
foreach entry : get_option('sandbox_expected_errors')
parts = entry.split(':')
if parts.length() != 2 or parts[0] not in sandboxes or parts[1] == ''
error('Invalid sandbox_expected_errors entry: ' + entry)
endif
expected_errors += {parts[0]: parts[1]}
endforeach
foreach sandbox: sandboxes
executable(
sandbox_exe = executable(
sandbox,
sandbox + '.cpp',
dependencies: [serif_dep, stroid_dep, nameof_dep],
build_rpath: mfem_runtime_prefix == '' ? '' : mfem_runtime_prefix / 'lib',
)
if expected_errors.has_key(sandbox)
test(
sandbox, python_build,
args: [files('../../tools/check_sandbox_error.py'), sandbox_exe, expected_errors[sandbox]],
workdir: meson.project_source_root(),
suite: 'sandbox',
)
else
test(sandbox, sandbox_exe, workdir: meson.project_source_root(), suite: 'sandbox')
endif
endforeach