MATH 676 – Finite element methods in scientific computing

advertisement
MATH 676
–
Finite element methods in
scientific computing
Wolfgang Bangerth, Texas A&M University
http://www.dealii.org/
Wolfgang Bangerth
Lecture 31.7:
Nonlinear problems
Part 5: Pseudo-time stepping
for the minimal surface equation
http://www.dealii.org/
Wolfgang Bangerth
The minimal surface equation
Consider the minimal surface equation:
(
−∇⋅
A
∇u = f
2
√ 1+|∇ u|
u = g
)
in Ω
on ∂Ω
where we choose
2
Ω=B1 (0)⊂ℝ ,
f =0,
g=sin (2 π( x + y ))
Goal: Solve this numerically with via pseudo-time stepping.
http://www.dealii.org/
Wolfgang Bangerth
Pseudo-time stepping
General approach: To solve
L(u) = f
by pseudo-time stepping, we seek the limit
u( x)=lim τ→∞ ū( x , τ)
where
ū( x , τ) solves
∂ ū( x , τ)
±L( ū) = ±f
∂τ
Note: τ is an artificial “time-like” variable. We will call it
pseudo-time.
http://www.dealii.org/
Wolfgang Bangerth
Pseudo-time stepping
Requirements: To find a stationary limit of
ū( x , τ) where
∂ ū( x , τ)
±L( ū) = ±f
∂τ
we need that this time-dependent equation
●
has a solution,
●
the solution is unique
●
the solution converges to a steady state as
●
convergence is independent of the starting point
●
the steady state is stable
http://www.dealii.org/
τ →∞
Wolfgang Bangerth
Pseudo-time stepping
General guide: To find a stationary limit of
ū( x , τ) where
∂ ū( x , τ)
±L( ū) = ±f
∂τ
choose the sign so that
●
the operator
I ±ϵ G( ū)
(where G ( ū) ū=L( ū))
is a contraction for a sufficiently small
●
ϵ>0
the resulting equation is something that resembles a
known “physical” equation
http://www.dealii.org/
Wolfgang Bangerth
Pseudo-time stepping
Example: Solve
−Δ u = f by finding the limit of
∂ ū( x , τ)
±(−Δ ū( x , τ) ) = ±f ( x)
∂τ
We have two options:
●
Plus sign:
∂ ū( x , τ)
−Δ ū( x , τ) = f ( x )
∂τ
This is the well-known heat equation: Unique solution!
●
Minus sign:
∂ ū( x , τ)
+Δ ū( x , τ ) = −f ( x)
∂τ
This is the “backward heat equation”: No unique solution!
http://www.dealii.org/
Wolfgang Bangerth
Pseudo-time stepping
Boundary + initial values: To solve
L(u) = f
u = g
in Ω
on ∂ Ω
by pseudo-time stepping using the equation
∂ ū( x , τ)
±L( ū) = ±f ( x)
∂τ
we need boundary and initial values:
ū( x , τ ) = g( x )
ū( x , 0) = ū0 ( x)
on ∂ Ω×(0, ∞)
in Ω
Note 1: We can (usually) choose initial conditions arbitrarily.
Note 2: But
means faster convergence!
ū0 ( x ) ≈ u( x )
http://www.dealii.org/
Wolfgang Bangerth
Pseudo-time stepping
Pseudo-time discretization: Do time stepping scheme on
∂ ū( x , τ )
±L( ū) = ±f ( x )
∂τ
ū( x , τ) = g ( x)
ū( x , 0) = ū0 ( x)
in Ω×(0, ∞)
on ∂ Ω×(0, ∞)
in Ω
For example, try the implicit Euler method:
n
n−1
ū ( x)−ū
Δτ
(x)
±L( ūn ) = ±f ( x)
n
ū ( x , τ) = g ( x)
in Ω
on ∂ Ω
Problem: If L(u) is nonlinear, then this equation is still
nonlinear in un – we wanted something linear!
http://www.dealii.org/
Wolfgang Bangerth
Pseudo-time stepping
Pseudo-time discretization: Do time stepping scheme on
∂ ū( x , τ )
±L( ū) = ±f ( x )
∂τ
ū( x , τ) = g ( x)
ū( x , 0) = ū0 ( x)
in Ω×(0, ∞)
on ∂ Ω×(0, ∞)
in Ω
For example, try the explicit Euler method:
n
n−1
ū ( x)−ū
Δτ
(x)
±L( ūn−1 ) = ±f ( x)
n
ū ( x , τ) = g( x )
in Ω
on ∂Ω
Problem: If L(u) is a second order differential operator, we
may have to take very small time steps! (See lecture 27.)
http://www.dealii.org/
Wolfgang Bangerth
Pseudo-time stepping
Pseudo-time discretization: Do time stepping scheme on
∂ ū( x , τ )
±L( ū) = ±f ( x )
∂τ
ū( x , τ) = g ( x)
ū( x , 0) = ū0 ( x)
in Ω×(0, ∞)
on ∂ Ω×(0, ∞)
in Ω
For example, try a semi-implicit Euler method:
n
n−1
ū ( x)−ū
Δτ
( x)
±G( ūn−1 ) ūn = ±f ( x )
n
ū ( x , τ) = g ( x)
in Ω
on ∂ Ω
Here: Choose G(u)u = L(u) where G(u) is a linear
operator. (See previous lecture.)
http://www.dealii.org/
Wolfgang Bangerth
Pseudo-time stepping
Pseudo-time discretization: Do time stepping scheme on
∂ ū( x , τ )
±L( ū) = ±f ( x )
∂τ
ū( x , τ) = g ( x)
ū( x , 0) = ū0 ( x)
in Ω×(0, ∞)
on ∂ Ω×(0, ∞)
in Ω
For example, try a semi-implicit method + extrapolation:
n
n−1
ū ( x)−ū
Δτ
(x)
±G(~
u n ) ū n = ±f ( x)
in Ω
n
ū ( x , τ) = g ( x)
on ∂ Ω
Here: Extrapolate from previous time steps, e.g.
~
u = ū
n
http://www.dealii.org/
n−1
+
ū
n−1
−ū
Δτ
n−2
Δ τ = 2 ū
n−1
−ū
n−2
Wolfgang Bangerth
Pseudo-time stepping
Pseudo-time discretization: Do time stepping scheme on
∂ ū( x , τ )
±L( ū) = ±f ( x )
∂τ
ū( x , τ) = g ( x)
ū( x , 0) = ū0 ( x)
in Ω×(0, ∞)
on ∂ Ω×(0, ∞)
in Ω
Goal: Use a method that
●
is stable
●
allows us to take large time steps
●
does not have to be particularly accurate
●
does not necessarily have to follow a “physical” trajectory
as long as the limit is correct!
http://www.dealii.org/
Wolfgang Bangerth
Minimal surface equation
Concrete application: Solve the minimal surface equation
(
−∇⋅
A
∇u = f
2
√ 1+|∇ u|
u = g
)
in Ω
on ∂Ω
Step 1: Find the steady state limit of
∂ ū
A
−∇⋅
∇ ū = f
2
∂τ
√ 1+|∇ ū|
ū = g
(
)
in Ω
on ∂ Ω
Note: Choose sign as in the heat equation.
http://www.dealii.org/
Wolfgang Bangerth
Minimal surface equation
Step 2: For
∂ ū
A
−∇⋅
∇ ū = f
2
∂τ
√ 1+|∇ ū|
ū = g
(
)
in Ω
on ∂ Ω
choose a semi-implicit discretization:
n
n−1
ū −ū
A
n
−∇⋅
∇
ū
= f
n−1 2
Δ τn
√ 1+|∇ ū |
ūn = g
(
)
in Ω
on ∂ Ω
Note: This choice likely already implies a time step
restriction.
http://www.dealii.org/
Wolfgang Bangerth
Minimal surface equation
Step 3: For
(
n
ū −Δ τ n ∇⋅
A
n
n−1
∇
ū
=
ū
+Δ τ n f
n−1 2
√ 1+|∇ ū |
n
ū = g
)
in Ω
on ∂ Ω
choose a space discretization (here: finite elements):
( φh , ū n )+Δ τ n
( (
∇ φh ,
A
n
∇
ū
√ 1+|∇ ūn−1|2
))
= ( φ h , ū
n−1
+Δ τ n f )
∀ φ h ∈V h
Note: We need to also enforce the correct boundary
conditions.
http://www.dealii.org/
Wolfgang Bangerth
Minimal surface equation
Step 4: For
n
(
ū −Δ τ n ∇⋅
A
n
n−1
∇
ū
=
ū
+Δ τ n f
n−1 2
√ 1+|∇ ū |
n
ū = g
)
in Ω
on ∂ Ω
choose a suitable time step Δ τ n :
●
Small enough to be “reasonably accurate”
●
Large enough to get to infinity “reasonably quickly”
●
In practice: increase time step over tim
●
Terminate iteration once solution “is converged”
http://www.dealii.org/
Wolfgang Bangerth
Adapting step-26
Let's adapt step-26 for this purpose!
●
If necessary:
– read through step-26
– watch lectures 26, 27, 29
●
Change boundary values (previously: zero)
●
Change right hand side (here: zero)
●
Implement different stiffness matrix
●
Left out:
– time step size control
– termination criterion
http://www.dealii.org/
Wolfgang Bangerth
MATH 676
–
Finite element methods in
scientific computing
Wolfgang Bangerth, Texas A&M University
http://www.dealii.org/
Wolfgang Bangerth
Download