Масштабное переобозначение

Улучшение читаемости и понимания кода
This commit is contained in:
ParkSuMin
2025-05-14 18:00:22 +03:00
parent 8100f0d4e1
commit d55f8fa5d3
7 changed files with 57 additions and 50 deletions

View File

@@ -1,7 +1,7 @@
#include "Solver.hpp"
void Solver::SolveExplicit(System& program, double tstop) const {
std::ofstream ExplicitOut(_name_1);
//ExplicitOut << "t x y T" << std::endl;
std::ofstream output(filename_expl);
//output << "t x y T" << std::endl;
for (double t = 0.0; t < tstop; t += delta) {
/* Обработка узлов по оси X */
@@ -44,15 +44,15 @@ void Solver::SolveExplicit(System& program, double tstop) const {
}
for (auto line : program.Nodes()) {
for (auto node : line)
ExplicitOut << t+1 << ' ' << node->X() << ' ' << node->Y() << ' ' << node->T() << '\n';
output << t+1 << ' ' << node->X() << ' ' << node->Y() << ' ' << node->T() << '\n';
}
ExplicitOut << "\n\n";
output << "\n\n";
}
}
void Solver::SolveImplicit(System& sys, double tstop) const {
std::ofstream EmplicitOut(_name_2);
//EmplicitOut << "t x y T" << std::endl;
std::ofstream output(filename_impl);
//output << "t x y T" << std::endl;
for (double t = 0.; t < tstop; t += delta) {
for (auto line : sys.Nodes())
@@ -72,9 +72,9 @@ void Solver::SolveImplicit(System& sys, double tstop) const {
}
for (auto line : sys.Nodes()) {
for (auto node : line)
EmplicitOut << t + 1 << ' ' << node->X() << ' ' << node->Y() << ' ' << node->T() << '\n';
output << t + 1 << ' ' << node->X() << ' ' << node->Y() << ' ' << node->T() << '\n';
}
EmplicitOut << "\n\n";
output << "\n\n";
}
}