www.mooseframework.org
LeastSquaresFit.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
13 
20 {
21 public:
23 
29 
33  virtual void initialize() override;
34 
38  virtual void execute() override;
39 
40 protected:
42  VectorPostprocessorName _vpp_name;
43 
45  const unsigned int _order;
46 
48  const bool _truncate_order;
49 
51  const std::string _x_name;
52  const std::string _y_name;
53 
58 
61 
63  unsigned int _num_samples;
64 
66  const Real _x_scale;
67  const Real _x_shift;
68  const Real _y_scale;
69  const Real _y_shift;
71 
75 
80 
85 
88 };
const Real _y_shift
const std::string _x_name
The name of the variables storing the x, y data.
const Real _y_scale
const bool _truncate_order
Whether to truncate the polynomial order if an insufficient number of points is provided.
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:31
virtual void execute() override
Perform the least squares fit.
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:192
const unsigned int _order
The order of the polynomial fit to be performed.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
VectorPostprocessorValue * _coeffs
The variable used to write out the coefficients of the fit.
const InputParameters & parameters() const
Get the parameters of the object.