Amandus: Simulations based on multilevel Schwarz methods
Classes | Functions
laplace/l-shaped.cc File Reference
#include <amandus/apps.h>
#include <amandus/laplace/matrix.h>
#include <amandus/laplace/matrix_factor.h>
#include <amandus/laplace/noforce.h>
#include <amandus/laplace/solution.h>
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/numerics/dof_output_operator.h>
#include <deal.II/numerics/dof_output_operator.templates.h>
#include <deal.II/base/function.h>
#include <deal.II/base/function_lib.h>
#include <deal.II/algorithms/newton.h>

Classes

class  Startup< dim >
 

Functions

int main ()
 

Detailed Description

About this example

This program build on laplace.cc in this same directory, but it adds error estimation and adaptively refined meshes.

How to compile and run

Go to example/laplace directory and type:

make laplace_laplace

Now you can see the executable. To execute it and produce the output, type:

./laplace

Introduction

We solve the Laplace equation

\begin{align*} - \Delta u & = 0 \qquad\qquad & \text{in}\ \Omega \end{align*}

on the L-shaped domain \(\Omega=[-1,1]^2 \setminus [0,1]^2\).

Function Documentation

int main ( )

We fix the dimension of the domain

1 const unsigned int d=2;

Construction of a ofstream and the attachment of the stream to the open file deallog

1 std::ofstream logfile("deallog");
2 deallog.attach(logfile);

Now we define an object for a triangulation and we fill it with a single cell of a square domain. The triangulation is refined 3 times, to yield \(4^3=64\) cells in total.

1 Triangulation<d> tr;
2 GridGenerator::hyper_cube (tr, -1, 1);
3 tr.refine_global(3);

We construct the tensor product polynomials of degree p. We use continuous polynomials.

1 const unsigned int degree = 2;
2 FE_Q<d> fe(degree);

Creation of a Matrix object. The Matrix class permits to construct the matrix A using LocalIntegrators functions. It is essential to implement a class matrix for every kind of problem you want to solve. For more details, read the documentation for the matrix class of the Laplace problem.

1 LaplaceIntegrators::Matrix<d> matrix_integrator;
Todo:
The code does't compile. Correct it and finish the code description.

Here is the call graph for this function: