mirror of
https://codeberg.org/vcbferreira/NuFI_deal.ii
synced 2026-08-12 14:33:18 +02:00
removal of unused vars/parameters
This commit is contained in:
+2
-5
@@ -14,9 +14,6 @@ constexpr double X_DOMAIN_RIGHT = 4 * M_PI;
|
|||||||
constexpr double LX = std::abs(X_DOMAIN_RIGHT - X_DOMAIN_LEFT);
|
constexpr double LX = std::abs(X_DOMAIN_RIGHT - X_DOMAIN_LEFT);
|
||||||
constexpr double LX_INV = 1 / LX;
|
constexpr double LX_INV = 1 / LX;
|
||||||
|
|
||||||
constexpr size_t CALC_NX = 512;
|
|
||||||
constexpr double CALC_DX = LX / CALC_NX;
|
|
||||||
|
|
||||||
constexpr double V_DOMAIN_LEFT = -10.;
|
constexpr double V_DOMAIN_LEFT = -10.;
|
||||||
constexpr double V_DOMAIN_RIGHT = 10.;
|
constexpr double V_DOMAIN_RIGHT = 10.;
|
||||||
|
|
||||||
@@ -31,7 +28,7 @@ constexpr double DV = std::abs(V_DOMAIN_RIGHT - V_DOMAIN_LEFT) / NV;
|
|||||||
constexpr size_t f0_TYPE = 1;
|
constexpr size_t f0_TYPE = 1;
|
||||||
|
|
||||||
// deal.ii options
|
// deal.ii options
|
||||||
constexpr unsigned int GLOBAL_REFINEMENT = 7;
|
constexpr unsigned int GLOBAL_REFINEMENT = 8;
|
||||||
constexpr unsigned int FE_DEGREE = 3;
|
constexpr unsigned int FE_DEGREE = 3;
|
||||||
constexpr unsigned int CONVERGENCE_ITERATIONS = 5000;
|
constexpr unsigned int CONVERGENCE_ITERATIONS = 5000;
|
||||||
constexpr double CONVERGENCE_LIMIT = 1e-8;
|
constexpr double CONVERGENCE_LIMIT = 1e-8;
|
||||||
@@ -55,7 +52,7 @@ constexpr unsigned int TMAX = 100;
|
|||||||
|
|
||||||
// Plotting options
|
// Plotting options
|
||||||
constexpr int PLOT_FREQUENCY = 10;
|
constexpr int PLOT_FREQUENCY = 10;
|
||||||
constexpr size_t PLOT_NX = CALC_NX;
|
constexpr size_t PLOT_NX = 512;
|
||||||
constexpr double PLOT_DX = LX / PLOT_NX;
|
constexpr double PLOT_DX = LX / PLOT_NX;
|
||||||
const std::string PLOT_DIR = "results/";
|
const std::string PLOT_DIR = "results/";
|
||||||
} // namespace Parameters
|
} // namespace Parameters
|
||||||
|
|||||||
@@ -200,8 +200,6 @@ void NuFISolver::run() {
|
|||||||
std::vector<GridStructure<1>> grid_versions;
|
std::vector<GridStructure<1>> grid_versions;
|
||||||
std::vector<SolutionSnapshot<1>> phi_history;
|
std::vector<SolutionSnapshot<1>> phi_history;
|
||||||
|
|
||||||
std::vector<double> x_eval(Parameters::CALC_NX);
|
|
||||||
|
|
||||||
std::ofstream time_file(Parameters::PLOT_DIR + "simulation_time.dat");
|
std::ofstream time_file(Parameters::PLOT_DIR + "simulation_time.dat");
|
||||||
|
|
||||||
double total_time = 0;
|
double total_time = 0;
|
||||||
@@ -219,13 +217,9 @@ void NuFISolver::run() {
|
|||||||
error_file << "# nufi Kelly l2 error estimate\n";
|
error_file << "# nufi Kelly l2 error estimate\n";
|
||||||
error_file << "# it l2_error_estimate\n";
|
error_file << "# it l2_error_estimate\n";
|
||||||
|
|
||||||
[[maybe_unused]] const double x_min = Parameters::X_DOMAIN_LEFT;
|
|
||||||
[[maybe_unused]] double dx = Parameters::CALC_DX;
|
|
||||||
|
|
||||||
//====//====//
|
//====//====//
|
||||||
// Time loop//
|
// Time loop//
|
||||||
//====//====//
|
//====//====//
|
||||||
|
|
||||||
for (unsigned int it = 0; it < Nt; ++it) {
|
for (unsigned int it = 0; it < Nt; ++it) {
|
||||||
stopwatch<double> timer;
|
stopwatch<double> timer;
|
||||||
|
|
||||||
@@ -242,35 +236,10 @@ void NuFISolver::run() {
|
|||||||
std::cout << "cells = " << poisson.get_triangulation().n_active_cells()
|
std::cout << "cells = " << poisson.get_triangulation().n_active_cells()
|
||||||
<< "\n"
|
<< "\n"
|
||||||
<< " dofs = " << poisson.get_dof_handler().n_dofs() << "\n";
|
<< " dofs = " << poisson.get_dof_handler().n_dofs() << "\n";
|
||||||
// double min_h = 1e100;
|
|
||||||
// double max_h = 0;
|
|
||||||
//
|
|
||||||
// for (auto cell : poisson.triangulation.active_cell_iterators()) {
|
|
||||||
// min_h = std::min(min_h, cell->diameter());
|
|
||||||
// max_h = std::max(max_h, cell->diameter());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// std::cout << "h ratio = " << max_h / min_h << std::endl;
|
|
||||||
// std::vector<double> x = make_x_eval(Parameters::CALC_NX);
|
|
||||||
// auto rho = eval_rho(it, x, grid_versions, phi_history, Parameters::NV);
|
|
||||||
//
|
|
||||||
// double mean = 0;
|
|
||||||
//
|
|
||||||
// for (auto r : rho)
|
|
||||||
// mean += r;
|
|
||||||
//
|
|
||||||
// mean /= rho.size();
|
|
||||||
//
|
|
||||||
// std::cout << "rho mean = " << mean << "\n";
|
|
||||||
// std::cout << "rho min = " << *std::min_element(rho.begin(), rho.end())
|
|
||||||
// << "\n";
|
|
||||||
// std::cout << "rho max = " << *std::max_element(rho.begin(), rho.end())
|
|
||||||
// << "\n";
|
|
||||||
// END: diagnostics
|
// END: diagnostics
|
||||||
|
|
||||||
double compute_start = timer.elapsed();
|
double compute_start = timer.elapsed();
|
||||||
// compute rho
|
// compute rho
|
||||||
//
|
|
||||||
poisson.set_rhs_function([&](const std::vector<Point<1>> &points) {
|
poisson.set_rhs_function([&](const std::vector<Point<1>> &points) {
|
||||||
std::vector<double> x(points.size());
|
std::vector<double> x(points.size());
|
||||||
|
|
||||||
@@ -281,7 +250,6 @@ void NuFISolver::run() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (it % Parameters::REFINE_FREQUENCY == 0) {
|
if (it % Parameters::REFINE_FREQUENCY == 0) {
|
||||||
// if (it == 0) {
|
|
||||||
refine_time = poisson.solve_step(it, grid_versions, true);
|
refine_time = poisson.solve_step(it, grid_versions, true);
|
||||||
compute_time = timer.elapsed() - compute_start - refine_time;
|
compute_time = timer.elapsed() - compute_start - refine_time;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user