|
Saddle-Point
|
Solves the two-component saddle-point Laplace system on a disk. More...
#include <step-6.h>
Classes | |
| class | Parameters |
| Run-time options read from a ParameterHandler input file. More... | |
Public Member Functions | |
| SaddlePointProblem (const Parameters ¶meters) | |
| Build a SaddlePointProblem problem from a fully populated Parameters object. | |
| void | run () |
| Top-level driver that performs the adaptive-refinement loop. | |
Solves the two-component saddle-point Laplace system on a disk.
The SaddlePointProblem class implements the full solve-cycle for the saddle-point problem described on the Introduction page. It owns the Triangulation, the FESystem (two copies of a scalar \(Q_k\) element), the DoFHandler, the constraint object that stores both hanging-node and Dirichlet constraints, the sparsity pattern, and the global system matrix and vectors.
The class is implemented as a template in the spatial dimension dim so that the same code can in principle be reused for 2D and 3D triangulations (in practice the program is only instantiated for dim = 2 because the manufactured solution and the right-hand sides are written for the 2D problem).
Typical usage from main():
| dim | Spatial dimension of the Laplace problem (currently 2). |
| SaddlePointProblem< dim >::SaddlePointProblem | ( | const Parameters & | parameters | ) |
Build a SaddlePointProblem problem from a fully populated Parameters object.
The constructor stores a reference to parameters, creates a vector-valued FESystem with two copies of a scalar \(Q_k\) element (where \(k\) comes from parameters.fe_degree), and associates the DoFHandler with the (still empty) triangulation. The triangulation itself is generated in run().
| [in] | parameters | Run-time configuration read from param.prm. |
| void SaddlePointProblem< dim >::run | ( | ) |
Top-level driver that performs the adaptive-refinement loop.
Drive the full solve-cycle loop for parameters.n_refinement_cycles cycles.
For each refinement cycle the function calls, in order, setup_system(), assemble_system(), solve(), output_results(), output_exact_results(), compute_error() and write_convergence_table(). On the first cycle the function generates the initial hyper-ball mesh of radius \(\pi\); on subsequent cycles it calls refine_grid() to globally refine the mesh.
This function calls all the other functions of the SaddlePointProblem class. The main loop of the function deals with mesh generation: on cycle 0 it creates a circular domain (a hyper-ball of radius \(\pi\)) and performs one global refinement; on subsequent cycles it refines the existing grid.
For each cycle it then calls, in order, setup_system(), assemble_system(), solve(), output_results(), output_exact_results(), compute_error() and write_convergence_table(). It also prints informational messages about the number of active cells and degrees of freedom.