LCOV - code coverage report
Current view: top level - src/utils - PermutationTensor.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 23 24 95.8 %
Date: 2025-07-17 01:28:37 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          41 : PermutationTensor::eps(unsigned int i, unsigned int j)
      14             : {
      15          41 :   if (i == 0 && j == 1)
      16          16 :     return 1;
      17          25 :   else if (i == 1 && j == 0)
      18          16 :     return -1;
      19           9 :   return 0;
      20             : }
      21             : 
      22             : int
      23          52 : PermutationTensor::eps(unsigned int i, unsigned int j, unsigned int k)
      24             : {
      25          52 :   if (i == 0 && j > 0 && k > 0)
      26          12 :     return eps(j - 1, k - 1);
      27          40 :   else if (j == 0 && i > 0 && k > 0)
      28          12 :     return -eps(i - 1, k - 1);
      29          28 :   else if (k == 0 && i > 0 && j > 0)
      30          12 :     return eps(i - 1, j - 1);
      31          16 :   return 0;
      32             : }
      33             : 
      34             : int
      35          24 : PermutationTensor::eps(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
      36             : {
      37          24 :   if (i == 0 && j > 0 && k > 0 && l > 0)
      38           6 :     return eps(j - 1, k - 1, l - 1);
      39          18 :   else if (j == 0 && i > 0 && k > 0 && l > 0)
      40           6 :     return -eps(i - 1, k - 1, l - 1);
      41          12 :   else if (k == 0 && i > 0 && j > 0 && l > 0)
      42           6 :     return eps(i - 1, j - 1, l - 1);
      43           6 :   else if (l == 0 && i > 0 && j > 0 && k > 0)
      44           6 :     return -eps(i - 1, j - 1, k - 1);
      45           0 :   return 0;
      46             : }

Generated by: LCOV version 1.14