ElementMeshProjection[mesh,p]
applies the projection p to the coordinates of an ElementMesh mesh.
ElementMeshProjection
ElementMeshProjection[mesh,p]
applies the projection p to the coordinates of an ElementMesh mesh.
Details and Options
- ElementMeshProjection returns a new ElementMesh with coordinates computed by mapping p/@mesh["Coordinates"].
- ElementMeshProjection can be used to project a 3D boundary mesh to a 2D mesh.
- ElementMeshProjection can be used to create parts of a 3D boundary mesh from a 2D mesh.
- ElementMeshProjection can be used to scale or rotate a mesh.
- ElementMeshProjection accepts the same options as ElementMesh.
Examples
open all close allBasic Examples (2)
Needs["NDSolve`FEM`"]Create an ElementMesh:
mesh2D = ToElementMesh[Rectangle[]]Visualize the ElementMesh:
mesh2D["Wireframe"]projectedMesh = ElementMeshProjection[mesh2D, RotationTransform[π / 3]]Visualize the projected ElementMesh:
projectedMesh["Wireframe"]Create and visualize a 2D ElementMesh:
mesh2D = ToElementMesh[Rectangle[]];
mesh2D["Wireframe"]projectedMesh = ElementMeshProjection[mesh2D, {#[[1]], #[[2]], 0.}&]Visualize the projected ElementMesh:
projectedMesh["Wireframe"]Scope (7)
1D to 1D (1)
Create and visualize a 1D ElementMesh:
mesh1D = ToElementMesh[Line[{{0}, {2π}}]];
mesh1D["Wireframe"]ElementMeshProjection[mesh1D, {2 * #[[1]]}&]2D to 2D (2)
Create and visualize a 2D ElementMesh:
mesh2D = ToElementMesh[Rectangle[]];
mesh2D["Wireframe"]projectedMesh = ElementMeshProjection[mesh2D, {#[[1]], 2 * #[[2]]}&]Visualize the projected ElementMesh:
projectedMesh["Wireframe"]Create and visualize a 2D boundary ElementMesh:
boundaryMesh2D = ToBoundaryMesh[Rectangle[]];
boundaryMesh2D["Wireframe"]projectedMesh = ElementMeshProjection[boundaryMesh2D, {#[[1]], 2 * #[[2]]}&]Visualize the projected boundary ElementMesh:
projectedMesh["Wireframe"]2D to 3D (2)
Create and visualize a 2D ElementMesh:
mesh2D = ToElementMesh[Rectangle[]];
mesh2D["Wireframe"]projectedMesh = ElementMeshProjection[mesh2D, {#[[1]], 2 * #[[2]], 0.}&]Visualize the projected boundary ElementMesh:
projectedMesh["Wireframe"]Create and visualize a 2D ElementMesh:
mesh2D = ToElementMesh[Rectangle[]];
mesh2D["Wireframe"]projectedMesh = ElementMeshProjection[mesh2D, {#[[1]], #[[2]], #[[1]] + #[[2]]}&]Visualize the projected boundary ElementMesh:
projectedMesh["Wireframe"]3D to 3D (1)
Create and visualize a 3D ElementMesh:
mesh3D = ToElementMesh[Ball[]];
mesh3D["Wireframe"]projectedMesh = ElementMeshProjection[mesh3D, {#[[1]], #[[2]], 2 * #[[3]]}&]Visualize the projected ElementMesh:
projectedMesh["Wireframe"]3D to 2D (1)
Create and visualize a 3D boundary ElementMesh:
boundaryMesh3D = ToBoundaryMesh[Polygon[{{0, 0, 0}, {3, 0, 0}, {3, 3, 0}, {0, 3, 0}, {1, 1, 0}, {1, 2, 0}, {2, 2, 0}, {2, 1, 0}}, {1, 2, 3, 4} -> {{5, 6, 7, 8}}]];boundaryMesh3D["Wireframe"]Project the boundary mesh to 2D:
projectedMesh = ElementMeshProjection[boundaryMesh3D, {#[[1]], #[[2]]}&]Visualize the projected ElementMesh:
projectedMesh["Wireframe"]Applications (1)
Make a rotational transform on a full element mesh:
mesh3D = ToElementMesh[Cuboid[{0, 0, 0}, {1, 2, 3}]];
result1 = ElementMeshProjection[mesh3D, RotationTransform[{{0, 0, 1}, {1, 1, 1}}]]Visualize the original wireframe mesh in black and the transformed wireframe in blue:
Show[result1["Wireframe"["MeshElementStyle" -> Directive[EdgeForm[Blue]]]], mesh3D["Wireframe"]]Possible Issues (3)
Projections from 3D to 1D and vice versa are not implemented:
ElementMeshProjection[ToElementMesh[Ball[]], {#[[1]]}&]Projections from 2D to 1D and vice versa are not implemented:
ElementMeshProjection[ToElementMesh[Rectangle[]], {#[[1]]}&]Projections can lead to a distorted ElementMesh:
ElementMeshProjection[ToElementMesh[Cuboid[{0, 0, 0}, {1, 2, 3}]], {#[[1]], #[[3]] / 10, 5 * #[[2]]}&]In some cases, this can be circumvented by using a different element type:
ElementMeshProjection[ToElementMesh[Cuboid[{0, 0, 0}, {1, 2, 3}], "MeshElementType" -> TetrahedronElement], {#[[1]], #[[3]] / 10, 5 * #[[2]]}&]Tech Notes
Text
Wolfram Research (2024), ElementMeshProjection, Wolfram Language function, https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMeshProjection.html.
CMS
Wolfram Language. 2024. "ElementMeshProjection." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMeshProjection.html.
APA
Wolfram Language. (2024). ElementMeshProjection. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMeshProjection.html
BibTeX
@misc{reference.wolfram_2026_elementmeshprojection, author="Wolfram Research", title="{ElementMeshProjection}", year="2024", howpublished="\url{https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMeshProjection.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_elementmeshprojection, organization={Wolfram Research}, title={ElementMeshProjection}, year={2024}, url={https://reference.wolfram.com/language/FEMDocumentation/ref/ElementMeshProjection.html}, note=[Accessed: 15-June-2026]}