LCOV - code coverage report
Current view: top level - src/vectorpostprocessors - SideOptimizationFunctionInnerProduct.C (source / functions) Hit Total Coverage
Test: idaholab/moose optimization: #32971 (54bef8) with base c6cf66 Lines: 21 25 84.0 %
Date: 2026-05-29 20:38:04 Functions: 5 6 83.3 %
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 "SideOptimizationFunctionInnerProduct.h"
      11             : 
      12             : InputParameters
      13          60 : SideOptimizationFunctionInnerProduct::validParams()
      14             : {
      15          60 :   InputParameters params = SideVectorPostprocessor::validParams();
      16          60 :   params += OptimizationFunctionInnerProductHelper::validParams();
      17         120 :   params.addRequiredCoupledVar(
      18             :       "variable", "Variable used for inner product calculation, usually the adjoint variable.");
      19          60 :   return params;
      20           0 : }
      21             : 
      22          30 : SideOptimizationFunctionInnerProduct::SideOptimizationFunctionInnerProduct(
      23          30 :     const InputParameters & parameters)
      24             :   : SideVectorPostprocessor(parameters),
      25             :     OptimizationFunctionInnerProductHelper(parameters),
      26          30 :     _var(coupledValue("variable")),
      27          60 :     _vec(declareVector("inner_product"))
      28             : {
      29          30 : }
      30             : 
      31             : void
      32         648 : SideOptimizationFunctionInnerProduct::initialize()
      33             : {
      34         648 :   setCurrentTime(_t, _dt);
      35         648 : }
      36             : 
      37             : void
      38        8640 : SideOptimizationFunctionInnerProduct::execute()
      39             : {
      40       25920 :   for (_qp = 0; _qp < _qrule->n_points(); ++_qp)
      41             :   {
      42       17280 :     const Real q_inner_product = _JxW[_qp] * _coord[_qp] * computeQpInnerProduct();
      43       17280 :     update(_q_point[_qp], q_inner_product);
      44             :   }
      45        8640 : }
      46             : 
      47             : void
      48           0 : SideOptimizationFunctionInnerProduct::threadJoin(const UserObject & y)
      49             : {
      50             :   const auto & vpp = static_cast<const SideOptimizationFunctionInnerProduct &>(y);
      51           0 :   add(vpp);
      52           0 : }
      53             : 
      54             : void
      55         648 : SideOptimizationFunctionInnerProduct::finalize()
      56             : {
      57         648 :   getVector(_vec);
      58         648 : }

Generated by: LCOV version 1.14