ElementMarkers[m]
returns markers of a mesh element m.
ElementMarkers
ElementMarkers[m]
returns markers of a mesh element m.
Details and Options
- A mesh element
is one of PointElement, LineElement, TriangleElement, QuadElement, TetrahedronElement, PrismElement or HexahedronElement. - If a mesh element has no markers specified, 0 is returned as a default.
Examples
open all close allBasic Examples (1)
<<NDSolve`FEM`ElementMarkers returns markers present in mesh elements of an ElementMesh:
ElementMarkers[ToElementMesh[Rectangle[]]["BoundaryElements"]]//ShortPossible Issues (1)
ElementMarkers is a function to extract markers from mesh elements. ElementMarker is a symbol used to address these markers in partial differential equations or boundary conditions.
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}}, {66, 66, 66, 44, 44, 44}]},
"BoundaryElements" -> {LineElement[{{3, 2}, {1, 3}, {2, 4}, {4, 6}, {6, 1}, {6, 7}, {7, 5}, {5, 3}}, {11, 22, 33, 33, 22, 44, 55, 55}]},
"PointElements" -> {PointElement[{{1}, {2}, {3}, {4}, {5}, {6}, {7}}, {1, 2, 2, 3, 3, 4, 4}]}]Visualize the mesh with markers in the "MeshElements" in blue, the markers in the "BoundaryElements" in red and the markers in the "PointElements" in brown:
Show[
mesh["Wireframe"],
mesh["Wireframe"["MeshElementMarkerStyle" -> Blue]],
mesh["Wireframe"["MeshElement" -> "BoundaryElements", "MeshElementMarkerStyle" -> Red]],
mesh["Wireframe"["MeshElement" -> "PointElements", "MeshElementMarkerStyle" -> Brown]]
]Extract the point element markers from the point elements:
ElementMarkers[mesh["PointElements"]]Set Dirichlet conditions by using the ElementMarker symbol:
solution = NDSolveValue[{Laplacian[u[x, y], {x, y}] == 1, DirichletCondition[u[x, y] == 0, ElementMarker == 2], DirichletCondition[u[x, y] == 1, ElementMarker == 4]}, u, {x, y}∈mesh]Plot3D[solution[x, y], {x, y}∈mesh]Tech Notes
Text
Wolfram Research (2021), ElementMarkers, Wolfram Language function, https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMarkers.html.
CMS
Wolfram Language. 2021. "ElementMarkers." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMarkers.html.
APA
Wolfram Language. (2021). ElementMarkers. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMarkers.html
BibTeX
@misc{reference.wolfram_2026_elementmarkers, author="Wolfram Research", title="{ElementMarkers}", year="2021", howpublished="\url{https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMarkers.html}", note=[Accessed: 28-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_elementmarkers, organization={Wolfram Research}, title={ElementMarkers}, year={2021}, url={https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMarkers.html}, note=[Accessed: 28-June-2026]}