LCOV - code coverage report
Current view: top level - include/kokkos/materials - KokkosMaterialPropertyValue.h (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 15 17 88.2 %
Date: 2026-05-29 20:35:17 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://www.mooseframework.org
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #pragma once
      11             : 
      12             : #include "KokkosMaterialPropertyValueDecl.h"
      13             : #include "KokkosMaterialPropertyDecl.h"
      14             : #include "KokkosDatum.h"
      15             : 
      16             : namespace Moose::Kokkos
      17             : {
      18             : 
      19             : template <typename T, unsigned int dimension>
      20             : KOKKOS_FUNCTION
      21    40059305 : MaterialPropertyValueBase<T, dimension>::MaterialPropertyValueBase(
      22           0 :     const MaterialProperty<T, dimension> & property, const Datum & datum, const unsigned int qp)
      23    40059305 :   : _idx(property._default ? libMesh::invalid_uint
      24    40059305 :                            : datum.propertyIdx(property._constant_option[datum.subdomain()], qp)),
      25    40059305 :     _data(property._default ? nullptr : &property._data[datum.subdomain()]),
      26    40059305 :     _value(property._value)
      27             : {
      28    40059305 : }
      29             : 
      30             : template <typename T, unsigned int dimension>
      31             : KOKKOS_FUNCTION
      32             : MaterialPropertyValue<T, dimension>::MaterialPropertyValue(
      33             :     const MaterialProperty<T, dimension> & property, const Datum & datum, const unsigned int qp)
      34             :   : MaterialPropertyValueBase<T, dimension>(property, datum, qp)
      35             : {
      36             : }
      37             : 
      38             : template <typename T>
      39             : KOKKOS_FUNCTION
      40    40059305 : MaterialPropertyValue<T, 0>::MaterialPropertyValue(const MaterialProperty<T, 0> & property,
      41             :                                                    const Datum & datum,
      42           0 :                                                    const unsigned int qp)
      43    40059305 :   : MaterialPropertyValueBase<T, 0>(property, datum, qp)
      44             : {
      45    40059305 : }
      46             : 
      47             : template <typename T>
      48             : KOKKOS_FUNCTION auto &
      49     6606901 : MaterialPropertyValue<T, 0>::operator=(const T & value)
      50             : {
      51     6606901 :   (*_data)(_idx) = value;
      52             : 
      53     6606901 :   return *this;
      54             : }
      55             : 
      56             : template <typename T>
      57             : KOKKOS_FUNCTION auto &
      58       84000 : MaterialPropertyValue<T, 0>::operator=(const MaterialPropertyValue<T, 0> & value)
      59             : {
      60       84000 :   (*_data)(_idx) = static_cast<T>(value);
      61             : 
      62       84000 :   return *this;
      63             : }
      64             : 
      65             : } // namespace Moose::Kokkos

Generated by: LCOV version 1.14