50 4 Discretization and Numerical Realizationξ 2x k 31x k 1τ kˆτ(a) Reference triangle.1ξ 1x 3x 2x k 2x 1(b) General triangle.Figure 4.1: Triangular mesh elements.ϕ k (x)ψ k (x)x kτ k(a) Piecewise constant basis function.(b) Piecewise affine basis function.Figure 4.2: Basis functions.Fur<strong>the</strong>rmore, we define <strong>the</strong> linear space T ψ (∂Ω) asT ψ (∂Ω) := span{ψ k } E k=1 ,where E denotes <strong>the</strong> number of elements. Obviously, dim T ψ (∂Ω) = E and every complexvaluedfunction g ψ ∈ T ψ (∂Ω) can be represented asg ψ =Eg k ψ kand thus it can be identified with a vector g := [g 1 , . . . , g E ] T ∈ C E .k=1A smooth enough function g can be approximated by a linear combination of piecewiseconstant functions in several ways. <strong>The</strong> simplest approach is to setg k = g(x k∗ )
51with x k∗denoting <strong>the</strong> midpoint of τ k . Alternatively, we can setg k = 1 3g(x k 1) + g(x k 2) + g(x k 3) .However, since we deal with functions in Lebesgue and Sobolev spaces, where we do notdistinguish between functions differing on a measure zero set, <strong>the</strong> above mentioned approximationsmay prove impossible. Hence, we introduce <strong>the</strong> projection P ψ : L 2 (∂Ω) → T ψ (∂Ω)minimizing <strong>the</strong> error∥g − P ψ g∥ L 2 (∂Ω),i.e.,P ψ g := arg min ∥g − g ψ∥ Lg ψ ∈T ψ (∂Ω) 2 (∂Ω).To find <strong>the</strong> coefficients g kf : R E → R as E f(g 1 , . . . , g E ) := g − 2g k ψ kk=1= ⟨g, g⟩ L 2 (∂Ω) − 2For <strong>the</strong> partial derivatives of f we get<strong>for</strong> a real-valued function g we introduce <strong>the</strong> functionL 2 (∂Ω)=g −Eg k ψ k , g −k=1Eg k ⟨g, ψ k ⟩ L 2 (∂Ω) +k=1∂f∂g j= −2⟨g, ψ j ⟩ L 2 (∂Ω) + 2Moreover, <strong>for</strong> <strong>the</strong> Hessian of f we haveH f [j, i] =EEg k ψ kk=1Eg kk=1 l=1Eg k ⟨ψ k , ψ j ⟩ L 2 (∂Ω).k=1∂2 f∂g j ∂g i= 2⟨ψ i , ψ j ⟩,L 2 (∂Ω)g l ⟨ψ k , ψ l ⟩ L 2 (∂Ω).which is <strong>the</strong> double Gram matrix corresponding to <strong>the</strong> basis of T ψ (∂Ω). Hence, <strong>the</strong> Hessianis positive definite and to find <strong>the</strong> minimum of f we set ∂f∂g j= 0 to obtain <strong>the</strong> system oflinear equationsEg k ⟨ψ k , ψ j ⟩ L 2 (∂Ω) = ⟨g, ψ j ⟩ L 2 (∂Ω) <strong>for</strong> j ∈ {1, . . . , E}k=1with a unique solution g = [g 1 , . . . , g E ] T ∈ R E . Because∆ k <strong>for</strong> k = j,⟨ψ k , ψ j ⟩ L 2 (∂Ω) =0 o<strong>the</strong>rwise,