ElementMesh[…]
領域あるいは領域の境界の離散分割を説明するのに使われるデータを表す.
ElementMesh
ElementMesh[…]
領域あるいは領域の境界の離散分割を説明するのに使われるデータを表す.
詳細とオプション
- ElementMesh[…]は,ToElementMeshあるいはToBoundaryMeshによって生成される.
- ElementMesh[…]は,"FiniteElementData"および"ElementMesh"の特性を使ってNDSolve`ProcessEquationsによって生成されるNDSolve`StateDataオブジェクトから抽出できる.
- 標準の出力形式では,境界ボックスとメッシュ要素のタイプが示される.
- ElementMeshオブジェクトは,NDSolve,InitializePDEMethodData,NumericalRegionの入力として使われる.
- ElementMeshは次の特性を持つ.
-
"BoundaryConnectivity" 境界要素 i が繋がれる境界要素を bc[[i]]が与えるようなリスト bc を与える "BoundaryElements" 境界要素を与える "BoundaryElementMarkerUnion" すべての境界要素マーカーの和集合を与える "BoundaryNormals" 境界要素の法線を与える "Bounds" 境界を与える "Coordinates" 座標を与える "ElementConnectivity" 要素 i が繋がれる要素を ec[[i]] が与えるようなリスト ec を与える "EmbeddingDimension" 埋込み次元を与える "MeshElements" メッシュ要素を与える "MeshElementMarkerUnion" すべてのメッシュ要素マーカーの和集合を与える "MeshElementMeasure" 各メッシュ要素の測定値を与える "MeshOrder" メッシュの次数を与える "PointElements" 点要素を与える "PointElementMarkerUnion" すべての点要素マーカーの和集合を与える "Properties" 特性を与える "Quality" メッシュの質を計算する "VertexBoundaryConnectivity" vbc[[i]]が境界要素に繋がれている位置ノード i において1を含むiような,SparseArray vbc を与える "VertexElementConnectivity" vec[[i]]が要素に繋がれている位置ノード i において1を含むiような,SparseArray vec を与える
例題
すべて開く すべて閉じる例 (1)
<<NDSolve`FEM`mesh = ToElementMesh[Rectangle[]]mesh["Coordinates"]//Shortmesh["MeshElements"]//Shortmesh["BoundaryElements"]//Shortmesh["PointElements"]//Shortスコープ (24)
"BoundaryConnectivity" (1)
境界接続性は,境界要素がどのようにお互いに繋がれているかについての情報を与える.
mesh = ToElementMesh["Coordinates" -> {{1.293, 0.228}, {1., 0.}, {0.94, 0.342}, {1.293, 0.}, {1.215, 0.442}, {2., 0.}, {1.879, 0.684}}, "MeshElements" -> {TriangleElement[{{1, 3, 2}, {1, 2, 4}, {1, 4, 6}, {1, 6, 7}, {1, 7, 5}, {1, 5, 3}}]}]bc = mesh["BoundaryConnectivity"]bc[[1]]これらの境界要素は同様に,どちらも境界要素1に繋がれている:
bc[[%]]Show[
mesh["Wireframe"["MeshElement" -> "BoundaryElements", "MeshElementIDStyle" -> Blue]],
mesh["Wireframe"["MeshElement" -> "PointElements", "MeshElementIDStyle" -> Red]]]"BoundaryElements" (1)
mesh = ToElementMesh[Disk[], "MeshOrder" -> 1, "MaxCellMeasure" -> {"Length" -> 0.5}, AccuracyGoal -> 1];
mesh["BoundaryElements"]Show[
mesh["Wireframe"["MeshElement" -> "BoundaryElements"]],
mesh["Wireframe"["MeshElement" -> "PointElements", "MeshElementIDStyle" -> Red]]
]"BoundaryElementMarkerUnion" (1)
"BoundaryNormals" (3)
bmesh = ToBoundaryMesh[ImplicitRegion[And@@(# <= 0& /@ {-y, 1 / 25 - (-3 / 2 + x) ^ 2 - y ^ 2, 1 - x ^ 2 - y ^ 2, -4 + x ^ 2 + y ^ 2, (-x + 2 * y) / Sqrt[5]}), {{x, 0.8, 2.2}, {y, -0.2, 1.}}]]Short[bn = bmesh["BoundaryNormals"]]法線を可視化するために,境界要素座標の平均を計算し,法線ベクトルをスケールされた矢印として表示する:
mean = Mean /@ GetElementCoordinates[bmesh["Coordinates"], #]& /@ ElementIncidents[bmesh["BoundaryElements"]];
Show[
bmesh["Wireframe"],
Graphics[MapThread[Arrow[{#1, #2}]&, {Join@@mean, Join@@(bn / 15 + mean)}]]]法線の方向は,境界セグメントの方向に依存することに注意する.
bmesh = ToBoundaryMesh["Coordinates" -> {{0.}, {1.}, {3.}}, "BoundaryElements" -> {PointElement[{{1}, {3}}], PointElement[{{2}}]}]bmesh["BoundaryNormals"]すべての場合において,法線の計算には第一次境界要素メッシュが使われる:
bmesh1 = ToBoundaryMesh[Rectangle[], "MeshOrder" -> 1];
bmesh2 = ToBoundaryMesh[Rectangle[], "MeshOrder" -> 2];bmesh1["BoundaryNormals"] === bmesh2["BoundaryNormals"]"Coordinates" (1)
"ElementConnectivity" (4)
mesh = ToElementMesh["Coordinates" -> {{1.293, 0.228}, {1., 0.}, {0.94, 0.342}, {1.293, 0.}, {1.215, 0.442}, {2., 0.}, {1.879, 0.684}}, "MeshElements" -> {TriangleElement[{{1, 3, 2}, {1, 2, 4}, {1, 4, 6}, {1, 6, 7}, {1, 7, 5}, {1, 5, 3}}]}]Show[
mesh["Wireframe"["MeshElementIDStyle" -> DarkGreen]],
mesh["Wireframe"["MeshElement" -> "PointElements", "MeshElementIDStyle" -> Red]]]第1要素の第1の辺はノード{3,2}を繋ぐもので,近傍要素を持たないので,0である.ノード2を中央のノードに繋ぐ第2の辺は,第2要素に繋がれている.第3要素は,中央のノードをノード3に繋ぐ辺を持ち,この辺は第6要素に繋がれている.第4要素以降の要素すべてについても同じように取り扱われる.
mesh["ElementConnectivity"]mesh = ToElementMesh[Rectangle[], "MeshOrder" -> 1, "MeshElementType" -> TriangleElement](ecv = mesh["ElementConnectivity"])//Shortecv[[1, 3]]ecv[[1, %]]Graphics[GraphicsComplex[mesh["Coordinates"], Polygon[ElementIncidents[mesh["MeshElements"]][[1]][[ecv[[1, 3]]]]]]]0以下のインシデントを含む要素の接続性はすべて,境界要素である:
(pos = Position[ecv, _ ? (!FreeQ[#, 0 | _ ? Negative]&), {2}])//Shortmesh["Wireframe"[pos]]Ω = ImplicitRegion[(x - 1 / 2) ^ 2 + (y - 1 / 2) ^ 2 ≥ (1 / 2) ^ 2 && (x + 1 / 2) ^ 2 + (y + 1 / 2) ^ 2 ≥ (1 / 2) ^ 2, {{x, -2, 2}, {y, -2, 2}}];
(mesh = ToElementMesh[Ω, "RegionHoles" -> {{-1 / 2, -1 / 2}}, "RegionMarker" -> {{{1 / 2, 1 / 2}, 2}, {{1 / 2, -1 / 2}, 1}}, "MaxBoundaryCellMeasure" -> 0.125])["Wireframe"](ecv = mesh["ElementConnectivity"])//Short0以下のインシデントを含む要素の接続性はすべて,境界要素である:
(pos = Position[ecv, _ ? (!FreeQ[#, 0 | _ ? Negative]&), {2}])//Short境界,内側の境界,境界に繋がれているすべての要素を可視化する:
Show[
mesh["Wireframe"[pos]],
mesh["Wireframe"["MeshElement" -> "BoundaryElements", "MeshElementStyle" -> Red]]](pos = Position[ecv, _ ? (!FreeQ[#, _ ? Negative]&), {2}])//ShortShow[
mesh["Wireframe"[pos]],
mesh["Wireframe"["MeshElement" -> "BoundaryElements", "MeshElementStyle" -> Red]]]四角と三角の要素,および要素の属性マーカーを持つメッシュを作成する:
coordinates = {{0., 0.}, {1., 0.}, {2., 0.}, {2.5, 0.5}, {0., 1.}, {1., 1.}, {2., 1.}, {3., 1.}, {2.5, 1.5}, {0., 2.}, {1., 2.}, {2., 2.}, {2., -0.5}, {2.5, 0.}, {3., 0.5}};mesh = ToElementMesh["Coordinates" -> coordinates, "MeshElements" -> {QuadElement[{{1, 2, 6, 5}, {2, 3, 7, 6}, {5, 6, 11, 10}, {6, 7, 12, 11}}, {1, 1, 2, 2}], TriangleElement[{{3, 4, 7}, {4, 8, 7}, {7, 9, 12}, {7, 8, 9}}, {1, 1, 2, 2}],
QuadElement[{{3, 13, 14, 4}, {14, 15, 8, 4}}, {1, 1}]
}]Show[
mesh["Wireframe"["MeshElement" -> "MeshElements", "MeshElementIDStyle" -> DarkGreen, "ContinuousElementID" -> True]],
mesh["Wireframe"["MeshElement" -> "PointElements", "MeshElementIDStyle" -> Red]]]mesh["ElementConnectivity"]"EmbeddingDimension" (1)
"MeshElements" (1)
"MeshElementMarkerUnion" (1)
4つ組と3つ組の要素,および要素の属性マーカーを含むメッシュを作成する:
coordinates = {{0., 0.}, {1., 0.}, {2., 0.}, {2.5, 0.5}, {0., 1.}, {1., 1.}, {2., 1.}, {3., 1.}, {2.5, 1.5}, {0., 2.}, {1., 2.}, {2., 2.}, {2., -0.5}, {2.5, 0.}, {3., 0.5}};mesh = ToElementMesh["Coordinates" -> coordinates, "MeshElements" -> {QuadElement[{{1, 2, 6, 5}, {2, 3, 7, 6}, {5, 6, 11, 10}, {6, 7, 12, 11}}, {1, 1, 2, 2}], TriangleElement[{{3, 4, 7}, {4, 8, 7}, {7, 9, 12}, {7, 8, 9}}, {1, 1, 2, 2}],
QuadElement[{{3, 13, 14, 4}, {14, 15, 8, 4}}, {1, 1}]
}]mesh["MeshElementMarkerUnion"]"MeshElementMeasure" (2)
coordinates = {{0., 0.}, {1., 0.}, {2., 0.}, {2.5, 0.5}, {0., 1.}, {1., 1.}, {2., 1.}, {3., 1.}, {2.5, 1.5}, {0., 2.}, {1., 2.}, {2., 2.}};mesh = ToElementMesh["Coordinates" -> coordinates, "MeshElements" -> {QuadElement[{{1, 2, 6, 5}, {2, 3, 7, 6}, {5, 6, 11, 10}, {6, 7, 12, 11}}], TriangleElement[{{3, 4, 7}, {4, 8, 7}, {7, 9, 12}, {7, 8, 9}}]}]mesh["Wireframe"]mesh["MeshElementMeasure"]Total[mesh["MeshElementMeasure"], 2]mesh = ToElementMesh[Disk[]];mesh["MeshOrder"]π - Total[mesh["MeshElementMeasure"], 2]mesh = ToElementMesh[Disk[], "MeshOrder" -> 1];mesh["MeshOrder"]π - Total[mesh["MeshElementMeasure"], 2]"MeshOrder" (1)
"PointElements" (1)
"PointElementMarkerUnion" (1)
"Properties" (1)
"Quality" (1)
"VertexBoundaryConnectivity" (1)
頂点の境界接続性は,頂点が境界要素にどのように繋がれているかについての情報を含む.
mesh = ToElementMesh[Rectangle[], "MeshOrder" -> 1, "MaxCellMeasure" -> 0.2]ノードを赤色で,境界の辺を青色でスタイル付けしたメッシュを可視化する:
Show[{
mesh["Wireframe"],
mesh["Wireframe"["MeshElement" -> "BoundaryElements", "MeshElementIDStyle" -> Blue]],
mesh["Wireframe"["MeshElement" -> "PointElements", "MeshElementIDStyle" -> Red]]}]Length[mesh["Coordinates"]]
Length[Join@@ElementIncidents[mesh["BoundaryElements"]]]vbc = mesh["VertexBoundaryConnectivity"]頂点の境界接続性の行列は,メッシュのノードと同じ数の行と,メッシュの境界要素を同じ数の列を持つ.それぞれの頂点の行に対して,列は,頂点が境界要素に繋がれている位置で1を含む:
vbc//MatrixFormvbc[[1]]["NonzeroPositions"]"VertexElementConnectivity" (1)
頂点の要素接続性は,頂点がメッシュ要素にどのように繋がれているかについての情報を持つ.
mesh = ToElementMesh[Rectangle[], "MeshOrder" -> 1, "MaxCellMeasure" -> 0.1]メッシュ要素の番号を青色でスタイル付けして,メッシュを可視化する:
Show[{
mesh["Wireframe"["MeshElement" -> "MeshElements", "MeshElementIDStyle" -> DarkGreen]]}]vec = mesh["VertexElementConnectivity"]Length[mesh["Coordinates"]]
Length[Join@@ElementIncidents[mesh["MeshElements"]]]MatrixPlot[vec]vec[[7]]["NonzeroPositions"]Graphics[GraphicsComplex[mesh["Coordinates"], {{EdgeForm[LightDarkSwitched[Black, White]], FaceForm[], Polygon[ElementIncidents[mesh["MeshElements"]][[1]][[Flatten[%]]]]},
{Red, PointSize[0.05], Point[7]}}]]特性と関係 (4)
ElementMeshは,InterpolatingFunctionオブジェクトから抽出できる:
data = RandomReal[{-1, 1}, {10, 3}];if = Interpolation[data, "InterpolationOrder" -> 1]mesh = if["ElementMesh"]mesh["Wireframe"]mesh = ToElementMesh[Disk[]]mesh["MeshOrder"](values = Function[{x, y}, Sqrt[x ^ 2 + y ^ 2]]@@@mesh["Coordinates"])//Shortif = ListInterpolation[values, mesh]Plot3D[if[x, y], {x, y}∈Disk[]]ElementMeshは,NDSolve`StateDataオブジェクトから抽出できる:
{state} = NDSolve`ProcessEquations[{-u^(0, 2)[x, y] - u^(2, 0)[x, y] == 1, DirichletCondition[u[x, y] == 0, True]}, u, {x, 0, 1}, {y, 0, 1}]state["FiniteElementData"]["FEMMethodData"]["ElementMesh"]ElementMeshは,NIntegrateの領域として使える:
mesh = ToElementMesh[Disk[]];
NIntegrate[1, {x, y}∈mesh]テクニカルノート
-
▪
- 要素メッシュの生成 ▪
- 要素メッシュの可視化
関連するガイド
-
▪
- 有限要素法
テキスト
Wolfram Research (2014), ElementMesh, Wolfram言語関数, https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMesh.html (2021年に更新).
CMS
Wolfram Language. 2014. "ElementMesh." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMesh.html.
APA
Wolfram Language. (2014). ElementMesh. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMesh.html
BibTeX
@misc{reference.wolfram_2026_elementmesh, author="Wolfram Research", title="{ElementMesh}", year="2021", howpublished="\url{https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMesh.html}", note=[Accessed: 17-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_elementmesh, organization={Wolfram Research}, title={ElementMesh}, year={2021}, url={https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMesh.html}, note=[Accessed: 17-August-2026]}