WRT in 2D: Poisson Example

Similar documents
Simple Examples on Rectangular Domains

MA8502 Numerical solution of partial differential equations. The Poisson problem: Mixed Dirichlet/Neumann boundary conditions along curved boundaries

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

Outline. 1 Boundary Value Problems. 2 Numerical Methods for BVPs. Boundary Value Problems Numerical Methods for BVPs

Final Exam May 4, 2016

A High-Order Galerkin Solver for the Poisson Problem on the Surface of the Cubed Sphere

Math 5630: Iterative Methods for Systems of Equations Hung Phan, UMass Lowell March 22, 2018

Qualifying Examination

Chapter Two: Numerical Methods for Elliptic PDEs. 1 Finite Difference Methods for Elliptic PDEs

Scientific Computing I

Weak form of Boundary Value Problems. Simulation Methods in Acoustics

Inverses. Stephen Boyd. EE103 Stanford University. October 28, 2017

Lehrstuhl Informatik V. Lehrstuhl Informatik V. 1. solve weak form of PDE to reduce regularity properties. Lehrstuhl Informatik V

Recall: Dot product on R 2 : u v = (u 1, u 2 ) (v 1, v 2 ) = u 1 v 1 + u 2 v 2, u u = u u 2 2 = u 2. Geometric Meaning:

TMA4220: Programming project - part 1

8 A pseudo-spectral solution to the Stokes Problem

Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C.

Algorithms for Scientific Computing

Overlapping Schwarz preconditioners for Fekete spectral elements

HIGHER-ORDER THEORIES

CSL361 Problem set 4: Basic linear algebra

Numerical Methods for Partial Differential Equations

Finite Difference Methods for Boundary Value Problems

3. Numerical integration

Lecture 21: Isoparametric Formulation of Plane Elements.

Multivariable Calculus

Classical Field Theory: Electrostatics-Magnetostatics

Transformations from R m to R n.

12. Stresses and Strains

Mathematical Tripos Part IA Lent Term Example Sheet 1. Calculate its tangent vector dr/du at each point and hence find its total length.

A Fast Fourier transform based direct solver for the Helmholtz problem. AANMPDE 2017 Palaiochora, Crete, Oct 2, 2017

[2] (a) Develop and describe the piecewise linear Galerkin finite element approximation of,

2.20 Fall 2018 Math Review

A brief introduction to finite element methods

AMS 529: Finite Element Methods: Fundamentals, Applications, and New Trends

OR MSc Maths Revision Course

Vector Calculus. A primer

Math 340 Final Exam December 16, 2006

CIV-E1060 Engineering Computation and Simulation Examination, December 12, 2017 / Niiranen

ONE - DIMENSIONAL INTEGRATION

Partial Differential Equations

Chapter 4. The First Fundamental Form (Induced Metric)

Solution to Homework 1

Properties of Transformations

G H. Extended Unit Tests A L L. Higher Still Advanced Higher Mathematics. (more demanding tests covering all levels) Contents. 3 Extended Unit Tests

Chapter 3. Differentiable Mappings. 1. Differentiable Mappings

Finite-Elements Method 2

Engg. Math. I. Unit-I. Differential Calculus

Numerical Solutions to Partial Differential Equations

Summary of time independent electrodynamics

PART IV Spectral Methods

PDEs, part 1: Introduction and elliptic PDEs

2. Polynomial interpolation

Finite Element Method for Ordinary Differential Equations

Preliminary Examination, Numerical Analysis, August 2016

Finite Element Method-Part II Isoparametric FE Formulation and some numerical examples Lecture 29 Smart and Micro Systems

Getting started: CFD notation

Implementation of the dg method

256 Summary. D n f(x j ) = f j+n f j n 2n x. j n=1. α m n = 2( 1) n (m!) 2 (m n)!(m + n)!. PPW = 2π k x 2 N + 1. i=0?d i,j. N/2} N + 1-dim.

MATH H53 : Final exam

Introduction. J.M. Burgers Center Graduate Course CFD I January Least-Squares Spectral Element Methods

Summary for Vector Calculus and Complex Calculus (Math 321) By Lei Li

TMA4220 Numerical Solution of Partial Differential Equations Using Element Methods Høst 2014

Mathematical Methods wk 2: Linear Operators

LEAST-SQUARES FINITE ELEMENT MODELS

Applied Mathematics Masters Examination Fall 2016, August 18, 1 4 pm.

Lemma 8: Suppose the N by N matrix A has the following block upper triangular form:

