第19回:DG法では何が変わるか — jump・average・penalty

ChatGPTで作る有限要素プログラム入門 Season 2 第7回(通算第19回)

はじめに――DG法は一つの方法ではない

discontinuous Galerkin(DG)法では, elementごとのpolynomialを隣接elementと直接同一視しません. その代わり,element interfaceに

\[ \boxed{ \text{jump} \quad+\quad \text{average / numerical flux} \quad+\quad \text{penalty} } \tag{1} \]

を置いて,element同士をweakly couplingします.

ただし「DG法」という単一のbilinear formがあるわけではありません. SIPG,NIPG,IIPG,LDG,BR2,WOPSIP,hybrid DG / HDGなど, どのnumerical fluxを選び,どのjumpをどう制御するかによって複数のfamilyがあります.

第19回のもう一つのポイント
前回のNitsche法はDGと別世界の方法ではない.
symmetric Nitsche formulationはclassical interior-penalty DGの特別な場合として解釈できる.

1.DG spaceでは同じvertexにも別々のunknownを持つ

Poisson equation \[ -\Delta u=f \qquad\text{in }\Omega \tag{2} \] を考えます.

lowest-orderに近い例としてdiscontinuous \(P_1\) spaceを \[ \boxed{ V_h^{DG} = \left\{ v_h\in L^2(\Omega): v_h|_T\in P_1(T) \quad \forall T\in\mathcal T_h \right\} } \tag{3} \] とします.

continuous P1と違って,隣接triangleが同じvertexを共有していても, そのvertex valueはelementごとに別のDoFです.

2次元triangleなら \[ \dim P_1(T)=3 \] なので,global unknown数は基本的に \[ 3\times(\text{number of elements}) \] です.

2.interior faceに向きを一つ固定する

interior face \[ F=T^+\cap T^- \] に対し,unit normal \[ \boldsymbol n_F \] を \(T^+\) から \(T^-\) へ向けて一つ固定します.

scalar function \(v\) のtraceを \[ v^\pm = v|_{T^\pm} \] と書きます.

DGではface orientationを途中で変えないことが重要です. jumpの符号はorientationに依存しますが, 最終bilinear formは一貫した定義を使えばorientation-independentになります.

3.jumpとaverage

今回はscalar jumpを \[ \boxed{ [v] = v^+-v^- } \tag{4} \] とし,averageを \[ \boxed{ \{v\} = \frac12 \left( v^++v^- \right) } \tag{5} \] とします.

gradientについても \[ \boxed{ \{\nabla v\} = \frac12 \left( \nabla v^+ + \nabla v^- \right). } \tag{6} \]

文献によってはscalar jumpではなく \[ v^+\boldsymbol n^+ + v^-\boldsymbol n^- \] というvector jumpを使います. 実装では定義を混ぜないことが最重要です.

4.elementwise integration by partsでface termが現れる

DG test functionはglobal \(H^1\) functionではないので, integration by partsはelementごとに行います.

\[ \sum_{T\in\mathcal T_h} (\nabla u,\nabla v_h)_T = (f,v_h)_\Omega + \sum_{T\in\mathcal T_h} \int_{\partial T} \partial_nu\,v_h\,ds. \tag{7} \]

interior faceの両側をまとめると, exact solutionがcontinuousでnormal fluxもsingle-valuedなら,

\[ \boxed{ \sum_{T} \int_{\partial T} \partial_nu\,v_h\,ds = \sum_{F\in\mathcal F_h^i} \int_F \{\nabla u\}\cdot\boldsymbol n_F [v_h]\,ds + \text{boundary terms}. } \tag{8} \]

つまりDGでは,continuous FEMで消えていたinterface termを numerical fluxとして設計し直す必要があります.

5.interior-penalty familyを一つの式で書く

parameter \[ \theta\in\{-1,0,1\} \] を使い,interior-penalty bilinear formを \[ \begin{aligned} a_h^\theta(u_h,v_h) :={}& \sum_T (\nabla u_h,\nabla v_h)_T \\ &- \sum_{F\in\mathcal F_h} ( \{\nabla u_h\}\cdot\boldsymbol n_F, [v_h] )_F \\ &- \theta \sum_{F\in\mathcal F_h} ( \{\nabla v_h\}\cdot\boldsymbol n_F, [u_h] )_F \\ &+ \sum_{F\in\mathcal F_h} \eta_F ( [u_h], [v_h] )_F \end{aligned} \tag{9} \] と書けます.

boundary faceでは \[ [v]=v, \qquad \{\nabla v\}=\nabla v \tag{10} \] というconventionを使います.

6.SIPG・NIPG・IIPGの違い

method \(\theta\) 特徴
SIPG\(1\)symmetric,adjoint consistent.penaltyは十分大きく選ぶ必要がある
NIPG\(-1\)nonsymmetric.第二のconsistency termのsignが反転する
IIPG\(0\)incomplete.adjoint-consistency termを省く

三者の違いは「DGかどうか」ではなく, face fluxの設計です.

7.SIPGを基準形として実装する

以下ではsymmetric interior penalty Galerkin(SIPG)を使います. \[ \theta=1 \] なので \[ a_h^{SIP}(u_h,v_h) = a_h^{SIP}(v_h,u_h). \tag{11} \]

DG energy normの代表例は \[ \boxed{ \|v_h\|_{DG}^2 = \sum_T \|\nabla v_h\|_{L^2(T)}^2 + \sum_{F\in\mathcal F_h} \eta_F \|[v_h]\|_{L^2(F)}^2. } \tag{12} \]

第一項がelement内のenergy, 第二項がelement間のdiscontinuityを測ります.

8.penaltyはjumpを抑えるがcontinuityを強制しない

penalty term \[ \eta_F ([u_h],[v_h])_F \] はjumpを小さくしますが, 有限の \(\eta_F\) では \[ [u_h]=0 \] をstrongly imposeしているわけではありません.

従ってDG solutionは有限mesh上では本当にdiscontinuousです.

一方,penaltyを極端に大きくするとconditioningが悪化します. SIPGでは \[ \boxed{ \text{coercivity} \quad\text{と}\quad \text{conditioning} } \] の両方を見る必要があります.

9.regular meshの典型的なpenalty scale

shape-regular meshでは典型的に \[ \boxed{ \eta_F = \frac{\gamma}{h_F} } \tag{13} \] を使います.

ここで \(\gamma\) はdimension,polynomial degree,mesh regularityに応じて coercivityを保証する大きさに取ります.

「\(\gamma=10\) ならどんなmeshでも安全」というuniversally fixedな定数ではありません.

10.anisotropic meshではnormal thicknessを見る

thin triangleではface length \(h_F\) とface-normal thicknessが全く異なる場合があります.

boundary faceまたはinterior faceの各側について \[ \ell_{T,F} = \frac{ d\,|T|_d }{ |F|_{d-1} } \tag{14} \] をface \(F\) に対するnormal thicknessとします.

anisotropic penaltyでは,例えば \[ \eta_F \sim \gamma \max_{T:\,F\subset\partial T} \ell_{T,F}^{-1} \tag{15} \] のようにnormal directionのelement scaleを反映する設計が自然です.

第18回のNitsche penaltyと同じ幾何学が, 今度はinterior facesにも現れます.

11.Nitsche法はSIPGの特別な場合

ここが第18回との重要な接続です. DG spaceの中のcontinuous subspace \[ V_h^c = V_h^{DG}\cap H^1(\Omega) \tag{16} \] へSIPG formulationを制限します.

すると全てのinterior facesで \[ [u_h]=0, \qquad [v_h]=0 \tag{17} \] なので,式 (9) のinterior-face termsは全部消えます.

残るのはboundary face上の \[ \boxed{ - (\partial_nu_h,v_h)_{\partial\Omega} - (u_h,\partial_nv_h)_{\partial\Omega} + \eta_{\partial} (u_h,v_h)_{\partial\Omega} } \tag{18} \] です.

これはまさにsymmetric Nitsche boundary formです.

したがって
\[ \boxed{ \text{symmetric Nitsche} = \text{SIPGをinterior-continuous spaceへ制限したboundary version} } \tag{19} \]

と見ることができます.

12.nonhomogeneous Dirichlet dataまで含める

