https://mooseframework.inl.gov
ImageFunction.C
Go to the documentation of this file.
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 
15 
18 {
19  // Define the general parameters
21  params += ImageSampler::validParams();
22  params.addClassDescription("Function with values sampled from an image or image stack.");
23  return params;
24 }
25 
27  : ImageSampler(parameters), Function(parameters)
28 {
29 }
30 
32 
33 void
35 {
36  FEProblemBase * fe_problem = this->getParam<FEProblemBase *>("_fe_problem_base");
37  MooseMesh & mesh = fe_problem->mesh();
39 }
40 
41 Real
42 ImageFunction::value(Real /*t*/, const Point & p) const
43 {
44  return sample(p);
45 }
virtual void initialSetup() override
Initialize the ImageSampler.
Definition: ImageFunction.C:34
Base class for function objects.
Definition: Function.h:36
registerMooseObject("MooseApp", ImageFunction)
A function for extracting data from an image or stack of images.
Definition: ImageFunction.h:19
virtual void setupImageSampler(MooseMesh &mesh)
Perform initialization of image data.
Definition: ImageSampler.C:80
MeshBase & mesh
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual Real value(Real t, const Point &p) const override
Return the pixel value for the given point.
Definition: ImageFunction.C:42
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
ImageFunction(const InputParameters &parameters)
Definition: ImageFunction.C:26
static InputParameters validParams()
Constructor.
Definition: ImageSampler.C:20
A helper class for reading and sampling images using VTK.
Definition: ImageSampler.h:83
static InputParameters validParams()
Class constructor.
Definition: ImageFunction.C:17
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual MooseMesh & mesh() override
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
virtual ~ImageFunction()
Class destructor.
Definition: ImageFunction.C:31
virtual libMesh::Real sample(const libMesh::Point &p) const
Return the pixel value for the given point.
Definition: ImageSampler.C:218
static InputParameters validParams()
Class constructor.
Definition: Function.C:16