Luca Heltai [email protected]
For each of the point below, extend the Poisson class with functions that
perform the indicated tasks, trying to minimize the amount of code you copy and
paste, possibly restructuring existing code by adding arguments to existing
functions, and generating wrappers similar to the run method (e.g.,
run_exercise_3).
Once you created a function that performs the given task, add it to the
poisson-tester.cc file, and make sure all the exercises are run through the
gtest executable, e.g., adding a test for each exercise, as in the following
snippet:
TEST_F(PoissonTester, Exercise3) {
run_exercise_3();
}By the end of this laboratory, you will have modified your Poisson code to allow also non-homogeneous Neumann boundary conditions on different parts of the domain, and you will have added some more options to the solver, enabling usage of a direct solver, or of some more sofisticated preconditioners.
-
See documentation of step-6 at https://www.dealii.org/current/doxygen/deal.II/step_6.html
-
Add the parameters
Mapping degreeMarking strategyEstimator typeCoarsening and refinement factors
where Mapping degree controls the degree of the mapping used in the code,
Marking strategy is a choice between global|fixed_fraction|fixed_number,
Estimator type is a choice between exact|kelly|residual, and
Coarsening and refinement factors is a std::pair<double, double> containing
the arguments to pass to the GridRefinement::refine_and_coarsen_fixed_*
functions
-
Make sure all
FEValuesclasses use a mapping with the correct order, and make sure you use the correct mapping in the output as well (if you have a recent Paraview) -
Add a
Vector<floatfielderror_per_celltoPoisson, to be filled by the methodestimate -
Add a method
residual_error_estimatorthat computes the residual error estimator, usingFEInterfaceValuesandFEValues -
Add a method
estimateto thePoissonclass, to compute the H1 seminorm of the difference between the exact and computed solution ifEstimator typeisexact, callsKellyErrorEstimator<dim>::estimateifEstimator typeiskelly, and callsresidual_error_estimatorifEstimator typeisresidual -
Add to the convergence tables also the estimator you computed. This should be identical to the
H1semi-norm in the case whereEstimator typeisexact -
Taking the exact solution computed on the L-shaped domain, compute the rate at which the adaptive finite element method converges in terms of the number of degrees of freedom using the three estimators above
-
Set zero boundary conditions, forcing term equal to four, exact solution equal to
-x^2-y^2+1and solve the problem on a circle with center in the origin and radius one, for various finite element and mapping degrees. What do you observe when the mapping degree does not match the finite element degree? How do you explain this? -
Create a test that reproduces exactly the behaviour of
step-6, using only your parameter file