https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
33void
35{
36 FEProblemBase * fe_problem = this->getParam<FEProblemBase *>("_fe_problem_base");
37 MooseMesh & mesh = fe_problem->mesh();
39}
40
41Real
42ImageFunction::value(Real /*t*/, const Point & p) const
43{
44 return sample(p);
45}
registerMooseObject("MooseApp", ImageFunction)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual MooseMesh & mesh() override
Base class for function objects.
Definition Function.h:30
static InputParameters validParams()
Class constructor.
Definition Function.C:16
A function for extracting data from an image or stack of images.
virtual void initialSetup() override
Initialize the ImageSampler.
virtual ~ImageFunction()
Class destructor.
static InputParameters validParams()
Class constructor.
virtual Real value(Real t, const Point &p) const override
Return the pixel value for the given point.
ImageFunction(const InputParameters &parameters)
A helper class for reading and sampling images using VTK.
virtual libMesh::Real sample(const libMesh::Point &p) const
Return the pixel value for the given point.
virtual void setupImageSampler(MooseMesh &mesh)
Perform initialization of image data.
static InputParameters validParams()
Constructor.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
MeshBase & mesh