Skip to content

Commit 26457ad

Browse files
Converting some arguments to be const reference
1 parent d83c84d commit 26457ad

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/MeshField.hpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ class OmegahMeshField {
330330

331331
// evaluate a field at the specified local coordinate for each triangle
332332
template <typename ViewType, typename ShapeField>
333-
auto triangleLocalPointEval(ViewType localCoords, size_t NumPtsPerElem,
334-
ShapeField field) const {
333+
auto triangleLocalPointEval(const ViewType &localCoords, size_t NumPtsPerElem,
334+
const ShapeField &field) const {
335335
auto offsets = createOffsets(meshInfo.numTri, NumPtsPerElem);
336336
auto eval = triangleLocalPointEval<ViewType, ShapeField>(localCoords,
337337
offsets, field);
@@ -340,8 +340,9 @@ class OmegahMeshField {
340340

341341
// evaluate a field at the specified local coordinates for each triangle
342342
template <typename ViewType, typename ShapeField>
343-
auto triangleLocalPointEval(ViewType localCoords, Kokkos::View<LO *> offsets,
344-
ShapeField field) const {
343+
auto triangleLocalPointEval(const ViewType &localCoords,
344+
Kokkos::View<LO *> offsets,
345+
const ShapeField &field) const {
345346
const auto MeshDim = 2;
346347
if (mesh.dim() != MeshDim) {
347348
MeshField::fail("input mesh must be 2d\n");
@@ -360,17 +361,18 @@ class OmegahMeshField {
360361
}
361362

362363
template <typename ViewType, typename ShapeField>
363-
auto tetrahedronLocalPointEval(ViewType localCoords, size_t NumPtsPerElem,
364-
ShapeField field) const {
364+
auto tetrahedronLocalPointEval(const ViewType &localCoords,
365+
size_t NumPtsPerElem,
366+
const ShapeField &field) const {
365367
auto offsets = createOffsets(meshInfo.numTet, NumPtsPerElem);
366368
auto eval = tetrahedronLocalPointEval(localCoords, offsets, field);
367369
return eval;
368370
}
369371

370372
template <typename ViewType, typename ShapeField>
371-
auto tetrahedronLocalPointEval(ViewType localCoords,
373+
auto tetrahedronLocalPointEval(const ViewType &localCoords,
372374
Kokkos::View<LO *> offsets,
373-
ShapeField field) const {
375+
const ShapeField &field) const {
374376
const auto MeshDim = 3;
375377
if (mesh.dim() != MeshDim) {
376378
MeshField::fail("input mesh must be 3d\n");

0 commit comments

Comments
 (0)