https://mooseframework.inl.gov
ParameterMeshFunction.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 "OptimizationFunction.h"
13 #include "ReporterInterface.h"
14 
15 #include "ParameterMesh.h"
16 
21 {
22 public:
24 
26 
27  using Function::value;
28  virtual Real value(Real t, const Point & p) const override;
29  virtual RealGradient gradient(Real t, const Point & p) const override;
30  virtual Real timeDerivative(Real t, const Point & p) const override;
31  virtual std::vector<Real> parameterGradient(Real t, const Point & p) const override;
32 
33 protected:
44  std::array<std::pair<std::size_t, Real>, 2> interpolateTime(Real t,
45  bool derivative = false) const;
46 
48  void checkSize() const;
49 
53  const std::vector<Real> & _values;
55  const std::vector<Real> & _coordt;
56 
57 private:
58  const std::vector<Real> _empty_vec = {};
59 };
std::array< std::pair< std::size_t, Real >, 2 > interpolateTime(Real t, bool derivative=false) const
This function is used to compute the weights for time interpolation.
Utility class to use an Exodus mesh to define controllable parameters for optimization problems This ...
Definition: ParameterMesh.h:42
const std::vector< Real > & _values
values from reporter
ParameterMeshFunction(const InputParameters &parameters)
const ParameterMesh _parameter_mesh
Parameter mesh.
virtual RealGradient gradient(Real t, const Point &p) const override
virtual Real timeDerivative(Real t, const Point &p) const override
void checkSize() const
Used to make sure DoFs in &#39;_parameter_mesh&#39; matches number of values in &#39;_values&#39;.
const std::vector< Real > & _coordt
Time coordinates from reporter.
virtual std::vector< Real > parameterGradient(Real t, const Point &p) const override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Base class for functions used in inverse optimization The parameterDerivative function is used in adj...
static InputParameters validParams()
const InputParameters & parameters() const
virtual Real value(Real t, const Point &p) const
const std::vector< Real > _empty_vec
virtual Real value(Real t, const Point &p) const override