boundary condition \[ u=g \qquad\text{on }\partial\Omega \] をweakly課すと,SIPG / symmetric Nitscheのboundary right-hand sideは \[ \boxed{ - \sum_{F\in\mathcal F_h^\partial} (g,\partial_nv_h)_F + \sum_{F\in\mathcal F_h^\partial} \eta_F (g,v_h)_F. } \tag{20} \]

interior jumpがあるかないかだけがDGとNitscheの違いであり, boundary calculusは同じinterior-penalty philosophyに属します.

13.DG assemblyではinterior faceが二要素を同時にcoupleする

continuous P1ではelement matrixを3×3でassembleしました. DG P1ではelement volume termも3×3ですが, interior face \(F=T^+\cap T^-\) は

\[ \boxed{ (T^+,T^-) \quad\Longrightarrow\quad 6\times6\ \text{face block} } \tag{21} \]

を作ります.

blockは \[ (++),\quad (+-),\quad (-+),\quad (--) \] の四つに分かれます.

ここでjump signを一つ間違えるとsymmetryもconsistencyも壊れます.

14.SIPG interior-face assemblyの核心

# one interior edge F = T_plus ∩ T_minus

all_ids = np.r_[ids_plus, ids_minus]

# fixed normal: plus -> minus
nF = outward_normal_of_plus

# traces of the six local basis functions
trace = np.r_[phi_plus, phi_minus]

# [v] = v_plus - v_minus
side = np.r_[
    np.ones(3),
    -np.ones(3)
]
jump = side * trace

# {grad phi} · nF
avg_dn = 0.5 * (
    np.vstack([
        grad_plus,
        grad_minus
    ]) @ nF
)

for i, I in enumerate(all_ids):
    for j, J in enumerate(all_ids):
        A[I, J] += weight * (
            -avg_dn[j] * jump[i]
            -avg_dn[i] * jump[j]
            +eta_F
            *jump[j] * jump[i]
        )

この三項がそれぞれ

\[ \text{consistency}, \qquad \text{adjoint consistency}, \qquad \text{penalty} \]

です.

15.boundary face assemblyはNitscheと同じ

# boundary edge
dn = grads @ n_out

A_loc += weight * (
    -np.outer(phi, dn)
    -np.outer(dn, phi)
    +eta_F
    *np.outer(phi, phi)
)

b_loc += weight * (
    -g * dn
    +eta_F * g * phi
)

第18回のsymmetric Nitsche codeと同じ形です. DGではこれにinterior-face loopが追加されると理解できます.

16.affine patch test

\[ u(x,y)=1+x+2y, \qquad f=0, \qquad g=u|_{\partial\Omega} \tag{22} \] を使います.

このexact solutionは各elementで \(P_1\) かつglobal continuousなので, exact quadratureならSIPGは \[ \boxed{ u_h=u } \tag{23} \] を再現します.

\(n\)max local nodal error
24.88e-15
42.18e-14
83.46e-14
161.98e-13

このtestはvolume termだけではなく, interior jump signsとNitsche-type boundary termsを同時に監査します.

17.smooth solutionの収束

次に \[ u(x,y) = \sin(\pi x)\sin(\pi y), \qquad f = 2\pi^2\sin(\pi x)\sin(\pi y) \tag{24} \] を使います.

uniform triangulation,DG \(P_1\), \[ \eta_F=\frac{20}{h_F} \] で計算した結果です.

\(n\) \(L^2\) relative error rate broken \(H^1\) relative error rate
41.2137e-1—3.3493e-1—
83.4436e-21.8171.7402e-10.945
169.0153e-31.9348.8055e-20.983
322.2942e-31.9744.4211e-20.994

regular mesh上のsmooth solutionでは \[ \boxed{ \|u-u_h\|_{L^2} = O(h^2), \qquad |u-u_h|_{1,h} = O(h) } \tag{25} \] へ漸近しています.

18.jumpそのものもerror indicatorになる

DG solutionでは \[ [u_h] \] が直接計算できます.

従って \[ \sum_F \eta_F \|[u_h]\|_{L^2(F)}^2 \tag{26} \] はenergy normの一部であるだけでなく, mesh refinementやdebuggingで 「どこでsolutionがつながっていないか」を可視化する量にもなります.

