LCOV - code coverage report
Current view: top level - include/utils - ArbitraryQuadrature.h (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 3 3 100.0 %
Date: 2025-07-17 01:28:37 Functions: 4 4 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             : // MOOSE includes
      13             : #include "Moose.h"
      14             : 
      15             : #include "libmesh/quadrature.h"
      16             : 
      17             : /**
      18             :  * Implements a fake quadrature rule where you can specify the locations
      19             :  * (in the reference domain) of the quadrature points.
      20             :  */
      21             : class ArbitraryQuadrature : public libMesh::QBase
      22             : {
      23             : public:
      24             :   ArbitraryQuadrature(const unsigned int _dim,
      25             :                       const libMesh::Order _order = libMesh::INVALID_ORDER);
      26             : 
      27             :   /**
      28             :    * Copy/move ctor, copy/move assignment operator, and destructor are
      29             :    * all explicitly defaulted for this simple class.
      30             :    */
      31         536 :   ArbitraryQuadrature(const ArbitraryQuadrature &) = default;
      32             :   ArbitraryQuadrature(ArbitraryQuadrature &&) = default;
      33             :   ArbitraryQuadrature & operator=(const ArbitraryQuadrature &) = default;
      34             :   ArbitraryQuadrature & operator=(ArbitraryQuadrature &&) = default;
      35     1063194 :   virtual ~ArbitraryQuadrature() = default;
      36             : 
      37             :   libMesh::QuadratureType type() const override;
      38             : 
      39             :   /**
      40             :    * Set the quadrature points. Note that this also sets the quadrature weights to unity
      41             :    */
      42             :   void setPoints(const std::vector<libMesh::Point> & points);
      43             : 
      44             :   /**
      45             :    * Set the quadrature weights
      46             :    */
      47             :   void setWeights(const std::vector<libMesh::Real> & weights);
      48             : 
      49      728866 :   virtual bool shapes_need_reinit() override { return true; }
      50             : 
      51             :   virtual std::unique_ptr<libMesh::QBase> clone() const override;
      52             : 
      53             : private:
      54             :   /**
      55             :    * These functions must be defined to fulfill the interface expected
      56             :    * by the quadrature initialization routines.  The names and
      57             :    * signatures depend on what version of libMesh we are compiled
      58             :    * against.
      59             :    */
      60             : #ifdef LIBMESH_QBASE_INIT_ARGUMENTS_REMOVED
      61             :   void init_1D() override;
      62             :   void init_2D() override;
      63             :   void init_3D() override;
      64             : #else
      65             :   void init_1D(const libMesh::ElemType _type = libMesh::INVALID_ELEM,
      66             :                unsigned int p_level = 0) override;
      67             :   void init_2D(const libMesh::ElemType _type = libMesh::INVALID_ELEM,
      68             :                unsigned int p_level = 0) override;
      69             :   void init_3D(const libMesh::ElemType _type = libMesh::INVALID_ELEM,
      70             :                unsigned int p_level = 0) override;
      71             : #endif // LIBMESH_QBASE_INIT_ARGUMENTS_REMOVED
      72             : };

Generated by: LCOV version 1.14