LCOV - code coverage report
Current view: top level - include/quadrature - quadrature_conical.h (source / functions) Hit Total Coverage
Test: libMesh/libmesh: #4229 (6a9aeb) with base 727f46 Lines: 6 8 75.0 %
Date: 2025-08-19 19:27:09 Functions: 3 4 75.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             : #ifndef LIBMESH_QUADRATURE_CONICAL_H
      20             : #define LIBMESH_QUADRATURE_CONICAL_H
      21             : 
      22             : // Local includes
      23             : #include "libmesh/quadrature.h"
      24             : 
      25             : namespace libMesh
      26             : {
      27             : 
      28             : /**
      29             :  * This class implements the so-called conical product quadrature
      30             :  * rules for Tri and Tet elements. These rules are generally
      31             :  * non-optimal in the number of evaluation points, but have the following nice
      32             :  * properties:
      33             :  * .) All positive weights.
      34             :  * .) Easily constructed for any order given the underlying 1D Gauss
      35             :  *    and Jacobi quadrature rules.
      36             :  * The construction of these rules is given by e.g.
      37             :  * A. H. Stroud, "Approximate Calculation of Multiple Integrals.", 1972.
      38             :  *
      39             :  * \author John W. Peterson
      40             :  * \date 2008
      41             :  * \brief Conical product quadrature rules for Tri and Tet elements.
      42             :  */
      43             : class QConical final : public QBase
      44             : {
      45             : public:
      46             : 
      47             :   /**
      48             :    * Constructor.  Declares the order of the quadrature rule.
      49             :    */
      50        2229 :   QConical (unsigned int d,
      51       20168 :             Order o=INVALID_ORDER) :
      52       20168 :     QBase(d,o)
      53             :   {
      54        2229 :     if (d == 1)
      55           0 :       init(EDGE2);
      56        2229 :   }
      57             : 
      58             :   /**
      59             :    * Copy/move ctor, copy/move assignment operator, and destructor are
      60             :    * all explicitly defaulted for this simple class.
      61             :    */
      62           0 :   QConical (const QConical &) = default;
      63             :   QConical (QConical &&) = default;
      64             :   QConical & operator= (const QConical &) = default;
      65             :   QConical & operator= (QConical &&) = default;
      66       20202 :   virtual ~QConical() = default;
      67             : 
      68             :   /**
      69             :    * \returns The QuadratureType for this class.
      70             :    */
      71             :   virtual QuadratureType type() const override;
      72             : 
      73             :   virtual std::unique_ptr<QBase> clone() const override;
      74             : 
      75             : private:
      76             : 
      77             :   /**
      78             :    * In 1D, use a Gauss rule.
      79             :    * In 2D, the conical product rule is only defined for Tris.
      80             :    * In 3D, the conical product rule is only defined for Tets.
      81             :    */
      82             :   virtual void init_1D () override;
      83             :   virtual void init_2D () override;
      84             :   virtual void init_3D () override;
      85             : 
      86             :   /**
      87             :    * Implementation of conical product rule for a Tri in 2D of
      88             :    * order get_order().
      89             :    */
      90             :   void conical_product_tri();
      91             : 
      92             :   /**
      93             :    * Implementation of conical product rule for a Tet in 3D of
      94             :    * order get_order().
      95             :    */
      96             :   void conical_product_tet();
      97             : 
      98             :   /**
      99             :    * Implementation of conical product rule for a Pyramid in 3D of
     100             :    * order get_order().
     101             :    */
     102             :   void conical_product_pyramid();
     103             : };
     104             : 
     105             : } // namespace libMesh
     106             : 
     107             : #endif // LIBMESH_QUADRATURE_CONICAL_H

Generated by: LCOV version 1.14