corrected saving and eval of fields over time

This commit is contained in:
Vasco C. B. Ferreira
2026-06-26 11:40:10 +02:00
parent 26d0637987
commit 006bd19fe2
10 changed files with 373 additions and 403 deletions
+24 -33
View File
@@ -1,44 +1,35 @@
#include <iostream>
#include <filesystem>
#include <iostream>
#include <nufi/nufi_solver.h>
void clear_results_directory(const std::string &dir)
{
if (!std::filesystem::exists(dir) || !std::filesystem::is_directory(dir))
return;
void clear_results_directory(const std::string &dir) {
if (!std::filesystem::exists(dir) || !std::filesystem::is_directory(dir))
return;
for (const auto &entry : std::filesystem::directory_iterator(dir))
{
if (std::filesystem::is_regular_file(entry))
{
std::filesystem::remove(entry.path());
std::cout << "Deleted: " << entry.path() << '\n';
}
for (const auto &entry : std::filesystem::directory_iterator(dir)) {
if (std::filesystem::is_regular_file(entry)) {
std::filesystem::remove(entry.path());
std::cout << "Deleted: " << entry.path() << '\n';
}
}
}
int main()
{
#include <omp.h>
std::cout << "Threads: " << omp_get_max_threads() << "\n";
try
{
clear_results_directory("results");
int main() {
#include <omp.h>
std::cout << "Threads: " << omp_get_max_threads() << "\n";
try {
clear_results_directory("results");
NuFISolver solver;
solver.run();
}
catch (const std::exception &exc)
{
std::cerr << "\nException:\n" << exc.what() << "\n";
return 1;
}
catch (...)
{
std::cerr << "\nUnknown exception!\n";
return 1;
}
NuFISolver solver;
solver.run();
} catch (const std::exception &exc) {
std::cerr << "\nException:\n" << exc.what() << "\n";
return 1;
} catch (...) {
std::cerr << "\nUnknown exception!\n";
return 1;
}
return 0;
return 0;
}