BUG: Horizontal R space on tensor product element is not globally constant

オープン
#5,394 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
backend

調査の方向性

まず issue の reproducer を実行し、ベースメッシュの解像度を上げたときの R × CG と DQ0 × CG の関数空間の次元を比較します。TensorProductElement と extrusion で水平な R 要素がどのように表現されているかを追跡し、一覧にある各メッシュ解像度で 5 DOFs が得られることを確認して fix を検証します。

索引モデルが issue の本文から書いたものです。

説明

bug

Describe the bug
This is a bug only on the horizontal R space - not the vertical.

I would like to construct an element on a cuboid mesh that is a tensor product of R space and CG.

elt = TensorProductElement(FiniteElement("R", quadrilateral, 0),
FiniteElement("CG", interval, p))
M = FunctionSpace(mesh, elt)

This TensorProductElement treats the R space as a per-cell discontinuous constant.

Steps to Reproduce
The following code compares the actual number of DOFS for this TensorProductElement to the expected DOFs (P*Layers + 1 when CG^P is in the extrusion direction and R in the horizontal direction).

We only extrude in 2 layers for each example so the number of DOFs coming from CG should not change. If the R space works correctly then increasing the resolution of the base mesh should not change the number of DOFs.

from firedrake import *
P = 2
LAYERS = 2
EXPECTED = P * LAYERS + 1
print(f"{'nx,ny':>8} {'base cells':>11} {'R (x) CG':>10} {'DQ0 (x) CG':>11} {'expected':>9}")

for n in (1, 2, 3, 4):
    base = UnitSquareMesh(n, n, quadrilateral=True)
    mesh = ExtrudedMesh(base, layers=LAYERS, layer_height=1.0 / LAYERS)

    cg_v = FiniteElement("CG", interval, P)
    r_elt = TensorProductElement(FiniteElement("R", quadrilateral, 0), cg_v)
    dq_elt = TensorProductElement(FiniteElement("DQ", quadrilateral, 0), cg_v)

    dim_r = FunctionSpace(mesh, r_elt).dim()
    dim_dq = FunctionSpace(mesh, dq_elt).dim()

    print(f"{f'{n},{n}':>8} {n*n:>11} {dim_r:>10} {dim_dq:>11} {EXPECTED:>9}")

Expected behavior
I expect every example R \times CG example in the above to have 5 DOFs.

Environment:

  • OS: MACOS
  • Python version: 3.14.6
主要言語
Python
スター
684
フォーク
204
平均マージ
4日 14時間
マージ済み PR(30日)
46

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

firedrakeproject/firedrake のほかの issue

firedrakeproject/firedrake の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。