LCOV - code coverage report
Current view: top level - src/postprocessors - TensorAveragePostprocessor.C (source / functions) Hit Total Coverage
Test: idaholab/swift: #92 (25e020) with base b3cd84 Lines: 12 13 92.3 %
Date: 2025-09-10 17:10:32 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /**********************************************************************/
       2             : /*                    DO NOT MODIFY THIS HEADER                       */
       3             : /*             Swift, a Fourier spectral solver for MOOSE             */
       4             : /*                                                                    */
       5             : /*            Copyright 2024 Battelle Energy Alliance, LLC            */
       6             : /*                        ALL RIGHTS RESERVED                         */
       7             : /**********************************************************************/
       8             : 
       9             : #include "TensorAveragePostprocessor.h"
      10             : 
      11             : registerMooseObject("SwiftApp", TensorAveragePostprocessor);
      12             : 
      13             : InputParameters
      14           8 : TensorAveragePostprocessor::validParams()
      15             : {
      16           8 :   InputParameters params = TensorPostprocessor::validParams();
      17           8 :   params.addClassDescription("Compute the average value over a buffer.");
      18           8 :   return params;
      19           0 : }
      20             : 
      21           4 : TensorAveragePostprocessor::TensorAveragePostprocessor(const InputParameters & parameters)
      22           4 :   : TensorPostprocessor(parameters)
      23             : {
      24           4 : }
      25             : 
      26             : void
      27           4 : TensorAveragePostprocessor::execute()
      28             : {
      29           4 :   _average = _u.sum().cpu().item<double>() / torch::numel(_u);
      30           4 : }
      31             : 
      32             : PostprocessorValue
      33           4 : TensorAveragePostprocessor::getValue() const
      34             : {
      35           4 :   return _average;
      36             : }

Generated by: LCOV version 1.14