LCOV - code coverage report
Current view: top level - src/vectorpostprocessors - ElementOptimizationFunctionInnerProduct.C (source / functions) Hit Total Coverage
Test: idaholab/moose optimization: #31706 (f8ed4a) with base bb0a08 Lines: 24 25 96.0 %
Date: 2025-11-03 17:26:17 Functions: 6 6 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             : #include "ElementOptimizationFunctionInnerProduct.h"
      11             : 
      12             : InputParameters
      13         671 : ElementOptimizationFunctionInnerProduct::validParams()
      14             : {
      15         671 :   InputParameters params = ElementVariableVectorPostprocessor::validParams();
      16         671 :   params += OptimizationFunctionInnerProductHelper::validParams();
      17         671 :   params.addClassDescription("Computes the inner product of variable with parameterized source "
      18             :                              "function for optimization gradient computation.");
      19         671 :   return params;
      20           0 : }
      21             : 
      22         340 : ElementOptimizationFunctionInnerProduct::ElementOptimizationFunctionInnerProduct(
      23         340 :     const InputParameters & parameters)
      24             :   : ElementVariableVectorPostprocessor(parameters),
      25             :     OptimizationFunctionInnerProductHelper(parameters),
      26         340 :     _var(coupledValue("variable")),
      27         680 :     _vec(declareVector("inner_product"))
      28             : {
      29         340 : }
      30             : 
      31             : void
      32       10683 : ElementOptimizationFunctionInnerProduct::initialize()
      33             : {
      34       10683 :   setCurrentTime(_t, _dt);
      35       10683 : }
      36             : 
      37             : void
      38     1038950 : ElementOptimizationFunctionInnerProduct::execute()
      39             : {
      40     4932208 :   for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
      41             :   {
      42     3893258 :     const Real q_inner_product = _JxW[_qp] * _coord[_qp] * computeQpInnerProduct();
      43     3893258 :     update(_q_point[_qp], q_inner_product);
      44             :   }
      45     1038950 : }
      46             : 
      47             : void
      48          66 : ElementOptimizationFunctionInnerProduct::threadJoin(const UserObject & y)
      49             : {
      50             :   const auto & vpp = static_cast<const ElementOptimizationFunctionInnerProduct &>(y);
      51          66 :   add(vpp);
      52          66 : }
      53             : 
      54             : void
      55       10617 : ElementOptimizationFunctionInnerProduct::finalize()
      56             : {
      57       10617 :   getVector(_vec);
      58       10617 : }

Generated by: LCOV version 1.14