mirror of
https://codeberg.org/vcbferreira/NuFI_deal.ii
synced 2026-08-12 14:33:18 +02:00
update on poisson :: refine
This commit is contained in:
+20
-8
@@ -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);
|
||||||
|
|||||||
@@ -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 =
|
||||||
|
|||||||
Reference in New Issue
Block a user