LCOV - code coverage report
Current view: top level - fem/integ - divdivmass.cpp (source / functions) Coverage Total Hit
Test: Palace Coverage Report Lines: 59.3 % 27 16
Test Date: 2025-10-23 22:45:05 Functions: 100.0 % 1 1
Legend: Lines: hit not hit

            Line data    Source code
       1              : // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
       2              : // SPDX-License-Identifier: Apache-2.0
       3              : 
       4              : #include "fem/integrator.hpp"
       5              : 
       6              : #include "fem/libceed/coefficient.hpp"
       7              : #include "fem/libceed/integrator.hpp"
       8              : 
       9              : #include "fem/qfunctions/l2mass_qf.h"
      10              : 
      11              : namespace palace
      12              : {
      13              : 
      14              : using namespace ceed;
      15              : 
      16           24 : void DivDivMassIntegrator::Assemble(Ceed ceed, CeedElemRestriction trial_restr,
      17              :                                     CeedElemRestriction test_restr, CeedBasis trial_basis,
      18              :                                     CeedBasis test_basis, CeedVector geom_data,
      19              :                                     CeedElemRestriction geom_data_restr,
      20              :                                     CeedOperator *op) const
      21              : {
      22              :   CeedQFunctionInfo info;
      23           24 :   info.assemble_q_data = assemble_q_data;
      24              : 
      25              :   // Set up QFunctions.
      26              :   CeedInt dim, space_dim, trial_num_comp, test_num_comp;
      27           24 :   PalaceCeedCall(ceed, CeedBasisGetDimension(trial_basis, &dim));
      28           24 :   PalaceCeedCall(ceed, CeedGeometryDataGetSpaceDimension(geom_data_restr, dim, &space_dim));
      29           24 :   PalaceCeedCall(ceed, CeedBasisGetNumComponents(trial_basis, &trial_num_comp));
      30           24 :   PalaceCeedCall(ceed, CeedBasisGetNumComponents(test_basis, &test_num_comp));
      31           24 :   MFEM_VERIFY(
      32              :       trial_num_comp == test_num_comp && trial_num_comp == 1,
      33              :       "DivDivMassIntegrator requires test and trial spaces with a single component!");
      34           24 :   switch (10 * space_dim + dim)
      35              :   {
      36            0 :     case 22:
      37            0 :       info.apply_qf = assemble_q_data ? f_build_l2mass_22 : f_apply_l2mass_22;
      38            0 :       info.apply_qf_path = PalaceQFunctionRelativePath(
      39              :           assemble_q_data ? f_build_l2mass_22_loc : f_apply_l2mass_22_loc);
      40              :       break;
      41           24 :     case 33:
      42           24 :       info.apply_qf = assemble_q_data ? f_build_l2mass_33 : f_apply_l2mass_33;
      43           24 :       info.apply_qf_path = PalaceQFunctionRelativePath(
      44              :           assemble_q_data ? f_build_l2mass_33_loc : f_apply_l2mass_33_loc);
      45              :       break;
      46            0 :     case 21:
      47            0 :       info.apply_qf = assemble_q_data ? f_build_l2mass_21 : f_apply_l2mass_21;
      48            0 :       info.apply_qf_path = PalaceQFunctionRelativePath(
      49              :           assemble_q_data ? f_build_l2mass_21_loc : f_apply_l2mass_21_loc);
      50              :       break;
      51            0 :     case 32:
      52            0 :       info.apply_qf = assemble_q_data ? f_build_l2mass_32 : f_apply_l2mass_32;
      53            0 :       info.apply_qf_path = PalaceQFunctionRelativePath(
      54              :           assemble_q_data ? f_build_l2mass_32_loc : f_apply_l2mass_32_loc);
      55              :       break;
      56            0 :     default:
      57            0 :       MFEM_ABORT("Invalid value of (dim, space_dim) = (" << dim << ", " << space_dim
      58              :                                                          << ") for DivDivMassIntegrator!");
      59              :   }
      60           24 :   info.trial_ops = EvalMode::Div | EvalMode::Interp | EvalMode::Weight;
      61           24 :   info.test_ops = EvalMode::Div | EvalMode::Interp;
      62              : 
      63              :   // Set up the coefficient and assemble. Mass goes first.
      64           24 :   auto ctx = PopulateCoefficientContext(space_dim, Q_mass, 1, Q, transpose_mass, transpose);
      65           24 :   AssembleCeedOperator(info, (void *)ctx.data(), ctx.size() * sizeof(CeedIntScalar), ceed,
      66              :                        trial_restr, test_restr, trial_basis, test_basis, geom_data,
      67              :                        geom_data_restr, op);
      68           24 : }
      69              : 
      70              : }  // namespace palace
        

Generated by: LCOV version 2.0-1