LCOV - code coverage report
Current view: top level - src/quadrature - quadrature_trap_2D.C (source / functions) Hit Total Coverage
Test: libMesh/libmesh: #4481 (67a8c4) with base cc8438 Lines: 19 21 90.5 %
Date: 2026-06-12 15:24:28 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : // The libMesh Finite Element Library.
       2             : // Copyright (C) 2002-2026 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             : // Local includes
      21             : #include "libmesh/quadrature_trap.h"
      22             : #include "libmesh/enum_to_string.h"
      23             : 
      24             : namespace libMesh
      25             : {
      26             : 
      27         426 : void QTrap::init_2D()
      28             : {
      29             : #if LIBMESH_DIM > 1
      30             : 
      31             :   //-----------------------------------------------------------------------
      32             :   // 2D quadrature rules
      33         426 :   switch (_type)
      34             :     {
      35             : 
      36             : 
      37             :       //---------------------------------------------
      38             :       // Quadrilateral quadrature rules
      39          14 :     case QUAD4:
      40             :     case QUADSHELL4:
      41             :     case QUAD8:
      42             :     case QUADSHELL8:
      43             :     case QUAD9:
      44             :     case QUADSHELL9:
      45             :       {
      46             : 
      47             :         // We compute the 2D quadrature rule as a tensor
      48             :         // product of the 1D quadrature rule.
      49          18 :         QTrap q1D(1);
      50             : 
      51          14 :         tensor_product_quad( q1D );
      52             : 
      53           4 :         return;
      54             :       }
      55             : 
      56             : 
      57             :       //---------------------------------------------
      58             :       // Triangle quadrature rules
      59         412 :     case TRI3:
      60             :     case TRISHELL3:
      61             :     case TRI3SUBDIVISION:
      62             :     case TRI6:
      63             :     case TRI7:
      64             :       {
      65         412 :         _points.resize(3);
      66         412 :         _weights.resize(3);
      67             : 
      68         412 :         _points[0](0) = 0.;
      69         412 :         _points[0](1) = 0.;
      70             : 
      71         412 :         _points[1](0) = 1.;
      72         412 :         _points[1](1) = 0.;
      73             : 
      74         412 :         _points[2](0) = 0.;
      75         412 :         _points[2](1) = 1.;
      76             : 
      77             : 
      78         412 :         _weights[0] = 1/Real(6);
      79         412 :         _weights[1] = 1/Real(6);
      80         412 :         _weights[2] = 1/Real(6);
      81             : 
      82         412 :         return;
      83             :       }
      84             : 
      85             : 
      86             :       //---------------------------------------------
      87             :       // Unsupported type
      88           0 :     default:
      89           0 :       libmesh_error_msg("Element type not supported!:" << Utility::enum_to_string(_type));
      90             :     }
      91             : #endif
      92             : }
      93             : 
      94             : } // namespace libMesh

Generated by: LCOV version 1.14