LCOV - code coverage report
Current view: top level - src/utils - PermutationTensor.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 863ef6 Lines: 23 24 95.8 %
Date: 2025-10-15 18:16:15 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       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             : #include "PermutationTensor.h"
      11             : 
      12             : int
      13          82 : PermutationTensor::eps(unsigned int i, unsigned int j)
      14             : {
      15          82 :   if (i == 0 && j == 1)
      16          32 :     return 1;
      17          50 :   else if (i == 1 && j == 0)
      18          32 :     return -1;
      19          18 :   return 0;
      20             : }
      21             : 
      22             : int
      23         104 : PermutationTensor::eps(unsigned int i, unsigned int j, unsigned int k)
      24             : {
      25         104 :   if (i == 0 && j > 0 && k > 0)
      26          24 :     return eps(j - 1, k - 1);
      27          80 :   else if (j == 0 && i > 0 && k > 0)
      28          24 :     return -eps(i - 1, k - 1);
      29          56 :   else if (k == 0 && i > 0 && j > 0)
      30          24 :     return eps(i - 1, j - 1);
      31          32 :   return 0;
      32             : }
      33             : 
      34             : int
      35          48 : PermutationTensor::eps(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
      36             : {
      37          48 :   if (i == 0 && j > 0 && k > 0 && l > 0)
      38          12 :     return eps(j - 1, k - 1, l - 1);
      39          36 :   else if (j == 0 && i > 0 && k > 0 && l > 0)
      40          12 :     return -eps(i - 1, k - 1, l - 1);
      41          24 :   else if (k == 0 && i > 0 && j > 0 && l > 0)
      42          12 :     return eps(i - 1, j - 1, l - 1);
      43          12 :   else if (l == 0 && i > 0 && j > 0 && k > 0)
      44          12 :     return -eps(i - 1, j - 1, k - 1);
      45           0 :   return 0;
      46             : }

Generated by: LCOV version 1.14