Finite Elements. Colin Cotter. January 18, Colin Cotter FEM

18.06 Problem Set 2 Solution

Matrices A brief introduction

Finite Elements. Colin Cotter. February 22, Colin Cotter FEM

CS137 Introduction to Scientific Computing Winter Quarter 2004 Solutions to Homework #3

Linear Algebra. Week 7

12. Thermal and scalar field analysis

Topic 2-2: Derivatives of Vector Functions. Textbook: Section 13.2, 13.4

Lecture Notes: African Institute of Mathematics Senegal, January Topic Title: A short introduction to numerical methods for elliptic PDEs

. D Matrix Calculus D 1

Linear Equations and Matrix

Math 23b Practice Final Summer 2011

Introduction to Boundary Value Problems

Introduction. Finite and Spectral Element Methods Using MATLAB. Second Edition. C. Pozrikidis. University of Massachusetts Amherst, USA

1 Linear transformations; the basics

Math 550, Exam 1. 2/10/11.

Electromagnetism HW 1 math review

Numerical Methods for Engineers, Second edition: Chapter 1 Errata

Chapter 2. General concepts. 2.1 The Navier-Stokes equations

The Spectral-Element Method: Introduction

Math 265H: Calculus III Practice Midterm II: Fall 2014

1. (a) (5 points) Find the unit tangent and unit normal vectors T and N to the curve. r (t) = 3 cos t, 0, 3 sin t, r ( 3π

Course Summary Math 211

Algebra Workshops 10 and 11

Fast Numerical Methods for Stochastic Computations

LECTURE 16 GAUSS QUADRATURE In general for Newton-Cotes (equispaced interpolation points/ data points/ integration points/ nodes).

ME FINITE ELEMENT ANALYSIS FORMULAS

HIGHER-ORDER THEORIES

Matrix Differentiation

Mathematical Concepts & Notation

x + ye z2 + ze y2, y + xe z2 + ze x2, z and where T is the

L. Vandenberghe EE133A (Spring 2017) 3. Matrices. notation and terminology. matrix operations. linear and affine functions.

Review of Strain Energy Methods and Introduction to Stiffness Matrix Methods of Structural Analysis

Transcription:

WRT in 2D: Poisson Example Consider 2 u f on [, L x [, L y with u. WRT: For all v X N, find u X N a(v, u) such that v u dv v f dv. Follows from strong form plus integration by parts: ( ) 2 u v + 2 u dx dy }{{ 2 }}{{ 2 } I x I y v f dv. First integral: I x : Ly [ Lx Ly [ Lx v 2 u dx dy 2 v u dx v(x, y) u xl x,y x,y } {{ } dy Ly Lx v u dx dy. Second integral, by symmetry: I y Ly Lx v u dx dy.

Evaluating Integrals Using Basis Functions For all v, u X N, v(x, y) u(x, y) N N v ij φ i (x) ψ j (y) i j N N u pq φ p (x) ψ q (y). p q Here, we take φ and ψ to be the bases on [, L x [, L y, φ i (x) : l i (r(x)), r(x) : + 2 L x x, ψ j (y) : l j (s(y)), s(y) : + 2 L y y, and the l i s and l j s are the (same) Lagrange interpolating polynomials based on the Gauss-Lobatto-Legendre (GLL) points r j [, : ˆ. Derivative with respect to x: Derivative with respect to y: N v i N u N φ i(x) ψ j (y) v ij j p q N v i N u N φ p(x) ψ q (y) u pq. N φ i (x) ψ j(y) v ij j p q N φ p (x) ψ q(y) u pq.

First integral, I x Ly Lx pq pq pq ( ) ( v ij φ i(x) ψ j (y)v ij pq ij Ly v ij ij ( Ly v ij ij v ij By,jq Ā x,ip u pq ij v T ( By Āx) ū. Second integral, by symmetry, I y v T ( Ā y B x ) ū. [ Lx ψ j (y) ψ q (y) ) ( Lx ψ j (y) ψ q (y) dy u pq φ p(x) ψ q (y)u pq ) φ i(x) φ p(x) dx dy u pq ) φ i(x) φ p(x) dx u pq, dx dy

Following as we did in D, we end up with the linear system Au Bf A B y A x + A y B x. Let, as in D, Ā x : 2 L x ˆDT ˆB ˆD, [Āx ip : Lx φ i(x) φ p(x) dx N φ i(x k ) k [ N 2 k L x 2 L x N k 2 L x N k ( ) Lx 2 ρ k φ p(x k ) dl i dr [ 2 L x ˆDT ˆB ˆD rk (Lx ˆD ki ρ k ˆDkp ˆD ki ˆBkk ˆDkp. ip 2 ρ k ) [ 2 L x (GLL quadrature) dl p dr rk This gives us the bar matrix, Ā x, which includes the endpoints.

To get the interior points only, we (re-)introduce the restriction matrix, R, and prolongation matrix, P : R T. Recall P T I T lr (N+) (N ). Q: What is the role of P in a matrix-vector product? Q: What is the role of R in a matrix-vector product?

Matlab Example wrttest.m N5; % Polynomial Order [Ah,Bh,Ch,Dh,z,w semhat(n); R speye(n+); RR(2:(end-),:); % Dirichlet Restriction Matrix A R*Ah*R ; f+*z; u A \ (R*(Bh*f)); u[;u;; ue.5*(-z.*z); err max(abs(u-ue)) After executing this code we can look at R: R full(r) R Ah 5.667e+ -5.7553e+ 7.529e- -2.3287e-.97e- -3.3333e-2-5.7553e+ 9.267e+ -3.989e+ 8.385e- -3.233e-.97e- 7.529e- -3.989e+ 6.4e+ -3.4e+ 8.385e- -2.3287e- -2.3287e- 8.385e- -3.4e+ 6.4e+ -3.989e+ 7.529e-.97e- -3.233e- 8.385e- -3.989e+ 9.267e+ -5.7553e+ -3.3333e-2.97e- -2.3287e- 7.529e- -5.7553e+ 5.667e+ >> A A 9.267e+ -3.989e+ 8.385e- -3.233e- -3.989e+ 6.4e+ -3.4e+ 8.385e- 8.385e- -3.4e+ 6.4e+ -3.989e+ -3.233e- 8.385e- -3.989e+ 9.267e+ >> Bh Bh 6.6667e-2 3.7847e- 5.5486e- 5.5486e- 3.7847e- 6.6667e-2 >> R*Bh*R ans 3.7847e- 5.5486e- 5.5486e- 3.7847e- We see that R does just what we need. It picks out the active rows (i.e., equations) in the ODE/PDE.

R T u extends u by zero, so that we can apply quadrature and/or differentiate u(x) on x, x,..., x N, as needed. >> u[ 2 3 4 u 2 3 4 >> R *u ans 2 3 4

Note: If we have Neumann conditions in the y-direction (say), then y-indices range from to N. For example, LHS of the ij-th equation will be I N q N p [B y A x + A y B x u A u. (B y,jq A x,ip + A y,jq B x,ip ) u pq { i,..., N j,..., N The mass matrices, B x, B y, and stiffness matrices, A x, A y, will have the correct size (and hence, correct index range in the first expression), if we set B x R x BR T x A x R x ĀR T x B y R y BR T y A y R y ĀR T y, with R T x T I T lr (N+) (N ), R T y I lr (N+) (N+). We typically refer to Ā and B as the Neumann operators. They are the full (N + ) (N + ) matrices corresponding to the Neumann problem. In terms of the generic ( hat ) matrices, they are (for x, say) Ā 2 L x Â, B L x 2 ˆB. Example: Solve 2 u on [, 2 [, u(x, y) at x, 2. u at y,.

Variable Coefficients in 2D: Recall D example: d dx q(x)du dx { u() f(x) + BCs u () WRT: v d dx q(x)du dx dx dv dx q(x)du dx dx v f(x) dx v f(x) dx (Dv) T QBDu v T Bf v T D T QBDu v T Bf Au Bf A : D T QBD. With (highly accurate) GLL quadrature, it is sufficient to evaluate q(x) at the GLL nodal points, x k, k,..., N The matrices Q and B are thus both diagonal: Q kk q(x k ), B kk ρ k, k,..., N.

2D example: [q(x, y) u f(x, y) + BCs v [q u dx dy v f(x, y) dx dy v [ q u + q u dx dy v f(x, y) dx dy First term on left, itegrated by parts [ Ly Lx I x Let Γ i denote the ith faces of, i: left face i2: right face i3: lower face i4: upper face v q u u dx v q Let ˆn i be the associated outward-pointing unit-normals on these faces: i: ˆn (ˆn x,, ˆn y, ) (, ) i2: ˆn 2 (ˆn x,2, ˆn y,2 ) (, ) i3: ˆn 3 (ˆn x,3, ˆn y,3 ) (, ) i4: ˆn 4 (ˆn x,4, ˆn y,4 ) (, ) We can rewrite I x as: I x Ly Lx v q u 2 dx dy i x x Γ i v q u ˆn x,i dy. dy Similarly, I y is I y Ly Lx v q u 4 dx dy i3 Γ i v q u ˆn y,i dy. Combining I x and I y, I I x + I y Ly Lx v q u + v q u 4 dx dy v (q u) dv v q u ˆn ds. i Γ i v q ( u ˆn x,i + v q u ) ˆn y,i ds.

If v q u ˆn, then u satisfies v (q u) dv v f dv for all v X N. Note: For any u X N we have the gradient ) u u u ( Dx D y u I 2 L x ˆD ˆD I 2 L y u. Example: x L x 2 (z + ), y L y (z + ) 2 [X, Y ndgrid(x, y) U sin πx U x D x U, U y D y U D x Î 2 ˆD, Dy 2 ˆD Î L x L y Plot U x, U y.

Returning to our weighted residual form, insertion of the bases and using quadrature yields I Ly Lx v q u + v q u dx dy (D x v) T Q B D x u + (D y v) T Q B D y u v T D T x Q B D x u + v T D T y Q B D y u. Note that if the range of indices on v and u includes all nodes, including the boundaries, then we would have the form of our Neumann operator, Ā D T x Q B D x + D T y Q B D y. To construct the A-matrix that governs the interior degrees of freedom, apply the restriction operator R to Ā: A R Ā RT. In the case of a rectangular domain, R restricts index sets in both the x and y directions and it can be written in tensor-product form: R R y R x. As always, the R x matrix is on the right, because it is acting on the fastest changing index in the u T [u u... u NN T lexicographical ordering of the unknowns.

Gradient-Based Form It is sometimes convenient to write Ā in a higher-level form. We can also write Ā [ Dx D y T [ QB QB [ Dx D y D T Q D. Here, we use the bold font to indicate that the matrices are working on or producing vector fields, i.e., inputs and/or outputs that have two components in 2D, three components in 3D, etc. Obviously, the D matrix is the discrete gradient operator introduced above.

Deformed Geometries If is deformed, ˆ x(r, s) ij x ij l i (r) l j (s) N N x ij l i (r) l j (s). j i Derivative is computed using the chain rule [w pq u u rps q + u (r x ) pq (u r ) pq + (s x ) pq (u s ) pq w [r x (Î ˆD)u + [s x ( ˆD Î)u. The full gradient (vector field) is given by, w u [ [rx [s x [r y [s y }{{} R x [ Dr D s u R x D r u. Here, we use bold font to indicate a vector field or a matrix that operates on and/or produces a vector field.

Metrics What is? rpsq pq ij pq ij dl i x ij dr l j (s q ) D r x (Î ˆD)x p x ij l i (r p ) dl j ds q D s x ( ˆD Î)x. Chain Rule: Set u x: u u + u. + + + +. At each point, (r p, s q ): [ [ [. Thus we find the inverse metrics, i j, by inverting the 2 2 matrix of computable derivatives i j, at each gridpoint (r p, s q ).

Integration in Similarly, we must transform f da ˆ f J dr ds. Here, J is the Jacobian: It is a scalar field corresponding to the amount of area in that is associated with a unit area in ˆ. An example is shown in the figure below. The blue area is given by the cross product, da dr ds J dr ds [ dr ds dr ds. ˆ That is, J pq is the determinant of the 2 2 metric tensor at each quadrature point. Mass Matrix: We note that the mass matrix in the deformed geometry is diagonal, evaluated at the GLL points: B diag(ρ p ρ q J pq J ( ˆB ˆB), if we view J as a diagonal matrix, following standard practice with GLL quadrature.

Bilinear Form in Deformed Coordinates As usual, we evaluate the bilinear form, a(v, u) v u da [Dv T (B) [Du [R x D r v T (B) [R x D r u v T ( Dr D s ) T [ [rx [s x [r y [s y T ( J ( ˆB ˆB) J ( ˆB ˆB) ) [ [rx [s x [r y [s y ( Dr D s ) u. v T D T r GDu. In d space dimensions, ( d ) i j G ij : J B, i,..., d, j,..., d, d 2 or 3. k k k Example, d 2: [ Grr G rs [ G G 2 G G sr G ss G 2 G 22. Note: G ij G ji. Each G.. is a diagonal matrix with (N + ) 2 (or, (N + ) d ) entries.