www.mooseframework.org
LeastSquaresFit.h
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 #ifndef LEAST_SQUARES_FIT_H
16 #define LEAST_SQUARES_FIT_H
17 
19 
20 // Forward Declarations
21 class LeastSquaresFit;
22 
23 template <>
25 
32 {
33 public:
39 
43  virtual void initialize() override;
44 
48  virtual void execute() override;
49 
50 protected:
52  VectorPostprocessorName _vpp_name;
53 
55  unsigned int _order;
56 
58  const std::string _x_name;
59  const std::string _y_name;
60 
64 
67 
69  unsigned int _num_samples;
70 
72  const Real _x_scale;
73  const Real _x_shift;
74  const Real _y_scale;
75  const Real _y_shift;
77 
81 
85 
89 
92 };
93 
94 #endif
const Real _y_shift
InputParameters validParams< LeastSquaresFit >()
const std::string _x_name
The name of the variables storing the x, y data.
const Real _y_scale
VectorPostprocessorValue * _sample_x
The variables used to write out samples of the least squares fit.
const VectorPostprocessorValue & _x_values
The variables with the x, y data to be fit.
This class is here to combine the VectorPostprocessor interface and the base class VectorPostprocesso...
const VectorPostprocessorValue & _y_values
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
VectorPostprocessorValue * _sample_y
unsigned int _num_samples
The number of samples to be taken.
VectorPostprocessorName _vpp_name
The name of the VectorPostprocessor on which to perform the fit.
LeastSquaresFit(const InputParameters &parameters)
Class constructor.
virtual void initialize() override
Initialize, clears old results.
const std::string _y_name
const Real _x_shift
const MooseEnum _output_type
The type of output.
bool _have_sample_x_min
Did the user specify the min and max x values for sampling?
const Real _x_scale
Values used to scale and or shift x and y data.
Real _sample_x_min
The min and max x values for sampling.
LeastSquaresFit is a VectorPostprocessor that performs a least squares fit on data calculated in anot...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:37
virtual void execute() override
Perform the least squares fit.
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:74
unsigned int _order
The order of the polynomial fit to be performed.
VectorPostprocessorValue * _coeffs
The variable used to write out the coefficients of the fit.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53