LCOV - code coverage report
Current view: top level - src/functions - ImageFunction.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 8601ad Lines: 16 17 94.1 %
Date: 2025-07-18 13:27:08 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 "ImageFunction.h"
      11             : #include "MooseMesh.h"
      12             : #include "FEProblemBase.h"
      13             : 
      14             : registerMooseObject("MooseApp", ImageFunction);
      15             : 
      16             : InputParameters
      17       14932 : ImageFunction::validParams()
      18             : {
      19             :   // Define the general parameters
      20       14932 :   InputParameters params = Function::validParams();
      21       14932 :   params += ImageSampler::validParams();
      22       14932 :   params.addClassDescription("Function with values sampled from an image or image stack.");
      23       14932 :   return params;
      24           0 : }
      25             : 
      26         349 : ImageFunction::ImageFunction(const InputParameters & parameters)
      27         349 :   : ImageSampler(parameters), Function(parameters)
      28             : {
      29         349 : }
      30             : 
      31         668 : ImageFunction::~ImageFunction() {}
      32             : 
      33             : void
      34         346 : ImageFunction::initialSetup()
      35             : {
      36         346 :   FEProblemBase * fe_problem = this->getParam<FEProblemBase *>("_fe_problem_base");
      37         346 :   MooseMesh & mesh = fe_problem->mesh();
      38         346 :   setupImageSampler(mesh);
      39         334 : }
      40             : 
      41             : Real
      42     2022640 : ImageFunction::value(Real /*t*/, const Point & p) const
      43             : {
      44     2022640 :   return sample(p);
      45             : }

Generated by: LCOV version 1.14