Repository navigation
Add Wedge topology and LinearWedgeShape - #113
Open
abhiyanpaudel wants to merge 14 commits into
Open
abhiyanpaudel wants to merge 14 commits into
abhiyanpaudel wants to merge 14 commits into
Conversation
Add Wedge to Mesh_Topology and numWedge to MeshInfo for wedge (triangular prism) elements. Wedge is appended after Pyramid so no existing enum value changes; Prism and numPrism are unchanged.
LinearWedgeShape is the linear wedge (triangular prism): the tensor product of the linear triangle in (xi0, xi1) and the linear edge in zeta in [-1, 1]. Nodes 0-2 are the triangle vertices at zeta = -1 and nodes 3-5 those at zeta = +1, following Zienkiewicz, Taylor and Zhu, Section 6.4, Fig. 6.16a. test/testWedgeShape.cpp checks the Kronecker delta property at the nodes and, at interior points, partition of unity, reproduction of the bilinear functions spanned by the basis and their gradients, and the analytic gradients against finite differences. test/testWedgeElement.cpp builds a FieldElement from a coordinate field, LinearWedgeShape and a small wedge-to-vertex map, and checks MeshField::evaluate, getJacobians and getJacobianDeterminants on a right prism and a skewed wedge against the geometric map written out by hand.
jacobmerson
reviewed
Oct 18, 2026
Comment on lines
+581
to
+585
| * Shape functions and ordering from: | ||
| * Zienkiewicz, Taylor, and Zhu | ||
| * 'The Finite Element Method: Its Basis and Fundamentals', 2013, Section 6.4, | ||
| * Fig. 6.16a: \f$N_a = \frac{1}{2} L_a (1 + \zeta_a \zeta)\f$, with | ||
| * \f$\zeta_a = -1\f$ for nodes 0-2 and \f$+1\f$ for nodes 3-5 |
Contributor
There was a problem hiding this comment.
Did you review this book?
Comment on lines
+589
to
+590
| static const size_t numNodes = 6; ///< Number of nodes (6 for linear wedge) | ||
| static const size_t meshEntDim = 3; ///< Mesh entity dimension (3D) |
Contributor
There was a problem hiding this comment.
why are these const but not constexpr?
| using MeshField::Real; | ||
| using Shape = MeshField::LinearWedgeShape; | ||
|
|
||
| KOKKOS_INLINE_FUNCTION bool isClose(Real a, Real b, Real tol) { |
Contributor
There was a problem hiding this comment.
this sort of utility should be in a utility header.
Comment on lines
+25
to
+27
| bool isClose(Real a, Real b) { | ||
| return Omega_h::are_close(a, b, 1e-12, 1e-12); | ||
| } |
Contributor
There was a problem hiding this comment.
This is a repeat of the same function you added previously..., but now you hardcoded the tolerances. Make sure you move it to a utility header. Also, tolerances should be based on the MeshFIeld config tolerances.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the
Wedgetopology and a linear wedge (triangular prism) shape function, as the first step toward wedge elements for field-aligned coupling applications. The basis is linear in the triangle coordinates and linear in zeta (tensor product, six nodes).Changes
src/MeshField_Defines.hpp: addWedgetoMesh_Topologysrc/MeshField_ShapeField.hpp: addnumWedgetoMeshInfosrc/MeshField_Shape.hpp: addLinearWedgeShape, following Zienkiewicz, Taylor & Zhu, The Finite Element Method, 7th ed., Section 6.4, Fig. 6.16atest/testLinearWedgeShape.cpp(new): Kronecker delta, partition of unity, reproduction of a function in span{1,test/testLinearWedgeElement.cpp(new):FieldElementevaluate, Jacobian and determinant on a right prism and a skewed wedge, checked against the hand-derived mapCMakeLists.txt: register the two tests