limited grid to be have a small diffence in refinement for neighbour cells

This commit is contained in:
Vasco C. B. Ferreira
2026-07-08 19:58:27 +02:00
parent b9da81076c
commit 576655ae27
3 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ constexpr double X_DOMAIN_RIGHT = 4 * M_PI;
constexpr double LX = std::abs(X_DOMAIN_RIGHT - X_DOMAIN_LEFT);
constexpr double LX_INV = 1 / LX;
constexpr size_t CALC_NX = 128;
constexpr size_t CALC_NX = 256;
constexpr double CALC_DX = LX / CALC_NX;
constexpr double V_DOMAIN_LEFT = -10.;
@@ -25,7 +25,7 @@ constexpr double DV = std::abs(V_DOMAIN_RIGHT - V_DOMAIN_LEFT) / NV;
// deal.ii options
constexpr unsigned int GLOBAL_REFINEMENT = 6;
constexpr unsigned int FE_DEGREE = 2;
constexpr unsigned int CONVERGENCE_ITERATIONS = 10000;
constexpr unsigned int CONVERGENCE_ITERATIONS = 15000;
constexpr double CONVERGENCE_LIMIT = 1e-8;
constexpr double EPS = 0.01;
+4 -2
View File
@@ -131,7 +131,8 @@ void PoissonProblem<dim>::set_rhs_function(
template <int dim>
PoissonProblem<dim>::PoissonProblem(unsigned int degree)
: fe(degree), dof_handler(triangulation), mapping(degree) {}
: triangulation(Triangulation<dim>::limit_level_difference_at_vertices),
fe(degree), dof_handler(triangulation), mapping(degree) {}
template <int dim>
std::vector<double>
@@ -416,7 +417,8 @@ void PoissonProblem<dim>::coarse_and_refine_grid(
constraints.distribute(solution);
cell_locator.rebuild(dof_handler, triangulation);
// cell_locator.rebuild(dof_handler, triangulation); // No need to be called
// again because its in setup_system();
std::cout << "Refinement Finished" << "\n";