adaptive refining online! it seems to use a single cpu at a time instead of all, need to check this

This commit is contained in:
Vasco C. B. Ferreira
2026-07-08 22:42:04 +02:00
parent 59b95dd096
commit 5651dd580a
7 changed files with 49 additions and 26 deletions
+7 -5
View File
@@ -132,7 +132,7 @@ void PoissonProblem<dim>::set_rhs_function(
template <int dim>
PoissonProblem<dim>::PoissonProblem(unsigned int degree)
: triangulation(Triangulation<dim>::limit_level_difference_at_vertices),
fe(degree), dof_handler(triangulation), mapping(degree) {}
dof_handler(triangulation), fe(degree), mapping(degree) {}
template <int dim>
std::vector<double>
@@ -208,12 +208,14 @@ std::vector<double> PoissonProblem<dim>::eval_vector_grad(
for (unsigned int p = 0; p < points.size(); ++p) {
const auto cell = cell_locator.locate(points[p]);
const auto cell_location = cell_locator.locate(points[p]);
cell->get_dof_values(solution, local_solution_buffer.begin(),
local_solution_buffer.end());
cell_location.info->cell->get_dof_values(
solution, local_solution_buffer.begin(), local_solution_buffer.end());
evaluator->reinit(cell, ArrayView<const Point<dim>>(&points[p], 1));
evaluator->reinit(
cell_location.info->cell,
ArrayView<const Point<dim>>(&cell_location.reference_point, 1));
evaluator->evaluate(local_solution_buffer, EvaluationFlags::gradients);
values[p] = evaluator->get_gradient(0)[0];