mirror of
https://codeberg.org/vcbferreira/NuFI_deal.ii
synced 2026-08-12 22:43:17 +02:00
corrected saving and eval of fields over time
This commit is contained in:
+24
-33
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user