conforming FEMには存在しなかった情報です.

19.DG法の種類はinterior-penalty familyだけではない

DGにはさらに別の設計思想があります.

family主な考え方
SIPG / NIPG / IIPGprimal formでjump・average・penaltyを直接組む
LDGfirst-order systemへ書き換え,solutionとfluxのnumerical tracesを設計する
BR2face jumpをlifting operatorでelement内部へ持ち上げて安定化する
WOPSIPprojected jumpをweakly over-penaliseし,CRに近い構造を持つ
hybrid DG / HDGsingle-valued skeleton unknownを導入し,element unknownを局所消去する

したがって,「DGを実装した」と言うだけではschemeを特定したことになりません.

20.WOPSIPはSIPGと何が違うか

WOPSIP(weakly over-penalised symmetric interior penalty)では, SIPGのようなinterior consistency flux termsをbilinear formに直接入れず, face jumpの低次projectionを強く制御します.

schematicallyには \[ \boxed{ a_h^{WOP}(v_h,w_h) = (\nabla_hv_h,\nabla_hw_h) + \sum_{F\in\mathcal F_h} \kappa_F(1) ( \Pi_F^0[v_h], \Pi_F^0[w_h] )_F. } \tag{27} \]

この設計はCR methodに近く, standard SIPGのようにcoercivityのためのpenalty thresholdを細かく調整する必要がない, という利点があります.

一方,SIPGのGalerkin consistencyとは構造が異なるため, error analysisでは \[ \boxed{ \text{approximation error} + \text{consistency error} } \] を分けて扱います.

21.なぜWOPSIPがanisotropic meshで重要なのか

standard SIPGのconsistency fluxをanisotropic trace inequalityで直接評価すると, 強いaspect ratioのためにdirectional approximation structureを損なうことがあります.

WOPSIPではCR-like projection structureを利用でき, consistency analysisをRT interpolationとの関係へ移すことができます.

第15回で扱った \[ \text{CR--RT discrete integration by parts} \] と第14回のRT interpolationが, ここでもanisotropic consistency estimateの道具になります.

22.hybridisationすると何が変わるか

hybrid DG / HDGではface上にsingle-valued unknown \[ \lambda_h \] を導入します.

element unknown \(u_h|_T\) は各element内で局所的に解き, global systemは主にskeleton unknown \(\lambda_h\) に対して組みます.

概念的には \[ \boxed{ \text{element unknown} \quad+\quad \text{skeleton trace unknown} } \tag{28} \] という構造です.

HWOPSIPはWOPSIPにこのhybrid ideaを取り込んだ設計であり, anisotropic Poisson problemでも利用できます.

23.hybridisationのメリットとデメリット

hybridisationの目的は, 単に新しいunknownを増やすことではありません. element unknownをlocalに閉じ込め, global couplingをmesh skeleton上のunknownへ集約することです.

メリット1:static condensationでglobal systemをskeletonへ縮約できる

element unknownを \(\boldsymbol u_T\), skeleton unknownを \(\boldsymbol\lambda\) とすると, local systemはschematicallyに \[ \begin{pmatrix} A_T & C_T^{\top}\\ C_T & D_T \end{pmatrix} \begin{pmatrix} \boldsymbol u_T\\ \boldsymbol\lambda_T \end{pmatrix} = \begin{pmatrix} \boldsymbol f_T\\ \boldsymbol g_T \end{pmatrix} \] と書けます.

\(A_T\) をelementごとにlocalにinvertすれば, \(\boldsymbol u_T\) を消去して \[ \boxed{ S_T = D_T - C_TA_T^{-1}C_T^{\top} } \] というlocal Schur complementをskeletonへassembleできます.

global solveでは主として \(\lambda_h\) だけを解き, 最後に各elementで \(\boldsymbol u_T\) をrecoverします.

メリット2:element local solveを並列化しやすい

\(A_T^{-1}\) を使うlocal eliminationとsolution recoveryは elementごとに独立です. したがって

\[ \boxed{ \text{local factorisation} \quad\longrightarrow\quad \text{parallel / GPU-friendly computation} } \]

