LCOV - code coverage report
Current view: top level - src/postprocessors - ScalePostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 12 13 92.3 %
Date: 2025-07-17 01:28:37 Functions: 3 3 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 "ScalePostprocessor.h"
      11             : 
      12             : registerMooseObject("MooseApp", ScalePostprocessor);
      13             : 
      14             : InputParameters
      15       15469 : ScalePostprocessor::validParams()
      16             : {
      17       15469 :   InputParameters params = GeneralPostprocessor::validParams();
      18       15469 :   params.addRequiredParam<PostprocessorName>("value", "The postprocessor to be scaled");
      19       15469 :   params.addParam<Real>("scaling_factor", 1.0, "The scaling factor");
      20             : 
      21       15469 :   params.addClassDescription("Scales a post-processor by a value");
      22             : 
      23       15469 :   return params;
      24           0 : }
      25             : 
      26         602 : ScalePostprocessor::ScalePostprocessor(const InputParameters & parameters)
      27             :   : GeneralPostprocessor(parameters),
      28         602 :     _value(getPostprocessorValue("value")),
      29        1204 :     _scaling_factor(getParam<Real>("scaling_factor"))
      30             : {
      31         602 : }
      32             : 
      33             : PostprocessorValue
      34        5140 : ScalePostprocessor::getValue() const
      35             : {
      36        5140 :   return _scaling_factor * _value;
      37             : }

Generated by: LCOV version 1.14