LCOV - code coverage report
Current view: top level - include/utils - TwoVector.h (source / functions) Hit Total Coverage
Test: idaholab/moose contact: 8601ad Lines: 3 3 100.0 %
Date: 2025-07-18 13:27:36 Functions: 2 2 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             : #pragma once
      11             : 
      12             : #include "EigenADReal.h"
      13             : #include <Eigen/Dense>
      14             : 
      15             : /**
      16             :  * A two-component zero initialized vector used for tangential quantities
      17             :  */
      18             : template <typename T>
      19      121937 : class GenericTwoVector : public Eigen::Matrix<T, 2, 1>
      20             : {
      21             : public:
      22        3110 :   GenericTwoVector() { this->setZero(); }
      23      249953 :   using Eigen::Matrix<T, 2, 1>::Matrix;
      24             : };
      25             : 
      26             : using TwoVector = GenericTwoVector<Real>;
      27             : using ADTwoVector = GenericTwoVector<ADReal>;
      28             : 
      29             : namespace MetaPhysicL
      30             : {
      31             : // raw_value AD->non-AD conversion for ADReal valued Eigen::Matrix objects
      32             : template <>
      33             : struct RawType<ADTwoVector>
      34             : {
      35             :   typedef TwoVector value_type;
      36             : 
      37             :   static value_type value(const ADTwoVector & in)
      38             :   {
      39             :     return value_type::NullaryExpr([&in](Eigen::Index i) { return raw_value(in(i)); });
      40             :   }
      41             : };
      42             : }

Generated by: LCOV version 1.14