mirror of
https://codeberg.org/vcbferreira/NuFI_deal.ii
synced 2026-08-12 22:43:17 +02:00
problem identified, ready to converge all branches
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
|
||||
#include "nufi/parameters.h"
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "nufi/nufi_solver.h"
|
||||
|
||||
|
||||
@@ -102,3 +104,15 @@ void save_Efield(unsigned int n,
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
|
||||
void save_space_vector(const std::vector<double>& vals, const std::string& filename, size_t it)
|
||||
{
|
||||
std::ofstream file("results/" + filename + "_" + std::to_string(it) + ".dat");
|
||||
|
||||
if (!file) throw std::runtime_error("failed to start file in results/");
|
||||
|
||||
file << vals.size() << "\n";
|
||||
file << Parameters::X_DOMAIN_LEFT << " " << Parameters::X_DOMAIN_RIGHT << "\n";
|
||||
file << std::fixed << std::setprecision(8);
|
||||
for (double val : vals) file << val << "\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user