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

           Branch data     Line data    Source code
       1                 :            : /* *****************************************************************
       2                 :            :     MESQUITE -- The Mesh Quality Improvement Toolkit
       3                 :            : 
       4                 :            :     Copyright 2006 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                 :            :     (2006) [email protected]
      24                 :            : 
      25                 :            :   ***************************************************************** */
      26                 :            : 
      27                 :            : /** \file AWMetricBarrier.hpp
      28                 :            :  *  \brief
      29                 :            :  *  \author Boyd Tidwell
      30                 :            :  */
      31                 :            : 
      32                 :            : #ifndef MSQ_AW_METRIC_BARRIER_HPP
      33                 :            : #define MSQ_AW_METRIC_BARRIER_HPP
      34                 :            : 
      35                 :            : #include "Mesquite.hpp"
      36                 :            : #include "AWMetric.hpp"
      37                 :            : #include <string>
      38                 :            : 
      39                 :            : namespace MBMesquite
      40                 :            : {
      41                 :            : 
      42         [ +  - ]:         61 : static const std::string& barrier_violated_msg_aw =
      43                 :         61 :     " 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                 :            : /**\brief A metric for comparing a matrix A with a target matrix W
      52                 :            :  *
      53                 :            :  * Implement a scalar function \f$\mu(A,W)\f$ where A and W are 2x2 or 3x3 matrices.
      54                 :            :  */
      55                 :            : class AWMetricBarrier : public AWMetric
      56                 :            : {
      57                 :            :   public:
      58                 :            :     MESQUITE_EXPORT virtual ~AWMetricBarrier();
      59                 :            : 
      60                 :          0 :     MESQUITE_EXPORT virtual std::string get_name() const
      61                 :            :     {
      62         [ #  # ]:          0 :         return "AWMetricBarrier";
      63                 :            :     }
      64                 :            : 
      65                 :            :     static inline bool invalid_determinant( double d )
      66                 :            :     {
      67                 :            :         return d < 1e-12;
      68                 :            :     }
      69                 :            : };
      70                 :            : 
      71                 :            : class AWMetricBarrier2D : public AWMetricBarrier
      72                 :            : {
      73                 :            :   public:
      74                 :            :     MESQUITE_EXPORT virtual ~AWMetricBarrier2D();
      75                 :            : 
      76                 :            :     /**\brief Evaluate \f$\mu(A,W)\f$
      77                 :            :      *
      78                 :            :      * This method always returns an error for 2D-only metrics
      79                 :            :      */
      80                 :            :     MESQUITE_EXPORT virtual bool evaluate( const MsqMatrix< 3, 3 >& A, const MsqMatrix< 3, 3 >& W, double& result,
      81                 :            :                                            MsqError& err );
      82                 :            : };
      83                 :            : 
      84                 :            : class AWMetricBarrier3D : public AWMetricBarrier
      85                 :            : {
      86                 :            :   public:
      87                 :            :     MESQUITE_EXPORT virtual ~AWMetricBarrier3D();
      88                 :            : 
      89                 :            :     /**\brief Evaluate \f$\mu(A,W)\f$
      90                 :            :      *
      91                 :            :      * This method always returns an error for 3D-only metrics
      92                 :            :      */
      93                 :            :     MESQUITE_EXPORT virtual bool evaluate( const MsqMatrix< 2, 2 >& A, const MsqMatrix< 2, 2 >& W, double& result,
      94                 :            :                                            MsqError& err );
      95                 :            : };
      96                 :            : 
      97                 :            : }  // namespace MBMesquite
      98                 :            : 
      99                 :            : #endif

Generated by: LCOV version 1.11