(here 1e-12) of -1 and 1. Try this immediately after calling
GridGenerator::hyper_cube(), as before:
@code
- for (const auto &cell : dof_handler.active_cell_iterators())
- {
- for (auto &face : cell->face_iterators())
- if ((std::fabs(face->center()(1) - (-1.0)) < 1e-12) ||
- (std::fabs(face->center()(1) - (1.0)) < 1e-12))
- face->set_boundary_id(1);
- }
+ for (auto &face : triangulation.active_face_iterators())
+ if (std::fabs(face->center()(1) - (-1.0)) < 1e-12 ||
+ std::fabs(face->center()(1) - (1.0)) < 1e-12)
+ face->set_boundary_id(1);
@endcode
- Although this code is significantly longer than before, it is useful for
+ Although this code is a bit longer than before, it is useful for
complex geometries, as it does not require knowledge of face labels.
<li>
already here. For example, we could evaluate the value of the solution in a
single point and compare the value for different %numbers of global
refinement (the number of global refinement steps is set in
- <code>LaplaceProblem::make_grid_and_dofs</code> above). To evaluate the
+ <code>LaplaceProblem::make_grid</code> above). To evaluate the
solution at a point, say at $(\frac 13, \frac 13)$, we could add the
following code to the <code>LaplaceProblem::output_results</code> function:
@code