という構造を持ちます. 高次要素では,full DG unknownをglobalに全部coupleするより skeleton systemへ縮約する利点が大きくなる場合があります.

メリット3:single-valued trace / fluxをglobal unknownとして持てる

face上の \(\lambda_h\) はsingle-valuedなので, element間のcommunicationをskeleton variableへ明示的に集約できます.

この構造は domain decomposition, local conservation, flux reconstruction, interface coupling とも相性がよいです.

メリット4:local post-processingを設計しやすい

一部のHDG familyでは, computed fluxやtraceを使ったelementwise post-processingによって より高次のsolution approximationを得られる場合があります.

ただしこれはhybridisationしただけで自動的に得られる性質ではありません. superconvergenceにはscheme,polynomial degrees,regularityなど追加条件が必要です.

デメリット1:実装は明らかに複雑になる

通常のDGではglobal matrixへ直接assembleすればよいところを, hybrid methodでは

\[ \text{local matrix} \to \text{local elimination} \to \text{Schur complement assembly} \to \text{skeleton solve} \to \text{local recovery} \]

という複数段階に分ける必要があります.

local-to-global face numbering,orientation, trace polynomial space, boundary trace treatmentまで正しく管理しなければなりません.

デメリット2:unknown数が必ず減るわけではない

hybridisationするとfull DGのelement unknownはglobal systemから消せます. しかし新しくface unknown \(\lambda_h\) を導入するため,

重要な注意
hybridisation = global DoF数が必ず少なくなる とは言えない.

standard DGと比べてglobal coupled dimensionが小さくなるかは, dimension,polynomial degree,mesh topology,trace degreeによって変わります. 特に低次法では,conforming FEMよりunknownが多くなることも普通です.

デメリット3:local eliminationにも計算・memory costがある

各elementで \(A_T\) のfactorisationやinverse actionが必要です. 高次3次元ではlocal block自体が大きくなるため, static condensationが無料というわけではありません.

同じlocal matrix structureを再利用できる場合には有利ですが, variable coefficient,nonlinear problem,moving meshでは local factorisationを繰り返すcostも考える必要があります.

デメリット4:Schur complement用solver / preconditionerが必要になる

縮約後のsystemはskeleton上にありますが, そのconditioningが自動的によくなるわけではありません.

methodによってはSPDになりますが, 一般のHDG・mixed・convection-dominated problemでは nonsymmetric / indefinite structureもあり得ます. したがって

\[ \boxed{ \text{hybridisation} \neq \text{solver problemの自動解決} } \]

です.

デメリット5:stabilisation parameterとtrace spaceの設計が増える

HDGでは \[ \tau_F \] のようなstabilisation parameterや, element polynomial degreeとtrace polynomial degreeの組合せを選びます.

これらはaccuracy,stability,conditioning,local conservationに影響するため, 「hybrid化すれば何でも安定」というわけではありません. anisotropic meshではface-normal geometryも引き続き監査が必要です.

観点 メリット デメリット
global system skeleton unknownへ縮約可能 DoF削減は次数・mesh依存
parallelism local elimination / recoveryをelement並列化しやすい local factorisation costが必要
interface single-valued skeleton traceを明示的に持てる face orientation・trace space実装が複雑
solver static condensation可能 Schur complement用preconditionerが必要
accuracy 一部HDGではlocal post-processingが有効 superconvergenceは自動ではない
hybridisationを使う判断
低次小規模問題で単純なimplementationを優先するなら, standard DGの方が扱いやすいことがあります.
一方,高次・大規模・並列計算では, local elimination + skeleton solve の構造が大きな利点になり得ます.

24.DGとCRはどこが似ていて,どこが違うか

methodelement間continuitycoupling
conforming P1pointwise continuousshared nodal DoF
CRface mean continuousshared face mean DoF
DGcontinuityを要求しないnumerical flux / penalty

WOPSIPがCR-likeと呼ばれる理由は, faceの低次momentを中心にcouplingする点にあります.

25.anisotropic DGで何を監査するか

anisotropic meshでは,単に \[ h_F \] を入れたisotropic penalty formulaを使うだけでは不十分な場合があります.

最低でも

