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 14988 : ImageFunction::validParams() 18 : { 19 : // Define the general parameters 20 14988 : InputParameters params = Function::validParams(); 21 14988 : params += ImageSampler::validParams(); 22 14988 : params.addClassDescription("Function with values sampled from an image or image stack."); 23 14988 : return params; 24 0 : } 25 : 26 377 : ImageFunction::ImageFunction(const InputParameters & parameters) 27 377 : : ImageSampler(parameters), Function(parameters) 28 : { 29 377 : } 30 : 31 724 : ImageFunction::~ImageFunction() {} 32 : 33 : void 34 374 : ImageFunction::initialSetup() 35 : { 36 374 : FEProblemBase * fe_problem = this->getParam<FEProblemBase *>("_fe_problem_base"); 37 374 : MooseMesh & mesh = fe_problem->mesh(); 38 374 : setupImageSampler(mesh); 39 362 : } 40 : 41 : Real 42 2277060 : ImageFunction::value(Real /*t*/, const Point & p) const 43 : { 44 2277060 : return sample(p); 45 : }