LCOV - code coverage report
Current view: top level - include/geom - face.h (source / functions) Hit Total Coverage
Test: libMesh/libmesh: #4229 (6a9aeb) with base 727f46 Lines: 15 15 100.0 %
Date: 2025-08-19 19:27:09 Functions: 9 10 90.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : // The libMesh Finite Element Library.
       2             : // Copyright (C) 2002-2025 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
       3             : 
       4             : // This library is free software; you can redistribute it and/or
       5             : // modify it under the terms of the GNU Lesser General Public
       6             : // License as published by the Free Software Foundation; either
       7             : // version 2.1 of the License, or (at your option) any later version.
       8             : 
       9             : // This library is distributed in the hope that it will be useful,
      10             : // but WITHOUT ANY WARRANTY; without even the implied warranty of
      11             : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      12             : // Lesser General Public License for more details.
      13             : 
      14             : // You should have received a copy of the GNU Lesser General Public
      15             : // License along with this library; if not, write to the Free Software
      16             : // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
      17             : 
      18             : 
      19             : 
      20             : #ifndef LIBMESH_FACE_H
      21             : #define LIBMESH_FACE_H
      22             : 
      23             : // Local includes
      24             : #include "libmesh/elem.h"
      25             : 
      26             : namespace libMesh
      27             : {
      28             : 
      29             : /**
      30             :  * The \p Face is an abstract element type that lives in two
      31             :  * dimensions.  A face can be a triangle or quadrilateral in general.
      32             :  *
      33             :  * \author Benjamin S. Kirk
      34             :  * \date 2002
      35             :  * \brief The base class for all 2D geometric element types.
      36             :  */
      37             : class Face : public Elem
      38             : {
      39             : public:
      40             : 
      41             :   /**
      42             :    * Constructor.  Explicitly specifies the number of
      43             :    * nodes and neighbors for which storage will be allocated.
      44             :    */
      45    27968316 :   Face (const unsigned int nn,
      46             :         const unsigned int ns,
      47             :         Elem * p,
      48             :         Elem ** elemlinkdata,
      49  4527579857 :         Node ** nodelinkdata) :
      50  4527579857 :     Elem(nn, ns, p, elemlinkdata, nodelinkdata) {}
      51             : 
      52             :   Face (Face &&) = delete;
      53             :   Face (const Face &) = delete;
      54             :   Face & operator= (const Face &) = delete;
      55             :   Face & operator= (Face &&) = delete;
      56  3473172913 :   virtual ~Face() = default;
      57             : 
      58             :   /**
      59             :    * \returns 2, the dimensionality of the object.
      60             :    */
      61 24619020555 :   virtual unsigned short dim () const override final { return 2; }
      62             : 
      63             :   /**
      64             :    * \returns 0.  All 2D elements have no faces, just
      65             :    * edges.
      66             :    */
      67     4737275 :   virtual unsigned int n_faces() const override final { return 0; }
      68             : 
      69             :   /**
      70             :    * build_side and build_edge are identical for faces.
      71             :    */
      72    29377686 :   virtual std::unique_ptr<Elem> build_edge_ptr (const unsigned int i) override final
      73    29377686 :   { return build_side_ptr(i); }
      74             : 
      75             :   /**
      76             :    * build_side and build_edge are identical for faces.
      77             :    */
      78       92376 :   virtual void build_edge_ptr (std::unique_ptr<Elem> & edge, const unsigned int i) override final
      79       92376 :   { build_side_ptr(edge, i); }
      80             : 
      81             :   /**
      82             :    * For the const build_edge_ptr we use the parent method
      83             :    */
      84             :   using Elem::build_edge_ptr;
      85             : 
      86             :  /**
      87             :    * is_edge_on_side is trivial in 2D.
      88             :    */
      89    32474052 :   virtual bool is_edge_on_side(const unsigned int e,
      90             :                                const unsigned int s) const override final
      91    32474052 :   { return (e == s); }
      92             : 
      93             :   /**
      94             :    * sides_on_edge is trivial in 2D.
      95             :    */
      96        4728 :   virtual std::vector<unsigned int> sides_on_edge(const unsigned int e) const override final
      97        4728 :   { return {e}; }
      98             : 
      99             :   /**
     100             :    * \returns The "circumcenter of mass" (area-weighted average of
     101             :    * triangulation circumcenters) of the element.
     102             :    *
     103             :    * Currently ignores curvature of element edges.
     104             :    */
     105             :   virtual Point quasicircumcenter () const override;
     106             : 
     107             : #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
     108             : 
     109             :   /**
     110             :    * \returns \p false.  All classes derived from \p Face
     111             :    * are finite elements.
     112             :    */
     113   216581750 :   virtual bool infinite () const override final { return false; }
     114             : 
     115             : #endif
     116             : 
     117             : };
     118             : 
     119             : } // namespace libMesh
     120             : 
     121             : #endif // LIBMESH_FACE_H

Generated by: LCOV version 1.14