From a78fd931155519965fc84918267dd17241dd61cf Mon Sep 17 00:00:00 2001 From: Sichao25 Date: Mon, 8 Sep 2025 18:04:25 -0400 Subject: [PATCH 1/2] fix missing return value compiler warning --- src/MeshField_ShapeField.hpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/MeshField_ShapeField.hpp b/src/MeshField_ShapeField.hpp index 6d3e900..8680451 100644 --- a/src/MeshField_ShapeField.hpp +++ b/src/MeshField_ShapeField.hpp @@ -96,14 +96,12 @@ struct QuadraticAccessor { KOKKOS_FUNCTION auto &operator()(int node, int component, int entity, Mesh_Topology t) const { - if (t == Vertex) { - return vtxField(node, component, entity); - } else if (t == Edge) { - return edgeField(node, component, entity); - } else { + if (t!= Vertex && t != Edge) { Kokkos::printf("%d is not a support topology\n", t); assert(false); } + return (t == Vertex) ? vtxField(node, component, entity) + : edgeField(node, component, entity); } }; @@ -128,12 +126,11 @@ template struct LinearAccessor { KOKKOS_FUNCTION auto &operator()(int entity, int node, int component, Mesh_Topology t) const { - if (t == Vertex) { - return vtxField(entity, node, component); - } else { + if (t != Vertex) { Kokkos::printf("%d is not a support topology\n", t); assert(false); } + return vtxField(entity, node, component); } }; From f8326d61f7305c1ba5b4a4773125383f63499c25 Mon Sep 17 00:00:00 2001 From: Sichao25 Date: Wed, 10 Sep 2025 22:02:43 -0400 Subject: [PATCH 2/2] format update --- src/MeshField_ShapeField.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MeshField_ShapeField.hpp b/src/MeshField_ShapeField.hpp index 8680451..cd841c2 100644 --- a/src/MeshField_ShapeField.hpp +++ b/src/MeshField_ShapeField.hpp @@ -96,12 +96,12 @@ struct QuadraticAccessor { KOKKOS_FUNCTION auto &operator()(int node, int component, int entity, Mesh_Topology t) const { - if (t!= Vertex && t != Edge) { + if (t != Vertex && t != Edge) { Kokkos::printf("%d is not a support topology\n", t); assert(false); } return (t == Vertex) ? vtxField(node, component, entity) - : edgeField(node, component, entity); + : edgeField(node, component, entity); } };