Saddle-Point
Loading...
Searching...
No Matches
SaddlePointProblem< dim > Class Template Reference

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 &parameters)
 Build a SaddlePointProblem problem from a fully populated Parameters object.
 
void run ()
 Top-level driver that performs the adaptive-refinement loop.
 

Detailed Description

template<int dim>
class SaddlePointProblem< dim >

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():

ParameterHandler prm;
parameters.declare_parameters(prm);
prm.parse_input(filename);
parameters.get_parameters(prm);
SaddlePointProblem<2> problem(parameters);
problem.run();
Run-time options read from a ParameterHandler input file.
Definition step-6.h:82
void get_parameters(ParameterHandler &prm)
Read the parameter values out of a (previously parsed) ParameterHandler into this Parameters object.
Definition step-6.cc:158
static void declare_parameters(ParameterHandler &prm)
Register every Parameters field with the given ParameterHandler.
Definition step-6.cc:122
Solves the two-component saddle-point Laplace system on a disk.
Definition step-6.h:65
Template Parameters
dimSpatial dimension of the Laplace problem (currently 2).

Constructor & Destructor Documentation

◆ SaddlePointProblem()

template<int dim>
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().

Parameters
[in]parametersRun-time configuration read from param.prm.

Member Function Documentation

◆ run()

template<int dim>
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.


The documentation for this class was generated from the following files: