• Keine Ergebnisse gefunden

In addition, the functionfh(approximation off in grid vertices) will be stored as VTK file for visualization purposes

N/A
N/A
Protected

Academic year: 2021

Aktie "In addition, the functionfh(approximation off in grid vertices) will be stored as VTK file for visualization purposes"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Numerik Partieller Differentialgleichungen, Sommersemester 2014 Aufgabenblatt 1

Prof. Peter Bastian Abgabe 30. April 2014

IWR, Universit¨at Heidelberg

BUNG1 DUNE GRID INTERFACE(PRACTICAL EXERCISE)

In this exercise you should become familiar DUNE grid interface. For our practical exercise we will use DUNE moduledune-npde(see homepage).

In the directory/dune-npde/uebungen/uebung1you will find an example programm which integra- tes the analytical function

fpx, yq exp3.234px0.5q2

on a structured grid. The integral is approximated by first order quadrature. The integration domain is unit cubeΩ tpx, yq|0 ¤ x ¤1,0 ¤y ¤1u. The integration is done for several grid refinements (beginning with only one cell) to prove the convergence. In addition, the functionfh(approximation off in grid vertices) will be stored as VTK file for visualization purposes.

1. Have a look at the programm, try to understand the source code, compile it and run the pro- gramm. Startparaviewto view the VTK file. Try to use different filters (especiallywarpfilter).

2. Modify the program in the way that the functionf will be integrated over the triangle subdo- mainΓ€Ω(see picture below).

Γ

p0,0q p1,0q

p1,1q p0,1q

Implement following tasks:

i) Only cells that are completely inΓwill be considered to quadrature.

ii) Only cells with at least one vertex inΓwill be considered to quadrature.

3. Instead of structured grid, you should integrate over an unstructured triangle grid which co- versΓcompletely. The filetriangle.mshcontains the suitable grid. This file can be read with the following commands:

typedef Dune::UGGrid<2> GridType;

GridType grid;

// read gmsh file

Dune::GridFactory<GridType> factory(&grid);

Dune::GmshReader<GridType>::read(factory,"triangle.msh",true,true);

factory.createGrid();

Compare the convergence orders os structured and unstructured grid. Try different integration order. Does it make any difference?

4. Modify the classFunctorVTKFunctionin the way that the output will be zero for all cells, which are not completely inΓ.

10 Punkte

(2)

BUNG2 DUNE GITTERSCHNITTSTELLE(PRAKTISCHE AUFGABE)

In dieser ¨Ubung sollen sie sich mit der Gitterschnittstelle von DUNE vertraut machen. Im Un- terverzeichnis/dune-npde/uebungen/uebung1desdune-npdeModuls finden Sie ein Beispielprogramm, welches das Integral der analytische Funktion

fpx, yq exp3.234px0.5q2

durch Quadratur erster Ordnung auf den Zellen eines strukturierten Gitters approximiert. Das in- tegrierte Gebiet ist in diesem Fall das Einheitsquadrat Ω tpx, yq|0 ¤ x ¤ 1,0 ¤ y ¤ 1u. Die Integration wird f ¨ur mehrere Gitteraufl ¨osungen durchgef ¨uhrt (beginnend mit einer einzigen Zelle), um die Konvergenz des Integrals zu bestimmen. Außerdem wird die Funktionfh, welchef in den Gittervertizes interpoliert, f ¨ur jede Gitteraufl ¨osung als VTK Datei f ¨ur eine sp¨atere Visualisierung ge- speichert.

1. Machen Sie sich zun¨achst mit dem Quellcode vertraut und f ¨uhren Sie das Programm probewei- se aus. Starten Sie das Programmparaviewum die geschriebenen VTK Dateien zu betrachten.

Experimentieren Sie ein bisschen mit denparaviewFiltern (insbesondere demwarpFilter).

2. Modifiziern Sie das Programm nun so, dass die Funktionf nicht mehr auf dem ganzen Gebiet Ωintegriert wird, sondern nur noch auf dem dreieckigen TeilgebietΓ€Ω, das in der nachfol- genden Grafik als grauer Schatten dargestellt ist.

Γ

p0,0q p1,0q p1,1q p0,1q

Implementieren Sie hierbei zwei verschiedene Vorgehensweisen:

i) Nur Zellen, welche ganz inΓenthalten sind werden in der Quadratur ber ¨ucksichtigt.

ii) Nur Zellen, f ¨ur die wenigstens ein Vertex in Γ enthalten ist werden in der Quadratur ber ¨ucksichtigt.

3. Anstatt das TeilgebietΓ durch Auschnitte eines strukturierten Gitters zu approximieren, soll nun die Integration auf einem unstrukturierten Dreicks-Gitter durchgef ¨uhrt werden, welches Γexakt ¨uberdeckt. Ein passendes Gitter ist in der Dateitriangle.mshenthalten. Diese Datei kann durch

typedef Dune::UGGrid<2> GridType;

GridType grid;

// read gmsh file

Dune::GridFactory<GridType> factory(&grid);

Dune::GmshReader<GridType>::read(factory,"triangle.msh",true,true);

factory.createGrid();

in ein DUNE-Gitter eingelesen werden. Vergleichen Sie die Konvergenz der Quadratur auf die- sem Gitter mit jener auf dem strukturierten Gitter. Probieren Sie auch Integration h ¨oherer Ord- nung (zB. 4).

4. Modifizieren Sie die KlasseFunctorVTKFunctionderart, dass Sie auf allen Zellen, die nicht ganz inΓenthalten sind nur noch Null ausgibt.

10 Punkte

Referenzen

ÄHNLICHE DOKUMENTE

It has been shown within the model proposed that the utilization of stored value card payment instruments crucially depends on their specific security risks, as well as the

Liste alle Studenten, die in einem höheren Semester sind als Feuerbach:. Studenten MatrNr Name

The mini-CIMS instrument utilizes a Stanford Research Systems Residual Gas Analyzer without the factory installed electron ionization source.. The SRS RGA (all models) tests

EBSD images with a colored overlay and an associated quartz c- axis orientation plot are indexed for each sample grid.. These c-axis orientation plots are oriented with their

However, when a migrant is made to integrate, his social proximity to the natives exposes him to relative deprivation, which in turn prompts him to form

While smoke diving, firefighters also have to carry a breathing apparatus (SCBA) with a mask and a radio station (15 kilos). Sometimes special clothing is needed in case of extreme

Grid approximation schemes for constructing value functions and optimal feedbacks in problems of guaranteed control are proposed via theory of generalized (minimax, viscos-

[r]