https://mooseframework.inl.gov
Loading...
Searching...
No Matches
LineValueSampler.h
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#pragma once
11
12// MOOSE includes
15
16class LineValueSampler : public SpatialUserObjectFunctor<PointVariableSamplerBase>
17{
18public:
20
22
31 static void generatePointsAndIDs(const Point & start_point,
32 const Point & end_point,
33 unsigned int num_points,
34 std::vector<Point> & points,
35 std::vector<Real> & ids);
36
42 virtual Real spatialValue(const Point & p) const override { return getValue(p); }
43
48 Real getValue(const Point & p) const;
49
50protected:
51 const Point _start_point;
52 const Point _end_point;
53
54 unsigned int & _num_points;
55
57 const RealVectorValue _line_vector;
58
60 const RealVectorValue _zero;
61
64
65private:
67};
std::vector< Real > VectorPostprocessorValue
Definition MooseTypes.h:231
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
static InputParameters validParams()
const Point _end_point
unsigned int & _num_points
const Real _line_vector_norm
Length of line segment.
static void generatePointsAndIDs(const Point &start_point, const Point &end_point, unsigned int num_points, std::vector< Point > &points, std::vector< Real > &ids)
Helper function to generate the list of points along a line and a unique ID for each point.
Real getValue(const Point &p) const
Gets the value of the variable at a point p.
const Point _start_point
const VectorPostprocessorValue & _vpp_value
const RealVectorValue _zero
Zero vector.
const RealVectorValue _line_vector
Vector connecting the start and end points of the line segment.
virtual Real spatialValue(const Point &p) const override
Gets the value of the variable at a point p.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Base class for creating a user object with the SpatialUserObject and Moose::Functor APIs.