update on poisson :: refine

This commit is contained in:
Vasco C. B. Ferreira
2026-07-08 11:11:35 +02:00
parent 0ce81fe849
commit cc7cf49a55
2 changed files with 20 additions and 9 deletions
+20 -8
View File
@@ -369,8 +369,14 @@ template <int dim> void PoissonProblem<dim>::assemble_system() {
} }
} }
template <int dim> void PoissonProblem<dim>::coarse_and_refine_grid() { template <int dim>
void PoissonProblem<dim>::coarse_and_refine_grid(
std::vector<Vector<double>> &solution_history) {
// Add refinement and coasring algorithm here // Add refinement and coasring algorithm here
//======//======//
// CHECK step-15.
//======//======//
Vector<float> error_per_cell(triangulation.n_active_cells()); Vector<float> error_per_cell(triangulation.n_active_cells());
KellyErrorEstimator<dim>::estimate( KellyErrorEstimator<dim>::estimate(
@@ -384,15 +390,21 @@ template <int dim> void PoissonProblem<dim>::coarse_and_refine_grid() {
triangulation.prepare_coarsening_and_refinement(); triangulation.prepare_coarsening_and_refinement();
// solution tranafer // old solutions transfer
const size_t N_sols = solution_history.size();
// setup_system SolutionTransfer<dim, Vector<double>> transfer(dof_handler);
transfer.prepare_for_coarsening_and_refinement(solution_history);
// solution_transfer interpolate triangulation.execute_coarsening_and_refinement();
// non_zero_constraint.distribute(current solution)
// setup_system();
//======//======//
// CHECK step-15. transfer.interpolate(solution_history);
solution = solution_history.back();
constraints.distribute(solution);
// rebuild cells with the grid // rebuild cells with the grid
cell_locator.rebuild(dof_handler, triangulation); cell_locator.rebuild(dof_handler, triangulation);
-1
View File
@@ -205,7 +205,6 @@ void NuFISolver::run() {
}); });
poisson.solve_step(); poisson.solve_step();
phi_history.push_back(poisson.get_solution()); phi_history.push_back(poisson.get_solution());
// std::vector<double> sampled_potential = // std::vector<double> sampled_potential =