\[ \boxed{ \begin{aligned} &\text{normal thickness},\\ &\text{trace inequality},\\ &\text{penalty stability},\\ &\text{directional interpolation error},\\ &\text{consistency error} \end{aligned} } \tag{29} \]

を分けて確認します.

「DGだからanisotropyに自動的に強い」ということではありません.

26.ChatGPTへのDG implementation audit prompt

Audit prompt
このPoisson DG codeを数学的に監査してください.
(1) finite-element spaceがelementwise discontinuous polynomial spaceになっているか,
(2) interior faceのplus/minus orientationを一貫して固定しているか,
(3) jumpとaverageの定義を途中で混ぜていないか,
(4) SIPG / NIPG / IIPGのどれを実装しているか明示されているか,
(5) SIPGなら二つのconsistency termsとpenalty termが正しいsignで入っているか,
(6) interior faceでplus/minus elementのcross blockまでassembleしているか,
(7) boundary face termがsymmetric Nitsche formと一致しているか,
(8) continuous subspaceへ制限するとinterior termsが消えNitsche methodになるか,
(9) penalty scaleがmesh geometryとpolynomial degreeに適合しているか,
(10) affine patch testを通るか,
(11) \(L^2\) とbroken \(H^1\) errorが期待orderで収束するか,
(12) anisotropic meshではnormal thicknessとtrace estimateを監査しているか,
(13) WOPSIPをSIPGと同じbilinear formだと誤認していないか,
(14) hybrid DGではskeleton unknownとelement unknownを区別しているか,
(15) static condensationでelement unknownをlocal eliminationしているか,
(16) hybridisationによるglobal DoF削減を無条件に主張していないか,
(17) Schur complementのconditioningとpreconditionerを別途監査しているか
を順に確認してください.

27.第19回の結論

DG法で最も大きく変わるのは,

\[ \boxed{ \text{element間continuityをspaceで課さず,face calculusで設計する} } \tag{30} \]

という点です.

そのface calculusが \[ \text{jump}, \qquad \text{average / numerical flux}, \qquad \text{penalty} \] です.

さらにDGは一種類ではなく, SIPG,NIPG,IIPG,LDG,BR2,WOPSIP,hybrid DGなど, fluxとstabilisationの設計そのものがmethodの違いになります.

そして第18回のNitsche法は, continuous interior spaceへSIPGを制限することで interior jump termsが消え,boundary termsだけが残るため,

\[ \boxed{ \text{Nitsche} \subset \text{interior-penalty DG philosophy} } \tag{31} \]

と理解できます.

Season 2 第7回の原則
DGでは 「element basis」より「faceで何を保存し,何をpenaliseするか」を先に決める.

次回はさらにcontinuity requirementを変え, Morley要素で4階問題をどう離散化するかへ進みます.

参考文献・関連ページ

  1. D. N. Arnold, F. Brezzi, B. Cockburn and L. D. Marini, “Unified analysis of discontinuous Galerkin methods for elliptic problems”, SIAM Journal on Numerical Analysis 39 (2002), 1749–1779.
  2. D. A. Di Pietro and A. Ern, Mathematical Aspects of Discontinuous Galerkin Methods, Springer, 2012.
  3. B. Rivière, Discontinuous Galerkin Methods for Solving Elliptic and Parabolic Equations, SIAM, 2008.
  4. J. A. Nitsche, “Über ein Variationsprinzip zur Lösung von Dirichlet-Problemen bei Verwendung von Teilräumen, die keinen Randbedingungen unterworfen sind”, Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg 36 (1971), 9–15.
  5. H. Ishizaka, “Anisotropic weakly over-penalised symmetric interior penalty method for the Stokes equation”, Journal of Scientific Computing 100 (2024), 53. DOI.
  6. H. Ishizaka, “Hybrid weakly over-penalised symmetric interior penalty method on anisotropic meshes”, Calcolo 61 (2024), 45. DOI.
  7. H. Ishizaka, “Nitsche's method under a semi-regular mesh condition”, Numerical Algorithms 102 (2026), 291–334. DOI.
  8. 第15回:CRとRTはなぜ相性がよいのか
  9. 第18回:Nitsche法とは何か

ページの先頭へ