LCOV - code coverage report
Current view: top level - src/mesquite/TargetMetric - TMetricBarrier.hpp (source / functions) Hit Total Coverage
Test: coverage_sk.info Lines: 6 8 75.0 %
Date: 2020-07-18 00:09:26 Functions: 3 4 75.0 %
Branches: 1 4 25.0 %

           Branch data     Line data    Source code
       1                 :            : /* *****************************************************************
       2                 :            :     MESQUITE -- The Mesh Quality Improvement Toolkit
       3                 :            : 
       4                 :            :     Copyright 2010 Sandia National Laboratories.  Developed at the
       5                 :            :     University of Wisconsin--Madison under SNL contract number
       6                 :            :     624796.  The U.S. Government and the University of Wisconsin
       7                 :            :     retain certain rights to this software.
       8                 :            : 
       9                 :            :     This library is free software; you can redistribute it and/or
      10                 :            :     modify it under the terms of the GNU Lesser General Public
      11                 :            :     License as published by the Free Software Foundation; either
      12                 :            :     version 2.1 of the License, or (at your option) any later version.
      13                 :            : 
      14                 :            :     This library is distributed in the hope that it will be useful,
      15                 :            :     but WITHOUT ANY WARRANTY; without even the implied warranty of
      16                 :            :     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      17                 :            :     Lesser General Public License for more details.
      18                 :            : 
      19                 :            :     You should have received a copy of the GNU Lesser General Public License
      20                 :            :     (lgpl.txt) along with this library; if not, write to the Free Software
      21                 :            :     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
      22                 :            : 
      23                 :            :     (2010) [email protected]
      24                 :            : 
      25                 :            :   ***************************************************************** */
      26                 :            : 
      27                 :            : /** \file TRelMetricBarrier.hpp
      28                 :            :  *  \brief
      29                 :            :  *  \author Boyd Tidwell
      30                 :            :  */
      31                 :            : 
      32                 :            : #ifndef MSQ_T_METRIC_BARRIER_HPP
      33                 :            : #define MSQ_T_METRIC_BARRIER_HPP
      34                 :            : 
      35                 :            : #include "Mesquite.hpp"
      36                 :            : #include "TMetric.hpp"
      37                 :            : #include <string>
      38                 :            : 
      39                 :            : namespace MBMesquite
      40                 :            : {
      41                 :            : 
      42         [ +  - ]:        194 : static const std::string& barrier_violated_msg =
      43                 :        194 :     " Barrier of barrier metric has been violated due to negative volume.\n \
      44                 :            :   Hint: If your initial mesh is tangled, you must use a non-Barrier metric.\n \
      45                 :            :         If a Barrier metric is used, you can only use untangled initial meshes.\n";
      46                 :            : 
      47                 :            : class MsqError;
      48                 :            : template < unsigned R, unsigned C >
      49                 :            : class MsqMatrix;
      50                 :            : 
      51                 :         38 : class TMetricBarrier : public TMetric
      52                 :            : {
      53                 :            :   public:
      54                 :            :     MESQUITE_EXPORT virtual ~TMetricBarrier();
      55                 :            : 
      56                 :          0 :     MESQUITE_EXPORT virtual std::string get_name() const
      57                 :            :     {
      58         [ #  # ]:          0 :         return "TMetricBarrier";
      59                 :            :     }
      60                 :            : 
      61                 :   11851717 :     static inline bool invalid_determinant( double d )
      62                 :            :     {
      63                 :   11851717 :         return d < 1e-12;
      64                 :            :     }
      65                 :            : };
      66                 :            : 
      67                 :          2 : class TMetricBarrier2D : public TMetricBarrier
      68                 :            : {
      69                 :            :   public:
      70                 :            :     MESQUITE_EXPORT virtual ~TMetricBarrier2D();
      71                 :            : 
      72                 :            :     /**\brief Evaluate \f$\mu(T)\f$
      73                 :            :      *
      74                 :            :      * This method always returns an error for 2D-only metrics
      75                 :            :      */
      76                 :            :     MESQUITE_EXPORT virtual bool evaluate( const MsqMatrix< 3, 3 >& T, double& result, MsqError& err );
      77                 :            : };
      78                 :            : 
      79                 :            : class TMetricBarrier3D : public TMetricBarrier
      80                 :            : {
      81                 :            :   public:
      82                 :            :     MESQUITE_EXPORT virtual ~TMetricBarrier3D();
      83                 :            : 
      84                 :            :     /**\brief Evaluate \f$\mu(T)\f$
      85                 :            :      *
      86                 :            :      * This method always returns an error for 3D-only metrics
      87                 :            :      */
      88                 :            :     MESQUITE_EXPORT virtual bool evaluate( const MsqMatrix< 2, 2 >& T, double& result, MsqError& err );
      89                 :            : };
      90                 :            : 
      91                 :            : }  // namespace MBMesquite
      92                 :            : 
      93                 :            : #endif

Generated by: LCOV version 1.11