https://mooseframework.inl.gov
PiecewiseTabularInterface.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 #include "MooseObject.h"
13 #include "InputParameters.h"
14 
15 class JSONFileReader;
16 
18 {
19 public:
21 
23  std::vector<Real> & data_x,
24  std::vector<Real> & data_y);
25 
26 protected:
28  bool isRawDataLoaded() const { return _raw_data_loaded; }
29 
32 
34  void buildFromJSON(const JSONFileReader & json_uo);
35 
37  void buildFromXandY();
38 
40  void buildFromXY();
41 
43  unsigned int _axis;
44  const bool _has_axis;
46 
47 private:
50 
53 
55  bool _raw_data_loaded = false;
56 
58  std::vector<Real> & _data_x;
59  std::vector<Real> & _data_y;
61 };
static InputParameters validParams()
User object that reads a JSON file and makes its data available to other objects. ...
bool isRawDataLoaded() const
Returns whether the raw data has been loaded already.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void buildFromFile(const libMesh::Parallel::Communicator &comm)
Reads data from supplied CSV file.
std::vector< Real > & _data_x
raw function data as read
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
PiecewiseTabularInterface(const MooseObject &object, std::vector< Real > &data_x, std::vector< Real > &data_y)
void buildFromXandY()
Builds data from &#39;x&#39; and &#39;y&#39; parameters.
const InputParameters & _parameters
Parameters supplied to the object.
unsigned int _axis
if _has_axis is true point component to use as function argument, otherwise use t ...
const MooseObject & _object
The object.
void buildFromXY()
Builds data from &#39;xy_data&#39; parameter.
bool _raw_data_loaded
Boolean to keep track of whether the data has been loaded.
void buildFromJSON(const JSONFileReader &json_uo)
Reads data from supplied JSON reader.