https://mooseframework.inl.gov
Loading...
Searching...
No Matches
LeastSquaresFit.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
13
20{
21public:
23
29
33 virtual void initialize() override;
34
38 virtual void execute() override;
39
40protected:
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};
std::vector< Real > VectorPostprocessorValue
Definition MooseTypes.h:231
This class is here to combine the VectorPostprocessor interface and the base class VectorPostprocesso...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
LeastSquaresFit is a VectorPostprocessor that performs a least squares fit on data calculated in anot...
static InputParameters validParams()
VectorPostprocessorValue * _sample_x
The variables used to write out samples of the least squares fit.
const Real _x_scale
Values used to scale and or shift x and y data.
VectorPostprocessorName _vpp_name
The name of the VectorPostprocessor on which to perform the fit.
unsigned int _num_samples
The number of samples to be taken.
const Real _x_shift
const VectorPostprocessorValue & _y_values
Real _sample_x_min
The min and max x values for sampling.
bool _have_sample_x_min
Did the user specify the min and max x values for sampling?
virtual void initialize() override
Initialize, clears old results.
const VectorPostprocessorValue & _x_values
The variables with the x, y data to be fit.
const Real _y_scale
VectorPostprocessorValue * _coeffs
The variable used to write out the coefficients of the fit.
const std::string _x_name
The name of the variables storing the x, y data.
const Real _y_shift
const unsigned int _order
The order of the polynomial fit to be performed.
const bool _truncate_order
Whether to truncate the polynomial order if an insufficient number of points is provided.
virtual void execute() override
Perform the least squares fit.
const MooseEnum _output_type
The type of output.
VectorPostprocessorValue * _sample_y
const std::string _y_name
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55