• Keine Ergebnisse gefunden

The following code fragment gives and example of the implementation which is also found at the beginning of the fileuebung01.cc

N/A
N/A
Protected

Academic year: 2021

Aktie "The following code fragment gives and example of the implementation which is also found at the beginning of the fileuebung01.cc"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Parallel Solution of Large Sparse Linear Systems, SS 2015 Exercise sheet 1

Prof. Dr. Peter Bastian, Marian Piatkowski Deadline May 4, 2015

IWR, Universit¨at Heidelberg

EXERCISE1 P1 FINITEELEMENTS ON A STRUCTURED SIMPLICIAL MESH

Consider the Poisson equation

´∆u“f inΩ“ p0,1q2ĂR2,

u“0 aufBΩ.

We want to solve this equation numerically withP1Finite Elements. The unitsquareΩis discretized with the followingstructured triangular mesh:

LetN be the number of divisions inx- andy-direction (in the picture we haveN “5), thus the mesh size ish“ N1. We number the nodes starting from the origin row-wise beginning at0toN2´1.

Your task is to specify one row of the stiffness matrix belonging to an interior node of the mesh.

10 Points EXERCISE2 COMPUTATION OF THEL2-NORM INDUNE

Implement a template functionl2norm()that computes the L2-norm of (mathematical) function.

The mathematical function is represented by a class with the member functionevaluateGlobal which has the point of evaluation as an input parameter and the result as an output parameter.

The following code fragment gives and example of the implementation which is also found at the beginning of the fileuebung01.cc.

template<typename GV, typename RF>

class Exp : ...

{

public:

Exp(const GV& gv_) : BaseT(gv_) {}

//! evaluate extended function on element

inline void evaluateGlobal (const typename Traits::DomainType& x, typename Traits::RangeType& y) const {

y = exp(-(x*x));

} };

The template functionl2norm() receives as a parameter aGridViewand a function object. The integration should be done over all elements of the grid. A simple possibility would be to approxi- mate the integral by the value of the function at the center of each element times the volume of each

(2)

element. A code fragment showing how to iterate over the grid and to compute the volume of the domain by calculating the volume of each element is found at the bottom of the fileuebung01.cc.

Implement also theL2-norm forDiscrete Grid Functions(DGF). DGF’s are functions that do not depend on a global coordinatexbut on an elementeand local coordinatexe with respect to that element. In other words, they are defined element-wise. You will find in the fileuebung01.cc a corresponding class and hints to the implementation such that you don’t have iterate over the grid by yourself as in the analytical case.

Modify the boundary conditions and the right-hand side for the Poisson equation for a given analytical solution of the Poisson equation. Compute the L2-error between the numerical and the analytical solution.

INSTALLATION OF DUNE ON YOUR OWN COMPUTER: If you have a computer with a Unix-like operating systems installed on, you can work on the exercises with your own computer. Just copy the shell scriptbuild.shinto a directory of your choice and run it.

scp psolv0XX@pool.iwr.uni-heidelberg.de:dune-parsolve-ss15/build.sh . bash build.sh

For the installation you need a working internet connection. A documentation for the installation

can be found at the homepage of DUNE. 10 Points

Referenzen

ÄHNLICHE DOKUMENTE

The specific materiality of a video is already a historical form of embodiment which defines itself through the original image and sound carriers onto which the code has

Once or twice a year, the Senckenberg Gesell- schaft für Naturforschung (SGN) supports a confer- ence as part of its official series. For the year 2011, the conference

I Über den Zeitpunkt des Empfangs kann keine Aussage getroffen werden (Unbounded indeterminancy). I Über die Reihenfolge der Empfangenen Nachrichten wird im Aktorenmodell keine

In the cases of Damad Ibrahim Paşa, the pro-European Grand Vizier from the Tulip Period (Lâle Devri) and Selim III, it was conservative groups who were the great brakes on

If industries choose different factor intensities in equilibrium, international trade leads to the equalization of the wage rate and the interest rate.. Equations (18a) and

As amino acids have been shown to be potent stimuli for aquatic animals [4], we used them to induce sensory responses of olfactory neurons in the rhinophore.. For

В ближайшие годы также не прогнозируется существенного роста инновационной активно- сти промышленных организаций, особенно низким уровнем

In the second part, I present seven ‚strategies of commemoration’ (Documenting, Interpreting, Investigating, Exhibiting of fragmentarized Memories, Swearing/staging of Trauma,