www.mooseframework.org
ImageFunction.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "ImageFunction.h"
16 #include "MooseMesh.h"
17 
18 template <>
21 {
22  // Define the general parameters
24  params += validParams<ImageSampler>();
25  params.addClassDescription("Function with values sampled from a given image stack");
26  return params;
27 }
28 
30  : ImageSampler(parameters), Function(parameters)
31 {
32 }
33 
35 
36 void
38 {
39  FEProblemBase * fe_problem = this->getParam<FEProblemBase *>("_fe_problem_base");
40  MooseMesh & mesh = fe_problem->mesh();
41  setupImageSampler(mesh);
42 }
43 
44 Real
45 ImageFunction::value(Real /*t*/, const Point & p)
46 {
47  return sample(p);
48 }
virtual void initialSetup() override
Initialize the ImageSampler.
Definition: ImageFunction.C:37
Base class for function objects.
Definition: Function.h:46
InputParameters validParams< ImageSampler >()
Definition: ImageSampler.C:24
virtual void setupImageSampler(MooseMesh &mesh)
Perform initialization of image data.
Definition: ImageSampler.C:80
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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:74
InputParameters validParams< ImageFunction >()
Definition: ImageFunction.C:20
ImageFunction(const InputParameters &parameters)
Class constructor.
Definition: ImageFunction.C:29
A helper class for reading and sampling images using VTK.
Definition: ImageSampler.h:57
virtual Real value(Real t, const Point &p) override
Return the pixel value for the given point.
Definition: ImageFunction.C:45
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 Real sample(const Point &p)
Return the pixel value for the given point.
Definition: ImageSampler.C:219
InputParameters validParams< Function >()
Definition: Function.C:19
virtual ~ImageFunction()
Class destructor.
Definition: ImageFunction.C:34